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

Unified Diff: ui/gl/gl_surface_android.cc

Issue 2047283003: Move GLSurface creation from //ui/gl to //ui/gl/init. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gl_context
Patch Set: Fix Ozone CreateViewGLSurface logic. Created 4 years, 6 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_surface.cc ('k') | ui/gl/gl_surface_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_surface_android.cc
diff --git a/ui/gl/gl_surface_android.cc b/ui/gl/gl_surface_android.cc
index 6480927a5296ab073687efd52ca13808cf9ffa4d..235097cc9cbee3ea070d933bd4c1f3f63d5df0f6 100644
--- a/ui/gl/gl_surface_android.cc
+++ b/ui/gl/gl_surface_android.cc
@@ -4,74 +4,11 @@
#include "ui/gl/gl_surface.h"
-#include "base/logging.h"
-#include "base/memory/ref_counted.h"
#include "third_party/khronos/EGL/egl.h"
-#include "ui/gfx/native_widget_types.h"
-#include "ui/gl/gl_implementation.h"
#include "ui/gl/gl_surface_egl.h"
-#include "ui/gl/gl_surface_osmesa.h"
-#include "ui/gl/gl_surface_stub.h"
namespace gl {
-// static
-scoped_refptr<GLSurface> GLSurface::CreateViewGLSurface(
- gfx::AcceleratedWidget window) {
- CHECK_NE(kGLImplementationNone, GetGLImplementation());
- if (GetGLImplementation() == kGLImplementationOSMesaGL) {
- scoped_refptr<GLSurface> surface(new GLSurfaceOSMesaHeadless());
- if (!surface->Initialize())
- return NULL;
- return surface;
- }
- DCHECK(GetGLImplementation() == kGLImplementationEGLGLES2);
- if (window != gfx::kNullAcceleratedWidget) {
- scoped_refptr<GLSurface> surface = new NativeViewGLSurfaceEGL(window);
- if (surface->Initialize())
- return surface;
- } else {
- scoped_refptr<GLSurface> surface = new GLSurfaceStub();
- if (surface->Initialize())
- return surface;
- }
- return NULL;
-}
-
-// static
-scoped_refptr<GLSurface> GLSurface::CreateOffscreenGLSurface(
- const gfx::Size& size) {
- CHECK_NE(kGLImplementationNone, GetGLImplementation());
- switch (GetGLImplementation()) {
- case kGLImplementationOSMesaGL: {
- scoped_refptr<GLSurface> surface(
- new GLSurfaceOSMesa(SURFACE_OSMESA_BGRA, size));
- if (!surface->Initialize())
- return NULL;
-
- return surface;
- }
- case kGLImplementationEGLGLES2: {
- scoped_refptr<GLSurface> surface;
- if (GLSurfaceEGL::IsEGLSurfacelessContextSupported() &&
- (size.width() == 0 && size.height() == 0)) {
- surface = new SurfacelessEGL(size);
- } else {
- surface = new PbufferGLSurfaceEGL(size);
- }
-
- if (!surface->Initialize())
- return NULL;
- return surface;
- }
- case kGLImplementationMockGL:
- return new GLSurfaceStub;
- default:
- NOTREACHED();
- return NULL;
- }
-}
-
EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() {
return EGL_DEFAULT_DISPLAY;
}
« no previous file with comments | « ui/gl/gl_surface.cc ('k') | ui/gl/gl_surface_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698