diff options
author | Feng Qian <fqian@google.com> | 2009-06-17 12:12:20 -0700 |
---|---|---|
committer | Feng Qian <fqian@google.com> | 2009-06-17 12:12:20 -0700 |
commit | 5f1ab04193ad0130ca8204aadaceae083aca9881 (patch) | |
tree | 5a92cd389e2cfe7fb67197ce14b38469462379f8 /WebCore/rendering/SVGRenderSupport.h | |
parent | 194315e5a908cc8ed67d597010544803eef1ac59 (diff) | |
download | external_webkit-5f1ab04193ad0130ca8204aadaceae083aca9881.zip external_webkit-5f1ab04193ad0130ca8204aadaceae083aca9881.tar.gz external_webkit-5f1ab04193ad0130ca8204aadaceae083aca9881.tar.bz2 |
Get WebKit r44544.
Diffstat (limited to 'WebCore/rendering/SVGRenderSupport.h')
-rw-r--r-- | WebCore/rendering/SVGRenderSupport.h | 53 |
1 files changed, 42 insertions, 11 deletions
diff --git a/WebCore/rendering/SVGRenderSupport.h b/WebCore/rendering/SVGRenderSupport.h index 7fdfcf8..da2bf59 100644 --- a/WebCore/rendering/SVGRenderSupport.h +++ b/WebCore/rendering/SVGRenderSupport.h @@ -1,9 +1,8 @@ /** - * This file is part of the DOM implementation for WebKit. - * * Copyright (C) 2007 Rob Buis <buis@kde.org> * (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> * (C) 2007 Eric Seidel <eric@webkit.org> + * Copyright (C) 2009 Google, Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -22,21 +21,53 @@ * */ +#ifndef SVGRenderBase_h +#define SVGRenderBase_h + #if ENABLE(SVG) #include "RenderObject.h" namespace WebCore { -class SVGResourceFilter; -void prepareToRenderSVGContent(RenderObject*, RenderObject::PaintInfo&, const FloatRect& boundingBox, SVGResourceFilter*&, SVGResourceFilter* rootFilter = 0); -void finishRenderSVGContent(RenderObject*, RenderObject::PaintInfo&, const FloatRect& boundingBox, SVGResourceFilter*&, GraphicsContext* savedContext); + class SVGResourceFilter; + class ImageBuffer; + + // SVGRendererBase is an abstract base class which all SVG renderers inherit + // from in order to share SVG renderer code. + // FIXME: This code can all move into RenderSVGModelObject once + // all SVG renderers inherit from RenderSVGModelObject. + class SVGRenderBase { + public: + // FIXME: These are only public for SVGRootInlineBox. + // It's unclear if these should be exposed or not. SVGRootInlineBox may + // pass the wrong RenderObject* and boundingBox to these functions. + static void prepareToRenderSVGContent(RenderObject*, RenderObject::PaintInfo&, const FloatRect& boundingBox, SVGResourceFilter*&, SVGResourceFilter* rootFilter = 0); + static void finishRenderSVGContent(RenderObject*, RenderObject::PaintInfo&, SVGResourceFilter*&, GraphicsContext* savedContext); + + protected: + static IntRect clippedOverflowRectForRepaint(RenderObject*, RenderBoxModelObject* repaintContainer); + static void computeRectForRepaint(RenderObject*, RenderBoxModelObject* repaintContainer, IntRect&, bool fixed); + + static void mapLocalToContainer(const RenderObject*, RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&); + + // Used to share the "walk all the children" logic between objectBoundingBox + // and repaintRectInLocalCoordinates in RenderSVGRoot and RenderSVGContainer + static FloatRect computeContainerBoundingBox(const RenderObject* container, bool includeAllPaintedContent); + + // returns the filter bounding box (or the empty rect if no filter) in local coordinates + static FloatRect filterBoundingBoxForRenderer(const RenderObject*); + }; + + // FIXME: This should move to RenderObject or PaintInfo + // Used for transforming the GraphicsContext and damage rect before passing PaintInfo to child renderers. + void applyTransformToPaintInfo(RenderObject::PaintInfo&, const TransformationMatrix& localToChildTransform); -// This offers a way to render parts of a WebKit rendering tree into a ImageBuffer. -class ImageBuffer; -void renderSubtreeToImage(ImageBuffer*, RenderObject*); + // This offers a way to render parts of a WebKit rendering tree into a ImageBuffer. + void renderSubtreeToImage(ImageBuffer*, RenderObject*); -void clampImageBufferSizeToViewport(RenderObject*, IntSize&); + void clampImageBufferSizeToViewport(FrameView*, IntSize& imageBufferSize); +} // namespace WebCore -} +#endif // ENABLE(SVG) -#endif +#endif // SVGRenderBase_h |