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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 2108033004: cc: Re-enable GPU rasterization after content veto. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update Created 4 years, 6 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 | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host.cc
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index 903236ec060f00df4cf06b52e4188581bda9c359..4323b4824bdc824b03840112159e423ffff3b51f 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -1050,10 +1050,21 @@ bool LayerTreeHost::DoUpdateLayers(Layer* root_layer) {
base::AutoReset<bool> painting(&in_paint_layer_contents_, true);
bool did_paint_content = false;
+ bool content_is_suitable_for_gpu = true;
for (const auto& layer : update_layer_list) {
did_paint_content |= layer->Update();
- content_is_suitable_for_gpu_rasterization_ &=
- layer->IsSuitableForGpuRasterization();
+ content_is_suitable_for_gpu &= layer->IsSuitableForGpuRasterization();
+ }
+
+ if (content_is_suitable_for_gpu) {
+ ++num_consecutive_frames_suitable_for_gpu_;
+ if (num_consecutive_frames_suitable_for_gpu_ >=
+ kNumFramesToConsiderBeforeGpuRasterization) {
+ content_is_suitable_for_gpu_rasterization_ = true;
+ }
+ } else {
+ num_consecutive_frames_suitable_for_gpu_ = 0;
+ content_is_suitable_for_gpu_rasterization_ = false;
}
return did_paint_content;
}
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698