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

Side by Side 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, 11 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 unified diff | Download patch | Annotate | Revision Log
« cc/single_thread_proxy.cc ('K') | « cc/thread_proxy.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/thread_proxy.h" 5 #include "cc/thread_proxy.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "cc/delay_based_time_source.h" 9 #include "cc/delay_based_time_source.h"
10 #include "cc/draw_quad.h" 10 #include "cc/draw_quad.h"
11 #include "cc/frame_rate_controller.h" 11 #include "cc/frame_rate_controller.h"
12 #include "cc/input_handler.h" 12 #include "cc/input_handler.h"
13 #include "cc/layer_tree_host.h" 13 #include "cc/layer_tree_host.h"
14 #include "cc/layer_tree_impl.h"
14 #include "cc/output_surface.h" 15 #include "cc/output_surface.h"
16 #include "cc/picture_layer.h"
17 #include "cc/picture_layer_impl.h"
18 #include "cc/picture_pile_impl.h"
15 #include "cc/scheduler.h" 19 #include "cc/scheduler.h"
16 #include "cc/scoped_thread_proxy.h" 20 #include "cc/scoped_thread_proxy.h"
17 #include "cc/thread.h" 21 #include "cc/thread.h"
18 #include "third_party/WebKit/Source/Platform/chromium/public/WebSharedGraphicsCo ntext3D.h" 22 #include "third_party/WebKit/Source/Platform/chromium/public/WebSharedGraphicsCo ntext3D.h"
19 23
20 using WebKit::WebSharedGraphicsContext3D; 24 using WebKit::WebSharedGraphicsContext3D;
21 25
22 namespace { 26 namespace {
23 27
24 // Measured in seconds. 28 // Measured in seconds.
(...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after
1005 return commitPendingRequest.commitPending; 1009 return commitPendingRequest.commitPending;
1006 } 1010 }
1007 1011
1008 void ThreadProxy::commitPendingOnImplThreadForTesting(CommitPendingRequest* requ est) 1012 void ThreadProxy::commitPendingOnImplThreadForTesting(CommitPendingRequest* requ est)
1009 { 1013 {
1010 DCHECK(isImplThread()); 1014 DCHECK(isImplThread());
1011 request->commitPending = m_schedulerOnImplThread->commitPending(); 1015 request->commitPending = m_schedulerOnImplThread->commitPending();
1012 request->completion.signal(); 1016 request->completion.signal();
1013 } 1017 }
1014 1018
1019 scoped_refptr<PicturePileImpl> ThreadProxy::capturePicturePile(const PictureLaye r* layer)
1020 {
1021 DCHECK(isMainThread());
1022 CompletionEvent completion;
1023 scoped_refptr<PicturePileImpl> picture_pile;
1024 {
1025 DebugScopedSetMainThreadBlocked mainThreadBlocked(this);
1026 Proxy::implThread()->postTask(base::Bind(&ThreadProxy::capturePicturePil eOnImplThread,
1027 m_implThreadWeakPtr,
1028 layer->id(),
1029 &completion,
1030 &picture_pile));
1031 completion.wait();
1032 }
1033 return picture_pile;
1034 }
1035
1036 void ThreadProxy::capturePicturePileOnImplThread(int id, CompletionEvent* comple tion, 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.
1037 {
1038 DCHECK(isImplThread());
1039 LayerTreeImpl* tree = m_layerTreeHostImpl->pendingTree() ? m_layerTreeHostIm pl->pendingTree() : m_layerTreeHostImpl->activeTree();
1040 LayerImpl* layer_impl = tree->LayerById(id);
1041 if (layer_impl) {
1042 const PictureLayerImpl* picture_layer_impl = static_cast<PictureLayerImp l*>(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.
1043 *picture_pile = picture_layer_impl->pile()->CloneForDrawing();
1044 }
1045 completion->signal();
1046 }
1047
1015 } // namespace cc 1048 } // namespace cc
OLDNEW
« 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