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

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: Add nearest_neighbor field to TextureMailbox. Created 6 years, 2 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/texture_layer.cc
diff --git a/cc/layers/texture_layer.cc b/cc/layers/texture_layer.cc
index d53cfbe40ef7a216561cca026fb806d6d7a86620..932ccb4661ad4bb400bda8043e44c3ea66484eca 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,15 @@ void TextureLayer::SetFlipped(bool flipped) {
SetNeedsCommit();
}
+void TextureLayer::SetNearestNeighbor(bool nearest_neighbor) {
+ //printf("TextureLayer::setNearestNeighbor %d\n", nearest_neighbor);
+ if (nearest_neighbor_ == nearest_neighbor)
+ return;
+ nearest_neighbor_ = nearest_neighbor;
+ //printf("TextureLayer::setNearestNeighbor setneedscommit\n");
+ 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 +248,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_);

Powered by Google App Engine
This is Rietveld 408576698