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 d7e0505eba68bd68ac938909ea89596661abfc7b..2c54b68cb6d637a6ae70488bbcf0de09cb6bd764 100644 |
--- a/content/browser/renderer_host/image_transport_factory_android.cc |
+++ b/content/browser/renderer_host/image_transport_factory_android.cc |
@@ -9,6 +9,7 @@ |
#include "content/common/gpu/gpu_process_launch_causes.h" |
#include "content/common/gpu/client/gl_helper.h" |
#include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
+#include "third_party/khronos/GLES2/gl2.h" |
#include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3D.h" |
using content::BrowserGpuChannelHostFactory; |
@@ -50,11 +51,6 @@ gfx::GLSurfaceHandle ImageTransportFactoryAndroid::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; |
} |
@@ -65,10 +61,6 @@ void ImageTransportFactoryAndroid::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 ImageTransportFactoryAndroid::InsertSyncPoint() { |
@@ -79,6 +71,26 @@ WebKit::WebGraphicsContext3D* ImageTransportFactoryAndroid::GetContext3D() { |
return context_.get(); |
} |
+uint32_t ImageTransportFactoryAndroid::CreateTexture() { |
+ return context_->createTexture(); |
+} |
+ |
+void ImageTransportFactoryAndroid::DeleteTexture(uint32_t id) { |
+ context_->deleteTexture(id); |
+} |
+ |
+void ImageTransportFactoryAndroid::AcquireTexture( |
+ uint32 texture_id, const signed char* mailbox_name) { |
+ context_->bindTexture(GL_TEXTURE_2D, texture_id); |
+ context_->consumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox_name); |
+} |
+ |
+void ImageTransportFactoryAndroid::ReleaseTexture( |
+ uint32 texture_id, const signed char* mailbox_name) { |
+ context_->bindTexture(GL_TEXTURE_2D, texture_id); |
+ context_->produceTextureCHROMIUM(GL_TEXTURE_2D, mailbox_name); |
+} |
+ |
GLHelper* ImageTransportFactoryAndroid::GetGLHelper() { |
if (!gl_helper_.get()) |
gl_helper_.reset(new GLHelper(GetContext3D(), NULL)); |