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

Unified Diff: cc/debug/invalidation_benchmark.cc

Issue 2225973003: cc: Remove usage of ComputeVisibleRects on main thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Project rects back to layer space after clipped by viewport. Created 4 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 | cc/layers/layer.h » ('j') | cc/trees/layer_tree_host_common_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/debug/invalidation_benchmark.cc
diff --git a/cc/debug/invalidation_benchmark.cc b/cc/debug/invalidation_benchmark.cc
index 681e29ef7cced1b62c1f9303d22c0c26df7494af..458ccf687006dab3fd1608b94642d58429010cc9 100644
--- a/cc/debug/invalidation_benchmark.cc
+++ b/cc/debug/invalidation_benchmark.cc
@@ -70,11 +70,18 @@ void InvalidationBenchmark::DidUpdateLayers(LayerTreeHost* host) {
void InvalidationBenchmark::RunOnLayer(PictureLayer* layer) {
PropertyTrees* property_trees = layer->layer_tree_host()->property_trees();
- LayerList update_list;
- update_list.push_back(layer);
- draw_property_utils::ComputeVisibleRectsForTesting(
- property_trees, property_trees->non_root_surfaces_enabled, &update_list);
- gfx::Rect visible_layer_rect = layer->visible_layer_rect_for_testing();
+ const TransformTree& transform_tree = property_trees->transform_tree;
+ int index = layer->transform_tree_index();
+ layer->layer_tree_host()->BuildPropertyTreesForTesting();
+ gfx::Point position =
+ gfx::Point(layer->position().x(), layer->position().y());
+ gfx::Rect layer_rect = gfx::Rect(position, layer->bounds());
ajuma 2016/08/09 20:44:01 The screen space transform already accounts for th
+ gfx::Rect screen_space_rect = MathUtil::MapEnclosingClippedRect(
+ transform_tree.ToScreen(index), layer_rect);
ajuma 2016/08/09 20:44:01 This should use Layer::screen_space_transform (sin
+ screen_space_rect.Intersect(
+ gfx::Rect(layer->layer_tree_host()->device_viewport_size()));
ajuma 2016/08/09 20:44:01 I wonder if it would be simpler to just start with
+ gfx::Rect visible_layer_rect = MathUtil::ProjectEnclosingClippedRect(
+ transform_tree.FromScreen(index), screen_space_rect);
ajuma 2016/08/09 20:44:01 And this needs to use the inverse of Layer::screen
switch (mode_) {
case FIXED_SIZE: {
// Invalidation with a random position and fixed size.
« no previous file with comments | « no previous file | cc/layers/layer.h » ('j') | cc/trees/layer_tree_host_common_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698