| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 render_surface->layer_list(), | 542 render_surface->layer_list(), |
| 543 render_surface_layer->id(), | 543 render_surface_layer->id(), |
| 544 render_surface->SurfacePropertyChangedOnlyFromDescendant(), | 544 render_surface->SurfacePropertyChangedOnlyFromDescendant(), |
| 545 render_surface->content_rect(), | 545 render_surface->content_rect(), |
| 546 render_surface_layer->mask_layer(), | 546 render_surface_layer->mask_layer(), |
| 547 render_surface_layer->filters()); | 547 render_surface_layer->filters()); |
| 548 } | 548 } |
| 549 } | 549 } |
| 550 | 550 |
| 551 void LayerTreeHostImpl::FrameData::AsValueInto( | 551 void LayerTreeHostImpl::FrameData::AsValueInto( |
| 552 base::debug::TracedValue* value) const { | 552 base::trace_event::TracedValue* value) const { |
| 553 value->SetBoolean("has_no_damage", has_no_damage); | 553 value->SetBoolean("has_no_damage", has_no_damage); |
| 554 | 554 |
| 555 // Quad data can be quite large, so only dump render passes if we select | 555 // Quad data can be quite large, so only dump render passes if we select |
| 556 // cc.debug.quads. | 556 // cc.debug.quads. |
| 557 bool quads_enabled; | 557 bool quads_enabled; |
| 558 TRACE_EVENT_CATEGORY_GROUP_ENABLED( | 558 TRACE_EVENT_CATEGORY_GROUP_ENABLED( |
| 559 TRACE_DISABLED_BY_DEFAULT("cc.debug.quads"), &quads_enabled); | 559 TRACE_DISABLED_BY_DEFAULT("cc.debug.quads"), &quads_enabled); |
| 560 if (quads_enabled) { | 560 if (quads_enabled) { |
| 561 value->BeginArray("render_passes"); | 561 value->BeginArray("render_passes"); |
| 562 for (size_t i = 0; i < render_passes.size(); ++i) { | 562 for (size_t i = 0; i < render_passes.size(); ++i) { |
| (...skipping 2702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3265 // Try to use the current frame time to keep animations non-jittery. But if | 3265 // Try to use the current frame time to keep animations non-jittery. But if |
| 3266 // we're not in a frame (because this is during an input event or a delayed | 3266 // we're not in a frame (because this is during an input event or a delayed |
| 3267 // task), fall back to physical time. This should still be monotonic. | 3267 // task), fall back to physical time. This should still be monotonic. |
| 3268 if (current_begin_frame_args_.IsValid()) | 3268 if (current_begin_frame_args_.IsValid()) |
| 3269 return current_begin_frame_args_; | 3269 return current_begin_frame_args_; |
| 3270 return BeginFrameArgs::Create( | 3270 return BeginFrameArgs::Create( |
| 3271 BEGINFRAME_FROM_HERE, gfx::FrameTime::Now(), base::TimeTicks(), | 3271 BEGINFRAME_FROM_HERE, gfx::FrameTime::Now(), base::TimeTicks(), |
| 3272 BeginFrameArgs::DefaultInterval(), BeginFrameArgs::NORMAL); | 3272 BeginFrameArgs::DefaultInterval(), BeginFrameArgs::NORMAL); |
| 3273 } | 3273 } |
| 3274 | 3274 |
| 3275 scoped_refptr<base::debug::ConvertableToTraceFormat> | 3275 scoped_refptr<base::trace_event::ConvertableToTraceFormat> |
| 3276 LayerTreeHostImpl::AsValue() const { | 3276 LayerTreeHostImpl::AsValue() const { |
| 3277 return AsValueWithFrame(NULL); | 3277 return AsValueWithFrame(NULL); |
| 3278 } | 3278 } |
| 3279 | 3279 |
| 3280 scoped_refptr<base::debug::ConvertableToTraceFormat> | 3280 scoped_refptr<base::trace_event::ConvertableToTraceFormat> |
| 3281 LayerTreeHostImpl::AsValueWithFrame(FrameData* frame) const { | 3281 LayerTreeHostImpl::AsValueWithFrame(FrameData* frame) const { |
| 3282 scoped_refptr<base::debug::TracedValue> state = | 3282 scoped_refptr<base::trace_event::TracedValue> state = |
| 3283 new base::debug::TracedValue(); | 3283 new base::trace_event::TracedValue(); |
| 3284 AsValueWithFrameInto(frame, state.get()); | 3284 AsValueWithFrameInto(frame, state.get()); |
| 3285 return state; | 3285 return state; |
| 3286 } | 3286 } |
| 3287 | 3287 |
| 3288 void LayerTreeHostImpl::AsValueInto(base::debug::TracedValue* value) const { | 3288 void LayerTreeHostImpl::AsValueInto( |
| 3289 base::trace_event::TracedValue* value) const { |
| 3289 return AsValueWithFrameInto(NULL, value); | 3290 return AsValueWithFrameInto(NULL, value); |
| 3290 } | 3291 } |
| 3291 | 3292 |
| 3292 void LayerTreeHostImpl::AsValueWithFrameInto( | 3293 void LayerTreeHostImpl::AsValueWithFrameInto( |
| 3293 FrameData* frame, | 3294 FrameData* frame, |
| 3294 base::debug::TracedValue* state) const { | 3295 base::trace_event::TracedValue* state) const { |
| 3295 if (this->pending_tree_) { | 3296 if (this->pending_tree_) { |
| 3296 state->BeginDictionary("activation_state"); | 3297 state->BeginDictionary("activation_state"); |
| 3297 ActivationStateAsValueInto(state); | 3298 ActivationStateAsValueInto(state); |
| 3298 state->EndDictionary(); | 3299 state->EndDictionary(); |
| 3299 } | 3300 } |
| 3300 MathUtil::AddToTracedValue("device_viewport_size", device_viewport_size_, | 3301 MathUtil::AddToTracedValue("device_viewport_size", device_viewport_size_, |
| 3301 state); | 3302 state); |
| 3302 | 3303 |
| 3303 std::set<const Tile*> tiles; | 3304 std::set<const Tile*> tiles; |
| 3304 active_tree_->GetAllTilesForTracing(&tiles); | 3305 active_tree_->GetAllTilesForTracing(&tiles); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 3330 pending_tree_->AsValueInto(state); | 3331 pending_tree_->AsValueInto(state); |
| 3331 state->EndDictionary(); | 3332 state->EndDictionary(); |
| 3332 } | 3333 } |
| 3333 if (frame) { | 3334 if (frame) { |
| 3334 state->BeginDictionary("frame"); | 3335 state->BeginDictionary("frame"); |
| 3335 frame->AsValueInto(state); | 3336 frame->AsValueInto(state); |
| 3336 state->EndDictionary(); | 3337 state->EndDictionary(); |
| 3337 } | 3338 } |
| 3338 } | 3339 } |
| 3339 | 3340 |
| 3340 scoped_refptr<base::debug::ConvertableToTraceFormat> | 3341 scoped_refptr<base::trace_event::ConvertableToTraceFormat> |
| 3341 LayerTreeHostImpl::ActivationStateAsValue() const { | 3342 LayerTreeHostImpl::ActivationStateAsValue() const { |
| 3342 scoped_refptr<base::debug::TracedValue> state = | 3343 scoped_refptr<base::trace_event::TracedValue> state = |
| 3343 new base::debug::TracedValue(); | 3344 new base::trace_event::TracedValue(); |
| 3344 ActivationStateAsValueInto(state.get()); | 3345 ActivationStateAsValueInto(state.get()); |
| 3345 return state; | 3346 return state; |
| 3346 } | 3347 } |
| 3347 | 3348 |
| 3348 void LayerTreeHostImpl::ActivationStateAsValueInto( | 3349 void LayerTreeHostImpl::ActivationStateAsValueInto( |
| 3349 base::debug::TracedValue* state) const { | 3350 base::trace_event::TracedValue* state) const { |
| 3350 TracedValue::SetIDRef(this, state, "lthi"); | 3351 TracedValue::SetIDRef(this, state, "lthi"); |
| 3351 if (tile_manager_) { | 3352 if (tile_manager_) { |
| 3352 state->BeginDictionary("tile_manager"); | 3353 state->BeginDictionary("tile_manager"); |
| 3353 tile_manager_->BasicStateAsValueInto(state); | 3354 tile_manager_->BasicStateAsValueInto(state); |
| 3354 state->EndDictionary(); | 3355 state->EndDictionary(); |
| 3355 } | 3356 } |
| 3356 } | 3357 } |
| 3357 | 3358 |
| 3358 void LayerTreeHostImpl::SetDebugState( | 3359 void LayerTreeHostImpl::SetDebugState( |
| 3359 const LayerTreeDebugState& new_debug_state) { | 3360 const LayerTreeDebugState& new_debug_state) { |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3506 } | 3507 } |
| 3507 | 3508 |
| 3508 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3509 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
| 3509 std::vector<PictureLayerImpl*>::iterator it = | 3510 std::vector<PictureLayerImpl*>::iterator it = |
| 3510 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3511 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
| 3511 DCHECK(it != picture_layers_.end()); | 3512 DCHECK(it != picture_layers_.end()); |
| 3512 picture_layers_.erase(it); | 3513 picture_layers_.erase(it); |
| 3513 } | 3514 } |
| 3514 | 3515 |
| 3515 } // namespace cc | 3516 } // namespace cc |
| OLD | NEW |