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

Unified Diff: ui/gl/yuv_to_rgb_converter.cc

Issue 1980183002: Workaround for Mac video flickering (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporate review feedback Created 4 years, 7 months 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 | « ui/gl/yuv_to_rgb_converter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/yuv_to_rgb_converter.cc
diff --git a/ui/gl/yuv_to_rgb_converter.cc b/ui/gl/yuv_to_rgb_converter.cc
index 4c19b3685d0ceb1396c3c49b0f5b067f2bf26571..c414268a8cd93b9e934668531f62e7e5bee0e2ec 100644
--- a/ui/gl/yuv_to_rgb_converter.cc
+++ b/ui/gl/yuv_to_rgb_converter.cc
@@ -100,12 +100,17 @@ YUVToRGBConverter::YUVToRGBConverter() {
int uv_sampler_location = glGetUniformLocation(program_, "a_uv_texture");
DCHECK_NE(-1, uv_sampler_location);
+ glGenTextures(1, &y_texture_);
+ glGenTextures(1, &uv_texture_);
+
glUniform1i(y_sampler_location, 0);
glUniform1i(uv_sampler_location, 1);
}
YUVToRGBConverter::~YUVToRGBConverter() {
gfx::ScopedSetGLToRealGLApi scoped_set_gl_api;
+ glDeleteTextures(1, &y_texture_);
+ glDeleteTextures(1, &uv_texture_);
glDeleteProgram(program_);
glDeleteShader(vertex_shader_);
glDeleteShader(fragment_shader_);
@@ -114,8 +119,6 @@ YUVToRGBConverter::~YUVToRGBConverter() {
}
void YUVToRGBConverter::CopyYUV420ToRGB(unsigned target,
- unsigned y_texture,
- unsigned uv_texture,
const gfx::Size& size,
unsigned rgb_texture) {
// Only support for rectangle targets exists so far.
@@ -140,9 +143,9 @@ void YUVToRGBConverter::CopyYUV420ToRGB(unsigned target,
// Set up and issue the draw call.
glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_RECTANGLE_ARB, y_texture);
+ glBindTexture(GL_TEXTURE_RECTANGLE_ARB, y_texture_);
glActiveTexture(GL_TEXTURE1);
- glBindTexture(GL_TEXTURE_RECTANGLE_ARB, uv_texture);
+ glBindTexture(GL_TEXTURE_RECTANGLE_ARB, uv_texture_);
gfx::ScopedFrameBufferBinder framebuffer_binder(framebuffer_);
gfx::ScopedViewport viewport(0, 0, size.width(), size.height());
glFramebufferTexture2DEXT(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
« no previous file with comments | « ui/gl/yuv_to_rgb_converter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698