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

Unified Diff: Source/core/paint/DeprecatedPaintLayer.cpp

Issue 1030323005: Simplify application of perspective origin. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add three more test expectation changes (added since earlier) Created 5 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
« no previous file with comments | « Source/core/paint/DeprecatedPaintLayer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/DeprecatedPaintLayer.cpp
diff --git a/Source/core/paint/DeprecatedPaintLayer.cpp b/Source/core/paint/DeprecatedPaintLayer.cpp
index e0c1dd8bc79aeae2e55998536e674edf802625c0..3cf4a7d1e25a955f3196bd01fe519c62f73a8d07 100644
--- a/Source/core/paint/DeprecatedPaintLayer.cpp
+++ b/Source/core/paint/DeprecatedPaintLayer.cpp
@@ -913,24 +913,8 @@ TransformationMatrix DeprecatedPaintLayer::perspectiveTransform() const
if (!style.hasPerspective())
return TransformationMatrix();
- // Maybe fetch the perspective from the backing?
- const IntRect borderBox = toLayoutBox(layoutObject())->pixelSnappedBorderBoxRect();
- const float boxWidth = borderBox.width();
- const float boxHeight = borderBox.height();
-
- float perspectiveOriginX = floatValueForLength(style.perspectiveOriginX(), boxWidth);
- float perspectiveOriginY = floatValueForLength(style.perspectiveOriginY(), boxHeight);
-
- // A perspective origin of 0,0 makes the vanishing point in the center of the element.
- // We want it to be in the top-left, so subtract half the height and width.
- perspectiveOriginX -= boxWidth / 2.0f;
- perspectiveOriginY -= boxHeight / 2.0f;
-
TransformationMatrix t;
- t.translate(perspectiveOriginX, perspectiveOriginY);
t.applyPerspective(style.perspective());
- t.translate(-perspectiveOriginX, -perspectiveOriginY);
-
return t;
}
« no previous file with comments | « Source/core/paint/DeprecatedPaintLayer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698