Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: Source/core/rendering/svg/SVGRenderSupport.cpp

Issue 360833002: Divorce PaintInvalidationState from LayoutState (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address Julien's comments Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/svg/SVGRenderSupport.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org> 2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org>
3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2009 Google, Inc. All rights reserved. 5 * Copyright (C) 2009 Google, Inc. All rights reserved.
6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. 7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 25 matching lines...) Expand all
36 #include "core/rendering/svg/RenderSVGRoot.h" 36 #include "core/rendering/svg/RenderSVGRoot.h"
37 #include "core/rendering/svg/RenderSVGText.h" 37 #include "core/rendering/svg/RenderSVGText.h"
38 #include "core/rendering/svg/RenderSVGViewportContainer.h" 38 #include "core/rendering/svg/RenderSVGViewportContainer.h"
39 #include "core/rendering/svg/SVGResources.h" 39 #include "core/rendering/svg/SVGResources.h"
40 #include "core/rendering/svg/SVGResourcesCache.h" 40 #include "core/rendering/svg/SVGResourcesCache.h"
41 #include "core/svg/SVGElement.h" 41 #include "core/svg/SVGElement.h"
42 #include "platform/geometry/TransformState.h" 42 #include "platform/geometry/TransformState.h"
43 43
44 namespace WebCore { 44 namespace WebCore {
45 45
46 LayoutRect SVGRenderSupport::clippedOverflowRectForRepaint(const RenderObject* o bject, const RenderLayerModelObject* repaintContainer) 46 LayoutRect SVGRenderSupport::clippedOverflowRectForRepaint(const RenderObject* o bject, const RenderLayerModelObject* repaintContainer, const PaintInvalidationSt ate* paintInvalidationState)
47 { 47 {
48 // Return early for any cases where we don't actually paint 48 // Return early for any cases where we don't actually paint
49 if (object->style()->visibility() != VISIBLE && !object->enclosingLayer()->h asVisibleContent()) 49 if (object->style()->visibility() != VISIBLE && !object->enclosingLayer()->h asVisibleContent())
50 return LayoutRect(); 50 return LayoutRect();
51 51
52 // Pass our local paint rect to computeRectForRepaint() which will 52 // Pass our local paint rect to computeRectForRepaint() which will
53 // map to parent coords and recurse up the parent chain. 53 // map to parent coords and recurse up the parent chain.
54 FloatRect repaintRect = object->paintInvalidationRectInLocalCoordinates(); 54 FloatRect repaintRect = object->paintInvalidationRectInLocalCoordinates();
55 object->computeFloatRectForPaintInvalidation(repaintContainer, repaintRect); 55 object->computeFloatRectForPaintInvalidation(repaintContainer, repaintRect, paintInvalidationState);
56 return enclosingLayoutRect(repaintRect); 56 return enclosingLayoutRect(repaintRect);
57 } 57 }
58 58
59 void SVGRenderSupport::computeFloatRectForRepaint(const RenderObject* object, co nst RenderLayerModelObject* repaintContainer, FloatRect& repaintRect, bool fixed ) 59 void SVGRenderSupport::computeFloatRectForRepaint(const RenderObject* object, co nst RenderLayerModelObject* repaintContainer, FloatRect& repaintRect, bool fixed , const PaintInvalidationState* paintInvalidationState)
60 { 60 {
61 repaintRect.inflate(object->style()->outlineWidth()); 61 repaintRect.inflate(object->style()->outlineWidth());
62 62
63 // Translate to coords in our parent renderer, and then call computeFloatRec tForPaintInvalidation() on our parent. 63 // Translate to coords in our parent renderer, and then call computeFloatRec tForPaintInvalidation() on our parent.
64 repaintRect = object->localToParentTransform().mapRect(repaintRect); 64 repaintRect = object->localToParentTransform().mapRect(repaintRect);
65 object->parent()->computeFloatRectForPaintInvalidation(repaintContainer, rep aintRect, fixed); 65 object->parent()->computeFloatRectForPaintInvalidation(repaintContainer, rep aintRect, fixed, paintInvalidationState);
66 } 66 }
67 67
68 void SVGRenderSupport::mapLocalToContainer(const RenderObject* object, const Ren derLayerModelObject* repaintContainer, TransformState& transformState, bool* was Fixed) 68 void SVGRenderSupport::mapLocalToContainer(const RenderObject* object, const Ren derLayerModelObject* repaintContainer, TransformState& transformState, bool* was Fixed, const PaintInvalidationState* paintInvalidationState)
69 { 69 {
70 transformState.applyTransform(object->localToParentTransform()); 70 transformState.applyTransform(object->localToParentTransform());
71 71
72 RenderObject* parent = object->parent(); 72 RenderObject* parent = object->parent();
73 73
74 // At the SVG/HTML boundary (aka RenderSVGRoot), we apply the localToBorderB oxTransform 74 // At the SVG/HTML boundary (aka RenderSVGRoot), we apply the localToBorderB oxTransform
75 // to map an element from SVG viewport coordinates to CSS box coordinates. 75 // to map an element from SVG viewport coordinates to CSS box coordinates.
76 // RenderSVGRoot's mapLocalToContainer method expects CSS box coordinates. 76 // RenderSVGRoot's mapLocalToContainer method expects CSS box coordinates.
77 if (parent->isSVGRoot()) 77 if (parent->isSVGRoot())
78 transformState.applyTransform(toRenderSVGRoot(parent)->localToBorderBoxT ransform()); 78 transformState.applyTransform(toRenderSVGRoot(parent)->localToBorderBoxT ransform());
79 79
80 MapCoordinatesFlags mode = UseTransforms; 80 MapCoordinatesFlags mode = UseTransforms;
81 parent->mapLocalToContainer(repaintContainer, transformState, mode, wasFixed ); 81 parent->mapLocalToContainer(repaintContainer, transformState, mode, wasFixed , paintInvalidationState);
82 } 82 }
83 83
84 const RenderObject* SVGRenderSupport::pushMappingToContainer(const RenderObject* object, const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap& geom etryMap) 84 const RenderObject* SVGRenderSupport::pushMappingToContainer(const RenderObject* object, const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap& geom etryMap)
85 { 85 {
86 ASSERT_UNUSED(ancestorToStopAt, ancestorToStopAt != object); 86 ASSERT_UNUSED(ancestorToStopAt, ancestorToStopAt != object);
87 87
88 RenderObject* parent = object->parent(); 88 RenderObject* parent = object->parent();
89 89
90 // At the SVG/HTML boundary (aka RenderSVGRoot), we apply the localToBorderB oxTransform 90 // At the SVG/HTML boundary (aka RenderSVGRoot), we apply the localToBorderB oxTransform
91 // to map an element from SVG viewport coordinates to CSS box coordinates. 91 // to map an element from SVG viewport coordinates to CSS box coordinates.
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 } 387 }
388 388
389 bool SVGRenderSupport::isRenderableTextNode(const RenderObject* object) 389 bool SVGRenderSupport::isRenderableTextNode(const RenderObject* object)
390 { 390 {
391 ASSERT(object->isText()); 391 ASSERT(object->isText());
392 // <br> is marked as text, but is not handled by the SVG rendering code-path . 392 // <br> is marked as text, but is not handled by the SVG rendering code-path .
393 return object->isSVGInlineText() && !toRenderSVGInlineText(object)->hasEmpty Text(); 393 return object->isSVGInlineText() && !toRenderSVGInlineText(object)->hasEmpty Text();
394 } 394 }
395 395
396 } 396 }
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/SVGRenderSupport.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698