Lines Matching refs:bitmap

29  * the draw calls (writing into the bitmap), a drawing primitive (e.g. Rect,
77 // Maximum bitmap size as defined in Skia's native code
105 * Construct an empty raster canvas. Use setBitmap() to specify a bitmap to
107 * this will typically be replaced when a target bitmap is set for the
111 // 0 means no native bitmap
117 * Construct a canvas with the specified bitmap to draw into. The bitmap
121 * bitmap's density.
123 * @param bitmap Specifies a mutable bitmap for the canvas to draw into.
125 public Canvas(Bitmap bitmap) {
126 if (!bitmap.isMutable()) {
127 throw new IllegalStateException("Immutable bitmap passed to Canvas constructor");
129 throwIfRecycled(bitmap);
130 mNativeCanvas = initRaster(bitmap.ni());
132 mBitmap = bitmap;
133 mDensity = bitmap.mDensity;
171 * Specify a bitmap for the canvas to draw into. As a side-effect, also
172 * updates the canvas's target density to match that of the bitmap.
174 * @param bitmap Specifies a mutable bitmap for the canvas to draw into.
179 public void setBitmap(Bitmap bitmap) {
181 throw new RuntimeException("Can't set a bitmap device on a GL canvas");
185 if (bitmap != null) {
186 if (!bitmap.isMutable()) {
189 throwIfRecycled(bitmap);
190 mDensity = bitmap.mDensity;
191 pointer = bitmap.ni();
195 mBitmap = bitmap;
234 * derived from the density of its backing bitmap, or
238 * to determine the scaling factor when drawing a bitmap into it.
248 * <p>Specifies the density for this Canvas' backing bitmap. This modifies
250 * backing bitmap via {@link Bitmap#setDensity(int) Bitmap.setDensity(int)}.
253 * to determine the scaling factor when drawing a bitmap into it. Use
254 * {@link Bitmap#DENSITY_NONE} to disable bitmap scaling.
273 * Attempting to draw with a bitmap wider than this value will result
284 * Attempting to draw with a bitmap taller than this value will result
334 * offscreen bitmap. All drawing calls are directed there, and only when
341 * @param bounds May be null. The maximum size the offscreen bitmap
366 * offscreen bitmap. All drawing calls are directed there, and only when
373 * @param bounds The maximum size the offscreen bitmap needs to be
645 * coordinate system of the current layer's bitmap, and so not
660 * coordinate system of the current layer's bitmap, and so not
780 * Fill the entire canvas' bitmap (restricted to the current clip) with the
792 * Fill the entire canvas' bitmap (restricted to the current clip) with the
805 * Fill the entire canvas' bitmap (restricted to the current clip) with the
815 * Fill the entire canvas' bitmap (restricted to the current clip) with the
826 * Fill the entire canvas' bitmap (restricted to the current clip) with
1024 private static void throwIfRecycled(Bitmap bitmap) {
1025 if (bitmap.isRecycled()) {
1026 throw new RuntimeException("Canvas: trying to use a recycled bitmap " + bitmap);
1031 * Draws the specified bitmap as an N-patch (most often, a 9-patches.)
1035 * @param bitmap The bitmap to draw as an N-patch
1038 * @param paint The paint to draw the bitmap with. may be null
1042 public void drawPatch(Bitmap bitmap, byte[] chunks, RectF dst, Paint paint) {
1046 * Draw the specified bitmap, with its top/left corner at (x,y), using
1050 * extends beyond the bitmap's original width/height (e.g. BlurMaskFilter),
1051 * then the bitmap will be drawn as if it were in a Shader with CLAMP mode.
1055 * <p>If the bitmap and canvas have different densities, this function
1056 * will take care of automatically scaling the bitmap to draw at the
1059 * @param bitmap The bitmap to be drawn
1060 * @param left The position of the left side of the bitmap being drawn
1061 * @param top The position of the top side of the bitmap being drawn
1062 * @param paint The paint used to draw the bitmap (may be null)
1064 public void drawBitmap(Bitmap bitmap, float left, float top, Paint paint) {
1065 throwIfRecycled(bitmap);
1066 native_drawBitmap(mNativeCanvas, bitmap.ni(), left, top,
1067 paint != null ? paint.mNativePaint : 0, mDensity, mScreenDensity, bitmap.mDensity);
1071 * Draw the specified bitmap, scaling/translating automatically to fill
1073 * specifies the subset of the bitmap to draw.
1076 * extends beyond the bitmap's original width/height (e.g. BlurMaskFilter),
1077 * then the bitmap will be drawn as if it were in a Shader with CLAMP mode.
1081 * <p>This function <em>ignores the density associated with the bitmap</em>.
1086 * @param bitmap The bitmap to be drawn
1087 * @param src May be null. The subset of the bitmap to be drawn
1088 * @param dst The rectangle that the bitmap will be scaled/translated
1090 * @param paint May be null. The paint used to draw the bitmap
1092 public void drawBitmap(Bitmap bitmap, Rect src, RectF dst, Paint paint) {
1096 throwIfRecycled(bitmap);
1097 native_drawBitmap(mNativeCanvas, bitmap.ni(), src, dst,
1098 paint != null ? paint.mNativePaint : 0, mScreenDensity, bitmap.mDensity);
1102 * Draw the specified bitmap, scaling/translating automatically to fill
1104 * specifies the subset of the bitmap to draw.
1107 * extends beyond the bitmap's original width/height (e.g. BlurMaskFilter),
1108 * then the bitmap will be drawn as if it were in a Shader with CLAMP mode.
1112 * <p>This function <em>ignores the density associated with the bitmap</em>.
1117 * @param bitmap The bitmap to be drawn
1118 * @param src May be null. The subset of the bitmap to be drawn
1119 * @param dst The rectangle that the bitmap will be scaled/translated
1121 * @param paint May be null. The paint used to draw the bitmap
1123 public void drawBitmap(Bitmap bitmap, Rect src, Rect dst, Paint paint) {
1127 throwIfRecycled(bitmap);
1128 native_drawBitmap(mNativeCanvas, bitmap.ni(), src, dst,
1129 paint != null ? paint.mNativePaint : 0, mScreenDensity, bitmap.mDensity);
1133 * Treat the specified array of colors as a bitmap, and draw it. This gives
1134 * the same result as first creating a bitmap from the array, and then
1135 * drawing it, but this method avoids explicitly creating a bitmap object
1138 * @param colors Array of colors representing the pixels of the bitmap
1142 * @param x The X coordinate for where to draw the bitmap
1143 * @param y The Y coordinate for where to draw the bitmap
1144 * @param width The width of the bitmap
1145 * @param height The height of the bitmap
1149 * @param paint May be null. The paint used to draw the bitmap
1188 * Draw the bitmap using the specified matrix.
1190 * @param bitmap The bitmap to draw
1191 * @param matrix The matrix used to transform the bitmap when it is drawn
1192 * @param paint May be null. The paint used to draw the bitmap
1194 public void drawBitmap(Bitmap bitmap, Matrix matrix, Paint paint) {
1195 nativeDrawBitmapMatrix(mNativeCanvas, bitmap.ni(), matrix.ni(),
1209 * Draw the bitmap through the mesh, where mesh vertices are evenly
1210 * distributed across the bitmap. There are meshWidth+1 vertices across, and
1213 * top of the bitmap from left to right. A more general version of this
1216 * @param bitmap The bitmap to draw using the mesh
1228 * multiplied by the corresponding bitmap colors. If not null,
1232 * @param paint May be null. The paint used to draw the bitmap
1234 public void drawBitmapMesh(Bitmap bitmap, int meshWidth, int meshHeight,
1249 nativeDrawBitmapMesh(mNativeCanvas, bitmap.ni(), meshWidth, meshHeight,
1289 * into the current shader (e.g. bitmap tile or gradient)
1628 private static native void native_setBitmap(int nativeCanvas, int bitmap);
1697 private native void native_drawBitmap(int nativeCanvas, int bitmap,
1703 private native void native_drawBitmap(int nativeCanvas, int bitmap,
1708 private static native void native_drawBitmap(int nativeCanvas, int bitmap,