@Override public final int getSurfaceHeight(final ProxySurface s) { return surface.getSurfaceHeight(); }
@Override public int getSurfaceHeight() { return surface.getSurfaceHeight(); }
@Override public final int getSurfaceHeight(final ProxySurface s) { return upstreamSurface.getSurfaceHeight(); }
@Override public String toString() { final String us_s = null != surface ? ( surface.getClass().getName() + ": 0x" + Long.toHexString(surface.getSurfaceHandle()) + " " +surface.getSurfaceWidth() + "x" + surface.getSurfaceHeight() ) : "nil"; return getClass().getSimpleName()+"["+upstream+", "+us_s+"]"; }
@Override public String toString() { final String us_s; final int sw, sh; if( null != upstreamSurface ) { us_s = upstreamSurface.getClass().getName() + ": 0x" + Long.toHexString(upstreamSurface.getSurfaceHandle()); sw = upstreamSurface.getSurfaceWidth(); sh = upstreamSurface.getSurfaceHeight(); } else { us_s = "nil"; sw = -1; sh = -1; } return "EGLUpstreamSurfaceHook[ "+ sw + "x" + sh + ", " + us_s+ "]"; }
final boolean useY = surface.getSurfaceWidth() >= surface.getSurfaceHeight(); // use smallest dimension switch ( eventType ) { case MouseEvent.EVENT_MOUSE_PRESSED: { final int d = Math.abs(edge0-edge1); final int dd = d - zoomLastEdgeDist; final float screenEdge = useY ? surface.getSurfaceHeight() : surface.getSurfaceWidth(); final float delta = dd / screenEdge; // [-1..1] if(DEBUG) {
private void createPixmap() { final NativeSurface ns = getNativeSurface(); final X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration) ns.getGraphicsConfiguration(); final XVisualInfo vis = config.getXVisualInfo(); final int bitsPerPixel = vis.getDepth(); final AbstractGraphicsScreen aScreen = config.getScreen(); final AbstractGraphicsDevice aDevice = aScreen.getDevice(); final long dpy = aDevice.getHandle(); final int screen = aScreen.getIndex(); pixmap = X11Lib.XCreatePixmap(dpy, X11Lib.RootWindow(dpy, screen), surface.getSurfaceWidth(), surface.getSurfaceHeight(), bitsPerPixel); if (pixmap == 0) { throw new GLException("XCreatePixmap failed"); } final long drawable = GLX.glXCreateGLXPixmap(dpy, vis, pixmap); if (drawable == 0) { X11Lib.XFreePixmap(dpy, pixmap); pixmap = 0; throw new GLException("glXCreateGLXPixmap failed"); } ((MutableSurface)ns).setSurfaceHandle(drawable); if (DEBUG) { System.err.println(getThreadName()+": Created pixmap " + toHexString(pixmap) + ", GLXPixmap " + toHexString(drawable) + ", display " + toHexString(dpy)); } }