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

Side by Side Diff: cc/trees/layer_tree_host.cc

Issue 25912003: cc: Stop using magic numbers to detect if we can use partial updates. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <stack> 8 #include <stack>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1111 } 1111 }
1112 } 1112 }
1113 1113
1114 void LayerTreeHost::RateLimit() { 1114 void LayerTreeHost::RateLimit() {
1115 // Force a no-op command on the compositor context, so that any ratelimiting 1115 // Force a no-op command on the compositor context, so that any ratelimiting
1116 // commands will wait for the compositing context, and therefore for the 1116 // commands will wait for the compositing context, and therefore for the
1117 // SwapBuffers. 1117 // SwapBuffers.
1118 proxy_->ForceSerializeOnSwapBuffers(); 1118 proxy_->ForceSerializeOnSwapBuffers();
1119 } 1119 }
1120 1120
1121 bool LayerTreeHost::AlwaysUsePartialTextureUpdates() {
1122 if (!proxy_->GetRendererCapabilities().allow_partial_texture_updates)
1123 return false;
1124 return !proxy_->HasImplThread();
1125 }
1126
1121 bool LayerTreeHost::RequestPartialTextureUpdate() { 1127 bool LayerTreeHost::RequestPartialTextureUpdate() {
1122 if (partial_texture_update_requests_ >= settings_.max_partial_texture_updates) 1128 if (partial_texture_update_requests_ >= settings_.max_partial_texture_updates)
1123 return false; 1129 return false;
1124 1130
1125 partial_texture_update_requests_++; 1131 partial_texture_update_requests_++;
1126 return true; 1132 return true;
1127 } 1133 }
1128 1134
1129 void LayerTreeHost::SetDeviceScaleFactor(float device_scale_factor) { 1135 void LayerTreeHost::SetDeviceScaleFactor(float device_scale_factor) {
1130 if (device_scale_factor == device_scale_factor_) 1136 if (device_scale_factor == device_scale_factor_)
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
1236 void LayerTreeHost::RegisterViewportLayers( 1242 void LayerTreeHost::RegisterViewportLayers(
1237 scoped_refptr<Layer> page_scale_layer, 1243 scoped_refptr<Layer> page_scale_layer,
1238 scoped_refptr<Layer> inner_viewport_scroll_layer, 1244 scoped_refptr<Layer> inner_viewport_scroll_layer,
1239 scoped_refptr<Layer> outer_viewport_scroll_layer) { 1245 scoped_refptr<Layer> outer_viewport_scroll_layer) {
1240 page_scale_layer_ = page_scale_layer; 1246 page_scale_layer_ = page_scale_layer;
1241 inner_viewport_scroll_layer_ = inner_viewport_scroll_layer; 1247 inner_viewport_scroll_layer_ = inner_viewport_scroll_layer;
1242 outer_viewport_scroll_layer_ = outer_viewport_scroll_layer; 1248 outer_viewport_scroll_layer_ = outer_viewport_scroll_layer;
1243 } 1249 }
1244 1250
1245 } // namespace cc 1251 } // namespace cc
OLDNEW
« 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