本文整理汇总了Java中sun.java2d.loops.SurfaceType类的典型用法代码示例。如果您正苦于以下问题:Java SurfaceType类的具体用法?Java SurfaceType怎么用?Java SurfaceType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SurfaceType类属于sun.java2d.loops包,在下文中一共展示了SurfaceType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Transform
import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
@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);
}
}
示例2: getSolidLoops
import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
public static synchronized RenderLoops getSolidLoops(SurfaceType type) {
for (int i = CACHE_SIZE - 1; i >= 0; i--) {
SurfaceType t = typecache[i];
if (t == type) {
return loopcache[i];
} else if (t == null) {
break;
}
}
RenderLoops l = makeRenderLoops(SurfaceType.OpaqueColor,
CompositeType.SrcNoEa,
type);
System.arraycopy(loopcache, 1, loopcache, 0, CACHE_SIZE-1);
System.arraycopy(typecache, 1, typecache, 0, CACHE_SIZE-1);
loopcache[CACHE_SIZE - 1] = l;
typecache[CACHE_SIZE - 1] = type;
return l;
}
示例3: BufferedMaskBlit
import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
protected BufferedMaskBlit(RenderQueue rq,
SurfaceType srcType,
CompositeType compType,
SurfaceType dstType)
{
super(srcType, compType, dstType);
this.rq = rq;
if (srcType == SurfaceType.IntArgb) {
this.srcTypeVal = ST_INT_ARGB;
} else if (srcType == SurfaceType.IntArgbPre) {
this.srcTypeVal = ST_INT_ARGB_PRE;
} else if (srcType == SurfaceType.IntRgb) {
this.srcTypeVal = ST_INT_RGB;
} else if (srcType == SurfaceType.IntBgr) {
this.srcTypeVal = ST_INT_BGR;
} else {
throw new InternalError("unrecognized source surface type");
}
}
示例4: scaleSurfaceData
import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
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;
}
示例5: register
import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
/**
* Note that we do not register loops to 8-byte destinations. This
* is due to faster processing of dithering through our software
* loops than through GDI StretchBlt processing.
*/
public static void register()
{
GraphicsPrimitive[] primitives = {
new GDIBlitLoops(SurfaceType.IntRgb,
GDIWindowSurfaceData.AnyGdi),
new GDIBlitLoops(SurfaceType.Ushort555Rgb,
GDIWindowSurfaceData.AnyGdi,
0x7C00, 0x03E0, 0x001F),
new GDIBlitLoops(SurfaceType.Ushort565Rgb,
GDIWindowSurfaceData.AnyGdi,
0xF800, 0x07E0, 0x001F),
new GDIBlitLoops(SurfaceType.ThreeByteBgr,
GDIWindowSurfaceData.AnyGdi),
new GDIBlitLoops(SurfaceType.ByteIndexedOpaque,
GDIWindowSurfaceData.AnyGdi,
true),
new GDIBlitLoops(SurfaceType.Index8Gray,
GDIWindowSurfaceData.AnyGdi,
true),
new GDIBlitLoops(SurfaceType.ByteGray,
GDIWindowSurfaceData.AnyGdi),
};
GraphicsPrimitiveMgr.register(primitives);
}
示例6: Transform
import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
@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);
}
}
示例7: getSolidLoops
import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
/**
* Return the RenderLoops this type of destination uses for
* solid fills and strokes.
*/
public synchronized RenderLoops getSolidLoops(SurfaceType stype) {
if (solidloops == null) {
solidloops = SurfaceData.makeRenderLoops(SurfaceType.OpaqueColor,
CompositeType.SrcNoEa,
stype);
}
return solidloops;
}
示例8: X11WindowSurfaceData
import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
public X11WindowSurfaceData(X11ComponentPeer peer,
X11GraphicsConfig gc,
SurfaceType sType) {
super(peer, gc, sType, peer.getColorModel());
if (isDrawableValid()) {
makePipes();
}
}
示例9: getPaintSurfaceType
import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
private static SurfaceType getPaintSurfaceType(SunGraphics2D sg2d) {
switch (sg2d.paintState) {
case SunGraphics2D.PAINT_OPAQUECOLOR:
return SurfaceType.OpaqueColor;
case SunGraphics2D.PAINT_ALPHACOLOR:
return SurfaceType.AnyColor;
case SunGraphics2D.PAINT_GRADIENT:
if (sg2d.paint.getTransparency() == OPAQUE) {
return SurfaceType.OpaqueGradientPaint;
} else {
return SurfaceType.GradientPaint;
}
case SunGraphics2D.PAINT_LIN_GRADIENT:
if (sg2d.paint.getTransparency() == OPAQUE) {
return SurfaceType.OpaqueLinearGradientPaint;
} else {
return SurfaceType.LinearGradientPaint;
}
case SunGraphics2D.PAINT_RAD_GRADIENT:
if (sg2d.paint.getTransparency() == OPAQUE) {
return SurfaceType.OpaqueRadialGradientPaint;
} else {
return SurfaceType.RadialGradientPaint;
}
case SunGraphics2D.PAINT_TEXTURE:
if (sg2d.paint.getTransparency() == OPAQUE) {
return SurfaceType.OpaqueTexturePaint;
} else {
return SurfaceType.TexturePaint;
}
default:
case SunGraphics2D.PAINT_CUSTOM:
return SurfaceType.AnyPaint;
}
}
示例10: updateSurfaceData
import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
/**
* 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();
}
示例11: getSurfaceType
import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
public static SurfaceType getSurfaceType(ColorModel cm) {
switch (cm.getPixelSize()) {
case 32:
case 24:
if (cm instanceof DirectColorModel) {
if (((DirectColorModel)cm).getRedMask() == 0xff0000) {
return IntRgbGdi;
} else {
return SurfaceType.IntRgbx;
}
} else {
return ThreeByteBgrGdi;
}
case 15:
return Ushort555RgbGdi;
case 16:
if ((cm instanceof DirectColorModel) &&
(((DirectColorModel)cm).getBlueMask() == 0x3e))
{
return SurfaceType.Ushort555Rgbx;
} else {
return Ushort565RgbGdi;
}
case 8:
if (cm.getColorSpace().getType() == ColorSpace.TYPE_GRAY &&
cm instanceof ComponentColorModel) {
return SurfaceType.ByteGray;
} else if (cm instanceof IndexColorModel &&
isOpaqueGray((IndexColorModel)cm)) {
return SurfaceType.Index8Gray;
} else {
return SurfaceType.ByteIndexedOpaque;
}
default:
throw new sun.java2d.InvalidPipeException("Unsupported bit " +
"depth: " +
cm.getPixelSize());
}
}
示例12: BufferedMaskFill
import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
protected BufferedMaskFill(RenderQueue rq,
SurfaceType srcType,
CompositeType compType,
SurfaceType dstType)
{
super(srcType, compType, dstType);
this.rq = rq;
}
示例13: getProxyKeyFor
import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
public Object getProxyKeyFor(SurfaceType st) {
synchronized (x11ProxyKeyMap) {
Object o = x11ProxyKeyMap.get(st);
if (o == null) {
o = new Object();
x11ProxyKeyMap.put(st, o);
}
return o;
}
}
示例14: getSolidLoops
import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
public synchronized RenderLoops getSolidLoops(SurfaceType stype) {
if (solidloops == null || sTypeOrig != stype) {
solidloops = SurfaceData.makeRenderLoops(SurfaceType.OpaqueColor,
CompositeType.SrcNoEa,
stype);
sTypeOrig = stype;
}
return solidloops;
}
示例15: GDIWindowSurfaceData
import sun.java2d.loops.SurfaceType; //导入依赖的package包/类
private GDIWindowSurfaceData(WComponentPeer peer, SurfaceType sType) {
super(sType, peer.getDeviceColorModel());
ColorModel cm = peer.getDeviceColorModel();
this.peer = peer;
int rMask = 0, gMask = 0, bMask = 0;
int depth;
switch (cm.getPixelSize()) {
case 32:
case 24:
if (cm instanceof DirectColorModel) {
depth = 32;
} else {
depth = 24;
}
break;
default:
depth = cm.getPixelSize();
}
if (cm instanceof DirectColorModel) {
DirectColorModel dcm = (DirectColorModel)cm;
rMask = dcm.getRedMask();
gMask = dcm.getGreenMask();
bMask = dcm.getBlueMask();
}
this.graphicsConfig =
(Win32GraphicsConfig) peer.getGraphicsConfiguration();
this.solidloops = graphicsConfig.getSolidLoops(sType);
Win32GraphicsDevice gd =
(Win32GraphicsDevice)graphicsConfig.getDevice();
initOps(peer, depth, rMask, gMask, bMask, gd.getScreen());
setBlitProxyKey(graphicsConfig.getProxyKey());
}