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 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1101 client_->OnSwapBuffersCompleteOnImplThread(); | 1101 client_->OnSwapBuffersCompleteOnImplThread(); |
1102 } | 1102 } |
1103 | 1103 |
1104 void LayerTreeHostImpl::Readback(void* pixels, | 1104 void LayerTreeHostImpl::Readback(void* pixels, |
1105 gfx::Rect rect_in_device_viewport) { | 1105 gfx::Rect rect_in_device_viewport) { |
1106 DCHECK(renderer_); | 1106 DCHECK(renderer_); |
1107 renderer_->GetFramebufferPixels(pixels, rect_in_device_viewport); | 1107 renderer_->GetFramebufferPixels(pixels, rect_in_device_viewport); |
1108 } | 1108 } |
1109 | 1109 |
1110 bool LayerTreeHostImpl::haveRootScrollLayer() const { | 1110 bool LayerTreeHostImpl::haveRootScrollLayer() const { |
1111 return RootScrollLayer(); | 1111 return !!RootScrollLayer(); |
1112 } | 1112 } |
1113 | 1113 |
1114 LayerImpl* LayerTreeHostImpl::RootLayer() const { | 1114 LayerImpl* LayerTreeHostImpl::RootLayer() const { |
1115 return active_tree_->root_layer(); | 1115 return active_tree_->root_layer(); |
1116 } | 1116 } |
1117 | 1117 |
1118 LayerImpl* LayerTreeHostImpl::RootScrollLayer() const { | 1118 LayerImpl* LayerTreeHostImpl::RootScrollLayer() const { |
1119 return active_tree_->RootScrollLayer(); | 1119 return active_tree_->RootScrollLayer(); |
1120 } | 1120 } |
1121 | 1121 |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1388 void LayerTreeHostImpl::setActiveTreeNeedsUpdateDrawProperties() { | 1388 void LayerTreeHostImpl::setActiveTreeNeedsUpdateDrawProperties() { |
1389 active_tree_->set_needs_update_draw_properties(); | 1389 active_tree_->set_needs_update_draw_properties(); |
1390 } | 1390 } |
1391 | 1391 |
1392 void LayerTreeHostImpl::setNeedsRedraw() { | 1392 void LayerTreeHostImpl::setNeedsRedraw() { |
1393 client_->SetNeedsRedrawOnImplThread(); | 1393 client_->SetNeedsRedrawOnImplThread(); |
1394 } | 1394 } |
1395 | 1395 |
1396 bool LayerTreeHostImpl::EnsureRenderSurfaceLayerList() { | 1396 bool LayerTreeHostImpl::EnsureRenderSurfaceLayerList() { |
1397 active_tree_->UpdateDrawProperties(LayerTreeImpl::UPDATE_ACTIVE_TREE); | 1397 active_tree_->UpdateDrawProperties(LayerTreeImpl::UPDATE_ACTIVE_TREE); |
1398 return active_tree_->RenderSurfaceLayerList().size(); | 1398 return !active_tree_->RenderSurfaceLayerList().empty(); |
1399 } | 1399 } |
1400 | 1400 |
1401 InputHandlerClient::ScrollStatus LayerTreeHostImpl::ScrollBegin( | 1401 InputHandlerClient::ScrollStatus LayerTreeHostImpl::ScrollBegin( |
1402 gfx::Point viewport_point, InputHandlerClient::ScrollInputType type) { | 1402 gfx::Point viewport_point, InputHandlerClient::ScrollInputType type) { |
1403 TRACE_EVENT0("cc", "LayerTreeHostImpl::ScrollBegin"); | 1403 TRACE_EVENT0("cc", "LayerTreeHostImpl::ScrollBegin"); |
1404 | 1404 |
1405 if (top_controls_manager_) | 1405 if (top_controls_manager_) |
1406 top_controls_manager_->ScrollBegin(); | 1406 top_controls_manager_->ScrollBegin(); |
1407 | 1407 |
1408 DCHECK(!CurrentlyScrollingLayer()); | 1408 DCHECK(!CurrentlyScrollingLayer()); |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2058 } | 2058 } |
2059 | 2059 |
2060 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { | 2060 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { |
2061 if (debug_state_.continuous_painting != debug_state.continuous_painting) | 2061 if (debug_state_.continuous_painting != debug_state.continuous_painting) |
2062 paint_time_counter_->ClearHistory(); | 2062 paint_time_counter_->ClearHistory(); |
2063 | 2063 |
2064 debug_state_ = debug_state; | 2064 debug_state_ = debug_state; |
2065 } | 2065 } |
2066 | 2066 |
2067 } // namespace cc | 2067 } // namespace cc |
OLD | NEW |