From 03697923f27df06343f8885f1c1b70bf4b3af9c2 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 29 Feb 2012 01:35:37 +0100 Subject: Software Rasterizer: Add 'Mesa X11' to GL_RENDERER list. EGLDrawable: Remove getWidth()/getHeight() EGL surface queries. EGLDrawable: Remove getWidth()/getHeight() EGL surface queries. This code is not only redunant, since the surface dimension is known in the NativeWindow surface returned by GLDrawableImpl., but also causes an exception since the EGL surface might not be realized at the time it's dimension is being queried. --- src/jogl/classes/jogamp/opengl/GLContextImpl.java | 6 ++++-- src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java | 14 +++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'src/jogl/classes/jogamp/opengl') diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java index 3d3c387e1..5cbe3a44d 100644 --- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java @@ -1102,8 +1102,10 @@ public abstract class GLContextImpl extends GLContext { Thread.dumpStack(); } else { glRenderer = glRenderer.toLowerCase(); - isHardwareRasterizer = ! ( glRenderer.contains("software") /* Mesa3D */ || - glRenderer.contains("softpipe") /* Gallium */ ); + isHardwareRasterizer = ! ( glRenderer.contains("software") /* Mesa3D */ || + glRenderer.contains("mesa x11") /* Mesa3D*/ || + glRenderer.contains("softpipe") /* Gallium */ + ); } } } diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java index a74d7d610..5c73b822c 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java @@ -218,17 +218,17 @@ public abstract class EGLDrawable extends GLDrawableImpl { protected final void swapBuffersImpl() { // single-buffer is already filtered out @ GLDrawableImpl#swapBuffers() if(!EGL.eglSwapBuffers(eglDisplay, eglSurface)) { - if(DEBUG) { - System.err.println("eglSwapBuffers failed:"); - Thread.dumpStack(); - } + throw new GLException("Error swapping buffers, eglError "+toHexString(EGL.eglGetError())+", "+this); } } + /** + * Surface not realizes yet (onscreen) .. Quering EGL surface size only makes sense for external drawable. + * Leave it here for later impl. of an EGLExternalDrawable. public int getWidth() { int[] tmp = new int[1]; if (!EGL.eglQuerySurface(eglDisplay, eglSurface, EGL.EGL_WIDTH, tmp, 0)) { - throw new GLException("Error querying surface width"); + throw new GLException("Error querying surface width, eglError "+toHexString(EGL.eglGetError())); } return tmp[0]; } @@ -236,10 +236,10 @@ public abstract class EGLDrawable extends GLDrawableImpl { public int getHeight() { int[] tmp = new int[1]; if (!EGL.eglQuerySurface(eglDisplay, eglSurface, EGL.EGL_HEIGHT, tmp, 0)) { - throw new GLException("Error querying surface height"); + throw new GLException("Error querying surface height, eglError "+toHexString(EGL.eglGetError())); } return tmp[0]; - } + } */ public GLDynamicLookupHelper getGLDynamicLookupHelper() { if (getGLProfile().usesNativeGLES2()) { -- cgit v1.2.3