Index: ui/gl/gl_surface_wayland.cc |
diff --git a/ui/gl/gl_surface_mac.cc b/ui/gl/gl_surface_wayland.cc |
similarity index 57% |
copy from ui/gl/gl_surface_mac.cc |
copy to ui/gl/gl_surface_wayland.cc |
index 099ff9e33889b864833b7ec196d80b5260ae269c..d11d67036a6bbf0c36b0239cc6a5a28d0317f760 100644 |
--- a/ui/gl/gl_surface_mac.cc |
+++ b/ui/gl/gl_surface_wayland.cc |
@@ -1,4 +1,4 @@ |
-// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Copyright 2013 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
@@ -7,31 +7,26 @@ |
#include "base/debug/trace_event.h" |
#include "base/logging.h" |
#include "base/memory/scoped_ptr.h" |
-#include "third_party/mesa/src/include/GL/osmesa.h" |
+#include "base/message_loop.h" |
#include "ui/gl/gl_bindings.h" |
#include "ui/gl/gl_implementation.h" |
-#include "ui/gl/gl_surface_cgl.h" |
-#include "ui/gl/gl_surface_osmesa.h" |
+#include "ui/gl/gl_surface_egl.h" |
#include "ui/gl/gl_surface_stub.h" |
-#if defined(USE_AURA) |
-#include "ui/gl/gl_surface_nsview.h" |
-#endif |
- |
namespace gfx { |
bool GLSurface::InitializeOneOffInternal() { |
switch (GetGLImplementation()) { |
- case kGLImplementationDesktopGL: |
- case kGLImplementationAppleGL: |
- if (!GLSurfaceCGL::InitializeOneOff()) { |
- LOG(ERROR) << "GLSurfaceCGL::InitializeOneOff failed."; |
+ case kGLImplementationEGLGLES2: |
+ if (!GLSurfaceEGL::InitializeOneOff()) { |
+ LOG(ERROR) << "GLSurfaceEGL::InitializeOneOff failed."; |
return false; |
} |
break; |
default: |
break; |
} |
+ |
return true; |
} |
@@ -39,14 +34,13 @@ scoped_refptr<GLSurface> GLSurface::CreateViewGLSurface( |
bool software, |
gfx::AcceleratedWidget window) { |
TRACE_EVENT0("gpu", "GLSurface::CreateViewGLSurface"); |
-#if defined(USE_AURA) |
if (software) |
return NULL; |
switch (GetGLImplementation()) { |
- case kGLImplementationDesktopGL: |
- case kGLImplementationAppleGL: { |
- scoped_refptr<GLSurface> surface(new GLSurfaceNSView(window)); |
+ case kGLImplementationEGLGLES2: { |
+ scoped_refptr<GLSurface> surface(new NativeViewGLSurfaceEGL( |
+ false, window)); |
if (!surface->Initialize()) |
return NULL; |
@@ -58,9 +52,6 @@ scoped_refptr<GLSurface> GLSurface::CreateViewGLSurface( |
NOTREACHED(); |
return NULL; |
} |
-#else |
- return CreateOffscreenGLSurface(software, gfx::Size(1,1)); |
-#endif |
} |
scoped_refptr<GLSurface> GLSurface::CreateOffscreenGLSurface( |
@@ -71,17 +62,8 @@ scoped_refptr<GLSurface> GLSurface::CreateOffscreenGLSurface( |
return NULL; |
switch (GetGLImplementation()) { |
- case kGLImplementationOSMesaGL: { |
- scoped_refptr<GLSurface> surface(new GLSurfaceOSMesa(OSMESA_RGBA, |
- size)); |
- if (!surface->Initialize()) |
- return NULL; |
- |
- return surface; |
- } |
- case kGLImplementationDesktopGL: |
- case kGLImplementationAppleGL: { |
- scoped_refptr<GLSurface> surface(new NoOpGLSurfaceCGL(size)); |
+ case kGLImplementationEGLGLES2: { |
+ scoped_refptr<GLSurface> surface(new PbufferGLSurfaceEGL(false, size)); |
if (!surface->Initialize()) |
return NULL; |