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 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 1489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1500 void LayerTreeHostImpl::OnDraw() { | 1500 void LayerTreeHostImpl::OnDraw() { |
1501 client_->OnDrawForOutputSurface(); | 1501 client_->OnDrawForOutputSurface(); |
1502 } | 1502 } |
1503 | 1503 |
1504 void LayerTreeHostImpl::OnCanDrawStateChangedForTree() { | 1504 void LayerTreeHostImpl::OnCanDrawStateChangedForTree() { |
1505 client_->OnCanDrawStateChanged(CanDraw()); | 1505 client_->OnCanDrawStateChanged(CanDraw()); |
1506 } | 1506 } |
1507 | 1507 |
1508 CompositorFrameMetadata LayerTreeHostImpl::MakeCompositorFrameMetadata() const { | 1508 CompositorFrameMetadata LayerTreeHostImpl::MakeCompositorFrameMetadata() const { |
1509 CompositorFrameMetadata metadata; | 1509 CompositorFrameMetadata metadata; |
1510 metadata.device_scale_factor = active_tree_->device_scale_factor(); | 1510 float metadata_device_scale_factor = |
1511 active_tree_->painted_device_scale_factor() > 0.0f | |
danakj
2015/10/22 23:15:29
if it defaults to one you dont need an if here. yo
oshima
2015/10/23 18:05:36
Done.
| |
1512 ? active_tree_->painted_device_scale_factor() | |
1513 : active_tree_->device_scale_factor(); | |
1514 | |
1515 metadata.device_scale_factor = metadata_device_scale_factor; | |
1511 metadata.page_scale_factor = active_tree_->current_page_scale_factor(); | 1516 metadata.page_scale_factor = active_tree_->current_page_scale_factor(); |
1512 metadata.scrollable_viewport_size = active_tree_->ScrollableViewportSize(); | 1517 metadata.scrollable_viewport_size = active_tree_->ScrollableViewportSize(); |
1513 metadata.root_layer_size = active_tree_->ScrollableSize(); | 1518 metadata.root_layer_size = active_tree_->ScrollableSize(); |
1514 metadata.min_page_scale_factor = active_tree_->min_page_scale_factor(); | 1519 metadata.min_page_scale_factor = active_tree_->min_page_scale_factor(); |
1515 metadata.max_page_scale_factor = active_tree_->max_page_scale_factor(); | 1520 metadata.max_page_scale_factor = active_tree_->max_page_scale_factor(); |
1516 metadata.location_bar_offset = | 1521 metadata.location_bar_offset = |
1517 gfx::Vector2dF(0.f, top_controls_manager_->ControlsTopOffset()); | 1522 gfx::Vector2dF(0.f, top_controls_manager_->ControlsTopOffset()); |
1518 metadata.location_bar_content_translation = | 1523 metadata.location_bar_content_translation = |
1519 gfx::Vector2dF(0.f, top_controls_manager_->ContentTopOffset()); | 1524 gfx::Vector2dF(0.f, top_controls_manager_->ContentTopOffset()); |
1520 metadata.root_background_color = active_tree_->background_color(); | 1525 metadata.root_background_color = active_tree_->background_color(); |
(...skipping 2117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3638 if (active_tree()) { | 3643 if (active_tree()) { |
3639 LayerAnimationValueProvider* layer = active_tree()->LayerById(layer_id); | 3644 LayerAnimationValueProvider* layer = active_tree()->LayerById(layer_id); |
3640 if (layer) | 3645 if (layer) |
3641 return layer->ScrollOffsetForAnimation(); | 3646 return layer->ScrollOffsetForAnimation(); |
3642 } | 3647 } |
3643 | 3648 |
3644 return gfx::ScrollOffset(); | 3649 return gfx::ScrollOffset(); |
3645 } | 3650 } |
3646 | 3651 |
3647 } // namespace cc | 3652 } // namespace cc |
OLD | NEW |