类java.awt.RadialGradientPaint源码实例Demo

下面列出了怎么用java.awt.RadialGradientPaint的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: openjdk-8   文件: WritingInterruptionTest.java
private static BufferedImage createTestImage() {
    int w = 1024;
    int h = 768;

    BufferedImage img = new
        BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = img.createGraphics();
    Color[] colors = { Color.red, Color.green, Color.blue };
    float[] dist = {0.0f, 0.5f, 1.0f };
    Point2D center = new Point2D.Float(0.5f * w, 0.5f * h);

    RadialGradientPaint p =
        new RadialGradientPaint(center, 0.5f * w, dist, colors);
    g.setPaint(p);
    g.fillRect(0, 0, w, h);
    g.dispose();

    return img;
}
 
源代码2 项目: jdk8u-jdk   文件: MlibOpsTest.java
private static BufferedImage createSrcImage() {
    BufferedImage img = createImage();

    Graphics2D g = img.createGraphics();
    Color[] colors = { Color.red, Color.green, Color.blue };
    float[] dist = {0.0f, 0.5f, 1.0f };
    Point2D center = new Point2D.Float(0.5f * w, 0.5f * h);

    RadialGradientPaint p =
            new RadialGradientPaint(center, 0.5f * w, dist, colors);
    g.setPaint(p);
    g.fillRect(0, 0, w, h);
    g.dispose();

    return img;
}
 
源代码3 项目: TencentKona-8   文件: MlibOpsTest.java
private static BufferedImage createSrcImage() {
    BufferedImage img = createImage();

    Graphics2D g = img.createGraphics();
    Color[] colors = { Color.red, Color.green, Color.blue };
    float[] dist = {0.0f, 0.5f, 1.0f };
    Point2D center = new Point2D.Float(0.5f * w, 0.5f * h);

    RadialGradientPaint p =
            new RadialGradientPaint(center, 0.5f * w, dist, colors);
    g.setPaint(p);
    g.fillRect(0, 0, w, h);
    g.dispose();

    return img;
}
 
源代码4 项目: openjdk-jdk9   文件: ConcurrentWritingTest.java
private static BufferedImage createTestImage() {
    int w = 1024;
    int h = 768;

    BufferedImage img = new
        BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = img.createGraphics();
    Color[] colors = { Color.red, Color.green, Color.blue };
    float[] dist = {0.0f, 0.5f, 1.0f };
    Point2D center = new Point2D.Float(0.5f * w, 0.5f * h);

    RadialGradientPaint p =
        new RadialGradientPaint(center, 0.5f * w, dist, colors);
    g.setPaint(p);
    g.fillRect(0, 0, w, h);
    g.dispose();

    return img;
}
 
源代码5 项目: TencentKona-8   文件: ConcurrentWritingTest.java
private static BufferedImage createTestImage() {
    int w = 1024;
    int h = 768;

    BufferedImage img = new
        BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = img.createGraphics();
    Color[] colors = { Color.red, Color.green, Color.blue };
    float[] dist = {0.0f, 0.5f, 1.0f };
    Point2D center = new Point2D.Float(0.5f * w, 0.5f * h);

    RadialGradientPaint p =
        new RadialGradientPaint(center, 0.5f * w, dist, colors);
    g.setPaint(p);
    g.fillRect(0, 0, w, h);
    g.dispose();

    return img;
}
 
源代码6 项目: jdk8u60   文件: MlibOpsTest.java
private static BufferedImage createSrcImage() {
    BufferedImage img = createImage();

    Graphics2D g = img.createGraphics();
    Color[] colors = { Color.red, Color.green, Color.blue };
    float[] dist = {0.0f, 0.5f, 1.0f };
    Point2D center = new Point2D.Float(0.5f * w, 0.5f * h);

    RadialGradientPaint p =
            new RadialGradientPaint(center, 0.5f * w, dist, colors);
    g.setPaint(p);
    g.fillRect(0, 0, w, h);
    g.dispose();

    return img;
}
 
