下面列出了java.awt.MultipleGradientPaint#getFractions ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/**
* Returns true if the given MultipleGradientPaint instance can be
* used by the accelerated OGLPaints.MultiGradient implementation.
* A MultipleGradientPaint is considered valid if the following
* conditions are met:
* - the number of gradient "stops" is <= MAX_FRACTIONS
* - the destination has support for fragment shaders
*/
@Override
boolean isPaintValid(SunGraphics2D sg2d) {
MultipleGradientPaint paint = (MultipleGradientPaint)sg2d.paint;
// REMIND: ugh, this creates garbage; would be nicer if
// we had a MultipleGradientPaint.getNumStops() method...
if (paint.getFractions().length > MULTI_MAX_FRACTIONS) {
return false;
}
OGLSurfaceData dstData = (OGLSurfaceData)sg2d.surfaceData;
OGLGraphicsConfig gc = dstData.getOGLGraphicsConfig();
if (!gc.isCapPresent(CAPS_EXT_GRAD_SHADER)) {
return false;
}
return true;
}
/**
* Returns true if the given MultipleGradientPaint instance can be
* used by the accelerated D3DPaints.MultiGradient implementation.
* A MultipleGradientPaint is considered valid if the following
* conditions are met:
* - the number of gradient "stops" is <= MAX_FRACTIONS
* - the destination has support for fragment shaders
*/
@Override
boolean isPaintValid(SunGraphics2D sg2d) {
MultipleGradientPaint paint = (MultipleGradientPaint)sg2d.paint;
// REMIND: ugh, this creates garbage; would be nicer if
// we had a MultipleGradientPaint.getNumStops() method...
if (paint.getFractions().length > MULTI_MAX_FRACTIONS_D3D) {
return false;
}
D3DSurfaceData dstData = (D3DSurfaceData)sg2d.surfaceData;
D3DGraphicsDevice gd = (D3DGraphicsDevice)
dstData.getDeviceConfiguration().getDevice();
if (!gd.isCapPresent(CAPS_LCD_SHADER)) {
return false;
}
return true;
}
/**
* Returns true if the given MultipleGradientPaint instance can be
* used by the accelerated OGLPaints.MultiGradient implementation.
* A MultipleGradientPaint is considered valid if the following
* conditions are met:
* - the number of gradient "stops" is <= MAX_FRACTIONS
* - the destination has support for fragment shaders
*/
@Override
boolean isPaintValid(SunGraphics2D sg2d) {
MultipleGradientPaint paint = (MultipleGradientPaint)sg2d.paint;
// REMIND: ugh, this creates garbage; would be nicer if
// we had a MultipleGradientPaint.getNumStops() method...
if (paint.getFractions().length > MULTI_MAX_FRACTIONS) {
return false;
}
OGLSurfaceData dstData = (OGLSurfaceData)sg2d.surfaceData;
OGLGraphicsConfig gc = dstData.getOGLGraphicsConfig();
if (!gc.isCapPresent(CAPS_EXT_GRAD_SHADER)) {
return false;
}
return true;
}
/**
* Returns true if the given MultipleGradientPaint instance can be
* used by the accelerated D3DPaints.MultiGradient implementation.
* A MultipleGradientPaint is considered valid if the following
* conditions are met:
* - the number of gradient "stops" is <= MAX_FRACTIONS
* - the destination has support for fragment shaders
*/
@Override
boolean isPaintValid(SunGraphics2D sg2d) {
MultipleGradientPaint paint = (MultipleGradientPaint)sg2d.paint;
// REMIND: ugh, this creates garbage; would be nicer if
// we had a MultipleGradientPaint.getNumStops() method...
if (paint.getFractions().length > MULTI_MAX_FRACTIONS_D3D) {
return false;
}
D3DSurfaceData dstData = (D3DSurfaceData)sg2d.surfaceData;
D3DGraphicsDevice gd = (D3DGraphicsDevice)
dstData.getDeviceConfiguration().getDevice();
if (!gd.isCapPresent(CAPS_LCD_SHADER)) {
return false;
}
return true;
}
/**
* Returns true if the given MultipleGradientPaint instance can be
* used by the accelerated OGLPaints.MultiGradient implementation.
* A MultipleGradientPaint is considered valid if the following
* conditions are met:
* - the number of gradient "stops" is <= MAX_FRACTIONS
* - the destination has support for fragment shaders
*/
@Override
boolean isPaintValid(SunGraphics2D sg2d) {
MultipleGradientPaint paint = (MultipleGradientPaint)sg2d.paint;
// REMIND: ugh, this creates garbage; would be nicer if
// we had a MultipleGradientPaint.getNumStops() method...
if (paint.getFractions().length > MULTI_MAX_FRACTIONS) {
return false;
}
OGLSurfaceData dstData = (OGLSurfaceData)sg2d.surfaceData;
OGLGraphicsConfig gc = dstData.getOGLGraphicsConfig();
if (!gc.isCapPresent(CAPS_EXT_GRAD_SHADER)) {
return false;
}
return true;
}
/**
* Returns true if the given MultipleGradientPaint instance can be
* used by the accelerated D3DPaints.MultiGradient implementation.
* A MultipleGradientPaint is considered valid if the following
* conditions are met:
* - the number of gradient "stops" is <= MAX_FRACTIONS
* - the destination has support for fragment shaders
*/
@Override
boolean isPaintValid(SunGraphics2D sg2d) {
MultipleGradientPaint paint = (MultipleGradientPaint)sg2d.paint;
// REMIND: ugh, this creates garbage; would be nicer if
// we had a MultipleGradientPaint.getNumStops() method...
if (paint.getFractions().length > MULTI_MAX_FRACTIONS_D3D) {
return false;
}
D3DSurfaceData dstData = (D3DSurfaceData)sg2d.surfaceData;
D3DGraphicsDevice gd = (D3DGraphicsDevice)
dstData.getDeviceConfiguration().getDevice();
if (!gd.isCapPresent(CAPS_LCD_SHADER)) {
return false;
}
return true;
}
/**
* Returns true if the given MultipleGradientPaint instance can be
* used by the accelerated OGLPaints.MultiGradient implementation.
* A MultipleGradientPaint is considered valid if the following
* conditions are met:
* - the number of gradient "stops" is <= MAX_FRACTIONS
* - the destination has support for fragment shaders
*/
@Override
boolean isPaintValid(SunGraphics2D sg2d) {
MultipleGradientPaint paint = (MultipleGradientPaint)sg2d.paint;
// REMIND: ugh, this creates garbage; would be nicer if
// we had a MultipleGradientPaint.getNumStops() method...
if (paint.getFractions().length > MULTI_MAX_FRACTIONS) {
return false;
}
OGLSurfaceData dstData = (OGLSurfaceData)sg2d.surfaceData;
OGLGraphicsConfig gc = dstData.getOGLGraphicsConfig();
if (!gc.isCapPresent(CAPS_EXT_GRAD_SHADER)) {
return false;
}
return true;
}
/**
* Returns true if the given MultipleGradientPaint instance can be
* used by the accelerated D3DPaints.MultiGradient implementation.
* A MultipleGradientPaint is considered valid if the following
* conditions are met:
* - the number of gradient "stops" is <= MAX_FRACTIONS
* - the destination has support for fragment shaders
*/
@Override
boolean isPaintValid(SunGraphics2D sg2d) {
MultipleGradientPaint paint = (MultipleGradientPaint)sg2d.paint;
// REMIND: ugh, this creates garbage; would be nicer if
// we had a MultipleGradientPaint.getNumStops() method...
if (paint.getFractions().length > MULTI_MAX_FRACTIONS_D3D) {
return false;
}
D3DSurfaceData dstData = (D3DSurfaceData)sg2d.surfaceData;
D3DGraphicsDevice gd = (D3DGraphicsDevice)
dstData.getDeviceConfiguration().getDevice();
if (!gd.isCapPresent(CAPS_LCD_SHADER)) {
return false;
}
return true;
}
/**
* Returns true if the given MultipleGradientPaint instance can be
* used by the accelerated OGLPaints.MultiGradient implementation.
* A MultipleGradientPaint is considered valid if the following
* conditions are met:
* - the number of gradient "stops" is <= MAX_FRACTIONS
* - the destination has support for fragment shaders
*/
@Override
boolean isPaintValid(SunGraphics2D sg2d) {
MultipleGradientPaint paint = (MultipleGradientPaint)sg2d.paint;
// REMIND: ugh, this creates garbage; would be nicer if
// we had a MultipleGradientPaint.getNumStops() method...
if (paint.getFractions().length > MULTI_MAX_FRACTIONS) {
return false;
}
OGLSurfaceData dstData = (OGLSurfaceData)sg2d.surfaceData;
OGLGraphicsConfig gc = dstData.getOGLGraphicsConfig();
if (!gc.isCapPresent(CAPS_EXT_GRAD_SHADER)) {
return false;
}
return true;
}
/**
* Returns true if the given MultipleGradientPaint instance can be
* used by the accelerated OGLPaints.MultiGradient implementation.
* A MultipleGradientPaint is considered valid if the following
* conditions are met:
* - the number of gradient "stops" is <= MAX_FRACTIONS
* - the destination has support for fragment shaders
*/
@Override
boolean isPaintValid(SunGraphics2D sg2d) {
MultipleGradientPaint paint = (MultipleGradientPaint)sg2d.paint;
// REMIND: ugh, this creates garbage; would be nicer if
// we had a MultipleGradientPaint.getNumStops() method...
if (paint.getFractions().length > MULTI_MAX_FRACTIONS) {
return false;
}
OGLSurfaceData dstData = (OGLSurfaceData)sg2d.surfaceData;
OGLGraphicsConfig gc = dstData.getOGLGraphicsConfig();
if (!gc.isCapPresent(CAPS_EXT_GRAD_SHADER)) {
return false;
}
return true;
}
/**
* Returns true if the given MultipleGradientPaint instance can be
* used by the accelerated OGLPaints.MultiGradient implementation.
* A MultipleGradientPaint is considered valid if the following
* conditions are met:
* - the number of gradient "stops" is <= MAX_FRACTIONS
* - the destination has support for fragment shaders
*/
@Override
boolean isPaintValid(SunGraphics2D sg2d) {
MultipleGradientPaint paint = (MultipleGradientPaint)sg2d.paint;
// REMIND: ugh, this creates garbage; would be nicer if
// we had a MultipleGradientPaint.getNumStops() method...
if (paint.getFractions().length > MULTI_MAX_FRACTIONS) {
return false;
}
OGLSurfaceData dstData = (OGLSurfaceData)sg2d.surfaceData;
OGLGraphicsConfig gc = dstData.getOGLGraphicsConfig();
if (!gc.isCapPresent(CAPS_EXT_GRAD_SHADER)) {
return false;
}
return true;
}
/**
* Returns true if the given MultipleGradientPaint instance can be
* used by the accelerated OGLPaints.MultiGradient implementation.
* A MultipleGradientPaint is considered valid if the following
* conditions are met:
* - the number of gradient "stops" is <= MAX_FRACTIONS
* - the destination has support for fragment shaders
*/
@Override
boolean isPaintValid(SunGraphics2D sg2d) {
MultipleGradientPaint paint = (MultipleGradientPaint)sg2d.paint;
// REMIND: ugh, this creates garbage; would be nicer if
// we had a MultipleGradientPaint.getNumStops() method...
if (paint.getFractions().length > MULTI_MAX_FRACTIONS) {
return false;
}
OGLSurfaceData dstData = (OGLSurfaceData)sg2d.surfaceData;
OGLGraphicsConfig gc = dstData.getOGLGraphicsConfig();
if (!gc.isCapPresent(CAPS_EXT_GRAD_SHADER)) {
return false;
}
return true;
}
/**
* Returns true if the given MultipleGradientPaint instance can be
* used by the accelerated D3DPaints.MultiGradient implementation.
* A MultipleGradientPaint is considered valid if the following
* conditions are met:
* - the number of gradient "stops" is <= MAX_FRACTIONS
* - the destination has support for fragment shaders
*/
@Override
boolean isPaintValid(SunGraphics2D sg2d) {
MultipleGradientPaint paint = (MultipleGradientPaint)sg2d.paint;
// REMIND: ugh, this creates garbage; would be nicer if
// we had a MultipleGradientPaint.getNumStops() method...
if (paint.getFractions().length > MULTI_MAX_FRACTIONS_D3D) {
return false;
}
D3DSurfaceData dstData = (D3DSurfaceData)sg2d.surfaceData;
D3DGraphicsDevice gd = (D3DGraphicsDevice)
dstData.getDeviceConfiguration().getDevice();
if (!gd.isCapPresent(CAPS_LCD_SHADER)) {
return false;
}
return true;
}
/**
* Returns true if the given MultipleGradientPaint instance can be
* used by the accelerated OGLPaints.MultiGradient implementation.
* A MultipleGradientPaint is considered valid if the following
* conditions are met:
* - the number of gradient "stops" is <= MAX_FRACTIONS
* - the destination has support for fragment shaders
*/
@Override
boolean isPaintValid(SunGraphics2D sg2d) {
MultipleGradientPaint paint = (MultipleGradientPaint)sg2d.paint;
// REMIND: ugh, this creates garbage; would be nicer if
// we had a MultipleGradientPaint.getNumStops() method...
if (paint.getFractions().length > MULTI_MAX_FRACTIONS) {
return false;
}
OGLSurfaceData dstData = (OGLSurfaceData)sg2d.surfaceData;
OGLGraphicsConfig gc = dstData.getOGLGraphicsConfig();
if (!gc.isCapPresent(CAPS_EXT_GRAD_SHADER)) {
return false;
}
return true;
}
/**
* Returns true if the given MultipleGradientPaint instance can be
* used by the accelerated D3DPaints.MultiGradient implementation.
* A MultipleGradientPaint is considered valid if the following
* conditions are met:
* - the number of gradient "stops" is <= MAX_FRACTIONS
* - the destination has support for fragment shaders
*/
@Override
boolean isPaintValid(SunGraphics2D sg2d) {
MultipleGradientPaint paint = (MultipleGradientPaint)sg2d.paint;
// REMIND: ugh, this creates garbage; would be nicer if
// we had a MultipleGradientPaint.getNumStops() method...
if (paint.getFractions().length > MULTI_MAX_FRACTIONS_D3D) {
return false;
}
D3DSurfaceData dstData = (D3DSurfaceData)sg2d.surfaceData;
D3DGraphicsDevice gd = (D3DGraphicsDevice)
dstData.getDeviceConfiguration().getDevice();
if (!gd.isCapPresent(CAPS_LCD_SHADER)) {
return false;
}
return true;
}
/**
* Returns true if the given MultipleGradientPaint instance can be
* used by the accelerated OGLPaints.MultiGradient implementation.
* A MultipleGradientPaint is considered valid if the following
* conditions are met:
* - the number of gradient "stops" is <= MAX_FRACTIONS
* - the destination has support for fragment shaders
*/
@Override
boolean isPaintValid(SunGraphics2D sg2d) {
MultipleGradientPaint paint = (MultipleGradientPaint)sg2d.paint;
// REMIND: ugh, this creates garbage; would be nicer if
// we had a MultipleGradientPaint.getNumStops() method...
if (paint.getFractions().length > MULTI_MAX_FRACTIONS) {
return false;
}
OGLSurfaceData dstData = (OGLSurfaceData)sg2d.surfaceData;
OGLGraphicsConfig gc = dstData.getOGLGraphicsConfig();
if (!gc.isCapPresent(CAPS_EXT_GRAD_SHADER)) {
return false;
}
return true;
}
/**
* Returns true if the given MultipleGradientPaint instance can be
* used by the accelerated D3DPaints.MultiGradient implementation.
* A MultipleGradientPaint is considered valid if the following
* conditions are met:
* - the number of gradient "stops" is <= MAX_FRACTIONS
* - the destination has support for fragment shaders
*/
@Override
boolean isPaintValid(SunGraphics2D sg2d) {
MultipleGradientPaint paint = (MultipleGradientPaint)sg2d.paint;
// REMIND: ugh, this creates garbage; would be nicer if
// we had a MultipleGradientPaint.getNumStops() method...
if (paint.getFractions().length > MULTI_MAX_FRACTIONS_D3D) {
return false;
}
D3DSurfaceData dstData = (D3DSurfaceData)sg2d.surfaceData;
D3DGraphicsDevice gd = (D3DGraphicsDevice)
dstData.getDeviceConfiguration().getDevice();
if (!gd.isCapPresent(CAPS_LCD_SHADER)) {
return false;
}
return true;
}
/**
* Returns true if the given MultipleGradientPaint instance can be
* used by the accelerated OGLPaints.MultiGradient implementation.
* A MultipleGradientPaint is considered valid if the following
* conditions are met:
* - the number of gradient "stops" is <= MAX_FRACTIONS
* - the destination has support for fragment shaders
*/
@Override
boolean isPaintValid(SunGraphics2D sg2d) {
MultipleGradientPaint paint = (MultipleGradientPaint)sg2d.paint;
// REMIND: ugh, this creates garbage; would be nicer if
// we had a MultipleGradientPaint.getNumStops() method...
if (paint.getFractions().length > MULTI_MAX_FRACTIONS) {
return false;
}
OGLSurfaceData dstData = (OGLSurfaceData)sg2d.surfaceData;
OGLGraphicsConfig gc = dstData.getOGLGraphicsConfig();
if (!gc.isCapPresent(CAPS_EXT_GRAD_SHADER)) {
return false;
}
return true;
}
/**
* Returns true if the given MultipleGradientPaint instance can be
* used by the accelerated D3DPaints.MultiGradient implementation.
* A MultipleGradientPaint is considered valid if the following
* conditions are met:
* - the number of gradient "stops" is <= MAX_FRACTIONS
* - the destination has support for fragment shaders
*/
@Override
boolean isPaintValid(SunGraphics2D sg2d) {
MultipleGradientPaint paint = (MultipleGradientPaint)sg2d.paint;
// REMIND: ugh, this creates garbage; would be nicer if
// we had a MultipleGradientPaint.getNumStops() method...
if (paint.getFractions().length > MULTI_MAX_FRACTIONS_D3D) {
return false;
}
D3DSurfaceData dstData = (D3DSurfaceData)sg2d.surfaceData;
D3DGraphicsDevice gd = (D3DGraphicsDevice)
dstData.getDeviceConfiguration().getDevice();
if (!gd.isCapPresent(CAPS_LCD_SHADER)) {
return false;
}
return true;
}
/**
* Returns true if the given MultipleGradientPaint instance can be
* used by the accelerated OGLPaints.MultiGradient implementation.
* A MultipleGradientPaint is considered valid if the following
* conditions are met:
* - the number of gradient "stops" is <= MAX_FRACTIONS
* - the destination has support for fragment shaders
*/
@Override
boolean isPaintValid(SunGraphics2D sg2d) {
MultipleGradientPaint paint = (MultipleGradientPaint)sg2d.paint;
// REMIND: ugh, this creates garbage; would be nicer if
// we had a MultipleGradientPaint.getNumStops() method...
if (paint.getFractions().length > MULTI_MAX_FRACTIONS) {
return false;
}
OGLSurfaceData dstData = (OGLSurfaceData)sg2d.surfaceData;
OGLGraphicsConfig gc = dstData.getOGLGraphicsConfig();
if (!gc.isCapPresent(CAPS_EXT_GRAD_SHADER)) {
return false;
}
return true;
}