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

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: Only SetNeedsDisplay|PushProperties if nearest_neighbor changed. 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
Index: cc/output/gl_renderer.cc
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
index a32778a437038b86816ea6c47aa522160e65c6fe..b1344ea9fb404a5c418974cd2191c861005d4039 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -1628,7 +1628,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());
@@ -1712,7 +1713,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
danakj 2014/12/09 19:44:45 is this what git cl format does for formatting?
jackhou1 2014/12/10 01:04:15 Yup.
? GL_LINEAR
: GL_NEAREST;

Powered by Google App Engine
This is Rietveld 408576698