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

Unified Diff: cc/trees/thread_proxy.cc

Issue 18191020: UI Resource Manager (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: 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.h ('K') | « cc/trees/thread_proxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/thread_proxy.cc
===================================================================
--- cc/trees/thread_proxy.cc (revision 210393)
+++ cc/trees/thread_proxy.cc (working copy)
@@ -1445,4 +1445,69 @@
}
}
+void ThreadProxy::CreateUIResource(UIResourceId uid,
aelias_OOO_until_Jul13 2013/07/08 23:40:49 Let's avoid adding these functions by buffering un
powei 2013/07/10 17:47:21 Requests on the main thread can be buffered until
+ scoped_refptr<UIResourceBitmap> bitmap,
+ bool async) {
+ DCHECK(IsMainThread());
+ Proxy::ImplThreadTaskRunner()->PostTask(
+ FROM_HERE,
+ base::Bind(&ThreadProxy::CreateUIResourceOnImplThread,
+ impl_thread_weak_ptr_,
+ uid,
+ bitmap,
+ async));
+}
+
+void ThreadProxy::CreateUIResourceOnImplThread(UIResourceId uid,
+ scoped_refptr<UIResourceBitmap>
+ bitmap,
+ bool async) {
+ DCHECK(IsImplThread());
+ layer_tree_host_impl_->CreateUIResource(uid, bitmap, async);
+}
+
+void ThreadProxy::DeleteUIResource(UIResourceId uid) {
+ DCHECK(IsMainThread());
+ Proxy::ImplThreadTaskRunner()->PostTask(
+ FROM_HERE,
+ base::Bind(&ThreadProxy::DeleteUIResourceOnImplThread,
+ impl_thread_weak_ptr_,
+ uid));
+}
+
+void ThreadProxy::DeleteUIResourceOnImplThread(UIResourceId uid) {
+ DCHECK(IsImplThread());
+ layer_tree_host_impl_->DeleteUIResource(uid);
+}
+
+void ThreadProxy::UIResourceCreatedOnImplThread(UIResourceId uid) {
+ DCHECK(IsImplThread());
+ Proxy::MainThreadTaskRunner()->PostTask(
+ FROM_HERE,
+ base::Bind(&ThreadProxy::PostUIResourceCreatedToMainThread,
+ main_thread_weak_ptr_,
+ uid));
+ // force a redraw here. Pretty sure this is incorrect
+ // scheduler_on_impl_thread_->SetNeedsForcedRedraw();
+}
+
+void ThreadProxy::UIResourceLostOnImplThread(UIResourceId uid) {
+ DCHECK(IsImplThread());
+ Proxy::MainThreadTaskRunner()->PostTask(
+ FROM_HERE,
+ base::Bind(&ThreadProxy::PostUIResourceLostToMainThread,
+ main_thread_weak_ptr_,
+ uid));
+}
+
+void ThreadProxy::PostUIResourceCreatedToMainThread(UIResourceId uid) {
+ DCHECK(IsMainThread());
+ layer_tree_host_->UIResourceReady(uid);
+}
+
+void ThreadProxy::PostUIResourceLostToMainThread(UIResourceId uid) {
+ DCHECK(IsMainThread());
+ layer_tree_host_->UIResourceLost(uid);
+}
+
} // namespace cc
« cc/trees/layer_tree_host.h ('K') | « cc/trees/thread_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698