diff options
| author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
|---|---|---|
| committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
| commit | 32761a6cee1d0dee366b885b7b9c777e67885688 (patch) | |
| tree | d6bec92bebfb216f4126356e55518842c2f476a1 /Source/WebCore/rendering/PaintInfo.h | |
| parent | a4e969f4965059196ca948db781e52f7cfebf19e (diff) | |
| download | WebKitGtk-tarball-32761a6cee1d0dee366b885b7b9c777e67885688.tar.gz | |
webkitgtk-2.4.11webkitgtk-2.4.11
Diffstat (limited to 'Source/WebCore/rendering/PaintInfo.h')
| -rw-r--r-- | Source/WebCore/rendering/PaintInfo.h | 52 |
1 files changed, 22 insertions, 30 deletions
diff --git a/Source/WebCore/rendering/PaintInfo.h b/Source/WebCore/rendering/PaintInfo.h index 511a6bcc5..ec5551b92 100644 --- a/Source/WebCore/rendering/PaintInfo.h +++ b/Source/WebCore/rendering/PaintInfo.h @@ -26,7 +26,10 @@ #ifndef PaintInfo_h #define PaintInfo_h +#if ENABLE(SVG) #include "AffineTransform.h" +#endif + #include "GraphicsContext.h" #include "IntRect.h" #include "LayoutRect.h" @@ -41,6 +44,7 @@ class OverlapTestRequestClient; class RenderInline; class RenderLayerModelObject; class RenderObject; +class RenderRegion; typedef HashMap<OverlapTestRequestClient*, IntRect> OverlapTestRequestMap; @@ -49,29 +53,19 @@ typedef HashMap<OverlapTestRequestClient*, IntRect> OverlapTestRequestMap; * (tx|ty) is the calculated position of the parent */ struct PaintInfo { - PaintInfo(GraphicsContext& newContext, const LayoutRect& newRect, PaintPhase newPhase, PaintBehavior newPaintBehavior, - RenderObject* newSubtreePaintRoot = nullptr, ListHashSet<RenderInline*>* newOutlineObjects = nullptr, + PaintInfo(GraphicsContext* newContext, const LayoutRect& newRect, PaintPhase newPhase, PaintBehavior newPaintBehavior, + RenderObject* newSubtreePaintRoot = nullptr, RenderRegion* region = nullptr, ListHashSet<RenderInline*>* newOutlineObjects = nullptr, OverlapTestRequestMap* overlapTestRequests = nullptr, const RenderLayerModelObject* newPaintContainer = nullptr) - : rect(newRect) - , phase(newPhase) - , paintBehavior(newPaintBehavior) - , subtreePaintRoot(newSubtreePaintRoot) - , outlineObjects(newOutlineObjects) - , overlapTestRequests(overlapTestRequests) - , paintContainer(newPaintContainer) - , m_context(&newContext) - { - } - - GraphicsContext& context() const + : context(newContext) + , rect(newRect) + , phase(newPhase) + , paintBehavior(newPaintBehavior) + , subtreePaintRoot(newSubtreePaintRoot) + , renderRegion(region) + , outlineObjects(newOutlineObjects) + , overlapTestRequests(overlapTestRequests) + , paintContainer(newPaintContainer) { - ASSERT(m_context); - return *m_context; - } - - void setContext(GraphicsContext& context) - { - m_context = &context; } void updateSubtreePaintRootForChildren(const RenderObject* renderer) @@ -91,39 +85,37 @@ struct PaintInfo { return !subtreePaintRoot || subtreePaintRoot == &renderer; } - bool forceTextColor() const { return forceBlackText() || forceWhiteText(); } bool forceBlackText() const { return paintBehavior & PaintBehaviorForceBlackText; } - bool forceWhiteText() const { return paintBehavior & PaintBehaviorForceWhiteText; } - Color forcedTextColor() const { return (forceBlackText()) ? Color::black : Color::white; } bool skipRootBackground() const { return paintBehavior & PaintBehaviorSkipRootBackground; } bool paintRootBackgroundOnly() const { return paintBehavior & PaintBehaviorRootBackgroundOnly; } +#if ENABLE(SVG) void applyTransform(const AffineTransform& localToAncestorTransform) { if (localToAncestorTransform.isIdentity()) return; - context().concatCTM(localToAncestorTransform); + context->concatCTM(localToAncestorTransform); - if (rect.isInfinite()) + if (rect == LayoutRect::infiniteRect()) return; - FloatRect tranformedRect(localToAncestorTransform.inverse().valueOr(AffineTransform()).mapRect(rect)); + FloatRect tranformedRect(localToAncestorTransform.inverse().mapRect(rect)); rect.setLocation(LayoutPoint(tranformedRect.location())); rect.setSize(LayoutSize(tranformedRect.size())); } +#endif + GraphicsContext* context; LayoutRect rect; PaintPhase phase; PaintBehavior paintBehavior; RenderObject* subtreePaintRoot; // used to draw just one element and its visual children + RenderRegion* renderRegion; ListHashSet<RenderInline*>* outlineObjects; // used to list outlines that should be painted by a block with inline children OverlapTestRequestMap* overlapTestRequests; const RenderLayerModelObject* paintContainer; // the layer object that originates the current painting - -private: - GraphicsContext* m_context; }; } // namespace WebCore |