源代码7 项目: openjdk-8-source   文件: MlibOpsTest.java
private static BufferedImage createSrcImage() {
    BufferedImage img = createImage();

    Graphics2D g = img.createGraphics();
    Color[] colors = { Color.red, Color.green, Color.blue };
    float[] dist = {0.0f, 0.5f, 1.0f };
    Point2D center = new Point2D.Float(0.5f * w, 0.5f * h);

    RadialGradientPaint p =
            new RadialGradientPaint(center, 0.5f * w, dist, colors);
    g.setPaint(p);
    g.fillRect(0, 0, w, h);
    g.dispose();

    return img;
}
 
源代码8 项目: openjdk-jdk8u   文件: MlibOpsTest.java
private static BufferedImage createSrcImage() {
    BufferedImage img = createImage();

    Graphics2D g = img.createGraphics();
    Color[] colors = { Color.red, Color.green, Color.blue };
    float[] dist = {0.0f, 0.5f, 1.0f };
    Point2D center = new Point2D.Float(0.5f * w, 0.5f * h);

    RadialGradientPaint p =
            new RadialGradientPaint(center, 0.5f * w, dist, colors);
    g.setPaint(p);
    g.fillRect(0, 0, w, h);
    g.dispose();

    return img;
}
 
源代码9 项目: jdk8u_jdk   文件: WritingInterruptionTest.java
private static BufferedImage createTestImage() {
    int w = 1024;
    int h = 768;

    BufferedImage img = new
        BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = img.createGraphics();
    Color[] colors = { Color.red, Color.green, Color.blue };
    float[] dist = {0.0f, 0.5f, 1.0f };
    Point2D center = new Point2D.Float(0.5f * w, 0.5f * h);

    RadialGradientPaint p =
        new RadialGradientPaint(center, 0.5f * w, dist, colors);
    g.setPaint(p);
    g.fillRect(0, 0, w, h);
    g.dispose();

    return img;
}
 
源代码10 项目: jdk8u-jdk   文件: ConcurrentWritingTest.java
private static BufferedImage createTestImage() {
    int w = 1024;
    int h = 768;

    BufferedImage img = new
        BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = img.createGraphics();
    Color[] colors = { Color.red, Color.green, Color.blue };
    float[] dist = {0.0f, 0.5f, 1.0f };
    Point2D center = new Point2D.Float(0.5f * w, 0.5f * h);

    RadialGradientPaint p =
        new RadialGradientPaint(center, 0.5f * w, dist, colors);
    g.setPaint(p);
    g.fillRect(0, 0, w, h);
    g.dispose();

    return img;
}
 
源代码11 项目: hottub   文件: WritingInterruptionTest.java
private static BufferedImage createTestImage() {
    int w = 1024;
    int h = 768;

    BufferedImage img = new
        BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = img.createGraphics();
    Color[] colors = { Color.red, Color.green, Color.blue };
    float[] dist = {0.0f, 0.5f, 1.0f };
    Point2D center = new Point2D.Float(0.5f * w, 0.5f * h);

    RadialGradientPaint p =
        new RadialGradientPaint(center, 0.5f * w, dist, colors);
    g.setPaint(p);
    g.fillRect(0, 0, w, h);
    g.dispose();

    return img;
}
 
源代码12 项目: jdk8u-dev-jdk   文件: MlibOpsTest.java
private static BufferedImage createSrcImage() {
    BufferedImage img = createImage();

    Graphics2D g = img.createGraphics();
    Color[] colors = { Color.red, Color.green, Color.blue };
    float[] dist = {0.0f, 0.5f, 1.0f };
    Point2D center = new Point2D.Float(0.5f * w, 0.5f * h);

    RadialGradientPaint p =
            new RadialGradientPaint(center, 0.5f * w, dist, colors);
    g.setPaint(p);
    g.fillRect(0, 0, w, h);
    g.dispose();

    return img;
}
 
源代码13 项目: openjdk-8   文件: ConcurrentWritingTest.java
private static BufferedImage createTestImage() {
    int w = 1024;
    int h = 768;

    BufferedImage img = new
        BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = img.createGraphics();
    Color[] colors = { Color.red, Color.green, Color.blue };
    float[] dist = {0.0f, 0.5f, 1.0f };
    Point2D center = new Point2D.Float(0.5f * w, 0.5f * h);

    RadialGradientPaint p =
        new RadialGradientPaint(center, 0.5f * w, dist, colors);
    g.setPaint(p);
    g.fillRect(0, 0, w, h);
    g.dispose();

    return img;
}
 
