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

Unified Diff: cc/output/gl_renderer.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/tiled_layer_impl.cc ('k') | cc/output/renderer_pixeltest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/gl_renderer.cc
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
index 13a98f656f6c3c25018493987c1ea7f36787cfd6..ee94a4c9f9b976e11ce81ee2867d31d4729e0699 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -1626,7 +1626,8 @@ void GLRenderer::DrawContentQuadAA(const DrawingFrame* frame,
SetupQuadForAntialiasing(device_transform, quad, &local_quad, edge);
ResourceProvider::ScopedSamplerGL quad_resource_lock(
- resource_provider_, resource_id, GL_LINEAR);
+ resource_provider_, resource_id,
+ quad->nearest_neighbor ? GL_NEAREST : GL_LINEAR);
SamplerType sampler =
SamplerTypeFromTextureTarget(quad_resource_lock.target());
@@ -1710,7 +1711,8 @@ void GLRenderer::DrawContentQuadNoAA(const DrawingFrame* frame,
bool scaled = (tex_to_geom_scale_x != 1.f || tex_to_geom_scale_y != 1.f);
GLenum filter =
- (scaled || !quad->quadTransform().IsIdentityOrIntegerTranslation())
+ (scaled || !quad->quadTransform().IsIdentityOrIntegerTranslation()) &&
+ !quad->nearest_neighbor
? GL_LINEAR
: GL_NEAREST;
« no previous file with comments | « cc/layers/tiled_layer_impl.cc ('k') | cc/output/renderer_pixeltest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698