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

Unified Diff: Source/platform/graphics/paint/DisplayItemPropertyTreeBuilder.cpp

Issue 1346733004: Include transform origin in the transform tree. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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/platform/graphics/paint/DisplayItemPropertyTreeBuilder.cpp
diff --git a/Source/platform/graphics/paint/DisplayItemPropertyTreeBuilder.cpp b/Source/platform/graphics/paint/DisplayItemPropertyTreeBuilder.cpp
index 6689f124037802d870a86390a1182af0ef09209d..b758a352bf4fda846947e864ad3e6a50cccf0368 100644
--- a/Source/platform/graphics/paint/DisplayItemPropertyTreeBuilder.cpp
+++ b/Source/platform/graphics/paint/DisplayItemPropertyTreeBuilder.cpp
@@ -65,8 +65,12 @@ enum TransformKind { NotATransform = 0, Only2DTranslation, RequiresTransformNode
enum ClipKind { NotAClip = 0, RequiresClipNode };
struct BeginDisplayItemClassification {
+ // |transformOrigin| is irrelevant unless a non-translation matrix is
+ // provided.
TransformKind transformKind = NotATransform;
TransformationMatrix matrix;
+ FloatPoint3D transformOrigin;
+
ClipKind clipKind = NotAClip;
FloatRect clipRect;
};
@@ -81,6 +85,7 @@ static BeginDisplayItemClassification classifyBeginItem(const DisplayItem& begin
if (DisplayItem::isTransform3DType(type)) {
const auto& begin3D = static_cast<const BeginTransform3DDisplayItem&>(beginDisplayItem);
result.matrix = begin3D.transform();
+ result.transformOrigin = begin3D.transformOrigin();
result.transformKind = result.matrix.isIdentityOr2DTranslation() ? Only2DTranslation : RequiresTransformNode;
} else if (type == DisplayItem::BeginTransform) {
const auto& begin2D = static_cast<const BeginTransformDisplayItem&>(beginDisplayItem);
@@ -120,7 +125,7 @@ void DisplayItemPropertyTreeBuilder::processBeginItem(const DisplayItem& display
case RequiresTransformNode:
// Emit a transform node.
newState.transformNode = m_transformTree->createNewNode(
- newState.transformNode, classification.matrix);
+ newState.transformNode, classification.matrix, classification.transformOrigin);
newState.offset = FloatSize();
break;
}
« no previous file with comments | « Source/platform/geometry/FloatPoint3D.h ('k') | Source/platform/graphics/paint/DisplayItemPropertyTreeBuilderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698