| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/layers/picture_layer_impl.h" | 5 #include "cc/layers/picture_layer_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/debug/trace_event_argument.h" | 10 #include "base/debug/trace_event_argument.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // When the pending tree pushes to the active tree, the pending twin | 111 // When the pending tree pushes to the active tree, the pending twin |
| 112 // becomes recycled. | 112 // becomes recycled. |
| 113 layer_impl->twin_layer_ = NULL; | 113 layer_impl->twin_layer_ = NULL; |
| 114 twin_layer_ = NULL; | 114 twin_layer_ = NULL; |
| 115 | 115 |
| 116 layer_impl->SetIsMask(is_mask_); | 116 layer_impl->SetIsMask(is_mask_); |
| 117 layer_impl->pile_ = pile_; | 117 layer_impl->pile_ = pile_; |
| 118 | 118 |
| 119 // Tilings would be expensive to push, so we swap. | 119 // Tilings would be expensive to push, so we swap. |
| 120 layer_impl->tilings_.swap(tilings_); | 120 layer_impl->tilings_.swap(tilings_); |
| 121 layer_impl->tilings_->SetClient(layer_impl); |
| 122 if (tilings_) |
| 123 tilings_->SetClient(this); |
| 121 | 124 |
| 122 // Remove invalidated tiles from what will become a recycle tree. | 125 // Remove invalidated tiles from what will become a recycle tree. |
| 123 if (tilings_) | 126 if (tilings_) |
| 124 tilings_->RemoveTilesInRegion(invalidation_); | 127 tilings_->RemoveTilesInRegion(invalidation_); |
| 125 | 128 |
| 126 layer_impl->tilings_->SetClient(layer_impl); | |
| 127 if (tilings_) | |
| 128 tilings_->SetClient(this); | |
| 129 | |
| 130 layer_impl->raster_page_scale_ = raster_page_scale_; | 129 layer_impl->raster_page_scale_ = raster_page_scale_; |
| 131 layer_impl->raster_device_scale_ = raster_device_scale_; | 130 layer_impl->raster_device_scale_ = raster_device_scale_; |
| 132 layer_impl->raster_source_scale_ = raster_source_scale_; | 131 layer_impl->raster_source_scale_ = raster_source_scale_; |
| 133 layer_impl->raster_contents_scale_ = raster_contents_scale_; | 132 layer_impl->raster_contents_scale_ = raster_contents_scale_; |
| 134 layer_impl->low_res_raster_contents_scale_ = low_res_raster_contents_scale_; | 133 layer_impl->low_res_raster_contents_scale_ = low_res_raster_contents_scale_; |
| 135 layer_impl->needs_post_commit_initialization_ = false; | 134 layer_impl->needs_post_commit_initialization_ = false; |
| 136 | 135 |
| 137 // The invalidation on this soon-to-be-recycled layer must be cleared to | 136 // The invalidation on this soon-to-be-recycled layer must be cleared to |
| 138 // mirror clearing the invalidation in PictureLayer's version of this function | 137 // mirror clearing the invalidation in PictureLayer's version of this function |
| 139 // in case push properties is skipped. | 138 // in case push properties is skipped. |
| (...skipping 1624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1764 PictureLayerTilingSet::TilingRange tiling_range = CurrentTilingRange(); | 1763 PictureLayerTilingSet::TilingRange tiling_range = CurrentTilingRange(); |
| 1765 size_t current_tiling_range_offset = current_tiling_ - tiling_range.start; | 1764 size_t current_tiling_range_offset = current_tiling_ - tiling_range.start; |
| 1766 return tiling_range.end - 1 - current_tiling_range_offset; | 1765 return tiling_range.end - 1 - current_tiling_range_offset; |
| 1767 } | 1766 } |
| 1768 } | 1767 } |
| 1769 NOTREACHED(); | 1768 NOTREACHED(); |
| 1770 return 0; | 1769 return 0; |
| 1771 } | 1770 } |
| 1772 | 1771 |
| 1773 } // namespace cc | 1772 } // namespace cc |
| OLD | NEW |