Search in sources :

Example 11 with Blit

use of sun.java2d.loops.Blit in project jdk8u_jdk by JetBrains.

the class OGLAnyCompositeBlit method Transform.

@Override
public synchronized void Transform(SurfaceData src, SurfaceData dst, Composite comp, Region clip, AffineTransform at, int hint, int srcx, int srcy, int dstx, int dsty, int width, int height) {
    Blit convertsrc = Blit.getFromCache(src.getSurfaceType(), CompositeType.SrcNoEa, SurfaceType.IntArgbPre);
    // use cached intermediate surface, if available
    final SurfaceData cachedSrc = srcTmp != null ? srcTmp.get() : null;
    // convert source to IntArgbPre
    src = convertFrom(convertsrc, src, srcx, srcy, width, height, cachedSrc, BufferedImage.TYPE_INT_ARGB_PRE);
    // transform IntArgbPre intermediate surface to OpenGL surface
    performop.Transform(src, dst, comp, clip, at, hint, 0, 0, dstx, dsty, width, height);
    if (src != cachedSrc) {
        // cache the intermediate surface
        srcTmp = new WeakReference<>(src);
    }
}
Also used : SurfaceData(sun.java2d.SurfaceData) Blit(sun.java2d.loops.Blit) TransformBlit(sun.java2d.loops.TransformBlit) ScaledBlit(sun.java2d.loops.ScaledBlit)

Example 12 with Blit

use of sun.java2d.loops.Blit in project jdk8u_jdk by JetBrains.

the class OGLAnyCompositeBlit method Blit.

public synchronized void Blit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int sx, int sy, int dx, int dy, int w, int h) {
    Blit convertsrc = Blit.getFromCache(src.getSurfaceType(), CompositeType.SrcNoEa, SurfaceType.IntArgbPre);
    SurfaceData cachedSrc = null;
    if (srcTmp != null) {
        // use cached intermediate surface, if available
        cachedSrc = (SurfaceData) srcTmp.get();
    }
    // convert source to IntArgbPre
    src = convertFrom(convertsrc, src, sx, sy, w, h, cachedSrc, BufferedImage.TYPE_INT_ARGB_PRE);
    // copy IntArgbPre intermediate surface to OpenGL surface
    performop.Blit(src, dst, comp, clip, 0, 0, dx, dy, w, h);
    if (src != cachedSrc) {
        // cache the intermediate surface
        srcTmp = new WeakReference(src);
    }
}
Also used : SurfaceData(sun.java2d.SurfaceData) WeakReference(java.lang.ref.WeakReference) Blit(sun.java2d.loops.Blit) TransformBlit(sun.java2d.loops.TransformBlit) ScaledBlit(sun.java2d.loops.ScaledBlit)

Example 13 with Blit

use of sun.java2d.loops.Blit in project jdk8u_jdk by JetBrains.

the class D3DSurfaceToGDIWindowSurfaceTransform method Transform.

@Override
public synchronized void Transform(SurfaceData src, SurfaceData dst, Composite comp, Region clip, AffineTransform at, int hint, int srcx, int srcy, int dstx, int dsty, int width, int height) {
    Blit convertsrc = Blit.getFromCache(src.getSurfaceType(), CompositeType.SrcNoEa, SurfaceType.IntArgbPre);
    // use cached intermediate surface, if available
    final SurfaceData cachedSrc = srcTmp != null ? srcTmp.get() : null;
    // convert source to IntArgbPre
    src = convertFrom(convertsrc, src, srcx, srcy, width, height, cachedSrc, BufferedImage.TYPE_INT_ARGB_PRE);
    // transform IntArgbPre intermediate surface to D3D surface
    performop.Transform(src, dst, comp, clip, at, hint, 0, 0, dstx, dsty, width, height);
    if (src != cachedSrc) {
        // cache the intermediate surface
        srcTmp = new WeakReference<>(src);
    }
}
Also used : SurfaceData(sun.java2d.SurfaceData) GDIWindowSurfaceData(sun.java2d.windows.GDIWindowSurfaceData) Blit(sun.java2d.loops.Blit) TransformBlit(sun.java2d.loops.TransformBlit) ScaledBlit(sun.java2d.loops.ScaledBlit)

