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

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

Issue 23463042: LayerTreeHost should not modify the LayerTreeSettings object. Instead it should use a temporary va… (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Fixed the formatting. Created 7 years, 3 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
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | no next file » | 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 LayerTreeHost::OnCreateAndInitializeOutputSurfaceAttempted(bool success) { 175 LayerTreeHost::OnCreateAndInitializeOutputSurfaceAttempted(bool success) {
176 TRACE_EVENT1("cc", 176 TRACE_EVENT1("cc",
177 "LayerTreeHost::OnCreateAndInitializeOutputSurfaceAttempted", 177 "LayerTreeHost::OnCreateAndInitializeOutputSurfaceAttempted",
178 "success", 178 "success",
179 success); 179 success);
180 180
181 DCHECK(output_surface_lost_); 181 DCHECK(output_surface_lost_);
182 if (success) { 182 if (success) {
183 output_surface_lost_ = false; 183 output_surface_lost_ = false;
184 184
185 // Update settings_ based on partial update capability.
186 size_t max_partial_texture_updates = 0;
187 if (proxy_->GetRendererCapabilities().allow_partial_texture_updates &&
188 !settings_.impl_side_painting) {
189 max_partial_texture_updates = std::min(
190 settings_.max_partial_texture_updates,
191 proxy_->MaxPartialTextureUpdates());
192 }
193 settings_.max_partial_texture_updates = max_partial_texture_updates;
194
195 if (!contents_texture_manager_ && 185 if (!contents_texture_manager_ &&
196 (!settings_.impl_side_painting || !settings_.solid_color_scrollbars)) { 186 (!settings_.impl_side_painting || !settings_.solid_color_scrollbars)) {
197 contents_texture_manager_ = 187 contents_texture_manager_ =
198 PrioritizedResourceManager::Create(proxy_.get()); 188 PrioritizedResourceManager::Create(proxy_.get());
199 surface_memory_placeholder_ = 189 surface_memory_placeholder_ =
200 contents_texture_manager_->CreateTexture(gfx::Size(), GL_RGBA); 190 contents_texture_manager_->CreateTexture(gfx::Size(), GL_RGBA);
201 } 191 }
202 192
203 client_->DidInitializeOutputSurface(true); 193 client_->DidInitializeOutputSurface(true);
204 return CreateSucceeded; 194 return CreateSucceeded;
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after
1078 } 1068 }
1079 1069
1080 void LayerTreeHost::RateLimit() { 1070 void LayerTreeHost::RateLimit() {
1081 // Force a no-op command on the compositor context, so that any ratelimiting 1071 // Force a no-op command on the compositor context, so that any ratelimiting
1082 // commands will wait for the compositing context, and therefore for the 1072 // commands will wait for the compositing context, and therefore for the
1083 // SwapBuffers. 1073 // SwapBuffers.
1084 proxy_->ForceSerializeOnSwapBuffers(); 1074 proxy_->ForceSerializeOnSwapBuffers();
1085 } 1075 }
1086 1076
1087 bool LayerTreeHost::RequestPartialTextureUpdate() { 1077 bool LayerTreeHost::RequestPartialTextureUpdate() {
1088 if (partial_texture_update_requests_ >= settings_.max_partial_texture_updates) 1078 size_t max_partial_texture_updates = settings_.max_partial_texture_updates;
danakj 2013/09/17 22:44:23 Oh, this should be 0 if the if statement below is
1079 if (proxy_->GetRendererCapabilities().allow_partial_texture_updates &&
1080 !settings_.impl_side_painting) {
1081 max_partial_texture_updates = std::min(max_partial_texture_updates,
1082 proxy_->MaxPartialTextureUpdates());
1083 }
1084
1085 if (partial_texture_update_requests_ >= max_partial_texture_updates)
1089 return false; 1086 return false;
1090 1087
1091 partial_texture_update_requests_++; 1088 partial_texture_update_requests_++;
1092 return true; 1089 return true;
1093 } 1090 }
1094 1091
1095 void LayerTreeHost::SetDeviceScaleFactor(float device_scale_factor) { 1092 void LayerTreeHost::SetDeviceScaleFactor(float device_scale_factor) {
1096 if (device_scale_factor == device_scale_factor_) 1093 if (device_scale_factor == device_scale_factor_)
1097 return; 1094 return;
1098 device_scale_factor_ = device_scale_factor; 1095 device_scale_factor_ = device_scale_factor;
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
1182 request.type = UIResourceRequest::UIResourceCreate; 1179 request.type = UIResourceRequest::UIResourceCreate;
1183 request.id = uid; 1180 request.id = uid;
1184 bool resource_lost = true; 1181 bool resource_lost = true;
1185 request.bitmap = iter->second->GetBitmap(uid, resource_lost); 1182 request.bitmap = iter->second->GetBitmap(uid, resource_lost);
1186 DCHECK(request.bitmap.get()); 1183 DCHECK(request.bitmap.get());
1187 ui_resource_request_queue_.push_back(request); 1184 ui_resource_request_queue_.push_back(request);
1188 } 1185 }
1189 } 1186 }
1190 1187
1191 } // namespace cc 1188 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698