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

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

Issue 292663008: Make shouldTransformOnTextPainting compilation unit local (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@turn-assert_unused-into-plain
Patch Set: Created 6 years, 7 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/RenderSVGResourceContainer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/RenderSVGResourceContainer.cpp
diff --git a/Source/core/rendering/svg/RenderSVGResourceContainer.cpp b/Source/core/rendering/svg/RenderSVGResourceContainer.cpp
index bc3c0518e8a18dfcb02c4c250cb9a696ae0516a9..7dfe28e69040f3eef72e922b0e0f0ec1a54843f1 100644
--- a/Source/core/rendering/svg/RenderSVGResourceContainer.cpp
+++ b/Source/core/rendering/svg/RenderSVGResourceContainer.cpp
@@ -235,6 +235,23 @@ void RenderSVGResourceContainer::registerResource()
}
}
+static bool shouldTransformOnTextPainting(RenderObject* object, AffineTransform& resourceTransform)
+{
+ ASSERT(object);
+
+ // This method should only be called for RenderObjects that deal with text rendering. Cmp. RenderObject.h's is*() methods.
+ ASSERT(object->isSVGText() || object->isSVGTextPath() || object->isSVGInline());
+
+ // In text drawing, the scaling part of the graphics context CTM is removed, compare SVGInlineTextBox::paintTextWithShadows.
+ // So, we use that scaling factor here, too, and then push it down to pattern or gradient space
+ // in order to keep the pattern or gradient correctly scaled.
+ float scalingFactor = SVGRenderingContext::calculateScreenFontSizeScalingFactor(object);
+ if (scalingFactor == 1)
+ return false;
+ resourceTransform.scale(scalingFactor);
+ return true;
+}
+
AffineTransform RenderSVGResourceContainer::computeResourceSpaceTransform(RenderObject* object, const AffineTransform& baseTransform, const SVGRenderStyle* svgStyle, unsigned short resourceMode)
{
AffineTransform computedSpaceTransform = baseTransform;
@@ -255,23 +272,6 @@ AffineTransform RenderSVGResourceContainer::computeResourceSpaceTransform(Render
return computedSpaceTransform;
}
-bool RenderSVGResourceContainer::shouldTransformOnTextPainting(RenderObject* object, AffineTransform& resourceTransform)
-{
- ASSERT(object);
-
- // This method should only be called for RenderObjects that deal with text rendering. Cmp. RenderObject.h's is*() methods.
- ASSERT(object->isSVGText() || object->isSVGTextPath() || object->isSVGInline());
-
- // In text drawing, the scaling part of the graphics context CTM is removed, compare SVGInlineTextBox::paintTextWithShadows.
- // So, we use that scaling factor here, too, and then push it down to pattern or gradient space
- // in order to keep the pattern or gradient correctly scaled.
- float scalingFactor = SVGRenderingContext::calculateScreenFontSizeScalingFactor(object);
- if (scalingFactor == 1)
- return false;
- resourceTransform.scale(scalingFactor);
- return true;
-}
-
// FIXME: This does not belong here.
AffineTransform RenderSVGResourceContainer::transformOnNonScalingStroke(RenderObject* object, const AffineTransform& resourceTransform)
{
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResourceContainer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698