OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/proxy_main.h" | 5 #include "cc/trees/proxy_main.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 | 152 |
153 if (!layer_tree_host_->visible()) { | 153 if (!layer_tree_host_->visible()) { |
154 TRACE_EVENT_INSTANT0("cc", "EarlyOut_NotVisible", TRACE_EVENT_SCOPE_THREAD); | 154 TRACE_EVENT_INSTANT0("cc", "EarlyOut_NotVisible", TRACE_EVENT_SCOPE_THREAD); |
155 std::vector<std::unique_ptr<SwapPromise>> empty_swap_promises; | 155 std::vector<std::unique_ptr<SwapPromise>> empty_swap_promises; |
156 channel_main_->BeginMainFrameAbortedOnImpl( | 156 channel_main_->BeginMainFrameAbortedOnImpl( |
157 CommitEarlyOutReason::ABORTED_NOT_VISIBLE, begin_main_frame_start_time, | 157 CommitEarlyOutReason::ABORTED_NOT_VISIBLE, begin_main_frame_start_time, |
158 std::move(empty_swap_promises)); | 158 std::move(empty_swap_promises)); |
159 return; | 159 return; |
160 } | 160 } |
161 | 161 |
162 if (layer_tree_host_->output_surface_lost()) { | |
163 TRACE_EVENT_INSTANT0("cc", "EarlyOut_OutputSurfaceLost", | |
164 TRACE_EVENT_SCOPE_THREAD); | |
165 std::vector<std::unique_ptr<SwapPromise>> empty_swap_promises; | |
166 channel_main_->BeginMainFrameAbortedOnImpl( | |
167 CommitEarlyOutReason::ABORTED_OUTPUT_SURFACE_LOST, | |
168 begin_main_frame_start_time, std::move(empty_swap_promises)); | |
169 return; | |
170 } | |
171 | |
172 current_pipeline_stage_ = ANIMATE_PIPELINE_STAGE; | 162 current_pipeline_stage_ = ANIMATE_PIPELINE_STAGE; |
173 | 163 |
174 layer_tree_host_->ApplyScrollAndScale( | 164 layer_tree_host_->ApplyScrollAndScale( |
175 begin_main_frame_state->scroll_info.get()); | 165 begin_main_frame_state->scroll_info.get()); |
176 | 166 |
177 if (begin_main_frame_state->begin_frame_callbacks) { | 167 if (begin_main_frame_state->begin_frame_callbacks) { |
178 for (auto& callback : *begin_main_frame_state->begin_frame_callbacks) | 168 for (auto& callback : *begin_main_frame_state->begin_frame_callbacks) |
179 callback.Run(); | 169 callback.Run(); |
180 } | 170 } |
181 | 171 |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 CompletionEvent completion; | 389 CompletionEvent completion; |
400 channel_main_->MainFrameWillHappenOnImplForTesting(&completion, | 390 channel_main_->MainFrameWillHappenOnImplForTesting(&completion, |
401 &main_frame_will_happen); | 391 &main_frame_will_happen); |
402 completion.Wait(); | 392 completion.Wait(); |
403 } | 393 } |
404 return main_frame_will_happen; | 394 return main_frame_will_happen; |
405 } | 395 } |
406 | 396 |
407 void ProxyMain::ReleaseOutputSurface() { | 397 void ProxyMain::ReleaseOutputSurface() { |
408 DCHECK(IsMainThread()); | 398 DCHECK(IsMainThread()); |
409 DCHECK(layer_tree_host_->output_surface_lost()); | |
410 | |
411 DebugScopedSetMainThreadBlocked main_thread_blocked(task_runner_provider_); | 399 DebugScopedSetMainThreadBlocked main_thread_blocked(task_runner_provider_); |
412 CompletionEvent completion; | 400 CompletionEvent completion; |
413 channel_main_->ReleaseOutputSurfaceOnImpl(&completion); | 401 channel_main_->ReleaseOutputSurfaceOnImpl(&completion); |
414 completion.Wait(); | 402 completion.Wait(); |
415 } | 403 } |
416 | 404 |
417 void ProxyMain::UpdateTopControlsState(TopControlsState constraints, | 405 void ProxyMain::UpdateTopControlsState(TopControlsState constraints, |
418 TopControlsState current, | 406 TopControlsState current, |
419 bool animate) { | 407 bool animate) { |
420 DCHECK(IsMainThread()); | 408 DCHECK(IsMainThread()); |
(...skipping 11 matching lines...) Expand all Loading... |
432 return false; | 420 return false; |
433 channel_main_->SetNeedsCommitOnImpl(); | 421 channel_main_->SetNeedsCommitOnImpl(); |
434 return true; | 422 return true; |
435 } | 423 } |
436 | 424 |
437 bool ProxyMain::IsMainThread() const { | 425 bool ProxyMain::IsMainThread() const { |
438 return task_runner_provider_->IsMainThread(); | 426 return task_runner_provider_->IsMainThread(); |
439 } | 427 } |
440 | 428 |
441 } // namespace cc | 429 } // namespace cc |
OLD | NEW |