Lines Matching refs:bitmap
230 static void force_all_opaque(const SkBitmap& bitmap) {
231 SkBitmap::Config config = bitmap.config();
234 force_all_opaque_8888(bitmap);
240 fprintf(stderr, "unsupported bitmap config %d\n", config);
241 SkDEBUGFAIL("unsupported bitmap config");
245 static void force_all_opaque_8888(const SkBitmap& bitmap) {
246 SkAutoLockPixels lock(bitmap);
247 for (int y = 0; y < bitmap.height(); y++) {
248 for (int x = 0; x < bitmap.width(); x++) {
249 *bitmap.getAddr32(x, y) |= (SK_A32_MASK << SK_A32_SHIFT);
254 static bool write_bitmap(const SkString& path, const SkBitmap& bitmap) {
259 bitmap.copyTo(©, SkBitmap::kARGB_8888_Config);
317 SkBitmap* bitmap) {
318 bitmap->setConfig(gRec.fConfig, size.width(), size.height());
319 bitmap->allocPixels();
320 bitmap->eraseColor(SK_ColorTRANSPARENT);
358 * bitmap out as a PNG).
362 * CON: If we read a bitmap from disk, we need to take its checksum
363 * from the source PNG (we can't compute it from the bitmap we
366 * CON: Seems wasteful to convert a bitmap to PNG format just to take
379 static void complete_bitmap(SkBitmap* bitmap) {
380 force_all_opaque(*bitmap);
404 SkBitmap* bitmap,
407 setup_bitmap(gRec, size, bitmap);
412 SkAutoTUnref<SkDevice> device(new SkDevice(*bitmap));
436 bitmap->setConfig(SkBitmap::kARGB_8888_Config, size.fWidth,
438 canvas->readPixels(bitmap, 0, 0);
441 complete_bitmap(bitmap);
446 SkPicture* pict, SkBitmap* bitmap,
449 setup_bitmap(gRec, size, bitmap);
450 SkCanvas canvas(*bitmap);
454 complete_bitmap(bitmap);
514 SkBitmap& bitmap, SkDynamicMemoryWStream* document) {
523 success = write_bitmap(path, bitmap);
605 * actual bitmap will be written out to a file within fMismatchPath.
646 // If we have access to a single expected bitmap, log more
741 * @param actualBitmap bitmap generated by this run
760 * force_all_opaque() was called on the bitmap before it
795 * @param gm which test generated the bitmap
798 * @param actualBitmap actual bitmap generated by this run
799 * @param referenceBitmap bitmap we expected to be generated
857 // Test: draw into a bitmap or pdf.
864 SkBitmap* bitmap) {
870 ErrorBitfield errors = generate_image(gm, gRec, context, rt, bitmap,
883 SkPDFDocumentToBitmap(&stream, bitmap);
889 gm, gRec, writePath, *bitmap, &document);
901 SkBitmap bitmap;
904 if (!generate_image(gm, gRec, context, rt, &bitmap, true)) {
908 gm, gRec, "-deferred", bitmap, &referenceBitmap);
918 SkBitmap bitmap;
920 setup_bitmap(gRec, size, &bitmap);
921 SkCanvas canvas(bitmap);
927 complete_bitmap(&bitmap);
932 gm, gRec, string.c_str(), bitmap, &referenceBitmap);
944 SkBitmap bitmap;
946 setup_bitmap(gRec, size, &bitmap);
947 SkCanvas canvas(bitmap);
948 TiledPipeController pipeController(bitmap);
953 complete_bitmap(&bitmap);
958 gm, gRec, string.c_str(), bitmap, &referenceBitmap);
1563 SkBitmap bitmap;
1565 &bitmap);
1567 gm, compareConfig, "-replay", bitmap, &comparisonBitmap);
1576 SkBitmap bitmap;
1578 &bitmap);
1580 gm, compareConfig, "-serialize", bitmap, &comparisonBitmap);
1596 // different bitmap than the standard rendering. It should
1603 SkBitmap bitmap;
1605 &bitmap);
1607 gm, compareConfig, "-rtree", bitmap, &comparisonBitmap);
1622 SkBitmap bitmap;
1624 &bitmap, replayScale);
1631 gm, compareConfig, suffix.c_str(), bitmap,