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

Unified Diff: ui/gl/gl_image_io_surface.mm

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 | « no previous file | ui/gl/yuv_to_rgb_converter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_image_io_surface.mm
diff --git a/ui/gl/gl_image_io_surface.mm b/ui/gl/gl_image_io_surface.mm
index 68bf3c0d1d226f2227be1820657b34cfe8447984..3c30173af03bf1e78de2235e7d8f5b387197b9ff 100644
--- a/ui/gl/gl_image_io_surface.mm
+++ b/ui/gl/gl_image_io_surface.mm
@@ -281,20 +281,14 @@ GLenum ConvertRequestedInternalFormat(GLenum internalformat) {
// Note that state restoration is done explicitly instead of scoped binders to
// avoid https://crbug.com/601729.
GLint rgb_texture = 0;
- GLuint y_texture = 0;
- GLuint uv_texture = 0;
glGetIntegerv(GL_TEXTURE_BINDING_RECTANGLE_ARB, &rgb_texture);
- glGenTextures(1, &y_texture);
- glGenTextures(1, &uv_texture);
base::ScopedClosureRunner destroy_resources_runner(base::BindBlock(^{
- glDeleteTextures(1, &y_texture);
- glDeleteTextures(1, &uv_texture);
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, rgb_texture);
}));
CGLContextObj cgl_context = CGLGetCurrentContext();
{
- glBindTexture(GL_TEXTURE_RECTANGLE_ARB, y_texture);
+ glBindTexture(GL_TEXTURE_RECTANGLE_ARB, yuv_to_rgb_converter->y_texture());
CGLError cgl_error = CGLTexImageIOSurface2D(
cgl_context, GL_TEXTURE_RECTANGLE_ARB, GL_RED, size_.width(),
size_.height(), GL_RED, GL_UNSIGNED_BYTE, io_surface_, 0);
@@ -305,7 +299,7 @@ GLenum ConvertRequestedInternalFormat(GLenum internalformat) {
}
}
{
- glBindTexture(GL_TEXTURE_RECTANGLE_ARB, uv_texture);
+ glBindTexture(GL_TEXTURE_RECTANGLE_ARB, yuv_to_rgb_converter->uv_texture());
CGLError cgl_error = CGLTexImageIOSurface2D(
cgl_context, GL_TEXTURE_RECTANGLE_ARB, GL_RG, size_.width() / 2,
size_.height() / 2, GL_RG, GL_UNSIGNED_BYTE, io_surface_, 1);
@@ -317,7 +311,9 @@ GLenum ConvertRequestedInternalFormat(GLenum internalformat) {
}
yuv_to_rgb_converter->CopyYUV420ToRGB(
- GL_TEXTURE_RECTANGLE_ARB, y_texture, uv_texture, size_, rgb_texture);
+ GL_TEXTURE_RECTANGLE_ARB,
+ size_,
+ rgb_texture);
return true;
}
« no previous file with comments | « no previous file | ui/gl/yuv_to_rgb_converter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698