Java Code Examples for sun.java2d.loops.Blit#getFromCache()
The following examples show how to use
sun.java2d.loops.Blit#getFromCache() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: D3DBlitLoops.java From hottub with GNU General Public License v2.0 | 6 votes |
@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); } }
Example 2
Source File: D3DBlitLoops.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
@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); } }
Example 3
Source File: D3DBlitLoops.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
@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); } }
Example 4
Source File: OGLBlitLoops.java From Bytecoder with Apache License 2.0 | 6 votes |
@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); } }
Example 5
Source File: OGLBlitLoops.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
@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); } }
Example 6
Source File: OGLBlitLoops.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
@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); } }
Example 7
Source File: X11PMBlitLoops.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public void Blit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int sx, int sy, int dx, int dy, int w, int h) { Blit blit = Blit.getFromCache(src.getSurfaceType(), CompositeType.SrcNoEa, dstType); blit.Blit(src, dst, comp, clip, sx, sy, dx, dy, w, h); updateBitmask(src, dst, src.getColorModel() instanceof IndexColorModel); }
Example 8
Source File: SurfaceDataProxy.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * This is the default implementation for updating the cached * SurfaceData from the source (primary) SurfaceData. * A simple Blit is used to copy the pixels from the source to * the destination SurfaceData. * A subclass can override this implementation if a more complex * operation is required to update its cached copies. */ public void updateSurfaceData(SurfaceData srcData, SurfaceData dstData, int w, int h) { SurfaceType srcType = srcData.getSurfaceType(); SurfaceType dstType = dstData.getSurfaceType(); Blit blit = Blit.getFromCache(srcType, CompositeType.SrcNoEa, dstType); blit.Blit(srcData, dstData, AlphaComposite.Src, null, 0, 0, 0, 0, w, h); dstData.markDirty(); }
Example 9
Source File: X11PMBlitLoops.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
public void Blit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int sx, int sy, int dx, int dy, int w, int h) { Blit blit = Blit.getFromCache(src.getSurfaceType(), CompositeType.SrcNoEa, dstType); blit.Blit(src, dst, comp, clip, sx, sy, dx, dy, w, h); updateBitmask(src, dst, src.getColorModel() instanceof IndexColorModel); }
Example 10
Source File: X11PMBlitLoops.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
public void Blit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int sx, int sy, int dx, int dy, int w, int h) { Blit blit = Blit.getFromCache(src.getSurfaceType(), CompositeType.SrcNoEa, dstType); blit.Blit(src, dst, comp, clip, sx, sy, dx, dy, w, h); updateBitmask(src, dst, src.getColorModel() instanceof IndexColorModel); }
Example 11
Source File: OGLBlitLoops.java From hottub with GNU General Public License v2.0 | 5 votes |
private synchronized void complexClipBlit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int sx, int sy, int dx, int dy, int w, int h) { SurfaceData cachedSrc = null; if (srcTmp != null) { // use cached intermediate surface, if available cachedSrc = srcTmp.get(); } // We can convert argb_pre data from OpenGL surface in two places: // - During OpenGL surface -> SW blit // - During SW -> SW blit // The first one is faster when we use opaque OGL surface, because in // this case we simply skip conversion and use color components as is. // Because of this we align intermediate buffer type with type of // destination not source. final int type = typeval == OGLSurfaceData.PF_INT_ARGB_PRE ? BufferedImage.TYPE_INT_ARGB_PRE : BufferedImage.TYPE_INT_ARGB; src = convertFrom(this, src, sx, sy, w, h, cachedSrc, type); // copy intermediate SW to destination SW using complex clip final Blit performop = Blit.getFromCache(src.getSurfaceType(), CompositeType.SrcNoEa, dst.getSurfaceType()); performop.Blit(src, dst, comp, clip, 0, 0, dx, dy, w, h); if (src != cachedSrc) { // cache the intermediate surface srcTmp = new WeakReference<>(src); } }
Example 12
Source File: SurfaceDataProxy.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * This is the default implementation for updating the cached * SurfaceData from the source (primary) SurfaceData. * A simple Blit is used to copy the pixels from the source to * the destination SurfaceData. * A subclass can override this implementation if a more complex * operation is required to update its cached copies. */ public void updateSurfaceData(SurfaceData srcData, SurfaceData dstData, int w, int h) { SurfaceType srcType = srcData.getSurfaceType(); SurfaceType dstType = dstData.getSurfaceType(); Blit blit = Blit.getFromCache(srcType, CompositeType.SrcNoEa, dstType); blit.Blit(srcData, dstData, AlphaComposite.Src, null, 0, 0, 0, 0, w, h); dstData.markDirty(); }
Example 13
Source File: SurfaceDataProxy.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * This is the default implementation for updating the cached * SurfaceData from the source (primary) SurfaceData. * A simple Blit is used to copy the pixels from the source to * the destination SurfaceData. * A subclass can override this implementation if a more complex * operation is required to update its cached copies. */ public void updateSurfaceData(SurfaceData srcData, SurfaceData dstData, int w, int h) { SurfaceType srcType = srcData.getSurfaceType(); SurfaceType dstType = dstData.getSurfaceType(); Blit blit = Blit.getFromCache(srcType, CompositeType.SrcNoEa, dstType); blit.Blit(srcData, dstData, AlphaComposite.Src, null, 0, 0, 0, 0, w, h); dstData.markDirty(); }
Example 14
Source File: OGLBlitLoops.java From Bytecoder with Apache License 2.0 | 5 votes |
private synchronized void complexClipBlit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int sx, int sy, int dx, int dy, int w, int h) { SurfaceData cachedSrc = null; if (srcTmp != null) { // use cached intermediate surface, if available cachedSrc = srcTmp.get(); } // We can convert argb_pre data from OpenGL surface in two places: // - During OpenGL surface -> SW blit // - During SW -> SW blit // The first one is faster when we use opaque OGL surface, because in // this case we simply skip conversion and use color components as is. // Because of this we align intermediate buffer type with type of // destination not source. final int type = typeval == OGLSurfaceData.PF_INT_ARGB_PRE ? BufferedImage.TYPE_INT_ARGB_PRE : BufferedImage.TYPE_INT_ARGB; src = convertFrom(this, src, sx, sy, w, h, cachedSrc, type); // copy intermediate SW to destination SW using complex clip final Blit performop = Blit.getFromCache(src.getSurfaceType(), CompositeType.SrcNoEa, dst.getSurfaceType()); performop.Blit(src, dst, comp, clip, 0, 0, dx, dy, w, h); if (src != cachedSrc) { // cache the intermediate surface srcTmp = new WeakReference<>(src); } }
Example 15
Source File: SurfaceDataProxy.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * This is the default implementation for updating the cached * SurfaceData from the source (primary) SurfaceData. * A simple Blit is used to copy the pixels from the source to * the destination SurfaceData. * A subclass can override this implementation if a more complex * operation is required to update its cached copies. */ public void updateSurfaceData(SurfaceData srcData, SurfaceData dstData, int w, int h) { SurfaceType srcType = srcData.getSurfaceType(); SurfaceType dstType = dstData.getSurfaceType(); Blit blit = Blit.getFromCache(srcType, CompositeType.SrcNoEa, dstType); blit.Blit(srcData, dstData, AlphaComposite.Src, null, 0, 0, 0, 0, w, h); dstData.markDirty(); }
Example 16
Source File: BufferedMaskBlit.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
@Override public void MaskBlit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int srcx, int srcy, int dstx, int dsty, int width, int height, byte[] mask, int maskoff, int maskscan) { if (width <= 0 || height <= 0) { return; } if (mask == null) { // no mask involved; delegate to regular blit loop if (blitop == null) { blitop = Blit.getFromCache(src.getSurfaceType(), CompositeType.AnyAlpha, this.getDestType()); } blitop.Blit(src, dst, comp, clip, srcx, srcy, dstx, dsty, width, height); return; } AlphaComposite acomp = (AlphaComposite)comp; if (acomp.getRule() != AlphaComposite.SRC_OVER) { comp = AlphaComposite.SrcOver; } rq.lock(); try { validateContext(dst, comp, clip); RenderBuffer buf = rq.getBuffer(); int totalBytesRequired = 20 + (width * height * 4); /* * REMIND: we should fix this so that it works with tiles that * are larger than the entire buffer, but the native * OGL/D3DMaskBlit isn't even prepared for tiles larger * than 32x32 pixels, so there's no urgency here... */ rq.ensureCapacity(totalBytesRequired); // enqueue parameters and tile pixels int newpos = enqueueTile(buf.getAddress(), buf.position(), src, src.getNativeOps(), srcTypeVal, mask, mask.length, maskoff, maskscan, srcx, srcy, dstx, dsty, width, height); buf.position(newpos); } finally { rq.unlock(); } }
Example 17
Source File: BufferedMaskBlit.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
@Override public void MaskBlit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int srcx, int srcy, int dstx, int dsty, int width, int height, byte[] mask, int maskoff, int maskscan) { if (width <= 0 || height <= 0) { return; } if (mask == null) { // no mask involved; delegate to regular blit loop if (blitop == null) { blitop = Blit.getFromCache(src.getSurfaceType(), CompositeType.AnyAlpha, this.getDestType()); } blitop.Blit(src, dst, comp, clip, srcx, srcy, dstx, dsty, width, height); return; } AlphaComposite acomp = (AlphaComposite)comp; if (acomp.getRule() != AlphaComposite.SRC_OVER) { comp = AlphaComposite.SrcOver; } rq.lock(); try { validateContext(dst, comp, clip); RenderBuffer buf = rq.getBuffer(); int totalBytesRequired = 20 + (width * height * 4); /* * REMIND: we should fix this so that it works with tiles that * are larger than the entire buffer, but the native * OGL/D3DMaskBlit isn't even prepared for tiles larger * than 32x32 pixels, so there's no urgency here... */ rq.ensureCapacity(totalBytesRequired); // enqueue parameters and tile pixels int newpos = enqueueTile(buf.getAddress(), buf.position(), src, src.getNativeOps(), srcTypeVal, mask, mask.length, maskoff, maskscan, srcx, srcy, dstx, dsty, width, height); buf.position(newpos); } finally { rq.unlock(); } }
Example 18
Source File: BufferedMaskBlit.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
@Override public void MaskBlit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int srcx, int srcy, int dstx, int dsty, int width, int height, byte[] mask, int maskoff, int maskscan) { if (width <= 0 || height <= 0) { return; } if (mask == null) { // no mask involved; delegate to regular blit loop if (blitop == null) { blitop = Blit.getFromCache(src.getSurfaceType(), CompositeType.AnyAlpha, this.getDestType()); } blitop.Blit(src, dst, comp, clip, srcx, srcy, dstx, dsty, width, height); return; } AlphaComposite acomp = (AlphaComposite)comp; if (acomp.getRule() != AlphaComposite.SRC_OVER) { comp = AlphaComposite.SrcOver; } rq.lock(); try { validateContext(dst, comp, clip); RenderBuffer buf = rq.getBuffer(); int totalBytesRequired = 20 + (width * height * 4); /* * REMIND: we should fix this so that it works with tiles that * are larger than the entire buffer, but the native * OGL/D3DMaskBlit isn't even prepared for tiles larger * than 32x32 pixels, so there's no urgency here... */ rq.ensureCapacity(totalBytesRequired); // enqueue parameters and tile pixels int newpos = enqueueTile(buf.getAddress(), buf.position(), src, src.getNativeOps(), srcTypeVal, mask, mask.length, maskoff, maskscan, srcx, srcy, dstx, dsty, width, height); buf.position(newpos); } finally { rq.unlock(); } }
Example 19
Source File: BufferedMaskBlit.java From hottub with GNU General Public License v2.0 | 4 votes |
@Override public void MaskBlit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int srcx, int srcy, int dstx, int dsty, int width, int height, byte[] mask, int maskoff, int maskscan) { if (width <= 0 || height <= 0) { return; } if (mask == null) { // no mask involved; delegate to regular blit loop if (blitop == null) { blitop = Blit.getFromCache(src.getSurfaceType(), CompositeType.AnyAlpha, this.getDestType()); } blitop.Blit(src, dst, comp, clip, srcx, srcy, dstx, dsty, width, height); return; } AlphaComposite acomp = (AlphaComposite)comp; if (acomp.getRule() != AlphaComposite.SRC_OVER) { comp = AlphaComposite.SrcOver; } rq.lock(); try { validateContext(dst, comp, clip); RenderBuffer buf = rq.getBuffer(); int totalBytesRequired = 20 + (width * height * 4); /* * REMIND: we should fix this so that it works with tiles that * are larger than the entire buffer, but the native * OGL/D3DMaskBlit isn't even prepared for tiles larger * than 32x32 pixels, so there's no urgency here... */ rq.ensureCapacity(totalBytesRequired); // enqueue parameters and tile pixels int newpos = enqueueTile(buf.getAddress(), buf.position(), src, src.getNativeOps(), srcTypeVal, mask, mask.length, maskoff, maskscan, srcx, srcy, dstx, dsty, width, height); buf.position(newpos); } finally { rq.unlock(); } }
Example 20
Source File: BufferedMaskBlit.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
@Override public void MaskBlit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int srcx, int srcy, int dstx, int dsty, int width, int height, byte[] mask, int maskoff, int maskscan) { if (width <= 0 || height <= 0) { return; } if (mask == null) { // no mask involved; delegate to regular blit loop if (blitop == null) { blitop = Blit.getFromCache(src.getSurfaceType(), CompositeType.AnyAlpha, this.getDestType()); } blitop.Blit(src, dst, comp, clip, srcx, srcy, dstx, dsty, width, height); return; } AlphaComposite acomp = (AlphaComposite)comp; if (acomp.getRule() != AlphaComposite.SRC_OVER) { comp = AlphaComposite.SrcOver; } rq.lock(); try { validateContext(dst, comp, clip); RenderBuffer buf = rq.getBuffer(); int totalBytesRequired = 20 + (width * height * 4); /* * REMIND: we should fix this so that it works with tiles that * are larger than the entire buffer, but the native * OGL/D3DMaskBlit isn't even prepared for tiles larger * than 32x32 pixels, so there's no urgency here... */ rq.ensureCapacity(totalBytesRequired); // enqueue parameters and tile pixels int newpos = enqueueTile(buf.getAddress(), buf.position(), src, src.getNativeOps(), srcTypeVal, mask, mask.length, maskoff, maskscan, srcx, srcy, dstx, dsty, width, height); buf.position(newpos); } finally { rq.unlock(); } }