Index: cc/thread_proxy.cc |
diff --git a/cc/thread_proxy.cc b/cc/thread_proxy.cc |
index b7e0e7c405e9c5518d600b6b875f37ab72fbabca..7bd9423b080431f5c27d519cf586e769753383bb 100644 |
--- a/cc/thread_proxy.cc |
+++ b/cc/thread_proxy.cc |
@@ -11,7 +11,11 @@ |
#include "cc/frame_rate_controller.h" |
#include "cc/input_handler.h" |
#include "cc/layer_tree_host.h" |
+#include "cc/layer_tree_impl.h" |
#include "cc/output_surface.h" |
+#include "cc/picture_layer.h" |
+#include "cc/picture_layer_impl.h" |
+#include "cc/picture_pile_impl.h" |
#include "cc/scheduler.h" |
#include "cc/scoped_thread_proxy.h" |
#include "cc/thread.h" |
@@ -1012,4 +1016,33 @@ void ThreadProxy::commitPendingOnImplThreadForTesting(CommitPendingRequest* requ |
request->completion.signal(); |
} |
+scoped_refptr<PicturePileImpl> ThreadProxy::capturePicturePile(const PictureLayer* layer) |
+{ |
+ DCHECK(isMainThread()); |
+ CompletionEvent completion; |
+ scoped_refptr<PicturePileImpl> picture_pile; |
+ { |
+ DebugScopedSetMainThreadBlocked mainThreadBlocked(this); |
+ Proxy::implThread()->postTask(base::Bind(&ThreadProxy::capturePicturePileOnImplThread, |
+ m_implThreadWeakPtr, |
+ layer->id(), |
+ &completion, |
+ &picture_pile)); |
+ completion.wait(); |
+ } |
+ return picture_pile; |
+} |
+ |
+void ThreadProxy::capturePicturePileOnImplThread(int id, CompletionEvent* completion, scoped_refptr<PicturePileImpl>* picture_pile) |
enne (OOO)
2013/01/02 19:35:22
Please push this function's logic into some new La
Leandro Graciá Gil
2013/01/03 20:32:10
Done.
|
+{ |
+ DCHECK(isImplThread()); |
+ LayerTreeImpl* tree = m_layerTreeHostImpl->pendingTree() ? m_layerTreeHostImpl->pendingTree() : m_layerTreeHostImpl->activeTree(); |
+ LayerImpl* layer_impl = tree->LayerById(id); |
+ if (layer_impl) { |
+ const PictureLayerImpl* picture_layer_impl = static_cast<PictureLayerImpl*>(layer_impl); |
enne (OOO)
2013/01/02 19:35:22
No static casting please. Add some virtual LayerI
Leandro Graciá Gil
2013/01/03 20:32:10
Done.
|
+ *picture_pile = picture_layer_impl->pile()->CloneForDrawing(); |
+ } |
+ completion->signal(); |
+} |
+ |
} // namespace cc |