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

Unified Diff: cc/thread_proxy.cc

Issue 11731002: Implement a method to access the non-composited content root layer picture pile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: resubmitting, empty files in the review. Created 7 years, 12 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/single_thread_proxy.cc ('K') | « cc/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/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
« cc/single_thread_proxy.cc ('K') | « cc/thread_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698