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

Unified Diff: ui/gl/gl_surface_wayland.cc

Issue 17265006: wayland patch for inspection Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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_egl.cc ('k') | ui/ui.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « ui/gl/gl_surface_egl.cc ('k') | ui/ui.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698