源代码14 项目: openjdk-jdk9   文件: MlibOpsTest.java
private static BufferedImage createSrcImage() {
    BufferedImage img = createImage();

    Graphics2D g = img.createGraphics();
    Color[] colors = { Color.red, Color.green, Color.blue };
    float[] dist = {0.0f, 0.5f, 1.0f };
    Point2D center = new Point2D.Float(0.5f * w, 0.5f * h);

    RadialGradientPaint p =
            new RadialGradientPaint(center, 0.5f * w, dist, colors);
    g.setPaint(p);
    g.fillRect(0, 0, w, h);
    g.dispose();

    return img;
}
 
源代码15 项目: openjdk-8   文件: MlibOpsTest.java
private static BufferedImage createSrcImage() {
    BufferedImage img = createImage();

    Graphics2D g = img.createGraphics();
    Color[] colors = { Color.red, Color.green, Color.blue };
    float[] dist = {0.0f, 0.5f, 1.0f };
    Point2D center = new Point2D.Float(0.5f * w, 0.5f * h);

    RadialGradientPaint p =
            new RadialGradientPaint(center, 0.5f * w, dist, colors);
    g.setPaint(p);
    g.fillRect(0, 0, w, h);
    g.dispose();

    return img;
}
 
源代码16 项目: jdk8u-jdk   文件: ConcurrentWritingTest.java
private static BufferedImage createTestImage() {
    int w = 1024;
    int h = 768;

    BufferedImage img = new
        BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = img.createGraphics();
    Color[] colors = { Color.red, Color.green, Color.blue };
    float[] dist = {0.0f, 0.5f, 1.0f };
    Point2D center = new Point2D.Float(0.5f * w, 0.5f * h);

    RadialGradientPaint p =
        new RadialGradientPaint(center, 0.5f * w, dist, colors);
    g.setPaint(p);
    g.fillRect(0, 0, w, h);
    g.dispose();

    return img;
}
 
源代码17 项目: jdk8u-dev-jdk   文件: ConcurrentReadingTest.java
private static void createTestFile() {
    int w = 1280;
    int h = 1024;

    BufferedImage img = new
        BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = img.createGraphics();
    Color[] colors = { Color.red, Color.green, Color.blue };
    float[] dist = {0.0f, 0.5f, 1.0f };
    Point2D center = new Point2D.Float(0.5f * w, 0.5f * h);

    RadialGradientPaint p =
        new RadialGradientPaint(center, 0.5f * w, dist, colors);
    g.setPaint(p);
    g.fillRect(0, 0, w, h);
    g.dispose();

    try {
        System.out.println("Create test image " + file.getAbsolutePath());
        boolean b = ImageIO.write(img, "JPEG", file);
        if (!b) {
            throw new RuntimeException("Failed to create test image.");
        }
    } catch (IOException e) {
        throw new RuntimeException("Test failed", e);
    }
}
 
源代码18 项目: dragonwell8_jdk   文件: RenderTests.java
private RadialGradientPaint makeRadial(int numColors, boolean alpha) {
    float interval = 1.0f / (numColors - 1);
    float[] fractions = new float[numColors];
    for (int i = 0; i < fractions.length; i++) {
        fractions[i] = i * interval;
    }
    Color[] colors = makeGradientColors(numColors, alpha);
    return new RadialGradientPaint(0.0f, 0.0f, 10.0f,
                                   fractions, colors,
                                   CycleMethod.REFLECT);
}
 
