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 1575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1586 | 1586 |
1587 void LayerTreeHostImpl::FinishAllRendering() { | 1587 void LayerTreeHostImpl::FinishAllRendering() { |
1588 if (renderer_) | 1588 if (renderer_) |
1589 renderer_->Finish(); | 1589 renderer_->Finish(); |
1590 } | 1590 } |
1591 | 1591 |
1592 void LayerTreeHostImpl::SetUseGpuRasterization(bool use_gpu) { | 1592 void LayerTreeHostImpl::SetUseGpuRasterization(bool use_gpu) { |
1593 if (use_gpu == use_gpu_rasterization_) | 1593 if (use_gpu == use_gpu_rasterization_) |
1594 return; | 1594 return; |
1595 | 1595 |
| 1596 // Note that this must happen first, in case the rest of the calls want to |
| 1597 // query the new state of |use_gpu_rasterization_|. |
1596 use_gpu_rasterization_ = use_gpu; | 1598 use_gpu_rasterization_ = use_gpu; |
| 1599 |
| 1600 // Clean up and replace existing tile manager with another one that uses |
| 1601 // appropriate rasterizer. |
1597 ReleaseTreeResources(); | 1602 ReleaseTreeResources(); |
1598 | |
1599 // Replace existing tile manager with another one that uses appropriate | |
1600 // rasterizer. | |
1601 if (tile_manager_) { | 1603 if (tile_manager_) { |
1602 DestroyTileManager(); | 1604 DestroyTileManager(); |
1603 CreateAndSetTileManager(); | 1605 CreateAndSetTileManager(); |
1604 } | 1606 } |
1605 | 1607 |
1606 // We have released tilings for both active and pending tree. | 1608 // We have released tilings for both active and pending tree. |
1607 // We would not have any content to draw until the pending tree is activated. | 1609 // We would not have any content to draw until the pending tree is activated. |
1608 // Prevent the active tree from drawing until activation. | 1610 // Prevent the active tree from drawing until activation. |
1609 SetRequiresHighResToDraw(); | 1611 SetRequiresHighResToDraw(); |
1610 } | 1612 } |
(...skipping 1875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3486 } | 3488 } |
3487 | 3489 |
3488 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3490 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
3489 std::vector<PictureLayerImpl*>::iterator it = | 3491 std::vector<PictureLayerImpl*>::iterator it = |
3490 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3492 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
3491 DCHECK(it != picture_layers_.end()); | 3493 DCHECK(it != picture_layers_.end()); |
3492 picture_layers_.erase(it); | 3494 picture_layers_.erase(it); |
3493 } | 3495 } |
3494 | 3496 |
3495 } // namespace cc | 3497 } // namespace cc |
OLD | NEW |