| 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/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 3525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3536 BeginFrameArgs LayerTreeHostImpl::CurrentBeginFrameArgs() const { | 3536 BeginFrameArgs LayerTreeHostImpl::CurrentBeginFrameArgs() const { |
| 3537 // TODO(mithro): Replace call with current_begin_frame_tracker_.Current() | 3537 // TODO(mithro): Replace call with current_begin_frame_tracker_.Current() |
| 3538 // once all calls which happens outside impl frames are fixed. | 3538 // once all calls which happens outside impl frames are fixed. |
| 3539 return current_begin_frame_tracker_.DangerousMethodCurrentOrLast(); | 3539 return current_begin_frame_tracker_.DangerousMethodCurrentOrLast(); |
| 3540 } | 3540 } |
| 3541 | 3541 |
| 3542 base::TimeDelta LayerTreeHostImpl::CurrentBeginFrameInterval() const { | 3542 base::TimeDelta LayerTreeHostImpl::CurrentBeginFrameInterval() const { |
| 3543 return current_begin_frame_tracker_.Interval(); | 3543 return current_begin_frame_tracker_.Interval(); |
| 3544 } | 3544 } |
| 3545 | 3545 |
| 3546 scoped_refptr<base::trace_event::ConvertableToTraceFormat> | 3546 scoped_ptr<base::trace_event::ConvertableToTraceFormat> |
| 3547 LayerTreeHostImpl::AsValueWithFrame(FrameData* frame) const { | 3547 LayerTreeHostImpl::AsValueWithFrame(FrameData* frame) const { |
| 3548 scoped_refptr<base::trace_event::TracedValue> state = | 3548 scoped_ptr<base::trace_event::TracedValue> state( |
| 3549 new base::trace_event::TracedValue(); | 3549 new base::trace_event::TracedValue()); |
| 3550 AsValueWithFrameInto(frame, state.get()); | 3550 AsValueWithFrameInto(frame, state.get()); |
| 3551 return state; | 3551 return std::move(state); |
| 3552 } | 3552 } |
| 3553 | 3553 |
| 3554 void LayerTreeHostImpl::AsValueWithFrameInto( | 3554 void LayerTreeHostImpl::AsValueWithFrameInto( |
| 3555 FrameData* frame, | 3555 FrameData* frame, |
| 3556 base::trace_event::TracedValue* state) const { | 3556 base::trace_event::TracedValue* state) const { |
| 3557 if (this->pending_tree_) { | 3557 if (this->pending_tree_) { |
| 3558 state->BeginDictionary("activation_state"); | 3558 state->BeginDictionary("activation_state"); |
| 3559 ActivationStateAsValueInto(state); | 3559 ActivationStateAsValueInto(state); |
| 3560 state->EndDictionary(); | 3560 state->EndDictionary(); |
| 3561 } | 3561 } |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3980 return task_runner_provider_->HasImplThread(); | 3980 return task_runner_provider_->HasImplThread(); |
| 3981 } | 3981 } |
| 3982 | 3982 |
| 3983 bool LayerTreeHostImpl::CommitToActiveTree() const { | 3983 bool LayerTreeHostImpl::CommitToActiveTree() const { |
| 3984 // In single threaded mode we skip the pending tree and commit directly to the | 3984 // In single threaded mode we skip the pending tree and commit directly to the |
| 3985 // active tree. | 3985 // active tree. |
| 3986 return !task_runner_provider_->HasImplThread(); | 3986 return !task_runner_provider_->HasImplThread(); |
| 3987 } | 3987 } |
| 3988 | 3988 |
| 3989 } // namespace cc | 3989 } // namespace cc |
| OLD | NEW |