源代码19 项目: openjdk-8-source   文件: TransformedPaintTest.java
private Paint createPaint(PaintType type, int startx, int starty,
                          int w, int h)
{
    // make sure that the blue color doesn't show up when filling a
    // w by h rect
    w++; h++;

    int endx = startx + w;
    int endy = starty + h;
    Rectangle2D.Float r = new Rectangle2D.Float(startx, starty, w, h);
    switch (type) {
        case COLOR: return Color.red;
        case GRADIENT: return
            new GradientPaint(startx, starty, Color.red,
                              endx, endy, Color.green);
        case LINEAR_GRADIENT: return
            new LinearGradientPaint(startx, starty, endx, endy,
                new float[] { 0.0f, 0.999f, 1.0f },
                new Color[] { Color.red, Color.green, Color.blue });
        case RADIAL_GRADIENT: return
            new RadialGradientPaint(startx, starty,
                (float)Math.sqrt(w * w + h * h),
                new float[] { 0.0f, 0.999f, 1.0f },
                new Color[] { Color.red, Color.green, Color.blue },
                CycleMethod.NO_CYCLE);
        case TEXTURE: {
            BufferedImage bi =
                new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
            Graphics2D g = (Graphics2D) bi.getGraphics();
            g.setPaint(createPaint(PaintType.LINEAR_GRADIENT, 0, 0, w, h));
            g.fillRect(0, 0, w, h);
            return new TexturePaint(bi, r);
        }
    }
    return Color.green;
}
 
源代码20 项目: jfreesvg   文件: SVGGraphics2D.java
/**
 * Returns an SVG color string based on the current paint.  To handle
 * {@code GradientPaint} we rely on the {@code setPaint()} method
 * having set the {@code gradientPaintRef} attribute.
 * 
 * @return An SVG color string. 
 */
private String svgColorStr() {
    String result = "black;";
    if (this.paint instanceof Color) {
        return rgbColorStr((Color) this.paint);
    } else if (this.paint instanceof GradientPaint 
            || this.paint instanceof LinearGradientPaint
            || this.paint instanceof RadialGradientPaint) {
        return "url(#" + this.gradientPaintRef + ")";
    }
    return result;
}
 
protected RadialGradientPaint getAnotherObject() {
    return null; /* TODO: could not update property
    float[] f = { 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f };
    Color[] c = { Color.RED, Color.GREEN, Color.BLUE, Color.RED, Color.GREEN, Color.BLUE };
    return new RadialGradientPaint(
            new Point2D.Float(f[0], f[1]), 100.0f,
            new Point2D.Float(f[2], f[3]),
            f, c, REFLECT, LINEAR_RGB,
            new AffineTransform(f));*/
}
 
源代码22 项目: dragonwell8_jdk   文件: TransformedPaintTest.java
private Paint createPaint(PaintType type, int startx, int starty,
                          int w, int h)
{
    // make sure that the blue color doesn't show up when filling a
    // w by h rect
    w++; h++;

    int endx = startx + w;
    int endy = starty + h;
    Rectangle2D.Float r = new Rectangle2D.Float(startx, starty, w, h);
    switch (type) {
        case COLOR: return Color.red;
        case GRADIENT: return
            new GradientPaint(startx, starty, Color.red,
                              endx, endy, Color.green);
        case LINEAR_GRADIENT: return
            new LinearGradientPaint(startx, starty, endx, endy,
                new float[] { 0.0f, 0.999f, 1.0f },
                new Color[] { Color.red, Color.green, Color.blue });
        case RADIAL_GRADIENT: return
            new RadialGradientPaint(startx, starty,
                (float)Math.sqrt(w * w + h * h),
                new float[] { 0.0f, 0.999f, 1.0f },
                new Color[] { Color.red, Color.green, Color.blue },
                CycleMethod.NO_CYCLE);
        case TEXTURE: {
            BufferedImage bi =
                new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
            Graphics2D g = (Graphics2D) bi.getGraphics();
            g.setPaint(createPaint(PaintType.LINEAR_GRADIENT, 0, 0, w, h));
            g.fillRect(0, 0, w, h);
            return new TexturePaint(bi, r);
        }
    }
    return Color.green;
}
 
