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

Unified Diff: ui/gl/gl_image_io_surface.mm

Issue 1874013002: Revert of Mac h264: Work around CGLContext+VTDecompresionSession deadlock (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/gl_image_io_surface.h ('k') | no next file » | 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 9c31c07b3efc4e845db4d87025a9853dbaa7d94b..3059333cc8896feb96c15f2b4147e3e927a3f417 100644
--- a/ui/gl/gl_image_io_surface.mm
+++ b/ui/gl/gl_image_io_surface.mm
@@ -6,9 +6,7 @@
#include <map>
-#include "base/callback_helpers.h"
#include "base/lazy_instance.h"
-#include "base/mac/bind_objc_block.h"
#include "base/mac/foundation_util.h"
#include "base/strings/stringize_macros.h"
#include "base/strings/stringprintf.h"
@@ -232,6 +230,7 @@
glDeleteShader(fragment_shader_);
glDeleteBuffersARB(1, &vertex_buffer_);
glDeleteFramebuffersEXT(1, &framebuffer_);
+ glDeleteTextures(2, yuv_textures_);
}
io_surface_.reset();
}
@@ -285,19 +284,6 @@
LOG(ERROR) << "YUV_420_BIPLANAR requires GL_TEXTURE_RECTANGLE_ARB target";
return false;
}
-
- // Ensure that all textures bound to IOSurfaces be destroyed before the
- // function exits. If they are not destroyed they may cause deadlocks between
- // VTDecompressionSession at CGLContextDestroy.
- // https://crbug.com/598388
- unsigned y_texture = 0;
- glGenTextures(1, &y_texture);
- unsigned uv_texture = 0;
- glGenTextures(1, &uv_texture);
- base::ScopedClosureRunner destroy_resources_runner(base::BindBlock(^{
- glDeleteTextures(1, &y_texture);
- glDeleteTextures(1, &uv_texture);
- }));
if (!framebuffer_) {
glGenFramebuffersEXT(1, &framebuffer_);
@@ -322,6 +308,10 @@
glUniform1i(y_sampler_location, 0);
glUniform1i(uv_sampler_location, 1);
+
+ glGenTextures(2, yuv_textures_);
+ DCHECK(yuv_textures_[0]);
+ DCHECK(yuv_textures_[1]);
}
CGLContextObj cgl_context =
@@ -339,7 +329,7 @@
gfx::ScopedActiveTexture active_texture0(GL_TEXTURE0);
gfx::ScopedTextureBinder texture_y_binder(GL_TEXTURE_RECTANGLE_ARB,
- y_texture);
+ yuv_textures_[0]);
cgl_error = CGLTexImageIOSurface2D(
cgl_context, GL_TEXTURE_RECTANGLE_ARB, GL_RED, size_.width(),
size_.height(), GL_RED, GL_UNSIGNED_BYTE, io_surface_.get(), 0);
@@ -351,7 +341,7 @@
{
gfx::ScopedActiveTexture active_texture1(GL_TEXTURE1);
gfx::ScopedTextureBinder texture_uv_binder(GL_TEXTURE_RECTANGLE_ARB,
- uv_texture);
+ yuv_textures_[1]);
cgl_error = CGLTexImageIOSurface2D(
cgl_context, GL_TEXTURE_RECTANGLE_ARB, GL_RG, size_.width() / 2,
size_.height() / 2, GL_RG, GL_UNSIGNED_BYTE, io_surface_.get(), 1);
« no previous file with comments | « ui/gl/gl_image_io_surface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698