Example 14 with Blit

use of sun.java2d.loops.Blit in project jdk8u_jdk by JetBrains.

the class D3DSurfaceToGDIWindowSurfaceTransform method register.

static void register() {
    Blit blitIntArgbPreToSurface = new D3DSwToSurfaceBlit(SurfaceType.IntArgbPre, D3DSurfaceData.ST_INT_ARGB_PRE);
    Blit blitIntArgbPreToTexture = new D3DSwToTextureBlit(SurfaceType.IntArgbPre, D3DSurfaceData.ST_INT_ARGB_PRE);
    TransformBlit transformBlitIntArgbPreToSurface = new D3DSwToSurfaceTransform(SurfaceType.IntArgbPre, D3DSurfaceData.ST_INT_ARGB_PRE);
    GraphicsPrimitive[] primitives = { // prevent D3DSurface -> Screen blits
    new D3DSurfaceToGDIWindowSurfaceBlit(), new D3DSurfaceToGDIWindowSurfaceScale(), new D3DSurfaceToGDIWindowSurfaceTransform(), // surface->surface ops
    new D3DSurfaceToSurfaceBlit(), new D3DSurfaceToSurfaceScale(), new D3DSurfaceToSurfaceTransform(), // render-to-texture surface->surface ops
    new D3DRTTSurfaceToSurfaceBlit(), new D3DRTTSurfaceToSurfaceScale(), new D3DRTTSurfaceToSurfaceTransform(), // surface->sw ops
    new D3DSurfaceToSwBlit(SurfaceType.IntArgb, D3DSurfaceData.ST_INT_ARGB), // sw->surface ops
    blitIntArgbPreToSurface, new D3DSwToSurfaceBlit(SurfaceType.IntArgb, D3DSurfaceData.ST_INT_ARGB), new D3DSwToSurfaceBlit(SurfaceType.IntRgb, D3DSurfaceData.ST_INT_RGB), new D3DSwToSurfaceBlit(SurfaceType.IntBgr, D3DSurfaceData.ST_INT_BGR), new D3DSwToSurfaceBlit(SurfaceType.ThreeByteBgr, D3DSurfaceData.ST_3BYTE_BGR), new D3DSwToSurfaceBlit(SurfaceType.Ushort565Rgb, D3DSurfaceData.ST_USHORT_565_RGB), new D3DSwToSurfaceBlit(SurfaceType.Ushort555Rgb, D3DSurfaceData.ST_USHORT_555_RGB), new D3DSwToSurfaceBlit(SurfaceType.ByteIndexed, D3DSurfaceData.ST_BYTE_INDEXED), //                                   D3DSurfaceData.ST_BYTE_INDEXED_BM),
    new D3DGeneralBlit(D3DSurfaceData.D3DSurface, CompositeType.AnyAlpha, blitIntArgbPreToSurface), new D3DSwToSurfaceScale(SurfaceType.IntArgb, D3DSurfaceData.ST_INT_ARGB), new D3DSwToSurfaceScale(SurfaceType.IntArgbPre, D3DSurfaceData.ST_INT_ARGB_PRE), new D3DSwToSurfaceScale(SurfaceType.IntRgb, D3DSurfaceData.ST_INT_RGB), new D3DSwToSurfaceScale(SurfaceType.IntBgr, D3DSurfaceData.ST_INT_BGR), new D3DSwToSurfaceScale(SurfaceType.ThreeByteBgr, D3DSurfaceData.ST_3BYTE_BGR), new D3DSwToSurfaceScale(SurfaceType.Ushort565Rgb, D3DSurfaceData.ST_USHORT_565_RGB), new D3DSwToSurfaceScale(SurfaceType.Ushort555Rgb, D3DSurfaceData.ST_USHORT_555_RGB), new D3DSwToSurfaceScale(SurfaceType.ByteIndexed, D3DSurfaceData.ST_BYTE_INDEXED), new D3DSwToSurfaceTransform(SurfaceType.IntArgb, D3DSurfaceData.ST_INT_ARGB), new D3DSwToSurfaceTransform(SurfaceType.IntRgb, D3DSurfaceData.ST_INT_RGB), new D3DSwToSurfaceTransform(SurfaceType.IntBgr, D3DSurfaceData.ST_INT_BGR), new D3DSwToSurfaceTransform(SurfaceType.ThreeByteBgr, D3DSurfaceData.ST_3BYTE_BGR), new D3DSwToSurfaceTransform(SurfaceType.Ushort565Rgb, D3DSurfaceData.ST_USHORT_565_RGB), new D3DSwToSurfaceTransform(SurfaceType.Ushort555Rgb, D3DSurfaceData.ST_USHORT_555_RGB), new D3DSwToSurfaceTransform(SurfaceType.ByteIndexed, D3DSurfaceData.ST_BYTE_INDEXED), //                                        D3DSurfaceData.ST_BYTE_INDEXED_BM),
    transformBlitIntArgbPreToSurface, new D3DGeneralTransformedBlit(transformBlitIntArgbPreToSurface), // texture->surface ops
    new D3DTextureToSurfaceBlit(), new D3DTextureToSurfaceScale(), new D3DTextureToSurfaceTransform(), // sw->texture ops
    blitIntArgbPreToTexture, new D3DSwToTextureBlit(SurfaceType.IntRgb, D3DSurfaceData.ST_INT_RGB), new D3DSwToTextureBlit(SurfaceType.IntArgb, D3DSurfaceData.ST_INT_ARGB), new D3DSwToTextureBlit(SurfaceType.IntBgr, D3DSurfaceData.ST_INT_BGR), new D3DSwToTextureBlit(SurfaceType.ThreeByteBgr, D3DSurfaceData.ST_3BYTE_BGR), new D3DSwToTextureBlit(SurfaceType.Ushort565Rgb, D3DSurfaceData.ST_USHORT_565_RGB), new D3DSwToTextureBlit(SurfaceType.Ushort555Rgb, D3DSurfaceData.ST_USHORT_555_RGB), new D3DSwToTextureBlit(SurfaceType.ByteIndexed, D3DSurfaceData.ST_BYTE_INDEXED), //                                   D3DSurfaceData.ST_BYTE_INDEXED_BM),
    new D3DGeneralBlit(D3DSurfaceData.D3DTexture, CompositeType.SrcNoEa, blitIntArgbPreToTexture) };
    GraphicsPrimitiveMgr.register(primitives);
}
Also used : TransformBlit(sun.java2d.loops.TransformBlit) GraphicsPrimitive(sun.java2d.loops.GraphicsPrimitive) Blit(sun.java2d.loops.Blit) TransformBlit(sun.java2d.loops.TransformBlit) ScaledBlit(sun.java2d.loops.ScaledBlit)

Aggregations

Blit (sun.java2d.loops.Blit)14 ScaledBlit (sun.java2d.loops.ScaledBlit)9 SurfaceData (sun.java2d.SurfaceData)7 TransformBlit (sun.java2d.loops.TransformBlit)7 BufferedImage (java.awt.image.BufferedImage)3 MaskBlit (sun.java2d.loops.MaskBlit)3 SurfaceType (sun.java2d.loops.SurfaceType)3 WritableRaster (java.awt.image.WritableRaster)2 WeakReference (java.lang.ref.WeakReference)2 BufImgSurfaceData (sun.awt.image.BufImgSurfaceData)2 CompositeType (sun.java2d.loops.CompositeType)2 GraphicsPrimitive (sun.java2d.loops.GraphicsPrimitive)2 GDIWindowSurfaceData (sun.java2d.windows.GDIWindowSurfaceData)2 AlphaComposite (java.awt.AlphaComposite)1 Composite (java.awt.Composite)1 CompositeContext (java.awt.CompositeContext)1 GradientPaint (java.awt.GradientPaint)1 LinearGradientPaint (java.awt.LinearGradientPaint)1 Paint (java.awt.Paint)1 PaintContext (java.awt.PaintContext)1