源代码23 项目: dragonwell8_jdk   文件: ConcurrentReadingTest.java
private static void createTestFile() {
    int w = 1280;
    int h = 1024;

    BufferedImage img = new
        BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = img.createGraphics();
    Color[] colors = { Color.red, Color.green, Color.blue };
    float[] dist = {0.0f, 0.5f, 1.0f };
    Point2D center = new Point2D.Float(0.5f * w, 0.5f * h);

    RadialGradientPaint p =
        new RadialGradientPaint(center, 0.5f * w, dist, colors);
    g.setPaint(p);
    g.fillRect(0, 0, w, h);
    g.dispose();

    try {
        System.out.println("Create test image " + file.getAbsolutePath());
        boolean b = ImageIO.write(img, "JPEG", file);
        if (!b) {
            throw new RuntimeException("Failed to create test image.");
        }
    } catch (IOException e) {
        throw new RuntimeException("Test failed", e);
    }
}
 
源代码24 项目: dragonwell8_jdk   文件: ReadingInterruptionTest.java
private static void createTestFile() {
    int w = 1280;
    int h = 1024;

    BufferedImage img = new
        BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = img.createGraphics();
    Color[] colors = { Color.red, Color.green, Color.blue };
    float[] dist = {0.0f, 0.5f, 1.0f };
    Point2D center = new Point2D.Float(0.5f * w, 0.5f * h);

    RadialGradientPaint p =
        new RadialGradientPaint(center, 0.5f * w, dist, colors);
    g.setPaint(p);
    g.fillRect(0, 0, w, h);
    g.dispose();

    try {
        System.out.println("Create test image " + file.getAbsolutePath());
        boolean b = ImageIO.write(img, "JPEG", file);
        if (!b) {
            throw new RuntimeException("Failed to create test image.");
        }
    } catch (IOException e) {
        throw new RuntimeException("Test failed", e);
    }
}
 
@Override
public RadialGradientPaint create() {
	Point2D center = ((Point2DSerializationWrapper) map.get(KEY_CENTER))
			.create();
	Point2D focus = ((Point2DSerializationWrapper) map.get(KEY_FOCUS))
			.create();
	float radius = ((Number) map.get(KEY_RADIUS)).floatValue();
	return new RadialGradientPaint(center, radius, focus, getFractions(),
			getColors(), getCycleMethod(), getColorSpace(), getTransform());
}
 
源代码26 项目: openjdk-8   文件: BufferedPaints.java
static void setPaint(RenderQueue rq, SunGraphics2D sg2d,
                     Paint paint, int ctxflags)
{
    if (sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR) {
        setColor(rq, sg2d.pixel);
    } else {
        boolean useMask = (ctxflags & BufferedContext.USE_MASK) != 0;
        switch (sg2d.paintState) {
        case SunGraphics2D.PAINT_GRADIENT:
            setGradientPaint(rq, sg2d,
                             (GradientPaint)paint, useMask);
            break;
        case SunGraphics2D.PAINT_LIN_GRADIENT:
            setLinearGradientPaint(rq, sg2d,
                                   (LinearGradientPaint)paint, useMask);
            break;
        case SunGraphics2D.PAINT_RAD_GRADIENT:
            setRadialGradientPaint(rq, sg2d,
                                   (RadialGradientPaint)paint, useMask);
            break;
        case SunGraphics2D.PAINT_TEXTURE:
            setTexturePaint(rq, sg2d,
                            (TexturePaint)paint, useMask);
            break;
        default:
            break;
        }
    }
}
 
源代码27 项目: buffer_bci   文件: PaintAlpha.java
/**
 * Create a new (if possible, darker) <code>Paint</code> of the same Type.
 * If the Type is not supported, the original <code>Paint</code> is returned.
 * <p>
 * @param paint a <code>Paint</code> implementation
 * (e.g. {@link Color}, {@link GradientPaint}, {@link TexturePaint},..)
 * <p>
 * @return a (usually new, see above) <code>Paint</code>
 */
public static Paint darker(Paint paint) {

    if (paint instanceof Color) {
        return darker((Color) paint);
    }
    if (legacyAlpha == true) {
        /*
         * Legacy? Just return the original Paint.
         * (this corresponds EXACTLY to how Paints used to be darkened)
         */
        return paint;
    }
    if (paint instanceof GradientPaint) {
        return darker((GradientPaint) paint);
    }
    if (paint instanceof LinearGradientPaint) {
        return darkerLinearGradientPaint((LinearGradientPaint) paint);
    }
    if (paint instanceof RadialGradientPaint) {
        return darkerRadialGradientPaint((RadialGradientPaint) paint);
    }
    if (paint instanceof TexturePaint) {
        try {
            return darkerTexturePaint((TexturePaint) paint);
        }
        catch (Exception e) {
            /*
             * Lots can go wrong while fiddling with Images, Color Models
             * & such!  If anything at all goes awry, just return the original
             * TexturePaint.  (TexturePaint's are immutable anyway, so no harm
             * done)
             */
            return paint;
        }
    }
    return paint;
}
 
