| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "platform/scheduler/renderer/renderer_scheduler_impl.h" | 5 #include "platform/scheduler/renderer/renderer_scheduler_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/debug/stack_trace.h" | 8 #include "base/debug/stack_trace.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 helper_.RemoveTaskObserver(task_observer); | 398 helper_.RemoveTaskObserver(task_observer); |
| 399 } | 399 } |
| 400 | 400 |
| 401 void RendererSchedulerImpl::WillBeginFrame(const cc::BeginFrameArgs& args) { | 401 void RendererSchedulerImpl::WillBeginFrame(const cc::BeginFrameArgs& args) { |
| 402 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), | 402 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), |
| 403 "RendererSchedulerImpl::WillBeginFrame", "args", args.AsValue()); | 403 "RendererSchedulerImpl::WillBeginFrame", "args", args.AsValue()); |
| 404 helper_.CheckOnValidThread(); | 404 helper_.CheckOnValidThread(); |
| 405 if (helper_.IsShutdown()) | 405 if (helper_.IsShutdown()) |
| 406 return; | 406 return; |
| 407 | 407 |
| 408 fprintf(stderr, |
| 409 "\nRendererSchedulerImpl::WillBeginFrame: current frame: %d\n [", |
| 410 args.frame_source_number); |
| 411 for (auto activate_frame : args.ready_to_activate_time) |
| 412 fprintf(stderr, "\tactivated frame: %d, activated time: %lu", |
| 413 activate_frame.first, activate_frame.second.ToInternalValue()); |
| 414 fprintf(stderr, "\n ]"); |
| 408 EndIdlePeriod(); | 415 EndIdlePeriod(); |
| 409 MainThreadOnly().estimated_next_frame_begin = args.frame_time + args.interval; | 416 MainThreadOnly().estimated_next_frame_begin = args.frame_time + args.interval; |
| 410 MainThreadOnly().have_seen_a_begin_main_frame = true; | 417 MainThreadOnly().have_seen_a_begin_main_frame = true; |
| 411 MainThreadOnly().begin_frame_not_expected_soon = false; | 418 MainThreadOnly().begin_frame_not_expected_soon = false; |
| 412 MainThreadOnly().compositor_frame_interval = args.interval; | 419 MainThreadOnly().compositor_frame_interval = args.interval; |
| 413 { | 420 { |
| 414 base::AutoLock lock(any_thread_lock_); | 421 base::AutoLock lock(any_thread_lock_); |
| 415 AnyThread().begin_main_frame_on_critical_path = args.on_critical_path; | 422 AnyThread().begin_main_frame_on_critical_path = args.on_critical_path; |
| 416 } | 423 } |
| 417 } | 424 } |
| (...skipping 1495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1913 case TimeDomainType::VIRTUAL: | 1920 case TimeDomainType::VIRTUAL: |
| 1914 return "virtual"; | 1921 return "virtual"; |
| 1915 default: | 1922 default: |
| 1916 NOTREACHED(); | 1923 NOTREACHED(); |
| 1917 return nullptr; | 1924 return nullptr; |
| 1918 } | 1925 } |
| 1919 } | 1926 } |
| 1920 | 1927 |
| 1921 } // namespace scheduler | 1928 } // namespace scheduler |
| 1922 } // namespace blink | 1929 } // namespace blink |
| OLD | NEW |