From 3a59bb92550acf8bf455007bb482f573a05d9448 Mon Sep 17 00:00:00 2001 From: "sievers@chromium.org" Date: Thu, 22 Aug 2013 18:54:08 +0000 Subject: Support stream textures with the synchronous compositor This adds a thread-safe StreamTextureManager for GLInProcessContext. It further adds some plumbing for the webkit thread to be able to create a StreamTextureFactory from the main thread (see render_view_impl.cc) with the ability to extract the thread-safe SurfaceTexture(Bridge) for a given stream. This is nothing but a crazy amount of plumbing to achieve this: - StreamTexture::Update() i.e. SurfaceTexture::updateTexImage needs to happen on the GL thread with a current context - The StreamTextureFactory and Proxy are referenced from the WebmediaPlayer instance which lives on the main thread - The callback for invalidating the video is posted to the compositor thread directly (here: UI thread) bypassing the main thread BUG=239760 NOTRY=True Review URL: https://chromiumcodereview.appspot.com/23234003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@219057 0039d316-1c4b-4281-b951-d872f2087c98 --- .../gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc | 5 +++++ .../common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h | 3 +++ 2 files changed, 8 insertions(+) (limited to 'webkit') diff --git a/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc b/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc index 66c7a53..9207ef9 100644 --- a/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc +++ b/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc @@ -1117,6 +1117,11 @@ DELEGATE_TO_GL_2(bindTexImage2DCHROMIUM, BindTexImage2DCHROMIUM, DELEGATE_TO_GL_2(releaseTexImage2DCHROMIUM, ReleaseTexImage2DCHROMIUM, WGC3Denum, WGC3Dint) +DELEGATE_TO_GL_1R(createStreamTextureCHROMIUM, CreateStreamTextureCHROMIUM, + WebGLId, WebGLId) +DELEGATE_TO_GL_1(destroyStreamTextureCHROMIUM, DestroyStreamTextureCHROMIUM, + WebGLId) + void* WebGraphicsContext3DInProcessCommandBufferImpl::mapBufferCHROMIUM( WGC3Denum target, WGC3Denum access) { ClearContext(); diff --git a/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h b/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h index f96607d..d763e14 100644 --- a/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h +++ b/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h @@ -468,6 +468,9 @@ class WEBKIT_GPU_EXPORT WebGraphicsContext3DInProcessCommandBufferImpl virtual void bindTexImage2DCHROMIUM(WGC3Denum target, WGC3Dint imageId); virtual void releaseTexImage2DCHROMIUM(WGC3Denum target, WGC3Dint imageId); + virtual WebGLId createStreamTextureCHROMIUM(WebGLId texture); + virtual void destroyStreamTextureCHROMIUM(WebGLId texture); + virtual void texStorage2DEXT( WGC3Denum target, WGC3Dint levels, WGC3Duint internalformat, WGC3Dint width, WGC3Dint height); -- cgit v1.1