源代码28 项目: TencentKona-8   文件: BufferedPaints.java
static void setPaint(RenderQueue rq, SunGraphics2D sg2d,
                     Paint paint, int ctxflags)
{
    if (sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR) {
        setColor(rq, sg2d.pixel);
    } else {
        boolean useMask = (ctxflags & BufferedContext.USE_MASK) != 0;
        switch (sg2d.paintState) {
        case SunGraphics2D.PAINT_GRADIENT:
            setGradientPaint(rq, sg2d,
                             (GradientPaint)paint, useMask);
            break;
        case SunGraphics2D.PAINT_LIN_GRADIENT:
            setLinearGradientPaint(rq, sg2d,
                                   (LinearGradientPaint)paint, useMask);
            break;
        case SunGraphics2D.PAINT_RAD_GRADIENT:
            setRadialGradientPaint(rq, sg2d,
                                   (RadialGradientPaint)paint, useMask);
            break;
        case SunGraphics2D.PAINT_TEXTURE:
            setTexturePaint(rq, sg2d,
                            (TexturePaint)paint, useMask);
            break;
        default:
            break;
        }
    }
}
 
源代码29 项目: jdk8u_jdk   文件: ReadingInterruptionTest.java
private static void createTestFile() {
    int w = 1280;
    int h = 1024;

    BufferedImage img = new
        BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = img.createGraphics();
    Color[] colors = { Color.red, Color.green, Color.blue };
    float[] dist = {0.0f, 0.5f, 1.0f };
    Point2D center = new Point2D.Float(0.5f * w, 0.5f * h);

    RadialGradientPaint p =
        new RadialGradientPaint(center, 0.5f * w, dist, colors);
    g.setPaint(p);
    g.fillRect(0, 0, w, h);
    g.dispose();

    try {
        System.out.println("Create test image " + file.getAbsolutePath());
        boolean b = ImageIO.write(img, "JPEG", file);
        if (!b) {
            throw new RuntimeException("Failed to create test image.");
        }
    } catch (IOException e) {
        throw new RuntimeException("Test failed", e);
    }
}
 
源代码30 项目: TencentKona-8   文件: SunGraphics2D.java
/**
 * Sets the Paint in the current graphics state.
 * @param paint The Paint object to be used to generate color in
 * the rendering process.
 * @see java.awt.Graphics#setColor
 * @see GradientPaint
 * @see TexturePaint
 */
public void setPaint(Paint paint) {
    if (paint instanceof Color) {
        setColor((Color) paint);
        return;
    }
    if (paint == null || this.paint == paint) {
        return;
    }
    this.paint = paint;
    if (imageComp == CompositeType.SrcOverNoEa) {
        // special case where compState depends on opacity of paint
        if (paint.getTransparency() == Transparency.OPAQUE) {
            if (compositeState != COMP_ISCOPY) {
                compositeState = COMP_ISCOPY;
            }
        } else {
            if (compositeState == COMP_ISCOPY) {
                compositeState = COMP_ALPHA;
            }
        }
    }
    Class<? extends Paint> paintClass = paint.getClass();
    if (paintClass == GradientPaint.class) {
        paintState = PAINT_GRADIENT;
    } else if (paintClass == LinearGradientPaint.class) {
        paintState = PAINT_LIN_GRADIENT;
    } else if (paintClass == RadialGradientPaint.class) {
        paintState = PAINT_RAD_GRADIENT;
    } else if (paintClass == TexturePaint.class) {
        paintState = PAINT_TEXTURE;
    } else {
        paintState = PAINT_CUSTOM;
    }
    validFontInfo = false;
    invalidatePipe();
}
 
 类所在包
 同包方法