| Index: content/browser/renderer_host/image_transport_factory_android.cc
|
| diff --git a/content/browser/renderer_host/image_transport_factory_android.cc b/content/browser/renderer_host/image_transport_factory_android.cc
|
| index a2b8f10edb2b22dff152ed1cffa5ed420539a402..558e4857704ef67e6fdf52c28f7836f2ef0d1879 100644
|
| --- a/content/browser/renderer_host/image_transport_factory_android.cc
|
| +++ b/content/browser/renderer_host/image_transport_factory_android.cc
|
| @@ -11,6 +11,7 @@
|
| #include "content/common/gpu/client/gl_helper.h"
|
| #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
|
| #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3D.h"
|
| +#include "third_party/khronos/GLES2/gl2.h"
|
| #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h"
|
|
|
| namespace content {
|
| @@ -30,6 +31,16 @@ class DirectGLImageTransportFactory : public ImageTransportFactoryAndroid {
|
| virtual void DestroySharedSurfaceHandle(
|
| const gfx::GLSurfaceHandle& handle) OVERRIDE {}
|
| virtual uint32_t InsertSyncPoint() OVERRIDE { return 0; }
|
| + virtual uint32_t CreateTexture() OVERRIDE {
|
| + return context_->createTexture();
|
| + }
|
| + virtual void DeleteTexture(uint32_t id) OVERRIDE {
|
| + context_->deleteTexture(id);
|
| + }
|
| + virtual void AcquireTexture(
|
| + uint32 texture_id, const signed char* mailbox_name) OVERRIDE {}
|
| + virtual void ReleaseTexture(
|
| + uint32 texture_id, const signed char* mailbox_name) OVERRIDE {}
|
| virtual WebKit::WebGraphicsContext3D* GetContext3D() OVERRIDE {
|
| return context_.get();
|
| }
|
| @@ -64,6 +75,12 @@ class CmdBufferImageTransportFactory : public ImageTransportFactoryAndroid {
|
| virtual void DestroySharedSurfaceHandle(
|
| const gfx::GLSurfaceHandle& handle) OVERRIDE;
|
| virtual uint32_t InsertSyncPoint() OVERRIDE;
|
| + virtual uint32_t CreateTexture() OVERRIDE;
|
| + virtual void DeleteTexture(uint32_t id) OVERRIDE;
|
| + virtual void AcquireTexture(
|
| + uint32 texture_id, const signed char* mailbox_name) OVERRIDE;
|
| + virtual void ReleaseTexture(
|
| + uint32 texture_id, const signed char* mailbox_name) OVERRIDE;
|
| virtual WebKit::WebGraphicsContext3D* GetContext3D() OVERRIDE {
|
| return context_.get();
|
| }
|
| @@ -105,11 +122,6 @@ CmdBufferImageTransportFactory::CreateSharedSurfaceHandle() {
|
| gfx::GLSurfaceHandle handle = gfx::GLSurfaceHandle(
|
| gfx::kNullPluginWindow, true);
|
| handle.parent_gpu_process_id = context_->GetGPUProcessID();
|
| - handle.parent_client_id = context_->GetChannelID();
|
| - handle.parent_context_id = context_->GetContextID();
|
| - handle.parent_texture_id[0] = context_->createTexture();
|
| - handle.parent_texture_id[1] = context_->createTexture();
|
| - handle.sync_point = context_->insertSyncPoint();
|
| context_->flush();
|
| return handle;
|
| }
|
| @@ -120,16 +132,33 @@ void CmdBufferImageTransportFactory::DestroySharedSurfaceHandle(
|
| NOTREACHED() << "Failed to make shared graphics context current";
|
| return;
|
| }
|
| -
|
| - context_->deleteTexture(handle.parent_texture_id[0]);
|
| - context_->deleteTexture(handle.parent_texture_id[1]);
|
| - context_->finish();
|
| }
|
|
|
| uint32_t CmdBufferImageTransportFactory::InsertSyncPoint() {
|
| return context_->insertSyncPoint();
|
| }
|
|
|
| +uint32_t CmdBufferImageTransportFactory::CreateTexture() {
|
| + return context_->createTexture();
|
| +}
|
| +
|
| +void CmdBufferImageTransportFactory::DeleteTexture(uint32_t id) {
|
| + context_->deleteTexture(id);
|
| +}
|
| +
|
| +void CmdBufferImageTransportFactory::AcquireTexture(
|
| + uint32 texture_id, const signed char* mailbox_name) {
|
| + context_->bindTexture(GL_TEXTURE_2D, texture_id);
|
| + context_->consumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox_name);
|
| + context_->flush();
|
| +}
|
| +
|
| +void CmdBufferImageTransportFactory::ReleaseTexture(
|
| + uint32 texture_id, const signed char* mailbox_name) {
|
| + context_->bindTexture(GL_TEXTURE_2D, texture_id);
|
| + context_->produceTextureCHROMIUM(GL_TEXTURE_2D, mailbox_name);
|
| +}
|
| +
|
| GLHelper* CmdBufferImageTransportFactory::GetGLHelper() {
|
| if (!gl_helper_.get())
|
| gl_helper_.reset(new GLHelper(GetContext3D(), NULL));
|
|
|