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

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

Issue 196413023: [SVG] Poor filter resolution when using CSS 3D transforms. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Moar comments. Created 6 years, 9 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') | no next file » | 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 7928a7c09d6d11841b27bf1b2514909e2762c535..6329cf0fa699c08a9df15da794f123393b244147 100644
--- a/Source/core/rendering/svg/SVGRenderingContext.cpp
+++ b/Source/core/rendering/svg/SVGRenderingContext.cpp
@@ -203,12 +203,17 @@ float SVGRenderingContext::calculateScreenFontSizeScalingFactor(const RenderObje
ASSERT(renderer);
AffineTransform ctm;
- calculateTransformationToOutermostCoordinateSystem(renderer, ctm);
+ // FIXME: calculateDeviceSpaceTransformation() queries layer compositing state - which is not
+ // supported during layout. Hence, the result may not include all CSS transforms.
+ calculateDeviceSpaceTransformation(renderer, ctm);
return narrowPrecisionToFloat(sqrt((pow(ctm.xScale(), 2) + pow(ctm.yScale(), 2)) / 2));
}
-void SVGRenderingContext::calculateTransformationToOutermostCoordinateSystem(const RenderObject* renderer, AffineTransform& absoluteTransform)
+void SVGRenderingContext::calculateDeviceSpaceTransformation(const RenderObject* renderer, AffineTransform& absoluteTransform)
{
+ // FIXME: trying to compute a device space transform at record time is wrong. All clients
+ // should be updated to avoid relying on this information, and the method should be removed.
+
ASSERT(renderer);
// We're about to possibly clear renderer, so save the deviceScaleFactor now.
float deviceScaleFactor = renderer->document().frameHost()->deviceScaleFactor();
@@ -224,18 +229,18 @@ void SVGRenderingContext::calculateTransformationToOutermostCoordinateSystem(con
// Continue walking up the layer tree, accumulating CSS transforms.
RenderLayer* layer = renderer ? renderer->enclosingLayer() : 0;
- while (layer) {
- if (TransformationMatrix* layerTransform = layer->transform())
- absoluteTransform = layerTransform->toAffineTransform() * absoluteTransform;
-
+ while (layer && layer->isAllowedToQueryCompositingState()) {
// We can stop at compositing layers, to match the backing resolution.
// FIXME: should we be computing the transform to the nearest composited layer,
// or the nearest composited layer that does not paint into its ancestor?
// I think this is the nearest composited ancestor since we will inherit its
// transforms in the composited layer tree.
- if (layer->hasCompositedLayerMapping())
+ if (layer->compositingState() != NotComposited)
break;
+ if (TransformationMatrix* layerTransform = layer->transform())
+ absoluteTransform = layerTransform->toAffineTransform() * absoluteTransform;
+
layer = layer->parent();
}
« no previous file with comments | « Source/core/rendering/svg/SVGRenderingContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698