Search in sources :

Example 6 with Shader_Delegate

use of android.graphics.Shader_Delegate in project android_frameworks_base by crdroidandroid.

the class GcSnapshot method setShader.

private boolean setShader(Graphics2D g, Paint_Delegate paint) {
    Shader_Delegate shaderDelegate = paint.getShader();
    if (shaderDelegate != null) {
        if (shaderDelegate.isSupported()) {
            java.awt.Paint shaderPaint = shaderDelegate.getJavaPaint();
            assert shaderPaint != null;
            if (shaderPaint != null) {
                g.setPaint(shaderPaint);
                return true;
            }
        } else {
            Bridge.getLog().fidelityWarning(LayoutLog.TAG_SHADER, shaderDelegate.getSupportMessage(), null, /*throwable*/
            null);
        }
    }
    // if no shader, use the paint color
    g.setColor(new Color(paint.getColor(), true));
    return false;
}
Also used : Shader_Delegate(android.graphics.Shader_Delegate) Color(java.awt.Color)

Aggregations

Shader_Delegate (android.graphics.Shader_Delegate)6 Color (java.awt.Color)6 Paint (android.graphics.Paint)1 Xfermode_Delegate (android.graphics.Xfermode_Delegate)1 AlphaComposite (java.awt.AlphaComposite)1 Composite (java.awt.Composite)1 Graphics2D (java.awt.Graphics2D)1