question: @ Override boolean isPaintValid ( SunGraphics2D sg2d ) { TexturePaint paint = ( TexturePaint ) sg2d . paint ; OGLSurfaceData dstData = ( OGLSurfaceData ) sg2d . surfaceData ; BufferedImage bi = paint . getImage ( ) ; if ( ! dstData . isTexNonPow2Available ( ) ) { int imgw = bi . getWidth ( ) ; int imgh = bi . getHeight ( ) ; if ( ( imgw & ( imgw - 1 ) ) != 0 || ( imgh & ( imgh - 1 ) ) != 0 ) { return false ; } } SurfaceData srcData = dstData . getSourceSurfaceData ( bi , SunGraphics2D . TRANSFORM_ISIDENT , CompositeType . SrcOver , null ) ; if ( ! ( srcData instanceof OGLSurfaceData ) ) { srcData = dstData . getSourceSurfaceData ( bi , SunGraphics2D . TRANSFORM_ISIDENT , CompositeType . SrcOver , null ) ; if ( ! ( srcData instanceof OGLSurfaceData ) ) { return false ; } } OGLSurfaceData oglData = ( OGLSurfaceData ) srcData ; if ( oglData . getType ( ) != OGLSurfaceData . TEXTURE ) { return false ; } return true ; }
target:  Returns true if the given TexturePaint instance can be used by the accelerated OGLPaints.Texture implementation.  A TexturePaint is considered valid if the following conditions are met: - the texture image dimensions are power-of-two (or the GL_ARB_texture_non_power_of_two extension is present) - the texture image can be (or is already) cached in an OpenGL texture object