Lines Matching defs:bitmap
154 static BitmapXferProc ChooseBitmapXferProc(const SkBitmap& bitmap,
192 switch (bitmap.colorType()) {
222 static void CallBitmapXferProc(const SkBitmap& bitmap, const SkIRect& rect,
225 switch (bitmap.colorType()) {
240 uint8_t* pixels = (uint8_t*)bitmap.getPixels();
242 const size_t rowBytes = bitmap.rowBytes();
265 be faster to operate directly on the device bitmap, rather than invoking
333 const SkBitmap* bitmap = blitter->justAnOpaqueColor(&value);
334 SkASSERT(bitmap);
336 uint16_t* addr = bitmap->getAddr16(0, 0);
337 size_t rb = bitmap->rowBytes();
354 const SkBitmap* bitmap = blitter->justAnOpaqueColor(&value);
355 SkASSERT(bitmap);
357 SkPMColor* addr = bitmap->getAddr32(0, 0);
358 size_t rb = bitmap->rowBytes();
1111 static bool just_translate(const SkMatrix& matrix, const SkBitmap& bitmap) {
1114 return SkTreatAsSprite(matrix, bitmap.width(), bitmap.height(), bits);
1117 void SkDraw::drawBitmapAsMask(const SkBitmap& bitmap,
1119 SkASSERT(bitmap.colorType() == kAlpha_8_SkColorType);
1121 if (just_translate(*fMatrix, bitmap)) {
1125 SkAutoLockPixels alp(bitmap);
1126 if (!bitmap.readyToDraw()) {
1131 mask.fBounds.set(ix, iy, ix + bitmap.width(), iy + bitmap.height());
1133 mask.fRowBytes = SkToU32(bitmap.rowBytes());
1134 mask.fImage = bitmap.getAddr8(0, 0);
1137 } else { // need to xform the bitmap first
1142 SkIntToScalar(bitmap.width()), SkIntToScalar(bitmap.height()));
1146 // set the mask's bounds to the transformed bitmap-bounds,
1165 // allocate (and clear) our temp buffer to hold the transformed bitmap
1170 // now draw our bitmap(src) into mask(dst), transformed by the matrix
1186 SkAutoBitmapShaderInstall install(bitmap, tmpPaint);
1188 rr.set(0, 0, SkIntToScalar(bitmap.width()),
1189 SkIntToScalar(bitmap.height()));
1214 const SkBitmap& bitmap) {
1216 clip.quickContains(x, y, x + bitmap.width(), y + bitmap.height());
1219 void SkDraw::drawBitmap(const SkBitmap& bitmap, const SkMatrix& prematrix,
1225 bitmap.width() == 0 || bitmap.height() == 0 ||
1226 bitmap.colorType() == kUnknown_SkColorType) {
1236 if (clipped_out(matrix, *fRC, bitmap.width(), bitmap.height())) {
1240 if (bitmap.colorType() != kAlpha_8_SkColorType && just_translate(matrix, bitmap)) {
1245 SkAutoLockPixels alp(bitmap);
1246 if (!bitmap.readyToDraw()) {
1251 if (clipHandlesSprite(*fRC, ix, iy, bitmap)) {
1254 SkBlitter* blitter = SkBlitter::ChooseSprite(*fBitmap, paint, bitmap,
1258 ir.set(ix, iy, ix + bitmap.width(), iy + bitmap.height());
1271 if (bitmap.colorType() == kAlpha_8_SkColorType) {
1272 draw.drawBitmapAsMask(bitmap, paint);
1274 SkAutoBitmapShaderInstall install(bitmap, paint);
1277 r.set(0, 0, SkIntToScalar(bitmap.width()),
1278 SkIntToScalar(bitmap.height()));
1284 void SkDraw::drawSprite(const SkBitmap& bitmap, int x, int y,
1290 bitmap.width() == 0 || bitmap.height() == 0 ||
1291 bitmap.colorType() == kUnknown_SkColorType) {
1296 bounds.set(x, y, x + bitmap.width(), y + bitmap.height());
1305 if (NULL == paint.getColorFilter() && clipHandlesSprite(*fRC, x, y, bitmap)) {
1308 SkBlitter* blitter = SkBlitter::ChooseSprite(*fBitmap, paint, bitmap,
1325 SkAutoBitmapShaderInstall install(bitmap, paint, &matrix);