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

Unified Diff: cc/layers/texture_layer_impl.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_impl.h ('k') | cc/layers/texture_layer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/texture_layer_impl.cc
diff --git a/cc/layers/texture_layer_impl.cc b/cc/layers/texture_layer_impl.cc
index bcde7cd49ecbac99591a787453cad6ea9a739cd2..b174348f7f16c7238e4ff2dfa61644111c7b9e8d 100644
--- a/cc/layers/texture_layer_impl.cc
+++ b/cc/layers/texture_layer_impl.cc
@@ -23,6 +23,7 @@ TextureLayerImpl::TextureLayerImpl(LayerTreeImpl* tree_impl, int id)
premultiplied_alpha_(true),
blend_background_color_(false),
flipped_(true),
+ nearest_neighbor_(false),
uv_top_left_(0.f, 0.f),
uv_bottom_right_(1.f, 1.f),
own_mailbox_(false),
@@ -62,6 +63,7 @@ void TextureLayerImpl::PushPropertiesTo(LayerImpl* layer) {
texture_layer->SetVertexOpacity(vertex_opacity_);
texture_layer->SetPremultipliedAlpha(premultiplied_alpha_);
texture_layer->SetBlendBackgroundColor(blend_background_color_);
+ texture_layer->SetNearestNeighbor(nearest_neighbor_);
if (own_mailbox_) {
texture_layer->SetTextureMailbox(texture_mailbox_,
release_callback_.Pass());
@@ -176,7 +178,8 @@ void TextureLayerImpl::AppendQuads(RenderPass* render_pass,
uv_bottom_right_,
bg_color,
vertex_opacity_,
- flipped_);
+ flipped_,
+ nearest_neighbor_);
}
SimpleEnclosedRegion TextureLayerImpl::VisibleContentOpaqueRegion() const {
@@ -211,6 +214,11 @@ void TextureLayerImpl::SetFlipped(bool flipped) {
SetNeedsPushProperties();
}
+void TextureLayerImpl::SetNearestNeighbor(bool nearest_neighbor) {
+ nearest_neighbor_ = nearest_neighbor;
+ SetNeedsPushProperties();
+}
+
void TextureLayerImpl::SetUVTopLeft(const gfx::PointF top_left) {
uv_top_left_ = top_left;
SetNeedsPushProperties();
« no previous file with comments | « cc/layers/texture_layer_impl.h ('k') | cc/layers/texture_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698