src/share/classes/sun/java2d/opengl/OGLBufImgOps.java

Print this page




  61                 return false;
  62             }
  63         } else if (biop instanceof LookupOp) {
  64             if (!isLookupOpValid((LookupOp)biop, img)) {
  65                 return false;
  66             }
  67         } else {
  68             // No acceleration for other BufferedImageOps (yet)
  69             return false;
  70         }
  71 
  72         SurfaceData dstData = sg.surfaceData;
  73         if (!(dstData instanceof OGLSurfaceData) ||
  74             (sg.interpolationType == AffineTransformOp.TYPE_BICUBIC) ||
  75             (sg.compositeState > SunGraphics2D.COMP_ALPHA))
  76         {
  77             return false;
  78         }
  79 
  80         SurfaceData srcData =
  81             dstData.getSourceSurfaceData(img, sg.TRANSFORM_ISIDENT,
  82                                          CompositeType.SrcOver, null);
  83         if (!(srcData instanceof OGLSurfaceData)) {
  84             // REMIND: this hack tries to ensure that we have a cached texture
  85             srcData =
  86                 dstData.getSourceSurfaceData(img, sg.TRANSFORM_ISIDENT,
  87                                              CompositeType.SrcOver, null);
  88             if (!(srcData instanceof OGLSurfaceData)) {
  89                 return false;
  90             }
  91         }
  92 
  93         // Verify that the source surface is actually a texture and
  94         // that the operation is supported
  95         OGLSurfaceData oglSrc = (OGLSurfaceData)srcData;
  96         OGLGraphicsConfig gc = oglSrc.getOGLGraphicsConfig();
  97         if (oglSrc.getType() != OGLSurfaceData.TEXTURE ||
  98             !gc.isCapPresent(CAPS_EXT_BIOP_SHADER))
  99         {
 100             return false;
 101         }
 102 
 103         int sw = img.getWidth();
 104         int sh = img.getHeight();
 105         OGLBlitLoops.IsoBlit(srcData, dstData,
 106                              img, biop,


  61                 return false;
  62             }
  63         } else if (biop instanceof LookupOp) {
  64             if (!isLookupOpValid((LookupOp)biop, img)) {
  65                 return false;
  66             }
  67         } else {
  68             // No acceleration for other BufferedImageOps (yet)
  69             return false;
  70         }
  71 
  72         SurfaceData dstData = sg.surfaceData;
  73         if (!(dstData instanceof OGLSurfaceData) ||
  74             (sg.interpolationType == AffineTransformOp.TYPE_BICUBIC) ||
  75             (sg.compositeState > SunGraphics2D.COMP_ALPHA))
  76         {
  77             return false;
  78         }
  79 
  80         SurfaceData srcData =
  81             dstData.getSourceSurfaceData(img, SunGraphics2D.TRANSFORM_ISIDENT,
  82                                          CompositeType.SrcOver, null);
  83         if (!(srcData instanceof OGLSurfaceData)) {
  84             // REMIND: this hack tries to ensure that we have a cached texture
  85             srcData =
  86                 dstData.getSourceSurfaceData(img, SunGraphics2D.TRANSFORM_ISIDENT,
  87                                              CompositeType.SrcOver, null);
  88             if (!(srcData instanceof OGLSurfaceData)) {
  89                 return false;
  90             }
  91         }
  92 
  93         // Verify that the source surface is actually a texture and
  94         // that the operation is supported
  95         OGLSurfaceData oglSrc = (OGLSurfaceData)srcData;
  96         OGLGraphicsConfig gc = oglSrc.getOGLGraphicsConfig();
  97         if (oglSrc.getType() != OGLSurfaceData.TEXTURE ||
  98             !gc.isCapPresent(CAPS_EXT_BIOP_SHADER))
  99         {
 100             return false;
 101         }
 102 
 103         int sw = img.getWidth();
 104         int sh = img.getHeight();
 105         OGLBlitLoops.IsoBlit(srcData, dstData,
 106                              img, biop,