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

Unified Diff: cc/output/gl_renderer.cc

Issue 558083002: [cc] Add nearest neighbor filtering for TextureLayer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 6 years, 1 month 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 78e2a2a3aa9b68e2ddc20a642926becb344034c0..577f8d2155ac8b4ee3d848c48423ef79afc3916a 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -2110,8 +2110,10 @@ void GLRenderer::FlushTextureQuadCache() {
GLC(gl_, gl_->Uniform1i(draw_cache_.sampler_location, 0));
// Assume the current active textures is 0.
- ResourceProvider::ScopedReadLockGL locked_quad(resource_provider_,
- draw_cache_.resource_id);
+ ResourceProvider::ScopedSamplerGL locked_quad(
+ resource_provider_,
+ draw_cache_.resource_id,
+ draw_cache_.nearest_neighbor ? GL_NEAREST : GL_LINEAR);
DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_));
GLC(gl_, gl_->BindTexture(GL_TEXTURE_2D, locked_quad.texture_id()));
@@ -2189,12 +2191,14 @@ void GLRenderer::EnqueueTextureQuad(const DrawingFrame* frame,
if (draw_cache_.program_id != binding.program_id ||
draw_cache_.resource_id != resource_id ||
draw_cache_.needs_blending != quad->ShouldDrawWithBlending() ||
+ draw_cache_.nearest_neighbor != quad->nearest_neighbor ||
draw_cache_.background_color != quad->background_color ||
draw_cache_.matrix_data.size() >= 8) {
FlushTextureQuadCache();
draw_cache_.program_id = binding.program_id;
draw_cache_.resource_id = resource_id;
draw_cache_.needs_blending = quad->ShouldDrawWithBlending();
+ draw_cache_.nearest_neighbor = quad->nearest_neighbor;
draw_cache_.background_color = quad->background_color;
draw_cache_.uv_xform_location = binding.tex_transform_location;

Powered by Google App Engine
This is Rietveld 408576698