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

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

Issue 230443003: Fix application of OBB paint-servers when device scale != 1 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. Created 6 years, 8 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
Index: Source/core/rendering/svg/RenderSVGResourceContainer.cpp
diff --git a/Source/core/rendering/svg/RenderSVGResourceContainer.cpp b/Source/core/rendering/svg/RenderSVGResourceContainer.cpp
index 4a396667a43b5fa67d24c0248b128382a8c3b595..4bd1c6fe472ba4dc2a5dbeeb4617d6119b30b791 100644
--- a/Source/core/rendering/svg/RenderSVGResourceContainer.cpp
+++ b/Source/core/rendering/svg/RenderSVGResourceContainer.cpp
@@ -232,6 +232,26 @@ void RenderSVGResourceContainer::registerResource()
}
}
+AffineTransform RenderSVGResourceContainer::computeResourceSpaceTransform(RenderObject* object, const AffineTransform& baseTransform, const SVGRenderStyle* svgStyle, unsigned short resourceMode)
+{
+ AffineTransform computedSpaceTransform = baseTransform;
+ if (resourceMode & ApplyToTextMode) {
+ // Depending on the font scaling factor, we may need to apply an
+ // additional transform (scale-factor) the paintserver, since text
+ // painting removes the scale factor from the context. (See
+ // SVGInlineTextBox::paintTextWithShadows.)
+ AffineTransform additionalTextTransformation;
+ if (shouldTransformOnTextPainting(object, additionalTextTransformation))
+ computedSpaceTransform = additionalTextTransformation * computedSpaceTransform;
+ }
+ if (resourceMode & ApplyToStrokeMode) {
+ // Non-scaling stroke needs to reset the transform back to the host transform.
+ if (svgStyle->vectorEffect() == VE_NON_SCALING_STROKE)
+ computedSpaceTransform = transformOnNonScalingStroke(object, computedSpaceTransform);
+ }
+ return computedSpaceTransform;
+}
+
bool RenderSVGResourceContainer::shouldTransformOnTextPainting(RenderObject* object, AffineTransform& resourceTransform)
{
ASSERT_UNUSED(object, object);
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResourceContainer.h ('k') | Source/core/rendering/svg/RenderSVGResourceGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698