Java Code Examples for sun.java2d.SurfaceData#getTransparency()
The following examples show how to use
sun.java2d.SurfaceData#getTransparency() .
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: DrawImage.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
protected boolean scaleSurfaceData(SunGraphics2D sg, Region clipRegion, SurfaceData srcData, SurfaceData dstData, SurfaceType srcType, SurfaceType dstType, int sx1, int sy1, int sx2, int sy2, double dx1, double dy1, double dx2, double dy2) { CompositeType comp = sg.imageComp; if (CompositeType.SrcOverNoEa.equals(comp) && (srcData.getTransparency() == Transparency.OPAQUE)) { comp = CompositeType.SrcNoEa; } ScaledBlit blit = ScaledBlit.getFromCache(srcType, comp, dstType); if (blit != null) { blit.Scale(srcData, dstData, sg.composite, clipRegion, sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2); return true; } return false; }
Example 2
Source File: DrawImage.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
protected boolean scaleSurfaceData(SunGraphics2D sg, Region clipRegion, SurfaceData srcData, SurfaceData dstData, SurfaceType srcType, SurfaceType dstType, int sx1, int sy1, int sx2, int sy2, double dx1, double dy1, double dx2, double dy2) { CompositeType comp = sg.imageComp; if (CompositeType.SrcOverNoEa.equals(comp) && (srcData.getTransparency() == Transparency.OPAQUE)) { comp = CompositeType.SrcNoEa; } ScaledBlit blit = ScaledBlit.getFromCache(srcType, comp, dstType); if (blit != null) { blit.Scale(srcData, dstData, sg.composite, clipRegion, sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2); return true; } return false; }
Example 3
Source File: XRSurfaceDataProxy.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
public static SurfaceDataProxy createProxy(SurfaceData srcData, XRGraphicsConfig dstConfig) { /*Don't cache already native surfaces*/ if (srcData instanceof XRSurfaceData) { return UNCACHED; } return new XRSurfaceDataProxy(dstConfig, srcData.getTransparency()); }
Example 4
Source File: XRSurfaceDataProxy.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
public static SurfaceDataProxy createProxy(SurfaceData srcData, XRGraphicsConfig dstConfig) { /*Don't cache already native surfaces*/ if (srcData instanceof XRSurfaceData) { return UNCACHED; } return new XRSurfaceDataProxy(dstConfig, srcData.getTransparency()); }
Example 5
Source File: DrawImage.java From Bytecoder with Apache License 2.0 | 5 votes |
protected static boolean isBgOperation(SurfaceData srcData, Color bgColor) { // If we cannot get the srcData, then cannot assume anything about // the image return ((srcData == null) || ((bgColor != null) && (srcData.getTransparency() != Transparency.OPAQUE))); }
Example 6
Source File: D3DSurfaceDataProxy.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public static SurfaceDataProxy createProxy(SurfaceData srcData, D3DGraphicsConfig dstConfig) { if (srcData instanceof D3DSurfaceData) { // srcData must be a VolatileImage which either matches // our pixel format or not - either way we do not cache it... return UNCACHED; } return new D3DSurfaceDataProxy(dstConfig, srcData.getTransparency()); }
Example 7
Source File: OGLSurfaceDataProxy.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
public static SurfaceDataProxy createProxy(SurfaceData srcData, OGLGraphicsConfig dstConfig) { if (srcData instanceof OGLSurfaceData) { // srcData must be a VolatileImage which either matches // our pixel format or not - either way we do not cache it... return UNCACHED; } return new OGLSurfaceDataProxy(dstConfig, srcData.getTransparency()); }
Example 8
Source File: DrawImage.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
protected static boolean isBgOperation(SurfaceData srcData, Color bgColor) { // If we cannot get the srcData, then cannot assume anything about // the image return ((srcData == null) || ((bgColor != null) && (srcData.getTransparency() != Transparency.OPAQUE))); }
Example 9
Source File: OGLSurfaceDataProxy.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
public static SurfaceDataProxy createProxy(SurfaceData srcData, OGLGraphicsConfig dstConfig) { if (srcData instanceof OGLSurfaceData) { // srcData must be a VolatileImage which either matches // our pixel format or not - either way we do not cache it... return UNCACHED; } return new OGLSurfaceDataProxy(dstConfig, srcData.getTransparency()); }
Example 10
Source File: D3DSurfaceDataProxy.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
public static SurfaceDataProxy createProxy(SurfaceData srcData, D3DGraphicsConfig dstConfig) { if (srcData instanceof D3DSurfaceData) { // srcData must be a VolatileImage which either matches // our pixel format or not - either way we do not cache it... return UNCACHED; } return new D3DSurfaceDataProxy(dstConfig, srcData.getTransparency()); }
Example 11
Source File: OGLSurfaceDataProxy.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
public static SurfaceDataProxy createProxy(SurfaceData srcData, OGLGraphicsConfig dstConfig) { if (srcData instanceof OGLSurfaceData) { // srcData must be a VolatileImage which either matches // our pixel format or not - either way we do not cache it... return UNCACHED; } return new OGLSurfaceDataProxy(dstConfig, srcData.getTransparency()); }
Example 12
Source File: D3DBlitLoops.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
static void Blit(SurfaceData srcData, SurfaceData dstData, Composite comp, Region clip, AffineTransform xform, int hint, int sx1, int sy1, int sx2, int sy2, double dx1, double dy1, double dx2, double dy2, int srctype, boolean texture) { int ctxflags = 0; if (srcData.getTransparency() == Transparency.OPAQUE) { ctxflags |= D3DContext.SRC_IS_OPAQUE; } D3DSurfaceData d3dDst = (D3DSurfaceData)dstData; D3DRenderQueue rq = D3DRenderQueue.getInstance(); rq.lock(); try { // make sure the RenderQueue keeps a hard reference to the // source (sysmem) SurfaceData to prevent it from being // disposed while the operation is processed on the QFT rq.addReference(srcData); if (texture) { // make sure we have a current context before uploading // the sysmem data to the texture object D3DContext.setScratchSurface(d3dDst.getContext()); } else { D3DContext.validateContext(d3dDst, d3dDst, clip, comp, xform, null, null, ctxflags); } int packedParams = createPackedParams(false, texture, false, xform != null, hint, srctype); enqueueBlit(rq, srcData, dstData, packedParams, sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2); // always flush immediately, since we (currently) have no means // of tracking changes to the system memory surface rq.flushNow(); } finally { rq.unlock(); } if (d3dDst.getType() == D3DSurfaceData.WINDOW) { // flush immediately when copying to the screen to improve // responsiveness of applications using VI or BI backbuffers D3DScreenUpdateManager mgr = (D3DScreenUpdateManager)ScreenUpdateManager.getInstance(); mgr.runUpdateNow(); } }
Example 13
Source File: D3DBlitLoops.java From hottub with GNU General Public License v2.0 | 4 votes |
static void Blit(SurfaceData srcData, SurfaceData dstData, Composite comp, Region clip, AffineTransform xform, int hint, int sx1, int sy1, int sx2, int sy2, double dx1, double dy1, double dx2, double dy2, int srctype, boolean texture) { int ctxflags = 0; if (srcData.getTransparency() == Transparency.OPAQUE) { ctxflags |= D3DContext.SRC_IS_OPAQUE; } D3DSurfaceData d3dDst = (D3DSurfaceData)dstData; D3DRenderQueue rq = D3DRenderQueue.getInstance(); rq.lock(); try { // make sure the RenderQueue keeps a hard reference to the // source (sysmem) SurfaceData to prevent it from being // disposed while the operation is processed on the QFT rq.addReference(srcData); if (texture) { // make sure we have a current context before uploading // the sysmem data to the texture object D3DContext.setScratchSurface(d3dDst.getContext()); } else { D3DContext.validateContext(d3dDst, d3dDst, clip, comp, xform, null, null, ctxflags); } int packedParams = createPackedParams(false, texture, false, xform != null, hint, srctype); enqueueBlit(rq, srcData, dstData, packedParams, sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2); // always flush immediately, since we (currently) have no means // of tracking changes to the system memory surface rq.flushNow(); } finally { rq.unlock(); } if (d3dDst.getType() == D3DSurfaceData.WINDOW) { // flush immediately when copying to the screen to improve // responsiveness of applications using VI or BI backbuffers D3DScreenUpdateManager mgr = (D3DScreenUpdateManager)ScreenUpdateManager.getInstance(); mgr.runUpdateNow(); } }
Example 14
Source File: OGLBlitLoops.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
static void Blit(SurfaceData srcData, SurfaceData dstData, Composite comp, Region clip, AffineTransform xform, int hint, int sx1, int sy1, int sx2, int sy2, double dx1, double dy1, double dx2, double dy2, int srctype, boolean texture) { int ctxflags = 0; if (srcData.getTransparency() == Transparency.OPAQUE) { ctxflags |= OGLContext.SRC_IS_OPAQUE; } OGLRenderQueue rq = OGLRenderQueue.getInstance(); rq.lock(); try { // make sure the RenderQueue keeps a hard reference to the // source (sysmem) SurfaceData to prevent it from being // disposed while the operation is processed on the QFT rq.addReference(srcData); OGLSurfaceData oglDst = (OGLSurfaceData)dstData; if (texture) { // make sure we have a current context before uploading // the sysmem data to the texture object OGLGraphicsConfig gc = oglDst.getOGLGraphicsConfig(); OGLContext.setScratchSurface(gc); } else { OGLContext.validateContext(oglDst, oglDst, clip, comp, xform, null, null, ctxflags); } int packedParams = createPackedParams(false, texture, false, xform != null, hint, srctype); enqueueBlit(rq, srcData, dstData, packedParams, sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2); // always flush immediately, since we (currently) have no means // of tracking changes to the system memory surface rq.flushNow(); } finally { rq.unlock(); } }
Example 15
Source File: OGLBlitLoops.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
/** * Note: The srcImg and biop parameters are only used when invoked * from the OGLBufImgOps.renderImageWithOp() method; in all other cases, * this method can be called with null values for those two parameters, * and they will be effectively ignored. */ static void IsoBlit(SurfaceData srcData, SurfaceData dstData, BufferedImage srcImg, BufferedImageOp biop, Composite comp, Region clip, AffineTransform xform, int hint, int sx1, int sy1, int sx2, int sy2, double dx1, double dy1, double dx2, double dy2, boolean texture) { int ctxflags = 0; if (srcData.getTransparency() == Transparency.OPAQUE) { ctxflags |= OGLContext.SRC_IS_OPAQUE; } OGLRenderQueue rq = OGLRenderQueue.getInstance(); rq.lock(); try { OGLSurfaceData oglSrc = (OGLSurfaceData)srcData; OGLSurfaceData oglDst = (OGLSurfaceData)dstData; int srctype = oglSrc.getType(); boolean rtt; OGLSurfaceData srcCtxData; if (srctype == OGLSurfaceData.TEXTURE) { // the source is a regular texture object; we substitute // the destination surface for the purposes of making a // context current rtt = false; srcCtxData = oglDst; } else { // the source is a pbuffer, backbuffer, or render-to-texture // surface; we set rtt to true to differentiate this kind // of surface from a regular texture object rtt = true; if (srctype == OGLSurfaceData.FBOBJECT) { srcCtxData = oglDst; } else { srcCtxData = oglSrc; } } OGLContext.validateContext(srcCtxData, oglDst, clip, comp, xform, null, null, ctxflags); if (biop != null) { OGLBufImgOps.enableBufImgOp(rq, oglSrc, srcImg, biop); } int packedParams = createPackedParams(true, texture, rtt, xform != null, hint, 0 /*unused*/); enqueueBlit(rq, srcData, dstData, packedParams, sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2); if (biop != null) { OGLBufImgOps.disableBufImgOp(rq, biop); } if (rtt && oglDst.isOnScreen()) { // we only have to flush immediately when copying from a // (non-texture) surface to the screen; otherwise Swing apps // might appear unresponsive until the auto-flush completes rq.flushNow(); } } finally { rq.unlock(); } }
Example 16
Source File: D3DBlitLoops.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
static void Blit(SurfaceData srcData, SurfaceData dstData, Composite comp, Region clip, AffineTransform xform, int hint, int sx1, int sy1, int sx2, int sy2, double dx1, double dy1, double dx2, double dy2, int srctype, boolean texture) { int ctxflags = 0; if (srcData.getTransparency() == Transparency.OPAQUE) { ctxflags |= D3DContext.SRC_IS_OPAQUE; } D3DSurfaceData d3dDst = (D3DSurfaceData)dstData; D3DRenderQueue rq = D3DRenderQueue.getInstance(); rq.lock(); try { // make sure the RenderQueue keeps a hard reference to the // source (sysmem) SurfaceData to prevent it from being // disposed while the operation is processed on the QFT rq.addReference(srcData); if (texture) { // make sure we have a current context before uploading // the sysmem data to the texture object D3DContext.setScratchSurface(d3dDst.getContext()); } else { D3DContext.validateContext(d3dDst, d3dDst, clip, comp, xform, null, null, ctxflags); } int packedParams = createPackedParams(false, texture, false, xform != null, hint, srctype); enqueueBlit(rq, srcData, dstData, packedParams, sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2); // always flush immediately, since we (currently) have no means // of tracking changes to the system memory surface rq.flushNow(); } finally { rq.unlock(); } if (d3dDst.getType() == D3DSurfaceData.WINDOW) { // flush immediately when copying to the screen to improve // responsiveness of applications using VI or BI backbuffers D3DScreenUpdateManager mgr = (D3DScreenUpdateManager)ScreenUpdateManager.getInstance(); mgr.runUpdateNow(); } }
Example 17
Source File: OGLBlitLoops.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
static void Blit(SurfaceData srcData, SurfaceData dstData, Composite comp, Region clip, AffineTransform xform, int hint, int sx1, int sy1, int sx2, int sy2, double dx1, double dy1, double dx2, double dy2, int srctype, boolean texture) { int ctxflags = 0; if (srcData.getTransparency() == Transparency.OPAQUE) { ctxflags |= OGLContext.SRC_IS_OPAQUE; } OGLRenderQueue rq = OGLRenderQueue.getInstance(); rq.lock(); try { // make sure the RenderQueue keeps a hard reference to the // source (sysmem) SurfaceData to prevent it from being // disposed while the operation is processed on the QFT rq.addReference(srcData); OGLSurfaceData oglDst = (OGLSurfaceData)dstData; if (texture) { // make sure we have a current context before uploading // the sysmem data to the texture object OGLGraphicsConfig gc = oglDst.getOGLGraphicsConfig(); OGLContext.setScratchSurface(gc); } else { OGLContext.validateContext(oglDst, oglDst, clip, comp, xform, null, null, ctxflags); } int packedParams = createPackedParams(false, texture, false, xform != null, hint, srctype); enqueueBlit(rq, srcData, dstData, packedParams, sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2); // always flush immediately, since we (currently) have no means // of tracking changes to the system memory surface rq.flushNow(); } finally { rq.unlock(); } }
Example 18
Source File: OGLBlitLoops.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
/** * Note: The srcImg and biop parameters are only used when invoked * from the OGLBufImgOps.renderImageWithOp() method; in all other cases, * this method can be called with null values for those two parameters, * and they will be effectively ignored. */ static void IsoBlit(SurfaceData srcData, SurfaceData dstData, BufferedImage srcImg, BufferedImageOp biop, Composite comp, Region clip, AffineTransform xform, int hint, int sx1, int sy1, int sx2, int sy2, double dx1, double dy1, double dx2, double dy2, boolean texture) { int ctxflags = 0; if (srcData.getTransparency() == Transparency.OPAQUE) { ctxflags |= OGLContext.SRC_IS_OPAQUE; } OGLRenderQueue rq = OGLRenderQueue.getInstance(); rq.lock(); try { OGLSurfaceData oglSrc = (OGLSurfaceData)srcData; OGLSurfaceData oglDst = (OGLSurfaceData)dstData; int srctype = oglSrc.getType(); boolean rtt; OGLSurfaceData srcCtxData; if (srctype == OGLSurfaceData.TEXTURE) { // the source is a regular texture object; we substitute // the destination surface for the purposes of making a // context current rtt = false; srcCtxData = oglDst; } else { // the source is a pbuffer, backbuffer, or render-to-texture // surface; we set rtt to true to differentiate this kind // of surface from a regular texture object rtt = true; if (srctype == OGLSurfaceData.FBOBJECT) { srcCtxData = oglDst; } else { srcCtxData = oglSrc; } } OGLContext.validateContext(srcCtxData, oglDst, clip, comp, xform, null, null, ctxflags); if (biop != null) { OGLBufImgOps.enableBufImgOp(rq, oglSrc, srcImg, biop); } int packedParams = createPackedParams(true, texture, rtt, xform != null, hint, 0 /*unused*/); enqueueBlit(rq, srcData, dstData, packedParams, sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2); if (biop != null) { OGLBufImgOps.disableBufImgOp(rq, biop); } if (rtt && oglDst.isOnScreen()) { // we only have to flush immediately when copying from a // (non-texture) surface to the screen; otherwise Swing apps // might appear unresponsive until the auto-flush completes rq.flushNow(); } } finally { rq.unlock(); } }
Example 19
Source File: OGLBlitLoops.java From dragonwell8_jdk with GNU General Public License v2.0 | 4 votes |
/** * Note: The srcImg and biop parameters are only used when invoked * from the OGLBufImgOps.renderImageWithOp() method; in all other cases, * this method can be called with null values for those two parameters, * and they will be effectively ignored. */ static void IsoBlit(SurfaceData srcData, SurfaceData dstData, BufferedImage srcImg, BufferedImageOp biop, Composite comp, Region clip, AffineTransform xform, int hint, int sx1, int sy1, int sx2, int sy2, double dx1, double dy1, double dx2, double dy2, boolean texture) { int ctxflags = 0; if (srcData.getTransparency() == Transparency.OPAQUE) { ctxflags |= OGLContext.SRC_IS_OPAQUE; } OGLRenderQueue rq = OGLRenderQueue.getInstance(); rq.lock(); try { OGLSurfaceData oglSrc = (OGLSurfaceData)srcData; OGLSurfaceData oglDst = (OGLSurfaceData)dstData; int srctype = oglSrc.getType(); boolean rtt; OGLSurfaceData srcCtxData; if (srctype == OGLSurfaceData.TEXTURE) { // the source is a regular texture object; we substitute // the destination surface for the purposes of making a // context current rtt = false; srcCtxData = oglDst; } else { // the source is a pbuffer, backbuffer, or render-to-texture // surface; we set rtt to true to differentiate this kind // of surface from a regular texture object rtt = true; if (srctype == OGLSurfaceData.FBOBJECT) { srcCtxData = oglDst; } else { srcCtxData = oglSrc; } } OGLContext.validateContext(srcCtxData, oglDst, clip, comp, xform, null, null, ctxflags); if (biop != null) { OGLBufImgOps.enableBufImgOp(rq, oglSrc, srcImg, biop); } int packedParams = createPackedParams(true, texture, rtt, xform != null, hint, 0 /*unused*/); enqueueBlit(rq, srcData, dstData, packedParams, sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2); if (biop != null) { OGLBufImgOps.disableBufImgOp(rq, biop); } if (rtt && oglDst.isOnScreen()) { // we only have to flush immediately when copying from a // (non-texture) surface to the screen; otherwise Swing apps // might appear unresponsive until the auto-flush completes rq.flushNow(); } } finally { rq.unlock(); } }
Example 20
Source File: D3DBlitLoops.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
/** * Note: The srcImg and biop parameters are only used when invoked * from the D3DBufImgOps.renderImageWithOp() method; in all other cases, * this method can be called with null values for those two parameters, * and they will be effectively ignored. */ static void IsoBlit(SurfaceData srcData, SurfaceData dstData, BufferedImage srcImg, BufferedImageOp biop, Composite comp, Region clip, AffineTransform xform, int hint, int sx1, int sy1, int sx2, int sy2, double dx1, double dy1, double dx2, double dy2, boolean texture) { int ctxflags = 0; if (srcData.getTransparency() == Transparency.OPAQUE) { ctxflags |= D3DContext.SRC_IS_OPAQUE; } D3DSurfaceData d3dDst = (D3DSurfaceData)dstData; D3DRenderQueue rq = D3DRenderQueue.getInstance(); boolean rtt = false; rq.lock(); try { D3DSurfaceData d3dSrc = (D3DSurfaceData)srcData; int srctype = d3dSrc.getType(); D3DSurfaceData srcCtxData = d3dSrc; if (srctype == D3DSurfaceData.TEXTURE) { rtt = false; } else { // the source is a backbuffer, or render-to-texture // surface; we set rtt to true to differentiate this kind // of surface from a regular texture object rtt = true; } D3DContext.validateContext(srcCtxData, d3dDst, clip, comp, xform, null, null, ctxflags); if (biop != null) { D3DBufImgOps.enableBufImgOp(rq, d3dSrc, srcImg, biop); } int packedParams = createPackedParams(true, texture, rtt, xform != null, hint, 0 /*unused*/); enqueueBlit(rq, srcData, dstData, packedParams, sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2); if (biop != null) { D3DBufImgOps.disableBufImgOp(rq, biop); } } finally { rq.unlock(); } if (rtt && (d3dDst.getType() == D3DSurfaceData.WINDOW)) { // we only have to flush immediately when copying from a // (non-texture) surface to the screen; otherwise Swing apps // might appear unresponsive until the auto-flush completes D3DScreenUpdateManager mgr = (D3DScreenUpdateManager)ScreenUpdateManager.getInstance(); mgr.runUpdateNow(); } }