| Index: cc/layers/picture_layer.cc
|
| diff --git a/cc/layers/picture_layer.cc b/cc/layers/picture_layer.cc
|
| index 55241d0a16f4c43125e3cdb09c95a104f23b6f2f..48f3f7349453f7dd859bab4af70b8a635413ff84 100644
|
| --- a/cc/layers/picture_layer.cc
|
| +++ b/cc/layers/picture_layer.cc
|
| @@ -24,7 +24,8 @@ PictureLayer::PictureLayer(ContentLayerClient* client)
|
| instrumentation_object_tracker_(id()),
|
| update_source_frame_number_(-1),
|
| can_use_lcd_text_for_update_(true),
|
| - is_mask_(false) {
|
| + is_mask_(false),
|
| + nearest_neighbor_(false) {
|
| }
|
|
|
| PictureLayer::PictureLayer(ContentLayerClient* client,
|
| @@ -37,12 +38,14 @@ PictureLayer::~PictureLayer() {
|
| }
|
|
|
| scoped_ptr<LayerImpl> PictureLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) {
|
| - return PictureLayerImpl::Create(tree_impl, id());
|
| + return PictureLayerImpl::Create(tree_impl, id(), is_mask_);
|
| }
|
|
|
| void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) {
|
| Layer::PushPropertiesTo(base_layer);
|
| PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer);
|
| + // TODO(danakj): Make is_mask_ a constructor parameter for PictureLayer.
|
| + DCHECK_EQ(layer_impl->is_mask_, is_mask_);
|
|
|
| int source_frame_number = layer_tree_host()->source_frame_number();
|
| gfx::Size impl_bounds = layer_impl->bounds();
|
| @@ -63,17 +66,16 @@ void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) {
|
| recording_source_->SetEmptyBounds();
|
| }
|
|
|
| - // Unlike other properties, invalidation must always be set on layer_impl.
|
| - // See PictureLayerImpl::PushPropertiesTo for more details.
|
| - layer_impl->invalidation_.Clear();
|
| - layer_impl->invalidation_.Swap(&recording_invalidation_);
|
| - layer_impl->set_is_mask(is_mask_);
|
| + layer_impl->SetNearestNeighbor(nearest_neighbor_);
|
| +
|
| scoped_refptr<RasterSource> raster_source =
|
| recording_source_->CreateRasterSource();
|
| raster_source->SetBackgoundColor(SafeOpaqueBackgroundColor());
|
| raster_source->SetRequiresClear(!contents_opaque() &&
|
| !client_->FillsBoundsCompletely());
|
| - layer_impl->UpdateRasterSource(raster_source);
|
| + layer_impl->UpdateRasterSource(raster_source, &recording_invalidation_,
|
| + nullptr);
|
| + DCHECK(recording_invalidation_.IsEmpty());
|
| }
|
|
|
| void PictureLayer::SetLayerTreeHost(LayerTreeHost* host) {
|
| @@ -206,6 +208,14 @@ void PictureLayer::ClearClient() {
|
| UpdateDrawsContent(HasDrawableContent());
|
| }
|
|
|
| +void PictureLayer::SetNearestNeighbor(bool nearest_neighbor) {
|
| + if (nearest_neighbor_ == nearest_neighbor)
|
| + return;
|
| +
|
| + nearest_neighbor_ = nearest_neighbor;
|
| + SetNeedsCommit();
|
| +}
|
| +
|
| bool PictureLayer::HasDrawableContent() const {
|
| return client_ && Layer::HasDrawableContent();
|
| }
|
|
|