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

Unified Diff: Source/core/rendering/svg/SVGRenderingContext.cpp

Issue 666403002: Decouple content transform fiddling from SVGRenderingContext::renderSubtree (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/svg/SVGRenderingContext.h ('k') | Source/core/svg/graphics/filters/SVGFEImage.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/SVGRenderingContext.cpp
diff --git a/Source/core/rendering/svg/SVGRenderingContext.cpp b/Source/core/rendering/svg/SVGRenderingContext.cpp
index 56a6e238dd6e4fbb7f106703c3ac58ef17d105f3..6c4496ad83eb4079b24a4b65bb709bb06ae4a0ee 100644
--- a/Source/core/rendering/svg/SVGRenderingContext.cpp
+++ b/Source/core/rendering/svg/SVGRenderingContext.cpp
@@ -183,6 +183,18 @@ static AffineTransform& currentContentTransformation()
return s_currentContentTransformation;
}
+SubtreeContentTransformScope::SubtreeContentTransformScope(const AffineTransform& subtreeContentTransformation)
+{
+ AffineTransform& contentTransformation = currentContentTransformation();
+ m_savedContentTransformation = contentTransformation;
+ contentTransformation = subtreeContentTransformation * contentTransformation;
+}
+
+SubtreeContentTransformScope::~SubtreeContentTransformScope()
+{
+ currentContentTransformation() = m_savedContentTransformation;
+}
+
float SVGRenderingContext::calculateScreenFontSizeScalingFactor(const RenderObject* renderer)
{
ASSERT(renderer);
@@ -232,21 +244,14 @@ void SVGRenderingContext::calculateDeviceSpaceTransformation(const RenderObject*
absoluteTransform.scale(deviceScaleFactor);
}
-void SVGRenderingContext::renderSubtree(GraphicsContext* context, RenderObject* item, const AffineTransform& subtreeContentTransformation)
+void SVGRenderingContext::renderSubtree(GraphicsContext* context, RenderObject* item)
{
- ASSERT(item);
ASSERT(context);
+ ASSERT(item);
+ ASSERT(!item->needsLayout());
PaintInfo info(context, PaintInfo::infiniteRect(), PaintPhaseForeground, PaintBehaviorNormal);
-
- AffineTransform& contentTransformation = currentContentTransformation();
- AffineTransform savedContentTransformation = contentTransformation;
- contentTransformation = subtreeContentTransformation * contentTransformation;
-
- ASSERT(!item->needsLayout());
item->paint(info, IntPoint());
-
- contentTransformation = savedContentTransformation;
}
FloatRect SVGRenderingContext::clampedAbsoluteTargetRect(const FloatRect& absoluteTargetRect)
« no previous file with comments | « Source/core/rendering/svg/SVGRenderingContext.h ('k') | Source/core/svg/graphics/filters/SVGFEImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698