| 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/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1198 | 1198 |
| 1199 void LayerTreeHostImpl::EnableVSyncNotification(bool enable) { | 1199 void LayerTreeHostImpl::EnableVSyncNotification(bool enable) { |
| 1200 if (output_surface_) | 1200 if (output_surface_) |
| 1201 output_surface_->EnableVSyncNotification(enable); | 1201 output_surface_->EnableVSyncNotification(enable); |
| 1202 } | 1202 } |
| 1203 | 1203 |
| 1204 gfx::Size LayerTreeHostImpl::DeviceViewportSize() const { | 1204 gfx::Size LayerTreeHostImpl::DeviceViewportSize() const { |
| 1205 return device_viewport_size(); | 1205 return device_viewport_size(); |
| 1206 } | 1206 } |
| 1207 | 1207 |
| 1208 float LayerTreeHostImpl::DeviceScaleFactor() const { |
| 1209 return device_scale_factor_; |
| 1210 } |
| 1211 |
| 1208 gfx::SizeF LayerTreeHostImpl::VisibleViewportSize() const { | 1212 gfx::SizeF LayerTreeHostImpl::VisibleViewportSize() const { |
| 1209 gfx::SizeF dip_size = | 1213 gfx::SizeF dip_size = |
| 1210 gfx::ScaleSize(DeviceViewportSize(), 1.f / device_scale_factor()); | 1214 gfx::ScaleSize(DeviceViewportSize(), 1.f / device_scale_factor()); |
| 1211 | 1215 |
| 1212 // The clip layer should be used if non-overlay scrollbars may exist since | 1216 // The clip layer should be used if non-overlay scrollbars may exist since |
| 1213 // it adjusts for them. | 1217 // it adjusts for them. |
| 1214 LayerImpl* clip_layer = active_tree_->RootClipLayer(); | 1218 LayerImpl* clip_layer = active_tree_->RootClipLayer(); |
| 1215 if (!Settings().solid_color_scrollbars && clip_layer && | 1219 if (!Settings().solid_color_scrollbars && clip_layer && |
| 1216 clip_layer->masks_to_bounds()) | 1220 clip_layer->masks_to_bounds()) |
| 1217 dip_size = clip_layer->bounds(); | 1221 dip_size = clip_layer->bounds(); |
| (...skipping 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2235 } | 2239 } |
| 2236 | 2240 |
| 2237 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { | 2241 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { |
| 2238 if (debug_state_.continuous_painting != debug_state.continuous_painting) | 2242 if (debug_state_.continuous_painting != debug_state.continuous_painting) |
| 2239 paint_time_counter_->ClearHistory(); | 2243 paint_time_counter_->ClearHistory(); |
| 2240 | 2244 |
| 2241 debug_state_ = debug_state; | 2245 debug_state_ = debug_state; |
| 2242 } | 2246 } |
| 2243 | 2247 |
| 2244 } // namespace cc | 2248 } // namespace cc |
| OLD | NEW |