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

Print this page




  43     protected void renderImageXform(SunGraphics2D sg, Image img,
  44                                     AffineTransform tx, int interpType,
  45                                     int sx1, int sy1, int sx2, int sy2,
  46                                     Color bgColor)
  47     {
  48         // punt to the MediaLib-based transformImage() in the superclass if:
  49         //     - bicubic interpolation is specified
  50         //     - a background color is specified and will be used
  51         //     - the source surface is neither a texture nor render-to-texture
  52         //       surface, and a non-default interpolation hint is specified
  53         //       (we can only control the filtering for texture->surface
  54         //       copies)
  55         //         REMIND: we should tweak the sw->texture->surface
  56         //         transform case to handle filtering appropriately
  57         //         (see 4841762)...
  58         //     - an appropriate TransformBlit primitive could not be found
  59         if (interpType != AffineTransformOp.TYPE_BICUBIC) {
  60             SurfaceData dstData = sg.surfaceData;
  61             SurfaceData srcData =
  62                 dstData.getSourceSurfaceData(img,
  63                                              sg.TRANSFORM_GENERIC,
  64                                              sg.imageComp,
  65                                              bgColor);
  66 
  67             if (srcData != null &&
  68                 !isBgOperation(srcData, bgColor) &&
  69                 (srcData.getSurfaceType() == OGLSurfaceData.OpenGLTexture ||
  70                  srcData.getSurfaceType() == OGLSurfaceData.OpenGLSurfaceRTT ||
  71                  interpType == AffineTransformOp.TYPE_NEAREST_NEIGHBOR))
  72             {
  73                 SurfaceType srcType = srcData.getSurfaceType();
  74                 SurfaceType dstType = dstData.getSurfaceType();
  75                 TransformBlit blit = TransformBlit.getFromCache(srcType,
  76                                                                 sg.imageComp,
  77                                                                 dstType);
  78 
  79                 if (blit != null) {
  80                     blit.Transform(srcData, dstData,
  81                                    sg.composite, sg.getCompClip(),
  82                                    tx, interpType,
  83                                    sx1, sy1, 0, 0, sx2-sx1, sy2-sy1);




  43     protected void renderImageXform(SunGraphics2D sg, Image img,
  44                                     AffineTransform tx, int interpType,
  45                                     int sx1, int sy1, int sx2, int sy2,
  46                                     Color bgColor)
  47     {
  48         // punt to the MediaLib-based transformImage() in the superclass if:
  49         //     - bicubic interpolation is specified
  50         //     - a background color is specified and will be used
  51         //     - the source surface is neither a texture nor render-to-texture
  52         //       surface, and a non-default interpolation hint is specified
  53         //       (we can only control the filtering for texture->surface
  54         //       copies)
  55         //         REMIND: we should tweak the sw->texture->surface
  56         //         transform case to handle filtering appropriately
  57         //         (see 4841762)...
  58         //     - an appropriate TransformBlit primitive could not be found
  59         if (interpType != AffineTransformOp.TYPE_BICUBIC) {
  60             SurfaceData dstData = sg.surfaceData;
  61             SurfaceData srcData =
  62                 dstData.getSourceSurfaceData(img,
  63                                              SunGraphics2D.TRANSFORM_GENERIC,
  64                                              sg.imageComp,
  65                                              bgColor);
  66 
  67             if (srcData != null &&
  68                 !isBgOperation(srcData, bgColor) &&
  69                 (srcData.getSurfaceType() == OGLSurfaceData.OpenGLTexture ||
  70                  srcData.getSurfaceType() == OGLSurfaceData.OpenGLSurfaceRTT ||
  71                  interpType == AffineTransformOp.TYPE_NEAREST_NEIGHBOR))
  72             {
  73                 SurfaceType srcType = srcData.getSurfaceType();
  74                 SurfaceType dstType = dstData.getSurfaceType();
  75                 TransformBlit blit = TransformBlit.getFromCache(srcType,
  76                                                                 sg.imageComp,
  77                                                                 dstType);
  78 
  79                 if (blit != null) {
  80                     blit.Transform(srcData, dstData,
  81                                    sg.composite, sg.getCompClip(),
  82                                    tx, interpType,
  83                                    sx1, sy1, 0, 0, sx2-sx1, sy2-sy1);