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

Unified Diff: ui/gl/gl_surface_egl.cc

Issue 202683003: gl: Clean up gfx::AcceleratedWidget usage in gl_surface_egl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: typofix Created 6 years, 9 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.h ('k') | ui/gl/gl_surface_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_surface_egl.cc
diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc
index a2beccdfc1dbbad16a0ae675463d2c26da6f43e0..4005913c5811e3a979b2d56a12dd2946e362b8d2 100644
--- a/ui/gl/gl_surface_egl.cc
+++ b/ui/gl/gl_surface_egl.cc
@@ -330,7 +330,7 @@ bool GLSurfaceEGL::IsCreateContextRobustnessSupported() {
GLSurfaceEGL::~GLSurfaceEGL() {}
-NativeViewGLSurfaceEGL::NativeViewGLSurfaceEGL(gfx::AcceleratedWidget window)
+NativeViewGLSurfaceEGL::NativeViewGLSurfaceEGL(EGLNativeWindowType window)
: window_(window),
surface_(NULL),
supports_post_sub_buffer_(false),
@@ -350,11 +350,6 @@ bool NativeViewGLSurfaceEGL::Initialize(
scoped_ptr<VSyncProvider> sync_provider) {
DCHECK(!surface_);
- if (window_ == kNullAcceleratedWidget) {
rjkroege 2014/03/20 17:52:04 why did you take this out?
spang 2014/03/20 19:06:44 I don't believe there is a NULL value for EGLNativ
- LOG(ERROR) << "Trying to create surface without window.";
- return false;
- }
-
if (!GetDisplay()) {
LOG(ERROR) << "Trying to create surface with invalid display.";
return false;
@@ -773,7 +768,7 @@ SurfacelessEGL::~SurfacelessEGL() {
// provider is not available.
class GLSurfaceOSMesaHeadless : public GLSurfaceOSMesa {
public:
- explicit GLSurfaceOSMesaHeadless(gfx::AcceleratedWidget window);
+ explicit GLSurfaceOSMesaHeadless();
rjkroege 2014/03/20 17:52:04 why not EGLNativeWindow?
spang 2014/03/20 19:06:44 We could, but why pass a value that is not used?
virtual bool IsOffscreen() OVERRIDE;
virtual bool SwapBuffers() OVERRIDE;
@@ -790,10 +785,8 @@ bool GLSurfaceOSMesaHeadless::IsOffscreen() { return false; }
bool GLSurfaceOSMesaHeadless::SwapBuffers() { return true; }
-GLSurfaceOSMesaHeadless::GLSurfaceOSMesaHeadless(gfx::AcceleratedWidget window)
- : GLSurfaceOSMesa(OSMESA_BGRA, gfx::Size(1, 1)) {
- DCHECK(window);
-}
+GLSurfaceOSMesaHeadless::GLSurfaceOSMesaHeadless()
+ : GLSurfaceOSMesa(OSMESA_BGRA, gfx::Size(1, 1)) {}
GLSurfaceOSMesaHeadless::~GLSurfaceOSMesaHeadless() { Destroy(); }
@@ -816,22 +809,27 @@ scoped_refptr<GLSurface>
GLSurface::CreateViewGLSurface(gfx::AcceleratedWidget window) {
if (GetGLImplementation() == kGLImplementationOSMesaGL) {
- scoped_refptr<GLSurface> surface(new GLSurfaceOSMesaHeadless(window));
+ scoped_refptr<GLSurface> surface(new GLSurfaceOSMesaHeadless());
if (!surface->Initialize())
return NULL;
return surface;
}
DCHECK(GetGLImplementation() == kGLImplementationEGLGLES2);
- if (window) {
+ if (window != kNullAcceleratedWidget) {
+ EGLNativeWindowType egl_window;
scoped_refptr<NativeViewGLSurfaceEGL> surface;
scoped_ptr<VSyncProvider> sync_provider;
#if defined(USE_OZONE)
- window = gfx::SurfaceFactoryOzone::GetInstance()->RealizeAcceleratedWidget(
- window);
+ egl_window =
+ gfx::SurfaceFactoryOzone::GetInstance()->RealizeAcceleratedWidget(
+ window);
sync_provider =
- gfx::SurfaceFactoryOzone::GetInstance()->CreateVSyncProvider(window);
+ gfx::SurfaceFactoryOzone::GetInstance()->CreateVSyncProvider(
+ egl_window);
+#else
+ egl_window = window;
#endif
- surface = new NativeViewGLSurfaceEGL(window);
+ surface = new NativeViewGLSurfaceEGL(egl_window);
if(surface->Initialize(sync_provider.Pass()))
return surface;
} else {
« no previous file with comments | « ui/gl/gl_surface_egl.h ('k') | ui/gl/gl_surface_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698