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

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: with new TestExpectations Created 5 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
Index: Source/core/paint/DeprecatedPaintLayer.cpp
diff --git a/Source/core/paint/DeprecatedPaintLayer.cpp b/Source/core/paint/DeprecatedPaintLayer.cpp
index 541f04ae21efff028d47823b87110d504e8e78a1..6c44b66f4f7c33601137b5ff5bf69e51ca593c77 100644
--- a/Source/core/paint/DeprecatedPaintLayer.cpp
+++ b/Source/core/paint/DeprecatedPaintLayer.cpp
@@ -908,24 +908,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;
}

Powered by Google App Engine
This is Rietveld 408576698