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.h" | 5 #include "cc/layers/picture_layer.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "cc/layers/content_layer_client.h" | 8 #include "cc/layers/content_layer_client.h" |
9 #include "cc/layers/picture_layer_impl.h" | 9 #include "cc/layers/picture_layer_impl.h" |
10 #include "cc/trees/layer_tree_impl.h" | 10 #include "cc/trees/layer_tree_impl.h" |
(...skipping 23 matching lines...) Expand all Loading... | |
34 | 34 |
35 void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) { | 35 void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) { |
36 Layer::PushPropertiesTo(base_layer); | 36 Layer::PushPropertiesTo(base_layer); |
37 PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer); | 37 PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer); |
38 | 38 |
39 if (layer_impl->bounds().IsEmpty()) { | 39 if (layer_impl->bounds().IsEmpty()) { |
40 // Update may not get called for an empty layer, so resize here instead. | 40 // Update may not get called for an empty layer, so resize here instead. |
41 // Using layer_impl because either bounds() or paint_properties().bounds | 41 // Using layer_impl because either bounds() or paint_properties().bounds |
42 // may disagree and either one could have been pushed to layer_impl. | 42 // may disagree and either one could have been pushed to layer_impl. |
43 pile_->SetEmptyBounds(); | 43 pile_->SetEmptyBounds(); |
44 } else if (update_source_frame_number_ == | 44 } else { |
45 layer_tree_host()->source_frame_number()) { | |
46 // TODO(ernstm): This DCHECK is only valid as long as the pile's tiling_rect | 45 // TODO(ernstm): This DCHECK is only valid as long as the pile's tiling_rect |
vmpstr
2014/10/24 20:41:12
I'm not sure what the todo here is, it seems to be
danakj
2014/10/24 20:43:07
Ya.. not sure either.
danakj
2014/10/24 20:44:30
I think this is from when we were going to use non
enne (OOO)
2014/10/24 20:50:24
Yes, that's exactly it.
| |
47 // is identical to the layer_rect. | 46 // is identical to the layer_rect. |
48 // If update called, then pile size must match bounds pushed to impl layer. | 47 // If update called, then pile size must match bounds pushed to impl layer. |
49 DCHECK_EQ(layer_impl->bounds().ToString(), pile_->tiling_size().ToString()); | 48 DCHECK_IMPLIES( |
49 update_source_frame_number_ == layer_tree_host()->source_frame_number(), | |
50 layer_impl->bounds().ToString() == pile_->tiling_size().ToString()); | |
50 } | 51 } |
51 | 52 |
52 // Unlike other properties, invalidation must always be set on layer_impl. | 53 // Unlike other properties, invalidation must always be set on layer_impl. |
53 // See PictureLayerImpl::PushPropertiesTo for more details. | 54 // See PictureLayerImpl::PushPropertiesTo for more details. |
54 layer_impl->invalidation_.Clear(); | 55 layer_impl->invalidation_.Clear(); |
55 layer_impl->invalidation_.Swap(&pile_invalidation_); | 56 layer_impl->invalidation_.Swap(&pile_invalidation_); |
56 layer_impl->pile_ = PicturePileImpl::CreateFromOther(pile_.get()); | 57 layer_impl->pile_ = PicturePileImpl::CreateFromOther(pile_.get()); |
57 } | 58 } |
58 | 59 |
59 void PictureLayer::SetLayerTreeHost(LayerTreeHost* host) { | 60 void PictureLayer::SetLayerTreeHost(LayerTreeHost* host) { |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
191 | 192 |
192 bool PictureLayer::HasDrawableContent() const { | 193 bool PictureLayer::HasDrawableContent() const { |
193 return client_ && Layer::HasDrawableContent(); | 194 return client_ && Layer::HasDrawableContent(); |
194 } | 195 } |
195 | 196 |
196 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 197 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { |
197 benchmark->RunOnLayer(this); | 198 benchmark->RunOnLayer(this); |
198 } | 199 } |
199 | 200 |
200 } // namespace cc | 201 } // namespace cc |
OLD | NEW |