use of com.airbnb.lottie.animation.LPaint in project lottie-android by airbnb.
the class LottieDrawable method ensureSoftwareRenderingObjectsInitialized.
private void ensureSoftwareRenderingObjectsInitialized() {
if (softwareRenderingCanvas != null) {
return;
}
softwareRenderingCanvas = new Canvas();
softwareRenderingTransformedBounds = new RectF();
softwareRenderingOriginalCanvasMatrix = new Matrix();
softwareRenderingOriginalCanvasMatrixInverse = new Matrix();
canvasClipBounds = new Rect();
canvasClipBoundsRectF = new RectF();
softwareRenderingPaint = new LPaint();
softwareRenderingSrcBoundsRect = new Rect();
softwareRenderingDstBoundsRect = new Rect();
softwareRenderingDstBoundsRectF = new RectF();
}
use of com.airbnb.lottie.animation.LPaint in project lottie-android by airbnb.
the class Utils method renderPath.
/**
* For testing purposes only. DO NOT USE IN PRODUCTION.
*/
@SuppressWarnings("unused")
public static Bitmap renderPath(Path path) {
RectF bounds = new RectF();
path.computeBounds(bounds, false);
Bitmap bitmap = Bitmap.createBitmap((int) bounds.right, (int) bounds.bottom, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
Paint paint = new LPaint();
paint.setAntiAlias(true);
paint.setColor(Color.BLUE);
canvas.drawPath(path, paint);
return bitmap;
}