| 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 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 impl_thread_weak_ptr_, | 616 impl_thread_weak_ptr_, |
| 617 &completion)); | 617 &completion)); |
| 618 completion.Wait(); | 618 completion.Wait(); |
| 619 } | 619 } |
| 620 | 620 |
| 621 main().weak_factory.InvalidateWeakPtrs(); | 621 main().weak_factory.InvalidateWeakPtrs(); |
| 622 blocked_main().layer_tree_host = NULL; | 622 blocked_main().layer_tree_host = NULL; |
| 623 main().started = false; | 623 main().started = false; |
| 624 } | 624 } |
| 625 | 625 |
| 626 void ThreadProxy::ForceSerializeOnSwapBuffers() { | |
| 627 DebugScopedSetMainThreadBlocked main_thread_blocked(this); | |
| 628 CompletionEvent completion; | |
| 629 Proxy::ImplThreadTaskRunner()->PostTask( | |
| 630 FROM_HERE, | |
| 631 base::Bind(&ThreadProxy::ForceSerializeOnSwapBuffersOnImplThread, | |
| 632 impl_thread_weak_ptr_, | |
| 633 &completion)); | |
| 634 completion.Wait(); | |
| 635 } | |
| 636 | |
| 637 void ThreadProxy::ForceSerializeOnSwapBuffersOnImplThread( | |
| 638 CompletionEvent* completion) { | |
| 639 if (impl().layer_tree_host_impl->renderer()) | |
| 640 impl().layer_tree_host_impl->renderer()->DoNoOp(); | |
| 641 completion->Signal(); | |
| 642 } | |
| 643 | |
| 644 bool ThreadProxy::SupportsImplScrolling() const { | 626 bool ThreadProxy::SupportsImplScrolling() const { |
| 645 return true; | 627 return true; |
| 646 } | 628 } |
| 647 | 629 |
| 648 void ThreadProxy::FinishAllRenderingOnImplThread(CompletionEvent* completion) { | 630 void ThreadProxy::FinishAllRenderingOnImplThread(CompletionEvent* completion) { |
| 649 TRACE_EVENT0("cc", "ThreadProxy::FinishAllRenderingOnImplThread"); | 631 TRACE_EVENT0("cc", "ThreadProxy::FinishAllRenderingOnImplThread"); |
| 650 DCHECK(IsImplThread()); | 632 DCHECK(IsImplThread()); |
| 651 impl().layer_tree_host_impl->FinishAllRendering(); | 633 impl().layer_tree_host_impl->FinishAllRendering(); |
| 652 completion->Signal(); | 634 completion->Signal(); |
| 653 } | 635 } |
| (...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1266 | 1248 |
| 1267 void ThreadProxy::PostFrameTimingEvents( | 1249 void ThreadProxy::PostFrameTimingEvents( |
| 1268 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, | 1250 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, |
| 1269 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) { | 1251 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) { |
| 1270 DCHECK(IsMainThread()); | 1252 DCHECK(IsMainThread()); |
| 1271 layer_tree_host()->RecordFrameTimingEvents(composite_events.Pass(), | 1253 layer_tree_host()->RecordFrameTimingEvents(composite_events.Pass(), |
| 1272 main_frame_events.Pass()); | 1254 main_frame_events.Pass()); |
| 1273 } | 1255 } |
| 1274 | 1256 |
| 1275 } // namespace cc | 1257 } // namespace cc |
| OLD | NEW |