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

Unified Diff: cc/layers/layer.cc

Issue 687873004: Introduce Property Trees (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wip-awoloszyn2
Patch Set: . Created 6 years 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: cc/layers/layer.cc
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index 08f39b9a21d6d67805fef6150237b57f3c51f810..7cf0e0fb915611828513d155de71350f70b70e3f 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -49,6 +49,9 @@ Layer::Layer()
layer_tree_host_(nullptr),
scroll_clip_layer_id_(INVALID_ID),
num_descendants_that_draw_content_(0),
+ transform_tree_index_(-1),
+ opacity_tree_index_(-1),
+ clip_tree_index_(-1),
should_scroll_on_main_thread_(false),
have_wheel_event_handlers_(false),
have_scroll_event_handlers_(false),
@@ -1233,6 +1236,10 @@ void Layer::AddDrawableDescendants(int num) {
parent()->AddDrawableDescendants(num);
}
+bool Layer::NeedsVisibleRectUpdated() const {
+ return DrawsContent();
+}
+
void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) {
benchmark->RunOnLayer(this);
}
@@ -1241,4 +1248,32 @@ bool Layer::HasDelegatedContent() const {
return false;
}
+gfx::Transform Layer::debug_screen_space_transform(
+ const TransformTree& tree) const {
+ gfx::Transform xform(1, 0, 0, 1, offset_to_transform_parent().x(),
+ offset_to_transform_parent().y());
+ if (transform_tree_index() >= 0) {
+ gfx::Transform ssxform = tree.Node(transform_tree_index())->data.to_screen;
+ xform.ConcatTransform(ssxform);
+ }
+ xform.Scale(1.0 / contents_scale_x(), 1.0 / contents_scale_y());
+ return xform;
+}
+
+gfx::Transform Layer::debug_draw_transform(const TransformTree& tree) const {
+ if (!has_render_target())
+ return debug_screen_space_transform(tree);
+
+ gfx::Transform xform(1, 0, 0, 1, offset_to_transform_parent().x(),
+ offset_to_transform_parent().y());
+ if (transform_tree_index() >= 0) {
+ gfx::Transform ssxform;
+ ComputeTransform(tree, transform_tree_index(),
+ render_target()->transform_tree_index(), &ssxform);
+ xform.ConcatTransform(ssxform);
+ }
+ xform.Scale(1.0 / contents_scale_x(), 1.0 / contents_scale_y());
+ return xform;
+}
+
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698