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

Unified Diff: Source/core/paint/SVGTextPainter.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/SVGTextPainter.cpp
diff --git a/Source/core/paint/SVGTextPainter.cpp b/Source/core/paint/SVGTextPainter.cpp
index 5c80177165e5aa16d99883d9556de86be56264b0..5779c840efe4888c2239ead579cea4b9d7599f84 100644
--- a/Source/core/paint/SVGTextPainter.cpp
+++ b/Source/core/paint/SVGTextPainter.cpp
@@ -8,6 +8,7 @@
#include "core/paint/BlockPainter.h"
#include "core/rendering/PaintInfo.h"
#include "core/rendering/svg/RenderSVGText.h"
+#include "core/rendering/svg/SVGRenderSupport.h"
#include "platform/graphics/GraphicsContextStateSaver.h"
namespace blink {
@@ -22,6 +23,12 @@ void SVGTextPainter::paint(const PaintInfo& paintInfo)
blockInfo.applyTransform(m_renderSVGText.localToParentTransform(), &stateSaver);
+ // 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_renderSVGText, m_renderSVGText.localToParentTransform());
+ blockInfo.rect = enclosingIntRect(transform.mapRect(FloatRect(blockInfo.rect)));
+
BlockPainter(m_renderSVGText).paint(blockInfo, LayoutPoint());
// Paint the outlines, if any

Powered by Google App Engine
This is Rietveld 408576698