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

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

Issue 1707143002: Added methods to generate sync tokens for resource id(s). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added reserve Created 4 years, 10 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/resources/resource_provider.cc ('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_impl.h" 5 #include "cc/trees/layer_tree_host_impl.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 3630 matching lines...) Expand 10 before | Expand all | Expand 10 after
3641 UIResourceData data; 3641 UIResourceData data;
3642 data.resource_id = id; 3642 data.resource_id = id;
3643 data.size = bitmap.GetSize(); 3643 data.size = bitmap.GetSize();
3644 data.opaque = bitmap.GetOpaque(); 3644 data.opaque = bitmap.GetOpaque();
3645 3645
3646 ui_resource_map_[uid] = data; 3646 ui_resource_map_[uid] = data;
3647 3647
3648 AutoLockUIResourceBitmap bitmap_lock(bitmap); 3648 AutoLockUIResourceBitmap bitmap_lock(bitmap);
3649 resource_provider_->CopyToResource(id, bitmap_lock.GetPixels(), 3649 resource_provider_->CopyToResource(id, bitmap_lock.GetPixels(),
3650 bitmap.GetSize()); 3650 bitmap.GetSize());
3651
3652 resource_provider_->GenerateSyncTokenForResource(id);
3651 MarkUIResourceNotEvicted(uid); 3653 MarkUIResourceNotEvicted(uid);
3652 } 3654 }
3653 3655
3654 void LayerTreeHostImpl::DeleteUIResource(UIResourceId uid) { 3656 void LayerTreeHostImpl::DeleteUIResource(UIResourceId uid) {
3655 ResourceId id = ResourceIdForUIResource(uid); 3657 ResourceId id = ResourceIdForUIResource(uid);
3656 if (id) { 3658 if (id) {
3657 resource_provider_->DeleteResource(id); 3659 resource_provider_->DeleteResource(id);
3658 ui_resource_map_.erase(uid); 3660 ui_resource_map_.erase(uid);
3659 } 3661 }
3660 MarkUIResourceNotEvicted(uid); 3662 MarkUIResourceNotEvicted(uid);
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
3971 return task_runner_provider_->HasImplThread(); 3973 return task_runner_provider_->HasImplThread();
3972 } 3974 }
3973 3975
3974 bool LayerTreeHostImpl::CommitToActiveTree() const { 3976 bool LayerTreeHostImpl::CommitToActiveTree() const {
3975 // In single threaded mode we skip the pending tree and commit directly to the 3977 // In single threaded mode we skip the pending tree and commit directly to the
3976 // active tree. 3978 // active tree.
3977 return !task_runner_provider_->HasImplThread(); 3979 return !task_runner_provider_->HasImplThread();
3978 } 3980 }
3979 3981
3980 } // namespace cc 3982 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/resource_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698