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 |