Chromium Code Reviews| Index: cc/output/color_lut_cache.cc |
| diff --git a/cc/output/color_lut_cache.cc b/cc/output/color_lut_cache.cc |
| index 1a796dbcf2f23602d6a7d642af80a7968e7ba4cc..f54c1934adfa4b2f7ecc249701e89f0aada1f2d6 100644 |
| --- a/cc/output/color_lut_cache.cc |
| +++ b/cc/output/color_lut_cache.cc |
| @@ -81,7 +81,10 @@ unsigned int ColorLUTCache::MakeLUT(const gfx::ColorTransform* transform, |
| } |
| } |
|
ccameron
2017/03/23 06:41:40
This was causing a single-frame flash of strange d
hubbe
2017/03/23 18:09:33
Is this GetInteger slow?
(IE, does it have to fetc
ccameron
2017/03/23 19:21:51
I'm not 100% sure what the internal implementation
hubbe
2017/03/23 19:30:40
If we do not, we should probably investigate if we
|
| - unsigned int lut_texture; |
| + GLuint previously_bound_texture = 0; |
| + GLuint lut_texture = 0; |
| + gl_->GetIntegerv(GL_TEXTURE_BINDING_2D, |
| + reinterpret_cast<GLint*>(&previously_bound_texture)); |
| gl_->GenTextures(1, &lut_texture); |
| gl_->BindTexture(GL_TEXTURE_2D, lut_texture); |
| gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); |
| @@ -92,6 +95,7 @@ unsigned int ColorLUTCache::MakeLUT(const gfx::ColorTransform* transform, |
| lut_samples * lut_samples, 0, GL_RGBA, |
| sizeof(T) == 1 ? GL_UNSIGNED_BYTE : GL_HALF_FLOAT_OES, |
| lut.data()); |
| + gl_->BindTexture(GL_TEXTURE_2D, previously_bound_texture); |
| return lut_texture; |
| } |