Java Code Examples for java.awt.MultipleGradientPaint#getFractions()

The following examples show how to use java.awt.MultipleGradientPaint#getFractions() . 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: OGLPaints.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 2
Source File: OGLPaints.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 3
Source File: D3DPaints.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 4
Source File: OGLPaints.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 5
Source File: D3DPaints.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 6
Source File: OGLPaints.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 7
Source File: D3DPaints.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 8
Source File: OGLPaints.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 9
Source File: D3DPaints.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 10
Source File: OGLPaints.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 11
Source File: OGLPaints.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 12
Source File: OGLPaints.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 13
Source File: OGLPaints.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 14
Source File: D3DPaints.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 15
Source File: OGLPaints.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 16
Source File: D3DPaints.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 17
Source File: OGLPaints.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 18
Source File: D3DPaints.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 19
Source File: OGLPaints.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 20
Source File: D3DPaints.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}