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

Unified Diff: content/browser/renderer_host/image_transport_factory_android.cc

Issue 11194042: Implement TextureImageTransportSurface using texture mailbox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: send SurfaceRel from Destroy(), hold GLContext ref for cleanup so surface is compatible Created 8 years, 1 month 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
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 deef5008acdaf4dc33a3cb632fbf5e2989233a15..d1663a9ac0a419c92395fce456b2367ca191526b 100644
--- a/content/browser/renderer_host/image_transport_factory_android.cc
+++ b/content/browser/renderer_host/image_transport_factory_android.cc
@@ -10,6 +10,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"
namespace content {
@@ -48,11 +49,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;
}
@@ -63,10 +59,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() {
@@ -77,6 +69,27 @@ 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);
+ context_->flush();
+}
+
+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));

Powered by Google App Engine
This is Rietveld 408576698