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

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: Sync and rebase 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
« no previous file with comments | « cc/layers/picture_layer.h ('k') | cc/layers/picture_layer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer.cc
diff --git a/cc/layers/picture_layer.cc b/cc/layers/picture_layer.cc
index 8a4fd6713c90fb114fab36c20d3abc323230a787..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,
@@ -65,6 +66,8 @@ void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) {
recording_source_->SetEmptyBounds();
}
+ layer_impl->SetNearestNeighbor(nearest_neighbor_);
+
scoped_refptr<RasterSource> raster_source =
recording_source_->CreateRasterSource();
raster_source->SetBackgoundColor(SafeOpaqueBackgroundColor());
@@ -205,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();
}
« no previous file with comments | « cc/layers/picture_layer.h ('k') | cc/layers/picture_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698