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

Unified Diff: cc/layers/texture_layer.cc

Issue 558083002: [cc] Add nearest neighbor filtering for TextureLayer. (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/texture_layer.h ('k') | cc/layers/texture_layer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/texture_layer.cc
diff --git a/cc/layers/texture_layer.cc b/cc/layers/texture_layer.cc
index d53cfbe40ef7a216561cca026fb806d6d7a86620..cf1149b5161ac63a1f818d7c760cf4a938efbe74 100644
--- a/cc/layers/texture_layer.cc
+++ b/cc/layers/texture_layer.cc
@@ -27,6 +27,7 @@ TextureLayer::TextureLayer(TextureLayerClient* client)
: Layer(),
client_(client),
flipped_(true),
+ nearest_neighbor_(false),
uv_top_left_(0.f, 0.f),
uv_bottom_right_(1.f, 1.f),
premultiplied_alpha_(true),
@@ -65,6 +66,13 @@ void TextureLayer::SetFlipped(bool flipped) {
SetNeedsCommit();
}
+void TextureLayer::SetNearestNeighbor(bool nearest_neighbor) {
+ if (nearest_neighbor_ == nearest_neighbor)
+ return;
+ nearest_neighbor_ = nearest_neighbor;
+ SetNeedsCommit();
+}
+
void TextureLayer::SetUV(const gfx::PointF& top_left,
const gfx::PointF& bottom_right) {
if (uv_top_left_ == top_left && uv_bottom_right_ == bottom_right)
@@ -238,6 +246,7 @@ void TextureLayer::PushPropertiesTo(LayerImpl* layer) {
TextureLayerImpl* texture_layer = static_cast<TextureLayerImpl*>(layer);
texture_layer->SetFlipped(flipped_);
+ texture_layer->SetNearestNeighbor(nearest_neighbor_);
texture_layer->SetUVTopLeft(uv_top_left_);
texture_layer->SetUVBottomRight(uv_bottom_right_);
texture_layer->SetVertexOpacity(vertex_opacity_);
« no previous file with comments | « cc/layers/texture_layer.h ('k') | cc/layers/texture_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698