Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4277)

Unified Diff: cc/layers/picture_layer.cc

Issue 2131233003: cc: Clean up PictureLayer API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/layers/picture_layer.cc
diff --git a/cc/layers/picture_layer.cc b/cc/layers/picture_layer.cc
index 7eddc388fdac5d977031bab52beb3edd61e4d55d..9226f2274c1bd0a9dcfbbd95d1def698da433efc 100644
--- a/cc/layers/picture_layer.cc
+++ b/cc/layers/picture_layer.cc
@@ -19,6 +19,10 @@
namespace cc {
+PictureLayer::Inputs::Inputs() : nearest_neighbor_(false) {}
+
+PictureLayer::Inputs::~Inputs() {}
+
scoped_refptr<PictureLayer> PictureLayer::Create(ContentLayerClient* client) {
return make_scoped_refptr(new PictureLayer(client));
}
@@ -27,8 +31,7 @@ PictureLayer::PictureLayer(ContentLayerClient* client)
: client_(client),
instrumentation_object_tracker_(id()),
update_source_frame_number_(-1),
- is_mask_(false),
- nearest_neighbor_(false) {}
+ is_mask_(false) {}
PictureLayer::PictureLayer(ContentLayerClient* client,
std::unique_ptr<RecordingSource> source)
@@ -52,7 +55,7 @@ void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) {
DCHECK_EQ(layer_impl->is_mask(), is_mask_);
DropRecordingSourceContentIfInvalid();
- layer_impl->SetNearestNeighbor(nearest_neighbor_);
+ layer_impl->SetNearestNeighbor(inputs_.nearest_neighbor_);
// Preserve lcd text settings from the current raster source.
bool can_use_lcd_text = layer_impl->RasterSourceUsesLCDText();
@@ -158,10 +161,10 @@ void PictureLayer::ClearClient() {
}
void PictureLayer::SetNearestNeighbor(bool nearest_neighbor) {
- if (nearest_neighbor_ == nearest_neighbor)
+ if (inputs_.nearest_neighbor_ == nearest_neighbor)
return;
- nearest_neighbor_ = nearest_neighbor;
+ inputs_.nearest_neighbor_ = nearest_neighbor;
SetNeedsCommit();
}
@@ -196,7 +199,7 @@ void PictureLayer::LayerSpecificPropertiesToProto(
RegionToProto(last_updated_invalidation_, picture->mutable_invalidation());
picture->set_is_mask(is_mask_);
- picture->set_nearest_neighbor(nearest_neighbor_);
+ picture->set_nearest_neighbor(inputs_.nearest_neighbor_);
picture->set_update_source_frame_number(update_source_frame_number_);
@@ -225,7 +228,7 @@ void PictureLayer::FromLayerSpecificPropertiesProto(
Region new_invalidation = RegionFromProto(picture.invalidation());
last_updated_invalidation_.Swap(&new_invalidation);
is_mask_ = picture.is_mask();
- nearest_neighbor_ = picture.nearest_neighbor();
+ inputs_.nearest_neighbor_ = picture.nearest_neighbor();
update_source_frame_number_ = picture.update_source_frame_number();
}

Powered by Google App Engine
This is Rietveld 408576698