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

Unified Diff: cc/debug/invalidation_benchmark.cc

Issue 1855013002: cc : Stop calculating visible rects on main thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/debug/rasterize_and_record_benchmark.cc » ('j') | no next file with comments »
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 3114cd23a027426f25a1cfe885b33ba9e34d35bf..f1f2580a81476127b27fe8d76d5c8010b3c666c3 100644
--- a/cc/debug/invalidation_benchmark.cc
+++ b/cc/debug/invalidation_benchmark.cc
@@ -13,6 +13,7 @@
#include "base/values.h"
#include "cc/layers/layer.h"
#include "cc/layers/picture_layer.h"
+#include "cc/trees/draw_property_utils.h"
#include "cc/trees/layer_tree_host.h"
#include "cc/trees/layer_tree_host_common.h"
#include "ui/gfx/geometry/rect.h"
@@ -68,10 +69,15 @@ 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();
switch (mode_) {
case FIXED_SIZE: {
// Invalidation with a random position and fixed size.
- gfx::Rect visible_layer_rect = layer->visible_layer_rect_for_testing();
int x = LCGRandom() * (visible_layer_rect.width() - width_);
int y = LCGRandom() * (visible_layer_rect.height() - height_);
gfx::Rect invalidation_rect(x, y, width_, height_);
@@ -85,7 +91,6 @@ void InvalidationBenchmark::RunOnLayer(PictureLayer* layer) {
}
case RANDOM: {
// Random invalidation inside the viewport.
- gfx::Rect visible_layer_rect = layer->visible_layer_rect_for_testing();
int x_min = LCGRandom() * visible_layer_rect.width();
int x_max = LCGRandom() * visible_layer_rect.width();
int y_min = LCGRandom() * visible_layer_rect.height();
« no previous file with comments | « no previous file | cc/debug/rasterize_and_record_benchmark.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698