From 653015cc1618a83baefca14e0600e68ba4681da3 Mon Sep 17 00:00:00 2001 From: Chien Yang Date: Wed, 7 Mar 2007 19:36:01 +0000 Subject: Fix to Issue 456 : NPOT background ( maybe raster) fail to work if HW doesn't support NPOT texture git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@788 ba19aa83-45c5-6ac9-afd3-db810772062c --- src/classes/share/javax/media/j3d/ImageComponentRetained.java | 3 +++ src/classes/share/javax/media/j3d/TextureRetained.java | 2 +- 2 files changed, 4 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 5f6473b..84efb72 100644 --- a/src/classes/share/javax/media/j3d/ImageComponentRetained.java +++ b/src/classes/share/javax/media/j3d/ImageComponentRetained.java @@ -103,6 +103,9 @@ abstract class ImageComponentRetained extends NodeComponentRetained { // and graphics driver doesn't support NPOT extension. private ImageData imageDataPowerOfTwo; private AffineTransformOp powerOfTwoATOp; + // The following flag means that if the image is non-power-of-two and the + // card doesn't support NPOT texture, we will scale the image to a power + // of two. private boolean enforceNonPowerOfTwoSupport = false; private boolean usedByOffScreenCanvas = false; diff --git a/src/classes/share/javax/media/j3d/TextureRetained.java b/src/classes/share/javax/media/j3d/TextureRetained.java index 62afe95..eb13480 100644 --- a/src/classes/share/javax/media/j3d/TextureRetained.java +++ b/src/classes/share/javax/media/j3d/TextureRetained.java @@ -1102,7 +1102,7 @@ abstract class TextureRetained extends NodeComponentRetained { } private boolean isEnabled(Canvas3D cv) { - if(widthOrHeightIsNPOT && + if(widthOrHeightIsNPOT && !isUseAsRaster() && ((cv.textureExtendedFeatures & Canvas3D.TEXTURE_NON_POWER_OF_TWO ) == 0)) { return false; } -- cgit v1.2.3