Chromium Code Reviews| 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 1335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1346 if (tile_manager_) { | 1346 if (tile_manager_) { |
| 1347 DCHECK(resource_pool_); | 1347 DCHECK(resource_pool_); |
| 1348 | 1348 |
| 1349 resource_pool_->CheckBusyResources(); | 1349 resource_pool_->CheckBusyResources(); |
| 1350 resource_pool_->ReduceResourceUsage(); | 1350 resource_pool_->ReduceResourceUsage(); |
| 1351 } | 1351 } |
| 1352 // If we're not visible, we likely released resources, so we want to | 1352 // If we're not visible, we likely released resources, so we want to |
| 1353 // aggressively flush here to make sure those DeleteTextures make it to the | 1353 // aggressively flush here to make sure those DeleteTextures make it to the |
| 1354 // GPU process to free up the memory. | 1354 // GPU process to free up the memory. |
| 1355 if (resource_provider_ && !visible_) | 1355 if (resource_provider_ && !visible_) |
| 1356 resource_provider_->ShallowFlushIfSupported(); | 1356 resource_provider_->GetResourceHelper()->ShallowFlushIfSupported(); |
|
danakj
2014/07/09 16:01:33
can we just call output_surface_->...->ShallowFlus
sohanjg
2014/07/10 15:11:06
Done.
| |
| 1357 } | 1357 } |
| 1358 | 1358 |
| 1359 void LayerTreeHostImpl::OnCanDrawStateChangedForTree() { | 1359 void LayerTreeHostImpl::OnCanDrawStateChangedForTree() { |
| 1360 client_->OnCanDrawStateChanged(CanDraw()); | 1360 client_->OnCanDrawStateChanged(CanDraw()); |
| 1361 } | 1361 } |
| 1362 | 1362 |
| 1363 CompositorFrameMetadata LayerTreeHostImpl::MakeCompositorFrameMetadata() const { | 1363 CompositorFrameMetadata LayerTreeHostImpl::MakeCompositorFrameMetadata() const { |
| 1364 CompositorFrameMetadata metadata; | 1364 CompositorFrameMetadata metadata; |
| 1365 metadata.device_scale_factor = device_scale_factor_; | 1365 metadata.device_scale_factor = device_scale_factor_; |
| 1366 metadata.page_scale_factor = active_tree_->total_page_scale_factor(); | 1366 metadata.page_scale_factor = active_tree_->total_page_scale_factor(); |
| (...skipping 1785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3152 } | 3152 } |
| 3153 | 3153 |
| 3154 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3154 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
| 3155 std::vector<PictureLayerImpl*>::iterator it = | 3155 std::vector<PictureLayerImpl*>::iterator it = |
| 3156 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3156 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
| 3157 DCHECK(it != picture_layers_.end()); | 3157 DCHECK(it != picture_layers_.end()); |
| 3158 picture_layers_.erase(it); | 3158 picture_layers_.erase(it); |
| 3159 } | 3159 } |
| 3160 | 3160 |
| 3161 } // namespace cc | 3161 } // namespace cc |
| OLD | NEW |