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 1493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1504 void LayerTreeHostImpl::OnDraw() { | 1504 void LayerTreeHostImpl::OnDraw() { |
1505 client_->OnDrawForOutputSurface(); | 1505 client_->OnDrawForOutputSurface(); |
1506 } | 1506 } |
1507 | 1507 |
1508 void LayerTreeHostImpl::OnCanDrawStateChangedForTree() { | 1508 void LayerTreeHostImpl::OnCanDrawStateChangedForTree() { |
1509 client_->OnCanDrawStateChanged(CanDraw()); | 1509 client_->OnCanDrawStateChanged(CanDraw()); |
1510 } | 1510 } |
1511 | 1511 |
1512 CompositorFrameMetadata LayerTreeHostImpl::MakeCompositorFrameMetadata() const { | 1512 CompositorFrameMetadata LayerTreeHostImpl::MakeCompositorFrameMetadata() const { |
1513 CompositorFrameMetadata metadata; | 1513 CompositorFrameMetadata metadata; |
1514 metadata.device_scale_factor = active_tree_->device_scale_factor(); | 1514 metadata.device_scale_factor = active_tree_->painted_device_scale_factor() * |
| 1515 active_tree_->device_scale_factor(); |
| 1516 |
1515 metadata.page_scale_factor = active_tree_->current_page_scale_factor(); | 1517 metadata.page_scale_factor = active_tree_->current_page_scale_factor(); |
1516 metadata.scrollable_viewport_size = active_tree_->ScrollableViewportSize(); | 1518 metadata.scrollable_viewport_size = active_tree_->ScrollableViewportSize(); |
1517 metadata.root_layer_size = active_tree_->ScrollableSize(); | 1519 metadata.root_layer_size = active_tree_->ScrollableSize(); |
1518 metadata.min_page_scale_factor = active_tree_->min_page_scale_factor(); | 1520 metadata.min_page_scale_factor = active_tree_->min_page_scale_factor(); |
1519 metadata.max_page_scale_factor = active_tree_->max_page_scale_factor(); | 1521 metadata.max_page_scale_factor = active_tree_->max_page_scale_factor(); |
1520 metadata.location_bar_offset = | 1522 metadata.location_bar_offset = |
1521 gfx::Vector2dF(0.f, top_controls_manager_->ControlsTopOffset()); | 1523 gfx::Vector2dF(0.f, top_controls_manager_->ControlsTopOffset()); |
1522 metadata.location_bar_content_translation = | 1524 metadata.location_bar_content_translation = |
1523 gfx::Vector2dF(0.f, top_controls_manager_->ContentTopOffset()); | 1525 gfx::Vector2dF(0.f, top_controls_manager_->ContentTopOffset()); |
1524 metadata.root_background_color = active_tree_->background_color(); | 1526 metadata.root_background_color = active_tree_->background_color(); |
(...skipping 2132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3657 return task_runner_provider_->HasImplThread(); | 3659 return task_runner_provider_->HasImplThread(); |
3658 } | 3660 } |
3659 | 3661 |
3660 bool LayerTreeHostImpl::CommitToActiveTree() const { | 3662 bool LayerTreeHostImpl::CommitToActiveTree() const { |
3661 // In single threaded mode we skip the pending tree and commit directly to the | 3663 // In single threaded mode we skip the pending tree and commit directly to the |
3662 // active tree. | 3664 // active tree. |
3663 return !task_runner_provider_->HasImplThread(); | 3665 return !task_runner_provider_->HasImplThread(); |
3664 } | 3666 } |
3665 | 3667 |
3666 } // namespace cc | 3668 } // namespace cc |
OLD | NEW |