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

Unified Diff: cc/layers/picture_layer.cc

Issue 789433003: [cc] Add nearest neighbor filtering for PictureLayer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Only SetNeedsDisplay|PushProperties if nearest_neighbor changed. Created 6 years 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 55241d0a16f4c43125e3cdb09c95a104f23b6f2f..feaaf9c7fe3e7bbbebf54599754c55846b2e6143 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,
@@ -68,6 +69,7 @@ void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) {
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());
@@ -206,6 +208,13 @@ void PictureLayer::ClearClient() {
UpdateDrawsContent(HasDrawableContent());
}
+void PictureLayer::SetNearestNeighbor(bool nearest_neighbor) {
+ if (nearest_neighbor_ != nearest_neighbor) {
danakj 2014/12/09 19:44:45 if == return
jackhou1 2014/12/10 01:04:14 Done.
+ nearest_neighbor_ = nearest_neighbor;
+ SetNeedsDisplay();
danakj 2014/12/09 19:44:45 SetNeedsCommit is what you are looking for here
jackhou1 2014/12/10 01:04:14 Done.
+ }
+}
+
bool PictureLayer::HasDrawableContent() const {
return client_ && Layer::HasDrawableContent();
}

Powered by Google App Engine
This is Rietveld 408576698