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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 1018463005: cc: PushProperties on viewport size change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/layers/picture_layer.cc ('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 5b656a8f7363adb04b77919df722098ecb258218..8c6eeef76452e7cdaffaaa041997487d4e1e6a73 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -343,6 +343,18 @@ void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) {
host_impl->set_gpu_rasterization_status(GetGpuRasterizationStatus());
RecordGpuRasterizationHistogram();
+ // When we are using GPU rasterization, tile size is based on the viewport
+ // width. We could have layers that change in size, but are not invalidated
+ // because no layout is required. When this happens, we need to notify the
+ // layers that they require a PushProperties to resize the tiles correctly.
+ if (root_layer() &&
+ device_viewport_size_ != host_impl->device_viewport_size() &&
+ UseGpuRasterization()) {
+ LayerTreeHostCommon::CallFunctionForSubtree(root_layer(), [](Layer* layer) {
+ layer->OnDeviceViewportSizeChanged();
+ });
+ }
+
host_impl->SetViewportSize(device_viewport_size_);
host_impl->SetDeviceScaleFactor(device_scale_factor_);
host_impl->SetDebugState(debug_state_);
« no previous file with comments | « cc/layers/picture_layer.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698