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; |