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

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

Issue 2247573002: cc: Don't upload UI resources twice after eviction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cc: Don't upload UI resources again after eviction Created 4 years, 4 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
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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after
1183 ui_resource_client_map_.erase(iter); 1183 ui_resource_client_map_.erase(iter);
1184 } 1184 }
1185 1185
1186 void LayerTreeHost::RecreateUIResources() { 1186 void LayerTreeHost::RecreateUIResources() {
1187 for (UIResourceClientMap::iterator iter = ui_resource_client_map_.begin(); 1187 for (UIResourceClientMap::iterator iter = ui_resource_client_map_.begin();
1188 iter != ui_resource_client_map_.end(); 1188 iter != ui_resource_client_map_.end();
1189 ++iter) { 1189 ++iter) {
1190 UIResourceId uid = iter->first; 1190 UIResourceId uid = iter->first;
1191 const UIResourceClientData& data = iter->second; 1191 const UIResourceClientData& data = iter->second;
1192 bool resource_lost = true; 1192 bool resource_lost = true;
1193 UIResourceRequest request(UIResourceRequest::UI_RESOURCE_CREATE, uid, 1193 if (std::find_if(ui_resource_request_queue_.begin(),
danakj 2016/08/15 22:52:11 Can you split this into a few lines cuz its hard t
no sievers 2016/08/26 18:38:18 Done.
1194 data.client->GetBitmap(uid, resource_lost)); 1194 ui_resource_request_queue_.end(),
1195 ui_resource_request_queue_.push_back(request); 1195 [uid](const UIResourceRequest& request) {
1196 return request.GetId() == uid;
1197 }) == ui_resource_request_queue_.end()) {
1198 UIResourceRequest request(UIResourceRequest::UI_RESOURCE_CREATE, uid,
1199 data.client->GetBitmap(uid, resource_lost));
1200 ui_resource_request_queue_.push_back(request);
1201 }
1196 } 1202 }
1197 } 1203 }
1198 1204
1199 // Returns the size of a resource given its id. 1205 // Returns the size of a resource given its id.
1200 gfx::Size LayerTreeHost::GetUIResourceSize(UIResourceId uid) const { 1206 gfx::Size LayerTreeHost::GetUIResourceSize(UIResourceId uid) const {
1201 UIResourceClientMap::const_iterator iter = ui_resource_client_map_.find(uid); 1207 UIResourceClientMap::const_iterator iter = ui_resource_client_map_.find(uid);
1202 if (iter == ui_resource_client_map_.end()) 1208 if (iter == ui_resource_client_map_.end())
1203 return gfx::Size(); 1209 return gfx::Size();
1204 1210
1205 const UIResourceClientData& data = iter->second; 1211 const UIResourceClientData& data = iter->second;
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
1671 1677
1672 surface_client_id_ = proto.surface_client_id(); 1678 surface_client_id_ = proto.surface_client_id();
1673 next_surface_sequence_ = proto.next_surface_sequence(); 1679 next_surface_sequence_ = proto.next_surface_sequence();
1674 } 1680 }
1675 1681
1676 AnimationHost* LayerTreeHost::animation_host() const { 1682 AnimationHost* LayerTreeHost::animation_host() const {
1677 return layer_tree_.animation_host(); 1683 return layer_tree_.animation_host();
1678 } 1684 }
1679 1685
1680 } // namespace cc 1686 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698