| 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 <cmath> | 8 #include <cmath> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 } | 57 } |
| 58 | 58 |
| 59 PictureLayerImpl::Pair::Pair(PictureLayerImpl* active_layer, | 59 PictureLayerImpl::Pair::Pair(PictureLayerImpl* active_layer, |
| 60 PictureLayerImpl* pending_layer) | 60 PictureLayerImpl* pending_layer) |
| 61 : active(active_layer), pending(pending_layer) { | 61 : active(active_layer), pending(pending_layer) { |
| 62 } | 62 } |
| 63 | 63 |
| 64 PictureLayerImpl::Pair::~Pair() { | 64 PictureLayerImpl::Pair::~Pair() { |
| 65 } | 65 } |
| 66 | 66 |
| 67 PictureLayerImpl::PictureLayerImpl(LayerTreeImpl* tree_impl, | 67 PictureLayerImpl::PictureLayerImpl( |
| 68 int id, | 68 LayerTreeImpl* tree_impl, |
| 69 bool is_mask) | 69 int id, |
| 70 : LayerImpl(tree_impl, id), | 70 bool is_mask, |
| 71 scoped_refptr<SyncedScrollOffset> scroll_offset) |
| 72 : LayerImpl(tree_impl, id, scroll_offset), |
| 71 twin_layer_(nullptr), | 73 twin_layer_(nullptr), |
| 72 tilings_(CreatePictureLayerTilingSet()), | 74 tilings_(CreatePictureLayerTilingSet()), |
| 73 ideal_page_scale_(0.f), | 75 ideal_page_scale_(0.f), |
| 74 ideal_device_scale_(0.f), | 76 ideal_device_scale_(0.f), |
| 75 ideal_source_scale_(0.f), | 77 ideal_source_scale_(0.f), |
| 76 ideal_contents_scale_(0.f), | 78 ideal_contents_scale_(0.f), |
| 77 raster_page_scale_(0.f), | 79 raster_page_scale_(0.f), |
| 78 raster_device_scale_(0.f), | 80 raster_device_scale_(0.f), |
| 79 raster_source_scale_(0.f), | 81 raster_source_scale_(0.f), |
| 80 raster_contents_scale_(0.f), | 82 raster_contents_scale_(0.f), |
| (...skipping 30 matching lines...) Expand all Loading... |
| 111 return make_scoped_ptr( | 113 return make_scoped_ptr( |
| 112 new TilingSetRasterQueue(tilings_.get(), prioritize_low_res)); | 114 new TilingSetRasterQueue(tilings_.get(), prioritize_low_res)); |
| 113 } | 115 } |
| 114 | 116 |
| 115 const char* PictureLayerImpl::LayerTypeAsString() const { | 117 const char* PictureLayerImpl::LayerTypeAsString() const { |
| 116 return "cc::PictureLayerImpl"; | 118 return "cc::PictureLayerImpl"; |
| 117 } | 119 } |
| 118 | 120 |
| 119 scoped_ptr<LayerImpl> PictureLayerImpl::CreateLayerImpl( | 121 scoped_ptr<LayerImpl> PictureLayerImpl::CreateLayerImpl( |
| 120 LayerTreeImpl* tree_impl) { | 122 LayerTreeImpl* tree_impl) { |
| 121 return PictureLayerImpl::Create(tree_impl, id(), is_mask_); | 123 return PictureLayerImpl::Create(tree_impl, id(), is_mask_, scroll_offset()); |
| 122 } | 124 } |
| 123 | 125 |
| 124 void PictureLayerImpl::PushPropertiesTo(LayerImpl* base_layer) { | 126 void PictureLayerImpl::PushPropertiesTo(LayerImpl* base_layer) { |
| 125 PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer); | 127 PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer); |
| 126 DCHECK_EQ(layer_impl->is_mask_, is_mask_); | 128 DCHECK_EQ(layer_impl->is_mask_, is_mask_); |
| 127 | 129 |
| 128 LayerImpl::PushPropertiesTo(base_layer); | 130 LayerImpl::PushPropertiesTo(base_layer); |
| 129 | 131 |
| 130 // Twin relationships should never change once established. | 132 // Twin relationships should never change once established. |
| 131 DCHECK_IMPLIES(twin_layer_, twin_layer_ == layer_impl); | 133 DCHECK_IMPLIES(twin_layer_, twin_layer_ == layer_impl); |
| (...skipping 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1309 | 1311 |
| 1310 bool PictureLayerImpl::AllTilesRequiredForDrawAreReadyToDraw() const { | 1312 bool PictureLayerImpl::AllTilesRequiredForDrawAreReadyToDraw() const { |
| 1311 if (!layer_tree_impl()->IsActiveTree()) | 1313 if (!layer_tree_impl()->IsActiveTree()) |
| 1312 return true; | 1314 return true; |
| 1313 | 1315 |
| 1314 return AllTilesRequiredAreReadyToDraw( | 1316 return AllTilesRequiredAreReadyToDraw( |
| 1315 &PictureLayerTiling::IsTileRequiredForDrawIfVisible); | 1317 &PictureLayerTiling::IsTileRequiredForDrawIfVisible); |
| 1316 } | 1318 } |
| 1317 | 1319 |
| 1318 } // namespace cc | 1320 } // namespace cc |
| OLD | NEW |