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

Unified Diff: content/common/gpu/image_transport_surface_android.cc

Issue 10795058: Add GL surface creation for Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 | « content/common/gpu/gpu_surface_lookup.cc ('k') | content/content_common.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/image_transport_surface_android.cc
diff --git a/content/common/gpu/image_transport_surface_android.cc b/content/common/gpu/image_transport_surface_android.cc
index 36f58171bed0c14496633c59235a7499cfd03da0..3aa190c7de14b53b3af295aff50dc19bf070246f 100644
--- a/content/common/gpu/image_transport_surface_android.cc
+++ b/content/common/gpu/image_transport_surface_android.cc
@@ -2,14 +2,42 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/logging.h"
#include "content/common/gpu/image_transport_surface.h"
+#include "base/logging.h"
+#include "content/common/gpu/gpu_surface_lookup.h"
+#include "content/common/gpu/texture_image_transport_surface.h"
+#include "ui/gl/gl_surface_egl.h"
+
// static
scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface(
GpuChannelManager* manager,
GpuCommandBufferStub* stub,
const gfx::GLSurfaceHandle& handle) {
- NOTIMPLEMENTED();
- return NULL;
+ scoped_refptr<gfx::GLSurface> surface;
+ if (!handle.handle && handle.transport) {
+ DCHECK(handle.parent_client_id);
+ surface = new TextureImageTransportSurface(manager, stub, handle);
+ } else if (handle.handle == gfx::kDummyPluginWindow && !handle.transport) {
+ DCHECK(GpuSurfaceLookup::GetInstance());
+ ANativeWindow* window = GpuSurfaceLookup::GetInstance()->GetNativeWidget(
+ stub->surface_id());
+ DCHECK(window);
+ surface = new gfx::NativeViewGLSurfaceEGL(false, window);
+ if (!surface.get() || !surface->Initialize())
+ return NULL;
+
+ surface = new PassThroughImageTransportSurface(
+ manager, stub, surface.get(), handle.transport);
+ } else {
+ NOTIMPLEMENTED();
+ return NULL;
+ }
+
+ if (surface->Initialize())
+ return surface;
+ else {
+ LOG(ERROR) << "Failed to initialize ImageTransportSurface";
+ return NULL;
+ }
}
« no previous file with comments | « content/common/gpu/gpu_surface_lookup.cc ('k') | content/content_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698