OLD | NEW |
---|---|
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/trees/thread_proxy.h" | 5 #include "cc/trees/thread_proxy.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
601 impl_thread_weak_ptr_, | 601 impl_thread_weak_ptr_, |
602 &completion)); | 602 &completion)); |
603 completion.Wait(); | 603 completion.Wait(); |
604 } | 604 } |
605 | 605 |
606 main().weak_factory.InvalidateWeakPtrs(); | 606 main().weak_factory.InvalidateWeakPtrs(); |
607 blocked_main().layer_tree_host = NULL; | 607 blocked_main().layer_tree_host = NULL; |
608 main().started = false; | 608 main().started = false; |
609 } | 609 } |
610 | 610 |
611 void ThreadProxy::ForceSerializeOnSwapBuffers() { | |
612 DebugScopedSetMainThreadBlocked main_thread_blocked(this); | |
613 CompletionEvent completion; | |
614 Proxy::ImplThreadTaskRunner()->PostTask( | |
615 FROM_HERE, | |
616 base::Bind(&ThreadProxy::ForceSerializeOnSwapBuffersOnImplThread, | |
617 impl_thread_weak_ptr_, | |
618 &completion)); | |
619 completion.Wait(); | |
620 } | |
621 | |
622 void ThreadProxy::ForceSerializeOnSwapBuffersOnImplThread( | |
623 CompletionEvent* completion) { | |
624 if (impl().layer_tree_host_impl->renderer()) | |
625 impl().layer_tree_host_impl->renderer()->DoNoOp(); | |
danakj
2015/09/21 19:48:33
https://code.google.com/p/chromium/codesearch#chro
| |
626 completion->Signal(); | |
627 } | |
628 | |
629 bool ThreadProxy::SupportsImplScrolling() const { | 611 bool ThreadProxy::SupportsImplScrolling() const { |
630 return true; | 612 return true; |
631 } | 613 } |
632 | 614 |
633 void ThreadProxy::FinishAllRenderingOnImplThread(CompletionEvent* completion) { | 615 void ThreadProxy::FinishAllRenderingOnImplThread(CompletionEvent* completion) { |
634 TRACE_EVENT0("cc", "ThreadProxy::FinishAllRenderingOnImplThread"); | 616 TRACE_EVENT0("cc", "ThreadProxy::FinishAllRenderingOnImplThread"); |
635 DCHECK(IsImplThread()); | 617 DCHECK(IsImplThread()); |
636 impl().layer_tree_host_impl->FinishAllRendering(); | 618 impl().layer_tree_host_impl->FinishAllRendering(); |
637 completion->Signal(); | 619 completion->Signal(); |
638 } | 620 } |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1239 | 1221 |
1240 void ThreadProxy::PostFrameTimingEvents( | 1222 void ThreadProxy::PostFrameTimingEvents( |
1241 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, | 1223 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, |
1242 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) { | 1224 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) { |
1243 DCHECK(IsMainThread()); | 1225 DCHECK(IsMainThread()); |
1244 layer_tree_host()->RecordFrameTimingEvents(composite_events.Pass(), | 1226 layer_tree_host()->RecordFrameTimingEvents(composite_events.Pass(), |
1245 main_frame_events.Pass()); | 1227 main_frame_events.Pass()); |
1246 } | 1228 } |
1247 | 1229 |
1248 } // namespace cc | 1230 } // namespace cc |
OLD | NEW |