| 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 "cc/layers/content_layer_client.h" | 7 #include "cc/layers/content_layer_client.h" |
| 8 #include "cc/layers/picture_layer_impl.h" | 8 #include "cc/layers/picture_layer_impl.h" |
| 9 #include "cc/trees/layer_tree_impl.h" | 9 #include "cc/trees/layer_tree_impl.h" |
| 10 #include "third_party/skia/include/core/SkPictureRecorder.h" | 10 #include "third_party/skia/include/core/SkPictureRecorder.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 } else if (update_source_frame_number_ == | 46 } else if (update_source_frame_number_ == |
| 47 layer_tree_host()->source_frame_number()) { | 47 layer_tree_host()->source_frame_number()) { |
| 48 // TODO(ernstm): This DCHECK is only valid as long as the pile's tiling_rect | 48 // TODO(ernstm): This DCHECK is only valid as long as the pile's tiling_rect |
| 49 // is identical to the layer_rect. | 49 // is identical to the layer_rect. |
| 50 // If update called, then pile size must match bounds pushed to impl layer. | 50 // If update called, then pile size must match bounds pushed to impl layer. |
| 51 DCHECK_EQ(layer_impl->bounds().ToString(), | 51 DCHECK_EQ(layer_impl->bounds().ToString(), |
| 52 pile_->tiling_rect().size().ToString()); | 52 pile_->tiling_rect().size().ToString()); |
| 53 } | 53 } |
| 54 | 54 |
| 55 layer_impl->SetIsMask(is_mask_); | 55 layer_impl->SetIsMask(is_mask_); |
| 56 layer_impl->SetUseGpuRasterization(layer_tree_host()->UseGpuRasterization()); | |
| 57 | 56 |
| 58 // Unlike other properties, invalidation must always be set on layer_impl. | 57 // Unlike other properties, invalidation must always be set on layer_impl. |
| 59 // See PictureLayerImpl::PushPropertiesTo for more details. | 58 // See PictureLayerImpl::PushPropertiesTo for more details. |
| 60 layer_impl->invalidation_.Clear(); | 59 layer_impl->invalidation_.Clear(); |
| 61 layer_impl->invalidation_.Swap(&pile_invalidation_); | 60 layer_impl->invalidation_.Swap(&pile_invalidation_); |
| 62 layer_impl->pile_ = PicturePileImpl::CreateFromOther(pile_.get()); | 61 layer_impl->pile_ = PicturePileImpl::CreateFromOther(pile_.get()); |
| 63 } | 62 } |
| 64 | 63 |
| 65 void PictureLayer::SetLayerTreeHost(LayerTreeHost* host) { | 64 void PictureLayer::SetLayerTreeHost(LayerTreeHost* host) { |
| 66 Layer::SetLayerTreeHost(host); | 65 Layer::SetLayerTreeHost(host); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 | 180 |
| 182 bool PictureLayer::IsSuitableForGpuRasterization() const { | 181 bool PictureLayer::IsSuitableForGpuRasterization() const { |
| 183 return pile_->is_suitable_for_gpu_rasterization(); | 182 return pile_->is_suitable_for_gpu_rasterization(); |
| 184 } | 183 } |
| 185 | 184 |
| 186 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 185 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { |
| 187 benchmark->RunOnLayer(this); | 186 benchmark->RunOnLayer(this); |
| 188 } | 187 } |
| 189 | 188 |
| 190 } // namespace cc | 189 } // namespace cc |
| OLD | NEW |