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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1503 | 1507 |
1504 UpdateMaxScrollOffset(); | 1508 UpdateMaxScrollOffset(); |
1505 SetFullRootLayerDamage(); | 1509 SetFullRootLayerDamage(); |
1506 } | 1510 } |
1507 | 1511 |
1508 void LayerTreeHostImpl::SetDeviceScaleFactor(float device_scale_factor) { | 1512 void LayerTreeHostImpl::SetDeviceScaleFactor(float device_scale_factor) { |
1509 if (device_scale_factor == device_scale_factor_) | 1513 if (device_scale_factor == device_scale_factor_) |
1510 return; | 1514 return; |
1511 device_scale_factor_ = device_scale_factor; | 1515 device_scale_factor_ = device_scale_factor; |
1512 | 1516 |
| 1517 if (renderer_) |
| 1518 renderer_->ViewportChanged(); |
| 1519 |
1513 UpdateMaxScrollOffset(); | 1520 UpdateMaxScrollOffset(); |
1514 SetFullRootLayerDamage(); | 1521 SetFullRootLayerDamage(); |
1515 } | 1522 } |
1516 | 1523 |
1517 void LayerTreeHostImpl::UpdateMaxScrollOffset() { | 1524 void LayerTreeHostImpl::UpdateMaxScrollOffset() { |
1518 active_tree_->UpdateMaxScrollOffset(); | 1525 active_tree_->UpdateMaxScrollOffset(); |
1519 } | 1526 } |
1520 | 1527 |
1521 void LayerTreeHostImpl::DidChangeTopControlsPosition() { | 1528 void LayerTreeHostImpl::DidChangeTopControlsPosition() { |
1522 client_->SetNeedsRedrawOnImplThread(); | 1529 client_->SetNeedsRedrawOnImplThread(); |
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2235 } | 2242 } |
2236 | 2243 |
2237 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { | 2244 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { |
2238 if (debug_state_.continuous_painting != debug_state.continuous_painting) | 2245 if (debug_state_.continuous_painting != debug_state.continuous_painting) |
2239 paint_time_counter_->ClearHistory(); | 2246 paint_time_counter_->ClearHistory(); |
2240 | 2247 |
2241 debug_state_ = debug_state; | 2248 debug_state_ = debug_state; |
2242 } | 2249 } |
2243 | 2250 |
2244 } // namespace cc | 2251 } // namespace cc |
OLD | NEW |