Chromium Code Reviews| 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 "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "cc/base/thread.h" | 10 #include "cc/base/thread.h" |
| (...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 601 | 601 |
| 602 begin_frame_completion_event_on_impl_thread_ = completion; | 602 begin_frame_completion_event_on_impl_thread_ = completion; |
| 603 } | 603 } |
| 604 | 604 |
| 605 void ThreadProxy::ScheduledActionBeginFrame() { | 605 void ThreadProxy::ScheduledActionBeginFrame() { |
| 606 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionBeginFrame"); | 606 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionBeginFrame"); |
| 607 scoped_ptr<BeginFrameAndCommitState> begin_frame_state( | 607 scoped_ptr<BeginFrameAndCommitState> begin_frame_state( |
| 608 new BeginFrameAndCommitState); | 608 new BeginFrameAndCommitState); |
| 609 begin_frame_state->monotonic_frame_begin_time = base::TimeTicks::Now(); | 609 begin_frame_state->monotonic_frame_begin_time = base::TimeTicks::Now(); |
| 610 begin_frame_state->scroll_info = layer_tree_host_impl_->ProcessScrollDeltas(); | 610 begin_frame_state->scroll_info = layer_tree_host_impl_->ProcessScrollDeltas(); |
| 611 DCHECK_GT(layer_tree_host_impl_->memory_allocation_limit_bytes(), 0u); | |
|
ccameron
2013/04/30 18:52:00
This assert seems important to me. We shouldn't be
| |
| 612 begin_frame_state->memory_allocation_limit_bytes = | 611 begin_frame_state->memory_allocation_limit_bytes = |
| 613 layer_tree_host_impl_->memory_allocation_limit_bytes(); | 612 layer_tree_host_impl_->memory_allocation_limit_bytes(); |
| 614 Proxy::MainThread()->PostTask(base::Bind(&ThreadProxy::BeginFrame, | 613 Proxy::MainThread()->PostTask(base::Bind(&ThreadProxy::BeginFrame, |
| 615 main_thread_weak_ptr_, | 614 main_thread_weak_ptr_, |
| 616 base::Passed(&begin_frame_state))); | 615 base::Passed(&begin_frame_state))); |
| 617 | 616 |
| 618 if (begin_frame_completion_event_on_impl_thread_) { | 617 if (begin_frame_completion_event_on_impl_thread_) { |
| 619 begin_frame_completion_event_on_impl_thread_->Signal(); | 618 begin_frame_completion_event_on_impl_thread_->Signal(); |
| 620 begin_frame_completion_event_on_impl_thread_ = NULL; | 619 begin_frame_completion_event_on_impl_thread_ = NULL; |
| 621 } | 620 } |
| (...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1352 | 1351 |
| 1353 void ThreadProxy::DidReceiveLastInputEventForVSync( | 1352 void ThreadProxy::DidReceiveLastInputEventForVSync( |
| 1354 base::TimeTicks frame_time) { | 1353 base::TimeTicks frame_time) { |
| 1355 if (render_vsync_notification_enabled_) { | 1354 if (render_vsync_notification_enabled_) { |
| 1356 TRACE_EVENT0("cc", "ThreadProxy::DidReceiveLastInputEventForVSync"); | 1355 TRACE_EVENT0("cc", "ThreadProxy::DidReceiveLastInputEventForVSync"); |
| 1357 DidVSync(frame_time); | 1356 DidVSync(frame_time); |
| 1358 } | 1357 } |
| 1359 } | 1358 } |
| 1360 | 1359 |
| 1361 } // namespace cc | 1360 } // namespace cc |
| OLD | NEW |