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" |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/trace_event/trace_event.h" | 12 #include "base/trace_event/trace_event.h" |
13 #include "base/trace_event/trace_event_argument.h" | 13 #include "base/trace_event/trace_event_argument.h" |
14 #include "base/trace_event/trace_event_synthetic_delay.h" | 14 #include "base/trace_event/trace_event_synthetic_delay.h" |
15 #include "cc/debug/benchmark_instrumentation.h" | 15 #include "cc/debug/benchmark_instrumentation.h" |
16 #include "cc/debug/devtools_instrumentation.h" | 16 #include "cc/debug/devtools_instrumentation.h" |
17 #include "cc/input/input_handler.h" | 17 #include "cc/input/input_handler.h" |
18 #include "cc/output/context_provider.h" | 18 #include "cc/output/context_provider.h" |
19 #include "cc/output/output_surface.h" | 19 #include "cc/output/output_surface.h" |
20 #include "cc/output/swap_promise.h" | 20 #include "cc/output/promise.h" |
21 #include "cc/quads/draw_quad.h" | 21 #include "cc/quads/draw_quad.h" |
22 #include "cc/resources/prioritized_resource_manager.h" | 22 #include "cc/resources/prioritized_resource_manager.h" |
23 #include "cc/scheduler/commit_earlyout_reason.h" | 23 #include "cc/scheduler/commit_earlyout_reason.h" |
24 #include "cc/scheduler/delay_based_time_source.h" | 24 #include "cc/scheduler/delay_based_time_source.h" |
25 #include "cc/scheduler/scheduler.h" | 25 #include "cc/scheduler/scheduler.h" |
26 #include "cc/trees/blocking_task_runner.h" | 26 #include "cc/trees/blocking_task_runner.h" |
27 #include "cc/trees/layer_tree_host.h" | 27 #include "cc/trees/layer_tree_host.h" |
28 #include "cc/trees/layer_tree_impl.h" | 28 #include "cc/trees/layer_tree_impl.h" |
29 #include "cc/trees/scoped_abort_remaining_swap_promises.h" | 29 #include "cc/trees/scoped_abort_remaining_swap_promises.h" |
30 #include "gpu/command_buffer/client/gles2_interface.h" | 30 #include "gpu/command_buffer/client/gles2_interface.h" |
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
850 Proxy::ImplThreadTaskRunner()->PostTask( | 850 Proxy::ImplThreadTaskRunner()->PostTask( |
851 FROM_HERE, base::Bind(&ThreadProxy::BeginMainFrameAbortedOnImplThread, | 851 FROM_HERE, base::Bind(&ThreadProxy::BeginMainFrameAbortedOnImplThread, |
852 impl_thread_weak_ptr_, | 852 impl_thread_weak_ptr_, |
853 CommitEarlyOutReason::FINISHED_NO_UPDATES)); | 853 CommitEarlyOutReason::FINISHED_NO_UPDATES)); |
854 | 854 |
855 // Although the commit is internally aborted, this is because it has been | 855 // Although the commit is internally aborted, this is because it has been |
856 // detected to be a no-op. From the perspective of an embedder, this commit | 856 // detected to be a no-op. From the perspective of an embedder, this commit |
857 // went through, and input should no longer be throttled, etc. | 857 // went through, and input should no longer be throttled, etc. |
858 layer_tree_host()->CommitComplete(); | 858 layer_tree_host()->CommitComplete(); |
859 layer_tree_host()->DidBeginMainFrame(); | 859 layer_tree_host()->DidBeginMainFrame(); |
860 layer_tree_host()->BreakSwapPromises(SwapPromise::COMMIT_NO_UPDATE); | 860 layer_tree_host()->BreakSwapPromises(Promise::DidNotSwap::COMMIT_NO_UPDATE); |
| 861 layer_tree_host()->BreakActivationPromises(Promise::DidNotActivate::COMMIT_N
O_UPDATE); |
861 return; | 862 return; |
862 } | 863 } |
863 | 864 |
864 // Notify the impl thread that the main thread is ready to commit. This will | 865 // Notify the impl thread that the main thread is ready to commit. This will |
865 // begin the commit process, which is blocking from the main thread's | 866 // begin the commit process, which is blocking from the main thread's |
866 // point of view, but asynchronously performed on the impl thread, | 867 // point of view, but asynchronously performed on the impl thread, |
867 // coordinated by the Scheduler. | 868 // coordinated by the Scheduler. |
868 { | 869 { |
869 TRACE_EVENT0("cc", "ThreadProxy::BeginMainFrame::commit"); | 870 TRACE_EVENT0("cc", "ThreadProxy::BeginMainFrame::commit"); |
870 | 871 |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1407 FROM_HERE, base::Bind(&ThreadProxy::DidCompletePageScaleAnimation, | 1408 FROM_HERE, base::Bind(&ThreadProxy::DidCompletePageScaleAnimation, |
1408 main_thread_weak_ptr_)); | 1409 main_thread_weak_ptr_)); |
1409 } | 1410 } |
1410 | 1411 |
1411 void ThreadProxy::OnDrawForOutputSurface() { | 1412 void ThreadProxy::OnDrawForOutputSurface() { |
1412 DCHECK(IsImplThread()); | 1413 DCHECK(IsImplThread()); |
1413 impl().scheduler->OnDrawForOutputSurface(); | 1414 impl().scheduler->OnDrawForOutputSurface(); |
1414 } | 1415 } |
1415 | 1416 |
1416 } // namespace cc | 1417 } // namespace cc |
OLD | NEW |