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

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 18191020: UI Resource Manager (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Fixed nits and bugs, removed cruft, added test for Create/DeleteUIResource in LTHI Created 7 years, 5 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
« cc/trees/layer_tree_host_impl.cc ('K') | « cc/trees/layer_tree_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_impl.cc
===================================================================
--- cc/trees/layer_tree_impl.cc (revision 214824)
+++ cc/trees/layer_tree_impl.cc (working copy)
@@ -282,7 +282,7 @@
// For max_texture_size.
if (!layer_tree_host_impl_->renderer())
- return;
+ return;
if (!root_layer())
return;
@@ -529,7 +529,7 @@
}
void LayerTreeImpl::SetRootLayerScrollOffsetDelegate(
- LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) {
+ LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) {
root_layer_scroll_offset_delegate_ = root_layer_scroll_offset_delegate;
if (root_scroll_layer_) {
root_scroll_layer_->SetScrollOffsetDelegate(
@@ -572,6 +572,35 @@
layer_tree_host_impl_->SetNeedsManageTiles();
}
+void LayerTreeImpl::set_ui_resource_request_queue(
+ const UIResourceRequestQueue& queue) {
+ ui_resource_request_queue_ = queue;
+}
+
+ResourceProvider::ResourceId LayerTreeImpl::ResourceIdForUIResource(
+ UIResourceId uid) const {
+ return layer_tree_host_impl_->ResourceIdForUIResource(uid);
+}
+
+void LayerTreeImpl::ProcessUIResourceRequestQueue() {
+ while (ui_resource_request_queue_.size() > 0) {
+ UIResourceRequest req = ui_resource_request_queue_.front();
+ ui_resource_request_queue_.pop_front();
+
+ switch (req.type) {
+ case UIResourceRequest::UIResourceCreate:
+ layer_tree_host_impl_->CreateUIResource(req.id, req.bitmap);
+ break;
+ case UIResourceRequest::UIResourceDelete:
+ layer_tree_host_impl_->DeleteUIResource(req.id);
+ break;
+ default:
+ NOTREACHED();
+ break;
+ }
+ }
+}
+
void LayerTreeImpl::AddLayerWithCopyOutputRequest(LayerImpl* layer) {
// Only the active tree needs to know about layers with copy requests, as
// they are aborted if not serviced during draw.
« cc/trees/layer_tree_host_impl.cc ('K') | « cc/trees/layer_tree_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698