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 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 1412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1423 resource_pool_->ReduceResourceUsage(); | 1423 resource_pool_->ReduceResourceUsage(); |
1424 } | 1424 } |
1425 // If we're not visible, we likely released resources, so we want to | 1425 // If we're not visible, we likely released resources, so we want to |
1426 // aggressively flush here to make sure those DeleteTextures make it to the | 1426 // aggressively flush here to make sure those DeleteTextures make it to the |
1427 // GPU process to free up the memory. | 1427 // GPU process to free up the memory. |
1428 if (output_surface_->context_provider() && !visible_) { | 1428 if (output_surface_->context_provider() && !visible_) { |
1429 output_surface_->context_provider()->ContextGL()->ShallowFlushCHROMIUM(); | 1429 output_surface_->context_provider()->ContextGL()->ShallowFlushCHROMIUM(); |
1430 } | 1430 } |
1431 } | 1431 } |
1432 | 1432 |
| 1433 void LayerTreeHostImpl::OnDraw() { |
| 1434 client_->OnDrawForOutputSurface(); |
| 1435 } |
| 1436 |
1433 void LayerTreeHostImpl::OnCanDrawStateChangedForTree() { | 1437 void LayerTreeHostImpl::OnCanDrawStateChangedForTree() { |
1434 client_->OnCanDrawStateChanged(CanDraw()); | 1438 client_->OnCanDrawStateChanged(CanDraw()); |
1435 } | 1439 } |
1436 | 1440 |
1437 CompositorFrameMetadata LayerTreeHostImpl::MakeCompositorFrameMetadata() const { | 1441 CompositorFrameMetadata LayerTreeHostImpl::MakeCompositorFrameMetadata() const { |
1438 CompositorFrameMetadata metadata; | 1442 CompositorFrameMetadata metadata; |
1439 metadata.device_scale_factor = device_scale_factor_; | 1443 metadata.device_scale_factor = device_scale_factor_; |
1440 metadata.page_scale_factor = active_tree_->current_page_scale_factor(); | 1444 metadata.page_scale_factor = active_tree_->current_page_scale_factor(); |
1441 metadata.scrollable_viewport_size = active_tree_->ScrollableViewportSize(); | 1445 metadata.scrollable_viewport_size = active_tree_->ScrollableViewportSize(); |
1442 metadata.root_layer_size = active_tree_->ScrollableSize(); | 1446 metadata.root_layer_size = active_tree_->ScrollableSize(); |
(...skipping 2024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3467 new_target.SetToMin(layer_impl->MaxScrollOffset()); | 3471 new_target.SetToMin(layer_impl->MaxScrollOffset()); |
3468 | 3472 |
3469 curve->UpdateTarget( | 3473 curve->UpdateTarget( |
3470 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) | 3474 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) |
3471 .InSecondsF(), | 3475 .InSecondsF(), |
3472 new_target); | 3476 new_target); |
3473 | 3477 |
3474 return true; | 3478 return true; |
3475 } | 3479 } |
3476 } // namespace cc | 3480 } // namespace cc |
OLD | NEW |