Search in sources :

Example 46 with Shader

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

the class BitmapDrawable method onBoundsChange.

@Override
protected void onBoundsChange(Rect bounds) {
    mDstRectAndInsetsDirty = true;
    final Bitmap bitmap = mBitmapState.mBitmap;
    final Shader shader = mBitmapState.mPaint.getShader();
    if (bitmap != null && shader != null) {
        updateShaderMatrix(bitmap, mBitmapState.mPaint, shader, needMirroring());
    }
}
Also used : Bitmap(android.graphics.Bitmap) Shader(android.graphics.Shader) BitmapShader(android.graphics.BitmapShader)

Aggregations

Shader (android.graphics.Shader)46 Paint (android.graphics.Paint)25 LinearGradient (android.graphics.LinearGradient)17 Bitmap (android.graphics.Bitmap)13 BitmapShader (android.graphics.BitmapShader)13 ShapeDrawable (android.graphics.drawable.ShapeDrawable)9 Matrix (android.graphics.Matrix)6 Point (android.graphics.Point)6 RectShape (android.graphics.drawable.shapes.RectShape)6 ColorDrawable (android.graphics.drawable.ColorDrawable)5 PaintDrawable (android.graphics.drawable.PaintDrawable)5 CallSuper (android.annotation.CallSuper)4 SuppressLint (android.annotation.SuppressLint)4 Drawable (android.graphics.drawable.Drawable)4 ColorFilter (android.graphics.ColorFilter)3 ShaderFactory (android.graphics.drawable.ShapeDrawable.ShaderFactory)3 OvalShape (android.graphics.drawable.shapes.OvalShape)3 Test (org.junit.Test)3 Canvas (android.graphics.Canvas)2 Path (android.graphics.Path)2