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

Unified Diff: Source/core/paint/SVGForeignObjectPainter.cpp

Issue 802833003: Remove the SVG paint culling optimization (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update PaintInfo rect when leaving SVG Created 6 years 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/paint/SVGForeignObjectPainter.cpp
diff --git a/Source/core/paint/SVGForeignObjectPainter.cpp b/Source/core/paint/SVGForeignObjectPainter.cpp
index 37e58373264d565e158680c17304a3bd69ac71f6..90aaf3302b71cf55277bce697019a4c70a2f84ea 100644
--- a/Source/core/paint/SVGForeignObjectPainter.cpp
+++ b/Source/core/paint/SVGForeignObjectPainter.cpp
@@ -23,6 +23,12 @@ void SVGForeignObjectPainter::paint(const PaintInfo& paintInfo)
GraphicsContextStateSaver stateSaver(*childPaintInfo.context);
childPaintInfo.applyTransform(m_renderSVGForeignObject.localTransform());
+ // When transitioning from SVG to HTML painters we need to keep the PaintInfo rect up-to-date
+ // because it can be used for clipping.
+ // FIXME: We need to find an approach that's not O(n^2).
+ const AffineTransform& transform = SVGRenderSupport::transformToRootBorderBox(m_renderSVGForeignObject, m_renderSVGForeignObject.localTransform());
pdr. 2014/12/15 05:02:21 How can we cache this from paint invalidation? (si
fs 2014/12/15 10:28:16 Add: m_cachedRootTransform = paintInvalidationSta
pdr. 2014/12/16 06:29:56 Thank you! This worked a charm. I'm not /too/ wor
fs 2014/12/16 09:43:55 I'm not too worried either - let's just hope that
+ childPaintInfo.rect = enclosingIntRect(transform.inverse().mapRect(FloatRect(childPaintInfo.rect)));
fs 2014/12/15 10:28:16 One inverse() too many (since transformToRootBorde
+
chrishtr 2014/12/15 16:36:24 Maybe just use an infinite rect here to turn off c
if (SVGRenderSupport::isOverflowHidden(&m_renderSVGForeignObject))
childPaintInfo.context->clip(m_renderSVGForeignObject.viewportRect());

Powered by Google App Engine
This is Rietveld 408576698