From dfcdd1a2d99584d1ec44a280d8186150756dfc64 Mon Sep 17 00:00:00 2001 From: Chien Yang Date: Fri, 20 Apr 2007 22:53:31 +0000 Subject: Fixed to Issue 412 : Exception when updating Y_UP BY_REFERENCE image git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@828 ba19aa83-45c5-6ac9-afd3-db810772062c --- src/classes/share/javax/media/j3d/ImageComponentRetained.java | 8 +++++++- src/classes/share/javax/media/j3d/TextureRetained.java | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'src/classes/share') diff --git a/src/classes/share/javax/media/j3d/ImageComponentRetained.java b/src/classes/share/javax/media/j3d/ImageComponentRetained.java index 1fe18ef..7a1548a 100644 --- a/src/classes/share/javax/media/j3d/ImageComponentRetained.java +++ b/src/classes/share/javax/media/j3d/ImageComponentRetained.java @@ -383,9 +383,15 @@ abstract class ImageComponentRetained extends NodeComponentRetained { return imageType; } } + else { + // Fix to Issue 412. Force copy for RenderedImage of type not equal to BufferedImage. + return imageType; + } // System.err.println("This is a RenderedImage or BufferedImage with TYPE_CUSTOM. It imageType classification may not be correct."); - + // TODO : Dead code - need to clean up for 1.6 + assert false; + ColorModel cm = ri.getColorModel(); ColorSpace cs = cm.getColorSpace(); SampleModel sm = ri.getSampleModel(); diff --git a/src/classes/share/javax/media/j3d/TextureRetained.java b/src/classes/share/javax/media/j3d/TextureRetained.java index e23e8f9..8fad226 100644 --- a/src/classes/share/javax/media/j3d/TextureRetained.java +++ b/src/classes/share/javax/media/j3d/TextureRetained.java @@ -1317,6 +1317,8 @@ abstract class TextureRetained extends NodeComponentRetained { boolean useAsRaster = isUseAsRaster(); ImageComponentRetained.ImageData imageData = image.getImageData(useAsRaster); + + assert imageData != null; updateTextureImage(cv, face, numLevels, level, @@ -1325,6 +1327,8 @@ abstract class TextureRetained extends NodeComponentRetained { boundaryWidth, image.getImageDataTypeIntValue(), imageData.get()); + + // TODO : Dead code - need to clean up for 1.6 // Now take care of the RenderedImage (byRef and yUp) case. Note, if image // is a RenderedImage ( byRef and yUp), then imageData will be null @@ -1428,6 +1432,9 @@ abstract class TextureRetained extends NodeComponentRetained { } else { + assert false; + + // TODO : Dead code - need to clean up for 1.6 // System.err.println("RenderedImage subImage update"); // determine the first tile of the image -- cgit v1.2.3