8159495: Fix Index Offsets

Reviewed-by: flar, serb, mschoene
This commit is contained in:
Phil Race 2016-07-05 10:29:31 -07:00
parent bb951288f4
commit 573f0c765c
4 changed files with 17 additions and 8 deletions

View File

@ -102,10 +102,13 @@ public abstract class X11SurfaceDataProxy extends SurfaceDataProxy
int w, int h) int w, int h)
{ {
if (cachedData == null) { if (cachedData == null) {
// Bitmask will be created lazily during the blit phase try {
cachedData = X11SurfaceData.createData(x11gc, w, h, // Bitmask will be created lazily during the blit phase
x11gc.getColorModel(), cachedData = X11SurfaceData.createData(x11gc, w, h,
null, 0, getTransparency()); x11gc.getColorModel(),
null, 0, getTransparency());
} catch (OutOfMemoryError oome) {
}
} }
return cachedData; return cachedData;
} }

View File

@ -138,6 +138,9 @@ public class XRPMBlitLoops {
vImg = (SunVolatileImage) dst.getGraphicsConfig().createCompatibleVolatileImage(w, h, src.getTransparency()); vImg = (SunVolatileImage) dst.getGraphicsConfig().createCompatibleVolatileImage(w, h, src.getTransparency());
vImg.setAccelerationPriority(1.0f); vImg.setAccelerationPriority(1.0f);
if (!(vImg.getDestSurface() instanceof XRSurfaceData)) {
throw new InvalidPipeException("Could not create XRSurfaceData");
}
if (src.getTransparency() == SurfaceData.OPAQUE) { if (src.getTransparency() == SurfaceData.OPAQUE) {
rgbTmpPM = new WeakReference<SunVolatileImage>(vImg); rgbTmpPM = new WeakReference<SunVolatileImage>(vImg);
} else { } else {

View File

@ -59,9 +59,12 @@ public class XRSurfaceDataProxy extends SurfaceDataProxy implements Transparency
public SurfaceData validateSurfaceData(SurfaceData srcData, public SurfaceData validateSurfaceData(SurfaceData srcData,
SurfaceData cachedData, int w, int h) { SurfaceData cachedData, int w, int h) {
if (cachedData == null) { if (cachedData == null) {
cachedData = XRSurfaceData.createData(xrgc, w, h, try {
xrgc.getColorModel(), null, 0, cachedData = XRSurfaceData.createData(xrgc, w, h,
getTransparency(), true); xrgc.getColorModel(), null, 0,
getTransparency(), true);
} catch (OutOfMemoryError oome) {
}
} }
return cachedData; return cachedData;
} }

View File

@ -441,7 +441,7 @@ jboolean XShared_initSurface(JNIEnv *env, X11SDOps *xsdo, jint depth, jint width
* width , height must be nonzero otherwise XCreatePixmap * width , height must be nonzero otherwise XCreatePixmap
* generates BadValue in error_handler * generates BadValue in error_handler
*/ */
if (width <= 0 || height <= 0) { if (width <= 0 || height <= 0 || width > 32767 || height > 32767) {
JNU_ThrowOutOfMemoryError(env, JNU_ThrowOutOfMemoryError(env,
"Can't create offscreen surface"); "Can't create offscreen surface");
return JNI_FALSE; return JNI_FALSE;