| 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 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1140 top_controls_manager_ ? top_controls_manager_->content_top_offset() : 0.f; | 1140 top_controls_manager_ ? top_controls_manager_->content_top_offset() : 0.f; |
| 1141 return gfx::SizeF(dip_size.width(), | 1141 return gfx::SizeF(dip_size.width(), |
| 1142 dip_size.height() - top_offset - overdraw_bottom_height_); | 1142 dip_size.height() - top_offset - overdraw_bottom_height_); |
| 1143 } | 1143 } |
| 1144 | 1144 |
| 1145 const LayerTreeSettings& LayerTreeHostImpl::Settings() const { | 1145 const LayerTreeSettings& LayerTreeHostImpl::Settings() const { |
| 1146 return settings(); | 1146 return settings(); |
| 1147 } | 1147 } |
| 1148 | 1148 |
| 1149 void LayerTreeHostImpl::DidLoseOutputSurface() { | 1149 void LayerTreeHostImpl::DidLoseOutputSurface() { |
| 1150 client_->DidLoseOutputSurfaceOnImplThread(); | 1150 // TODO(jamesr): The renderer_ check is needed to make some of the |
| 1151 // LayerTreeHostContextTest tests pass, but shouldn't be necessary (or |
| 1152 // important) in production. We should adjust the test to not need this. |
| 1153 if (renderer_) |
| 1154 client_->DidLoseOutputSurfaceOnImplThread(); |
| 1151 } | 1155 } |
| 1152 | 1156 |
| 1153 void LayerTreeHostImpl::OnSwapBuffersComplete() { | 1157 void LayerTreeHostImpl::OnSwapBuffersComplete() { |
| 1154 client_->OnSwapBuffersCompleteOnImplThread(); | 1158 client_->OnSwapBuffersCompleteOnImplThread(); |
| 1155 } | 1159 } |
| 1156 | 1160 |
| 1157 void LayerTreeHostImpl::Readback(void* pixels, | 1161 void LayerTreeHostImpl::Readback(void* pixels, |
| 1158 gfx::Rect rect_in_device_viewport) { | 1162 gfx::Rect rect_in_device_viewport) { |
| 1159 DCHECK(renderer_); | 1163 DCHECK(renderer_); |
| 1160 renderer_->GetFramebufferPixels(pixels, rect_in_device_viewport); | 1164 renderer_->GetFramebufferPixels(pixels, rect_in_device_viewport); |
| (...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2086 } | 2090 } |
| 2087 | 2091 |
| 2088 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { | 2092 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { |
| 2089 if (debug_state_.continuous_painting != debug_state.continuous_painting) | 2093 if (debug_state_.continuous_painting != debug_state.continuous_painting) |
| 2090 paint_time_counter_->ClearHistory(); | 2094 paint_time_counter_->ClearHistory(); |
| 2091 | 2095 |
| 2092 debug_state_ = debug_state; | 2096 debug_state_ = debug_state; |
| 2093 } | 2097 } |
| 2094 | 2098 |
| 2095 } // namespace cc | 2099 } // namespace cc |
| OLD | NEW |