Home | History | Annotate | Download | only in rendering
      1 /*
      2     Copyright (C) 2006 Alexander Kellett <lypanov (at) kde.org>
      3     Copyright (C) 2006, 2009 Apple Inc. All rights reserved.
      4     Copyright (C) 2007 Rob Buis <buis (at) kde.org>
      5     Copyright (C) 2009 Google, Inc.
      6 
      7     This library is free software; you can redistribute it and/or
      8     modify it under the terms of the GNU Library General Public
      9     License as published by the Free Software Foundation; either
     10     version 2 of the License, or (at your option) any later version.
     11 
     12     This library is distributed in the hope that it will be useful,
     13     but WITHOUT ANY WARRANTY; without even the implied warranty of
     14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     15     Library General Public License for more details.
     16 
     17     You should have received a copy of the GNU Library General Public License
     18     along with this library; see the file COPYING.LIB.  If not, write to
     19     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
     20     Boston, MA 02110-1301, USA.
     21 */
     22 
     23 #ifndef RenderSVGImage_h
     24 #define RenderSVGImage_h
     25 
     26 #if ENABLE(SVG)
     27 #include "AffineTransform.h"
     28 #include "FloatRect.h"
     29 #include "RenderImage.h"
     30 #include "SVGPreserveAspectRatio.h"
     31 #include "SVGRenderSupport.h"
     32 
     33 namespace WebCore {
     34 
     35     class SVGImageElement;
     36 
     37     class RenderSVGImage : public RenderImage, protected SVGRenderBase {
     38     public:
     39         RenderSVGImage(SVGImageElement*);
     40 
     41     private:
     42         virtual const SVGRenderBase* toSVGRenderBase() const { return this; }
     43         virtual const char* renderName() const { return "RenderSVGImage"; }
     44         virtual bool isSVGImage() const { return true; }
     45 
     46         virtual const AffineTransform& localToParentTransform() const { return m_localTransform; }
     47 
     48         virtual FloatRect objectBoundingBox() const;
     49         virtual FloatRect strokeBoundingBox() const { return m_localBounds; }
     50         virtual FloatRect repaintRectInLocalCoordinates() const;
     51 
     52         virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer);
     53         virtual void computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect&, bool fixed = false);
     54 
     55         virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&) const;
     56 
     57         virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
     58         virtual void absoluteQuads(Vector<FloatQuad>&);
     59         virtual void addFocusRingRects(Vector<IntRect>&, int tx, int ty);
     60 
     61         virtual void imageChanged(WrappedImagePtr, const IntRect* = 0);
     62 
     63         virtual void layout();
     64         virtual void paint(PaintInfo&, int parentX, int parentY);
     65 
     66         virtual bool requiresLayer() const { return false; }
     67 
     68         virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction);
     69         virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
     70 
     71         virtual AffineTransform localTransform() const { return m_localTransform; }
     72 
     73         AffineTransform m_localTransform;
     74         FloatRect m_localBounds;
     75         mutable FloatRect m_cachedLocalRepaintRect;
     76     };
     77 
     78 } // namespace WebCore
     79 
     80 #endif // ENABLE(SVG)
     81 #endif // RenderSVGImage_h
     82 
     83 // vim:ts=4:noet
     84