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

Unified Diff: ui/gfx/gl/gl_surface_linux.cc

Issue 8549024: wayland: integrate gl_surface_wayland.cc into gl_surface_linux.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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
« no previous file with comments | « ui/gfx/gl/gl.gyp ('k') | ui/gfx/gl/gl_surface_wayland.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/gl/gl_surface_linux.cc
diff --git a/ui/gfx/gl/gl_surface_linux.cc b/ui/gfx/gl/gl_surface_linux.cc
index 3abb81c7e119cbaf490c6e2ec22c29c3ab53cf5f..cf067c2bee39c68da14fb5d2cd67a51a475b9ea8 100644
--- a/ui/gfx/gl/gl_surface_linux.cc
+++ b/ui/gfx/gl/gl_surface_linux.cc
@@ -6,16 +6,22 @@
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
+#if !defined(USE_WAYLAND)
#include "third_party/mesa/MesaLib/include/GL/osmesa.h"
+#endif
#include "ui/gfx/gl/gl_bindings.h"
#include "ui/gfx/gl/gl_implementation.h"
#include "ui/gfx/gl/gl_surface_egl.h"
+#if !defined(USE_WAYLAND)
#include "ui/gfx/gl/gl_surface_glx.h"
#include "ui/gfx/gl/gl_surface_osmesa.h"
+#endif
#include "ui/gfx/gl/gl_surface_stub.h"
namespace gfx {
+#if !defined(USE_WAYLAND)
+
namespace {
Display* g_osmesa_display;
} // namespace anonymous
@@ -48,26 +54,30 @@ class NativeViewGLSurfaceOSMesa : public GLSurfaceOSMesa {
DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceOSMesa);
};
+#endif // !USE_WAYLAND
+
bool GLSurface::InitializeOneOffInternal() {
switch (GetGLImplementation()) {
+#if !defined(USE_WAYLAND)
case kGLImplementationDesktopGL:
if (!GLSurfaceGLX::InitializeOneOff()) {
LOG(ERROR) << "GLSurfaceGLX::InitializeOneOff failed.";
return false;
}
break;
- case kGLImplementationEGLGLES2:
- if (!GLSurfaceEGL::InitializeOneOff()) {
- LOG(ERROR) << "GLSurfaceEGL::InitializeOneOff failed.";
- return false;
- }
- break;
case kGLImplementationOSMesaGL:
if (!NativeViewGLSurfaceOSMesa::InitializeOneOff()) {
LOG(ERROR) << "NativeViewGLSurfaceOSMesa::InitializeOneOff failed.";
return false;
}
break;
+#endif
+ case kGLImplementationEGLGLES2:
+ if (!GLSurfaceEGL::InitializeOneOff()) {
+ LOG(ERROR) << "GLSurfaceEGL::InitializeOneOff failed.";
+ return false;
+ }
+ break;
default:
break;
}
@@ -75,6 +85,8 @@ bool GLSurface::InitializeOneOffInternal() {
return true;
}
+#if !defined(USE_WAYLAND)
+
NativeViewGLSurfaceOSMesa::NativeViewGLSurfaceOSMesa(
gfx::PluginWindowHandle window)
: GLSurfaceOSMesa(OSMESA_BGRA, gfx::Size()),
@@ -231,6 +243,8 @@ bool NativeViewGLSurfaceOSMesa::UpdateSize() {
return true;
}
+#endif // !USE_WAYLAND
+
scoped_refptr<GLSurface> GLSurface::CreateViewGLSurface(
bool software,
gfx::PluginWindowHandle window) {
@@ -238,6 +252,7 @@ scoped_refptr<GLSurface> GLSurface::CreateViewGLSurface(
return NULL;
switch (GetGLImplementation()) {
+#if !defined(USE_WAYLAND)
case kGLImplementationOSMesaGL: {
scoped_refptr<GLSurface> surface(
new NativeViewGLSurfaceOSMesa(window));
@@ -246,17 +261,18 @@ scoped_refptr<GLSurface> GLSurface::CreateViewGLSurface(
return surface;
}
- case kGLImplementationEGLGLES2: {
- scoped_refptr<GLSurface> surface(new NativeViewGLSurfaceEGL(
- false, window));
+ case kGLImplementationDesktopGL: {
+ scoped_refptr<GLSurface> surface(new NativeViewGLSurfaceGLX(
+ window));
if (!surface->Initialize())
return NULL;
return surface;
}
- case kGLImplementationDesktopGL: {
- scoped_refptr<GLSurface> surface(new NativeViewGLSurfaceGLX(
- window));
+#endif
+ case kGLImplementationEGLGLES2: {
+ scoped_refptr<GLSurface> surface(new NativeViewGLSurfaceEGL(
+ false, window));
if (!surface->Initialize())
return NULL;
@@ -277,6 +293,7 @@ scoped_refptr<GLSurface> GLSurface::CreateOffscreenGLSurface(
return NULL;
switch (GetGLImplementation()) {
+#if !defined(USE_WAYLAND)
case kGLImplementationOSMesaGL: {
scoped_refptr<GLSurface> surface(new GLSurfaceOSMesa(OSMESA_RGBA,
size));
@@ -285,15 +302,16 @@ scoped_refptr<GLSurface> GLSurface::CreateOffscreenGLSurface(
return surface;
}
- case kGLImplementationEGLGLES2: {
- scoped_refptr<GLSurface> surface(new PbufferGLSurfaceEGL(false, size));
+ case kGLImplementationDesktopGL: {
+ scoped_refptr<GLSurface> surface(new PbufferGLSurfaceGLX(size));
if (!surface->Initialize())
return NULL;
return surface;
}
- case kGLImplementationDesktopGL: {
- scoped_refptr<GLSurface> surface(new PbufferGLSurfaceGLX(size));
+#endif
+ case kGLImplementationEGLGLES2: {
+ scoped_refptr<GLSurface> surface(new PbufferGLSurfaceEGL(false, size));
if (!surface->Initialize())
return NULL;
« no previous file with comments | « ui/gfx/gl/gl.gyp ('k') | ui/gfx/gl/gl_surface_wayland.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698