下面列出了java.awt.Color#getTransparency ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@Override
public boolean isSupportedOperation(SurfaceData srcData,
int txtype,
CompositeType comp,
Color bgColor)
{
// These could probably be combined into a single
// nested if, but the logic is easier to follow this way.
// we don't have X11 scale loops, so always use
// software surface in case of scaling
if (txtype >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
return false;
}
if (bgColor != null &&
bgColor.getTransparency() != Transparency.OPAQUE)
{
return false;
}
// for transparent images SrcNoEa+bgColor has the
// same effect as SrcOverNoEa+bgColor, so we allow
// copying from pixmap SD using accelerated blitbg loops:
// SrcOver will be changed to SrcNoEa in DrawImage.blitSD
if (CompositeType.SrcOverNoEa.equals(comp) ||
(CompositeType.SrcNoEa.equals(comp) &&
bgColor != null))
{
return true;
}
return false;
}
@Override
public boolean isSupportedOperation(SurfaceData srcData,
int txtype,
CompositeType comp,
Color bgColor)
{
// These could probably be combined into a single
// nested if, but the logic is easier to follow this way.
// we don't have X11 scale loops, so always use
// software surface in case of scaling
if (txtype >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
return false;
}
if (bgColor != null &&
bgColor.getTransparency() != Transparency.OPAQUE)
{
return false;
}
// for transparent images SrcNoEa+bgColor has the
// same effect as SrcOverNoEa+bgColor, so we allow
// copying from pixmap SD using accelerated blitbg loops:
// SrcOver will be changed to SrcNoEa in DrawImage.blitSD
if (CompositeType.SrcOverNoEa.equals(comp) ||
(CompositeType.SrcNoEa.equals(comp) &&
bgColor != null))
{
return true;
}
return false;
}
@Override
public boolean isSupportedOperation(SurfaceData srcData,
int txtype,
CompositeType comp,
Color bgColor)
{
// These could probably be combined into a single
// nested if, but the logic is easier to follow this way.
// we don't have X11 scale loops, so always use
// software surface in case of scaling
if (txtype >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
return false;
}
if (bgColor != null &&
bgColor.getTransparency() != Transparency.OPAQUE)
{
return false;
}
// for transparent images SrcNoEa+bgColor has the
// same effect as SrcOverNoEa+bgColor, so we allow
// copying from pixmap SD using accelerated blitbg loops:
// SrcOver will be changed to SrcNoEa in DrawImage.blitSD
if (CompositeType.SrcOverNoEa.equals(comp) ||
(CompositeType.SrcNoEa.equals(comp) &&
bgColor != null))
{
return true;
}
return false;
}
@Override
public boolean isSupportedOperation(SurfaceData srcData,
int txtype,
CompositeType comp,
Color bgColor)
{
// These could probably be combined into a single
// nested if, but the logic is easier to follow this way.
// we don't have X11 scale loops, so always use
// software surface in case of scaling
if (txtype >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
return false;
}
if (bgColor != null &&
bgColor.getTransparency() != Transparency.OPAQUE)
{
return false;
}
// for transparent images SrcNoEa+bgColor has the
// same effect as SrcOverNoEa+bgColor, so we allow
// copying from pixmap SD using accelerated blitbg loops:
// SrcOver will be changed to SrcNoEa in DrawImage.blitSD
if (CompositeType.SrcOverNoEa.equals(comp) ||
(CompositeType.SrcNoEa.equals(comp) &&
bgColor != null))
{
return true;
}
return false;
}
@Override
public boolean isSupportedOperation(SurfaceData srcData,
int txtype,
CompositeType comp,
Color bgColor)
{
// These could probably be combined into a single
// nested if, but the logic is easier to follow this way.
// we don't have X11 scale loops, so always use
// software surface in case of scaling
if (txtype >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
return false;
}
if (bgColor != null &&
bgColor.getTransparency() != Transparency.OPAQUE)
{
return false;
}
// for transparent images SrcNoEa+bgColor has the
// same effect as SrcOverNoEa+bgColor, so we allow
// copying from pixmap SD using accelerated blitbg loops:
// SrcOver will be changed to SrcNoEa in DrawImage.blitSD
if (CompositeType.SrcOverNoEa.equals(comp) ||
(CompositeType.SrcNoEa.equals(comp) &&
bgColor != null))
{
return true;
}
return false;
}
@Override
public boolean isSupportedOperation(SurfaceData srcData,
int txtype,
CompositeType comp,
Color bgColor)
{
// These could probably be combined into a single
// nested if, but the logic is easier to follow this way.
// we don't have X11 scale loops, so always use
// software surface in case of scaling
if (txtype >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
return false;
}
if (bgColor != null &&
bgColor.getTransparency() != Transparency.OPAQUE)
{
return false;
}
// for transparent images SrcNoEa+bgColor has the
// same effect as SrcOverNoEa+bgColor, so we allow
// copying from pixmap SD using accelerated blitbg loops:
// SrcOver will be changed to SrcNoEa in DrawImage.blitSD
if (CompositeType.SrcOverNoEa.equals(comp) ||
(CompositeType.SrcNoEa.equals(comp) &&
bgColor != null))
{
return true;
}
return false;
}
@Override
public boolean isSupportedOperation(SurfaceData srcData,
int txtype,
CompositeType comp,
Color bgColor)
{
// These could probably be combined into a single
// nested if, but the logic is easier to follow this way.
// we don't have X11 scale loops, so always use
// software surface in case of scaling
if (txtype >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
return false;
}
if (bgColor != null &&
bgColor.getTransparency() != Transparency.OPAQUE)
{
return false;
}
// for transparent images SrcNoEa+bgColor has the
// same effect as SrcOverNoEa+bgColor, so we allow
// copying from pixmap SD using accelerated blitbg loops:
// SrcOver will be changed to SrcNoEa in DrawImage.blitSD
if (CompositeType.SrcOverNoEa.equals(comp) ||
(CompositeType.SrcNoEa.equals(comp) &&
bgColor != null))
{
return true;
}
return false;
}
@Override
public boolean isSupportedOperation(SurfaceData srcData,
int txtype,
CompositeType comp,
Color bgColor)
{
// These could probably be combined into a single
// nested if, but the logic is easier to follow this way.
// we don't have X11 scale loops, so always use
// software surface in case of scaling
if (txtype >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
return false;
}
if (bgColor != null &&
bgColor.getTransparency() != Transparency.OPAQUE)
{
return false;
}
// for transparent images SrcNoEa+bgColor has the
// same effect as SrcOverNoEa+bgColor, so we allow
// copying from pixmap SD using accelerated blitbg loops:
// SrcOver will be changed to SrcNoEa in DrawImage.blitSD
if (CompositeType.SrcOverNoEa.equals(comp) ||
(CompositeType.SrcNoEa.equals(comp) &&
bgColor != null))
{
return true;
}
return false;
}
@Override
public boolean isSupportedOperation(SurfaceData srcData,
int txtype,
CompositeType comp,
Color bgColor)
{
// These could probably be combined into a single
// nested if, but the logic is easier to follow this way.
// we don't have X11 scale loops, so always use
// software surface in case of scaling
if (txtype >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
return false;
}
if (bgColor != null &&
bgColor.getTransparency() != Transparency.OPAQUE)
{
return false;
}
// for transparent images SrcNoEa+bgColor has the
// same effect as SrcOverNoEa+bgColor, so we allow
// copying from pixmap SD using accelerated blitbg loops:
// SrcOver will be changed to SrcNoEa in DrawImage.blitSD
if (CompositeType.SrcOverNoEa.equals(comp) ||
(CompositeType.SrcNoEa.equals(comp) &&
bgColor != null))
{
return true;
}
return false;
}
@Override
public boolean isSupportedOperation(SurfaceData srcData,
int txtype,
CompositeType comp,
Color bgColor)
{
// These could probably be combined into a single
// nested if, but the logic is easier to follow this way.
// we don't have X11 scale loops, so always use
// software surface in case of scaling
if (txtype >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
return false;
}
if (bgColor != null &&
bgColor.getTransparency() != Transparency.OPAQUE)
{
return false;
}
// for transparent images SrcNoEa+bgColor has the
// same effect as SrcOverNoEa+bgColor, so we allow
// copying from pixmap SD using accelerated blitbg loops:
// SrcOver will be changed to SrcNoEa in DrawImage.blitSD
if (CompositeType.SrcOverNoEa.equals(comp) ||
(CompositeType.SrcNoEa.equals(comp) &&
bgColor != null))
{
return true;
}
return false;
}
@Override
public boolean isSupportedOperation(SurfaceData srcData,
int txtype,
CompositeType comp,
Color bgColor)
{
// These could probably be combined into a single
// nested if, but the logic is easier to follow this way.
// we don't have X11 scale loops, so always use
// software surface in case of scaling
if (txtype >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
return false;
}
if (bgColor != null &&
bgColor.getTransparency() != Transparency.OPAQUE)
{
return false;
}
// for transparent images SrcNoEa+bgColor has the
// same effect as SrcOverNoEa+bgColor, so we allow
// copying from pixmap SD using accelerated blitbg loops:
// SrcOver will be changed to SrcNoEa in DrawImage.blitSD
if (CompositeType.SrcOverNoEa.equals(comp) ||
(CompositeType.SrcNoEa.equals(comp) &&
bgColor != null))
{
return true;
}
return false;
}
@Override
public boolean isSupportedOperation(SurfaceData srcData,
int txtype,
CompositeType comp,
Color bgColor)
{
// These could probably be combined into a single
// nested if, but the logic is easier to follow this way.
// we don't have X11 scale loops, so always use
// software surface in case of scaling
if (txtype >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
return false;
}
if (bgColor != null &&
bgColor.getTransparency() != Transparency.OPAQUE)
{
return false;
}
// for transparent images SrcNoEa+bgColor has the
// same effect as SrcOverNoEa+bgColor, so we allow
// copying from pixmap SD using accelerated blitbg loops:
// SrcOver will be changed to SrcNoEa in DrawImage.blitSD
if (CompositeType.SrcOverNoEa.equals(comp) ||
(CompositeType.SrcNoEa.equals(comp) &&
bgColor != null))
{
return true;
}
return false;
}
@Override
public boolean isSupportedOperation(SurfaceData srcData,
int txtype,
CompositeType comp,
Color bgColor)
{
// These could probably be combined into a single
// nested if, but the logic is easier to follow this way.
// we don't have X11 scale loops, so always use
// software surface in case of scaling
if (txtype >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
return false;
}
if (bgColor != null &&
bgColor.getTransparency() != Transparency.OPAQUE)
{
return false;
}
// for transparent images SrcNoEa+bgColor has the
// same effect as SrcOverNoEa+bgColor, so we allow
// copying from pixmap SD using accelerated blitbg loops:
// SrcOver will be changed to SrcNoEa in DrawImage.blitSD
if (CompositeType.SrcOverNoEa.equals(comp) ||
(CompositeType.SrcNoEa.equals(comp) &&
bgColor != null))
{
return true;
}
return false;
}