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 "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
9 #include "cc/blimp/client_picture_cache.h" | 9 #include "cc/blimp/client_picture_cache.h" |
10 #include "cc/blimp/engine_picture_cache.h" | 10 #include "cc/blimp/engine_picture_cache.h" |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
201 bool PictureLayer::HasDrawableContent() const { | 201 bool PictureLayer::HasDrawableContent() const { |
202 return picture_layer_inputs_.client && Layer::HasDrawableContent(); | 202 return picture_layer_inputs_.client && Layer::HasDrawableContent(); |
203 } | 203 } |
204 | 204 |
205 void PictureLayer::SetTypeForProtoSerialization(proto::LayerNode* proto) const { | 205 void PictureLayer::SetTypeForProtoSerialization(proto::LayerNode* proto) const { |
206 proto->set_type(proto::LayerNode::PICTURE_LAYER); | 206 proto->set_type(proto::LayerNode::PICTURE_LAYER); |
207 } | 207 } |
208 | 208 |
209 void PictureLayer::LayerSpecificPropertiesToProto(proto::LayerProperties* proto, | 209 void PictureLayer::LayerSpecificPropertiesToProto(proto::LayerProperties* proto, |
210 bool inputs_only) { | 210 bool inputs_only) { |
211 DCHECK(GetLayerTree()); | |
212 DCHECK(GetLayerTree()->engine_picture_cache()); | |
Wez
2016/10/13 16:53:52
nit: Is it worth DCHECK()ing these, given that you
Khushal
2016/10/13 18:47:28
I found an unhelpful seg-fault instead of a pretty
| |
213 | |
211 Layer::LayerSpecificPropertiesToProto(proto, inputs_only); | 214 Layer::LayerSpecificPropertiesToProto(proto, inputs_only); |
212 DropRecordingSourceContentIfInvalid(); | 215 DropRecordingSourceContentIfInvalid(); |
213 proto::PictureLayerProperties* picture = proto->mutable_picture(); | 216 proto::PictureLayerProperties* picture = proto->mutable_picture(); |
214 | 217 |
215 picture->set_nearest_neighbor(picture_layer_inputs_.nearest_neighbor); | 218 picture->set_nearest_neighbor(picture_layer_inputs_.nearest_neighbor); |
216 RectToProto(picture_layer_inputs_.recorded_viewport, | 219 RectToProto(picture_layer_inputs_.recorded_viewport, |
217 picture->mutable_recorded_viewport()); | 220 picture->mutable_recorded_viewport()); |
218 if (picture_layer_inputs_.display_list) { | 221 if (picture_layer_inputs_.display_list) { |
219 picture_layer_inputs_.display_list->ToProtobuf( | 222 picture_layer_inputs_.display_list->ToProtobuf( |
220 picture->mutable_display_list()); | 223 picture->mutable_display_list()); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
311 picture_layer_inputs_.display_list = nullptr; | 314 picture_layer_inputs_.display_list = nullptr; |
312 picture_layer_inputs_.painter_reported_memory_usage = 0; | 315 picture_layer_inputs_.painter_reported_memory_usage = 0; |
313 } | 316 } |
314 } | 317 } |
315 | 318 |
316 const DisplayItemList* PictureLayer::GetDisplayItemList() { | 319 const DisplayItemList* PictureLayer::GetDisplayItemList() { |
317 return picture_layer_inputs_.display_list.get(); | 320 return picture_layer_inputs_.display_list.get(); |
318 } | 321 } |
319 | 322 |
320 } // namespace cc | 323 } // namespace cc |
OLD | NEW |