Lines Matching defs:bitmap

39  * the draw calls (writing into the bitmap), a drawing primitive (e.g. Rect,
86 // Maximum bitmap size as defined in Skia's native code
104 * Construct an empty raster canvas. Use setBitmap() to specify a bitmap to
106 * this will typically be replaced when a target bitmap is set for the
111 // 0 means no native bitmap
121 * Construct a canvas with the specified bitmap to draw into. The bitmap
125 * bitmap's density.
127 * @param bitmap Specifies a mutable bitmap for the canvas to draw into.
129 public Canvas(@NonNull Bitmap bitmap) {
130 if (!bitmap.isMutable()) {
131 throw new IllegalStateException("Immutable bitmap passed to Canvas constructor");
133 throwIfCannotDraw(bitmap);
134 mNativeCanvasWrapper = initRaster(bitmap);
137 mBitmap = bitmap;
138 mDensity = bitmap.mDensity;
178 * Specify a bitmap for the canvas to draw into. All canvas state such as
181 * the canvas' target density is updated to match that of the bitmap.
183 * @param bitmap Specifies a mutable bitmap for the canvas to draw into.
187 public void setBitmap(@Nullable Bitmap bitmap) {
189 throw new RuntimeException("Can't set a bitmap device on a HW accelerated canvas");
192 if (bitmap == null) {
196 if (!bitmap.isMutable()) {
199 throwIfCannotDraw(bitmap);
201 native_setBitmap(mNativeCanvasWrapper, bitmap);
202 mDensity = bitmap.mDensity;
205 mBitmap = bitmap;
249 * derived from the density of its backing bitmap, or
253 * to determine the scaling factor when drawing a bitmap into it.
263 * <p>Specifies the density for this Canvas' backing bitmap. This modifies
265 * backing bitmap via {@link Bitmap#setDensity(int) Bitmap.setDensity(int)}.
268 * to determine the scaling factor when drawing a bitmap into it. Use
269 * {@link Bitmap#DENSITY_NONE} to disable bitmap scaling.
288 * Attempting to draw with a bitmap wider than this value will result
299 * Attempting to draw with a bitmap taller than this value will result
397 * redirects drawing to an offscreen bitmap.
407 * All drawing calls are directed to a newly allocated offscreen bitmap.
415 * offscreen bitmap is drawn back when restore() is called.
417 * @param bounds May be null. The maximum size the offscreen bitmap
458 * redirects drawing to an offscreen bitmap.
468 * All drawing calls are directed to a newly allocated offscreen bitmap.
473 * The {@code alpha} parameter is applied when the offscreen bitmap is
476 * @param bounds The maximum size the offscreen bitmap needs to be
808 * coordinate system of the current layer's bitmap, and so not
827 * coordinate system of the current layer's bitmap, and so not
964 * Fill the entire canvas' bitmap (restricted to the current clip) with the
976 * Fill the entire canvas' bitmap (restricted to the current clip) with the
989 * Fill the entire canvas' bitmap (restricted to the current clip) with the
999 * Fill the entire canvas' bitmap (restricted to the current clip) with the
1010 * Fill the entire canvas' bitmap (restricted to the current clip) with
1269 protected void throwIfCannotDraw(Bitmap bitmap) {
1270 if (bitmap.isRecycled()) {
1271 throw new RuntimeException("Canvas: trying to use a recycled bitmap " + bitmap);
1273 if (!bitmap.isPremultiplied() && bitmap.getConfig() == Bitmap.Config.ARGB_8888 &&
1274 bitmap.hasAlpha()) {
1275 throw new RuntimeException("Canvas: trying to use a non-premultiplied bitmap "
1276 + bitmap);
1281 * Draws the specified bitmap as an N-patch (most often, a 9-patches.)
1285 * @param paint The paint to draw the bitmap with. may be null
1290 Bitmap bitmap = patch.getBitmap();
1291 throwIfCannotDraw(bitmap);
1293 native_drawNinePatch(mNativeCanvasWrapper, bitmap.getNativeInstance(), patch.mNativeChunk,
1299 * Draws the specified bitmap as an N-patch (most often, a 9-patches.)
1303 * @param paint The paint to draw the bitmap with. may be null
1308 Bitmap bitmap = patch.getBitmap();
1309 throwIfCannotDraw(bitmap);
1311 native_drawNinePatch(mNativeCanvasWrapper, bitmap.getNativeInstance(), patch.mNativeChunk,
1317 * Draw the specified bitmap, with its top/left corner at (x,y), using
1321 * extends beyond the bitmap's original width/height (e.g. BlurMaskFilter),
1322 * then the bitmap will be drawn as if it were in a Shader with CLAMP mode.
1326 * <p>If the bitmap and canvas have different densities, this function
1327 * will take care of automatically scaling the bitmap to draw at the
1330 * @param bitmap The bitmap to be drawn
1331 * @param left The position of the left side of the bitmap being drawn
1332 * @param top The position of the top side of the bitmap being drawn
1333 * @param paint The paint used to draw the bitmap (may be null)
1335 public void drawBitmap(@NonNull Bitmap bitmap, float left, float top, @Nullable Paint paint) {
1336 throwIfCannotDraw(bitmap);
1337 native_drawBitmap(mNativeCanvasWrapper, bitmap, left, top,
1338 paint != null ? paint.getNativeInstance() : 0, mDensity, mScreenDensity, bitmap.mDensity);
1342 * Draw the specified bitmap, scaling/translating automatically to fill
1344 * specifies the subset of the bitmap to draw.
1347 * extends beyond the bitmap's original width/height (e.g. BlurMaskFilter),
1348 * then the bitmap will be drawn as if it were in a Shader with CLAMP mode.
1352 * <p>This function <em>ignores the density associated with the bitmap</em>.
1357 * @param bitmap The bitmap to be drawn
1358 * @param src May be null. The subset of the bitmap to be drawn
1359 * @param dst The rectangle that the bitmap will be scaled/translated
1361 * @param paint May be null. The paint used to draw the bitmap
1363 public void drawBitmap(@NonNull Bitmap bitmap, @Nullable Rect src, @NonNull RectF dst,
1368 throwIfCannotDraw(bitmap);
1374 right = bitmap.getWidth();
1375 bottom = bitmap.getHeight();
1383 native_drawBitmap(mNativeCanvasWrapper, bitmap, left, top, right, bottom,
1385 bitmap.mDensity);
1389 * Draw the specified bitmap, scaling/translating automatically to fill
1391 * specifies the subset of the bitmap to draw.
1394 * extends beyond the bitmap's original width/height (e.g. BlurMaskFilter),
1395 * then the bitmap will be drawn as if it were in a Shader with CLAMP mode.
1399 * <p>This function <em>ignores the density associated with the bitmap</em>.
1404 * @param bitmap The bitmap to be drawn
1405 * @param src May be null. The subset of the bitmap to be drawn
1406 * @param dst The rectangle that the bitmap will be scaled/translated
1408 * @param paint May be null. The paint used to draw the bitmap
1410 public void drawBitmap(@NonNull Bitmap bitmap, @Nullable Rect src, @NonNull Rect dst,
1415 throwIfCannotDraw(bitmap);
1421 right = bitmap.getWidth();
1422 bottom = bitmap.getHeight();
1430 native_drawBitmap(mNativeCanvasWrapper, bitmap, left, top, right, bottom,
1432 bitmap.mDensity);
1436 * Treat the specified array of colors as a bitmap, and draw it. This gives
1437 * the same result as first creating a bitmap from the array, and then
1438 * drawing it, but this method avoids explicitly creating a bitmap object
1441 * @param colors Array of colors representing the pixels of the bitmap
1445 * @param x The X coordinate for where to draw the bitmap
1446 * @param y The Y coordinate for where to draw the bitmap
1447 * @param width The width of the bitmap
1448 * @param height The height of the bitmap
1452 * @param paint May be null. The paint used to draw the bitmap
1504 * Draw the bitmap using the specified matrix.
1506 * @param bitmap The bitmap to draw
1507 * @param matrix The matrix used to transform the bitmap when it is drawn
1508 * @param paint May be null. The paint used to draw the bitmap
1510 public void drawBitmap(@NonNull Bitmap bitmap, @NonNull Matrix matrix, @Nullable Paint paint) {
1511 nativeDrawBitmapMatrix(mNativeCanvasWrapper, bitmap, matrix.ni(),
1525 * Draw the bitmap through the mesh, where mesh vertices are evenly
1526 * distributed across the bitmap. There are meshWidth+1 vertices across, and
1529 * top of the bitmap from left to right. A more general version of this
1532 * @param bitmap The bitmap to draw using the mesh
1544 * multiplied by the corresponding bitmap colors. If not null,
1548 * @param paint May be null. The paint used to draw the bitmap
1550 public void drawBitmapMesh(@NonNull Bitmap bitmap, int meshWidth, int meshHeight,
1566 nativeDrawBitmapMesh(mNativeCanvasWrapper, bitmap, meshWidth, meshHeight,
1606 * into the current shader (e.g. bitmap tile or gradient)
1995 private static native long initRaster(Bitmap bitmap);
1997 Bitmap bitmap);
2088 private native void native_drawBitmap(long nativeCanvas, Bitmap bitmap,
2094 private native void native_drawBitmap(long nativeCanvas, Bitmap bitmap,
2104 Bitmap bitmap,
2108 Bitmap bitmap,