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

Unified Diff: ui/gl/gl_surface_egl.cc

Issue 22277004: Add gfx::SurfaceFactoryWebview (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: directly set/unset factory Created 7 years, 4 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 | « ui/gl/gl.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_surface_egl.cc
diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc
index 8c29342ab408e2f0e10fb0ff370807d449c5646c..5376b6ceb9abf7bb5016ae8c3fc31c9266d57e17 100644
--- a/ui/gl/gl_surface_egl.cc
+++ b/ui/gl/gl_surface_egl.cc
@@ -25,6 +25,10 @@
#include "ui/gl/gl_switches.h"
#include "ui/gl/scoped_make_current.h"
+#if defined(OS_ANDROID)
+#include "ui/gl/android/surface_factory_android.h"
+#endif
+
#if defined(USE_X11)
extern "C" {
#include <X11/Xlib.h>
@@ -647,7 +651,15 @@ GLSurface::CreateViewGLSurface(gfx::AcceleratedWidget window) {
if(surface->Initialize(sync_provider))
return surface;
} else {
- scoped_refptr<GLSurface> surface = new GLSurfaceStub();
+ scoped_refptr<GLSurface> surface;
+
+#if defined(OS_ANDROID)
+ if (SurfaceFactoryAndroid* factory = SurfaceFactoryAndroid::GetInstance())
+ surface = factory->CreateNonOwnedViewSurface();
no sievers 2013/08/06 20:31:29 null check factory or tests will crash
boliu 2013/08/06 21:10:06 That's what the if is for :)
+#endif
+
+ if (!surface)
+ surface = new GLSurfaceStub();
if (surface->Initialize())
return surface;
}
« no previous file with comments | « ui/gl/gl.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698