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

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

Issue 1295403003: DisplayItemPropertyTreeBuilder: Support (2D) transform and scroll display items. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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 | « no previous file | Source/platform/graphics/paint/DisplayItemPropertyTreeBuilderTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/paint/DisplayItemPropertyTreeBuilder.cpp
diff --git a/Source/platform/graphics/paint/DisplayItemPropertyTreeBuilder.cpp b/Source/platform/graphics/paint/DisplayItemPropertyTreeBuilder.cpp
index e66901d3e7589235b86bbc19d17812eae5c70a07..6689f124037802d870a86390a1182af0ef09209d 100644
--- a/Source/platform/graphics/paint/DisplayItemPropertyTreeBuilder.cpp
+++ b/Source/platform/graphics/paint/DisplayItemPropertyTreeBuilder.cpp
@@ -8,7 +8,9 @@
#include "platform/graphics/paint/DisplayItem.h"
#include "platform/graphics/paint/DisplayItemClipTree.h"
#include "platform/graphics/paint/DisplayItemTransformTree.h"
+#include "platform/graphics/paint/ScrollDisplayItem.h"
#include "platform/graphics/paint/Transform3DDisplayItem.h"
+#include "platform/graphics/paint/TransformDisplayItem.h"
namespace blink {
@@ -80,6 +82,15 @@ static BeginDisplayItemClassification classifyBeginItem(const DisplayItem& begin
const auto& begin3D = static_cast<const BeginTransform3DDisplayItem&>(beginDisplayItem);
result.matrix = begin3D.transform();
result.transformKind = result.matrix.isIdentityOr2DTranslation() ? Only2DTranslation : RequiresTransformNode;
+ } else if (type == DisplayItem::BeginTransform) {
+ const auto& begin2D = static_cast<const BeginTransformDisplayItem&>(beginDisplayItem);
+ result.matrix = begin2D.transform();
+ result.transformKind = begin2D.transform().isIdentityOrTranslation() ? Only2DTranslation : RequiresTransformNode;
+ } else if (DisplayItem::isScrollType(type)) {
+ const auto& beginScroll = static_cast<const BeginScrollDisplayItem&>(beginDisplayItem);
+ const IntSize& offset = beginScroll.currentOffset();
+ result.matrix.translate(-offset.width(), -offset.height());
+ result.transformKind = Only2DTranslation;
}
return result;
}
« no previous file with comments | « no previous file | Source/platform/graphics/paint/DisplayItemPropertyTreeBuilderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698