| 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 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 helper_.RemoveTaskObserver(task_observer); | 393 helper_.RemoveTaskObserver(task_observer); |
| 394 } | 394 } |
| 395 | 395 |
| 396 void RendererSchedulerImpl::WillBeginFrame(const cc::BeginFrameArgs& args) { | 396 void RendererSchedulerImpl::WillBeginFrame(const cc::BeginFrameArgs& args) { |
| 397 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), | 397 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), |
| 398 "RendererSchedulerImpl::WillBeginFrame", "args", args.AsValue()); | 398 "RendererSchedulerImpl::WillBeginFrame", "args", args.AsValue()); |
| 399 helper_.CheckOnValidThread(); | 399 helper_.CheckOnValidThread(); |
| 400 if (helper_.IsShutdown()) | 400 if (helper_.IsShutdown()) |
| 401 return; | 401 return; |
| 402 | 402 |
| 403 /* TODO: Remove me */ fprintf( |
| 404 stderr, "\nRendererSchedulerImpl::WillBeginFrame: current frame: %d\n [", |
| 405 args.source_frame_number); |
| 406 for (auto activate_frame : args.ready_to_activate_time) |
| 407 fprintf(stderr, "\tactivated frame: %d, activated time: %lu", |
| 408 activate_frame.first, activate_frame.second.ToInternalValue()); |
| 409 fprintf(stderr, "\n ]"); |
| 403 EndIdlePeriod(); | 410 EndIdlePeriod(); |
| 404 MainThreadOnly().estimated_next_frame_begin = args.frame_time + args.interval; | 411 MainThreadOnly().estimated_next_frame_begin = args.frame_time + args.interval; |
| 405 MainThreadOnly().have_seen_a_begin_main_frame = true; | 412 MainThreadOnly().have_seen_a_begin_main_frame = true; |
| 406 MainThreadOnly().begin_frame_not_expected_soon = false; | 413 MainThreadOnly().begin_frame_not_expected_soon = false; |
| 407 MainThreadOnly().compositor_frame_interval = args.interval; | 414 MainThreadOnly().compositor_frame_interval = args.interval; |
| 408 { | 415 { |
| 409 base::AutoLock lock(any_thread_lock_); | 416 base::AutoLock lock(any_thread_lock_); |
| 410 AnyThread().begin_main_frame_on_critical_path = args.on_critical_path; | 417 AnyThread().begin_main_frame_on_critical_path = args.on_critical_path; |
| 411 } | 418 } |
| 412 } | 419 } |
| (...skipping 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1914 case TimeDomainType::VIRTUAL: | 1921 case TimeDomainType::VIRTUAL: |
| 1915 return "virtual"; | 1922 return "virtual"; |
| 1916 default: | 1923 default: |
| 1917 NOTREACHED(); | 1924 NOTREACHED(); |
| 1918 return nullptr; | 1925 return nullptr; |
| 1919 } | 1926 } |
| 1920 } | 1927 } |
| 1921 | 1928 |
| 1922 } // namespace scheduler | 1929 } // namespace scheduler |
| 1923 } // namespace blink | 1930 } // namespace blink |
| OLD | NEW |