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

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: Added DCHECK of resource queue size to PushPropertiesTo 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
« no previous file with comments | « 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)
@@ -104,6 +104,9 @@
}
void LayerTreeImpl::PushPropertiesTo(LayerTreeImpl* target_tree) {
+ // The request queue should have been processed and does not require a push.
+ DCHECK_EQ(ui_resource_request_queue_.size(), 0u);
+
target_tree->SetLatencyInfo(latency_info_);
latency_info_.Clear();
target_tree->SetPageScaleFactorAndLimits(
@@ -282,7 +285,7 @@
// For max_texture_size.
if (!layer_tree_host_impl_->renderer())
- return;
+ return;
if (!root_layer())
return;
@@ -529,7 +532,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 +575,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.
« no previous file with comments | « cc/trees/layer_tree_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698