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

Unified Diff: ui/gl/gl_surface_x11.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_win.cc ('k') | ui/gl/init/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_surface_x11.cc
diff --git a/ui/gl/gl_surface_x11.cc b/ui/gl/gl_surface_x11.cc
index 916e9a009db1a298027fe8cb7b746b86640f2880..a3b403a535da9a806b327a0ba2b5ffb29bfe863c 100644
--- a/ui/gl/gl_surface_x11.cc
+++ b/ui/gl/gl_surface_x11.cc
@@ -4,93 +4,12 @@
#include "ui/gl/gl_surface.h"
-#include <stdint.h>
-
-#include <memory>
-
-#include "base/logging.h"
-#include "base/macros.h"
-#include "base/trace_event/trace_event.h"
#include "ui/gfx/native_widget_types.h"
-#include "ui/gl/gl_bindings.h"
-#include "ui/gl/gl_implementation.h"
+#include "ui/gfx/x/x11_types.h"
#include "ui/gl/gl_surface_egl.h"
-#include "ui/gl/gl_surface_egl_x11.h"
-#include "ui/gl/gl_surface_glx.h"
-#include "ui/gl/gl_surface_osmesa_x11.h"
-#include "ui/gl/gl_surface_stub.h"
namespace gl {
-scoped_refptr<GLSurface> GLSurface::CreateViewGLSurface(
- gfx::AcceleratedWidget window) {
- TRACE_EVENT0("gpu", "GLSurface::CreateViewGLSurface");
- switch (GetGLImplementation()) {
- case kGLImplementationOSMesaGL: {
- scoped_refptr<GLSurface> surface(new GLSurfaceOSMesaX11(window));
- if (!surface->Initialize())
- return NULL;
-
- return surface;
- }
- case kGLImplementationDesktopGL: {
- scoped_refptr<GLSurface> surface(new NativeViewGLSurfaceGLX(window));
- if (!surface->Initialize())
- return NULL;
-
- return surface;
- }
- case kGLImplementationEGLGLES2: {
- DCHECK(window != gfx::kNullAcceleratedWidget);
- scoped_refptr<GLSurface> surface(new NativeViewGLSurfaceEGLX11(window));
- if (!surface->Initialize())
- return NULL;
-
- return surface;
- }
- case kGLImplementationMockGL:
- return new GLSurfaceStub;
- default:
- NOTREACHED();
- return NULL;
- }
-}
-
-scoped_refptr<GLSurface> GLSurface::CreateOffscreenGLSurface(
- const gfx::Size& size) {
- TRACE_EVENT0("gpu", "GLSurface::CreateOffscreenGLSurface");
- switch (GetGLImplementation()) {
- case kGLImplementationOSMesaGL: {
- scoped_refptr<GLSurface> surface(
- new GLSurfaceOSMesa(SURFACE_OSMESA_RGBA, size));
- if (!surface->Initialize())
- return NULL;
-
- return surface;
- }
- case kGLImplementationDesktopGL: {
- scoped_refptr<GLSurface> surface(
- new UnmappedNativeViewGLSurfaceGLX(size));
- if (!surface->Initialize())
- return NULL;
-
- return surface;
- }
- case kGLImplementationEGLGLES2: {
- scoped_refptr<GLSurface> surface(new PbufferGLSurfaceEGL(size));
- if (!surface->Initialize())
- return NULL;
-
- return surface;
- }
- case kGLImplementationMockGL:
- return new GLSurfaceStub;
- default:
- NOTREACHED();
- return NULL;
- }
-}
-
EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() {
return gfx::GetXDisplay();
}
« no previous file with comments | « ui/gl/gl_surface_win.cc ('k') | ui/gl/init/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698