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