Lines Matching refs:bm

175     SkBitmap bm;  in test_alphaType()  local
186 bool success = decoder->decode(&stream, &bm, kN32_SkColorType, in test_alphaType()
197 const SkAlphaType boundsAlphaType = bm.alphaType(); in test_alphaType()
206 success = decoder->decode(&stream, &bm, kN32_SkColorType, SkImageDecoder::kDecodePixels_Mode); in test_alphaType()
232 REPORTER_ASSERT(reporter, bm.alphaType() == boundsAlphaType in test_alphaType()
233 || bm.alphaType() == kOpaque_SkAlphaType); in test_alphaType()
272 SkBitmap bm; in DEF_TEST() local
290 bool success = decoder->decode(&stream, &bm, kN32_SkColorType, in DEF_TEST()
297 REPORTER_ASSERT(reporter, bm.width() == 1 && bm.height() == 1); in DEF_TEST()
299 SkAutoLockPixels alp(bm); in DEF_TEST()
300 REPORTER_ASSERT(reporter, bm.getAddr32(0, 0)[0] == 0x7fffffff); in DEF_TEST()
312 success = decoder->decode(&stream, &bm, kN32_SkColorType, in DEF_TEST()
319 REPORTER_ASSERT(reporter, bm.width() == 1 && bm.height() == 1); in DEF_TEST()
321 SkAutoLockPixels alp(bm); in DEF_TEST()
322 REPORTER_ASSERT(reporter, bm.getAddr32(0, 0)[0] == 0x7f7f7f7f); in DEF_TEST()
395 SkBitmap bm; in DEF_TEST() local
397 bool success = SkInstallDiscardablePixelRef(encoded, &bm); in DEF_TEST()
403 SkAutoLockPixels alp(bm); in DEF_TEST()
405 bool rightSize = ((kExpectedWidth == bm.width()) in DEF_TEST()
406 && (kExpectedHeight == bm.height())); in DEF_TEST()
411 for (int y = 0; y < bm.height(); ++y) { in DEF_TEST()
412 for (int x = 0; x < bm.width(); ++x) { in DEF_TEST()
413 error |= (*correctPixel != bm.getColor(x, y)); in DEF_TEST()
446 SkBitmap bm; in DEF_TEST() local
447 SkAssertResult(bm.setInfo(SkImageInfo::MakeN32Premul(1, 1))); in DEF_TEST()
449 install_pixel_ref(&bm, stream.detach(), 1, true)); in DEF_TEST()
450 SkAutoLockPixels alp(bm); in DEF_TEST()
451 REPORTER_ASSERT(reporter, bm.getPixels()); in DEF_TEST()
515 SkBitmap bm; in test_options() local
522 SkDecodingImageGenerator::Create(encodedData, opts), &bm); in test_options()
528 SkDecodingImageGenerator::Create(encodedStream->duplicate(), opts), &bm); in test_options()
546 REPORTER_ASSERT(reporter, check_rounding(bm.height(), kExpectedHeight, in test_options()
548 REPORTER_ASSERT(reporter, check_rounding(bm.width(), kExpectedWidth, in test_options()
556 SkAutoLockPixels alp(bm); in test_options()
557 if (bm.getPixels() == NULL) { in test_options()
567 || (bm.colorType() == requestedColorType)); in test_options()
570 if ((kN32_SkColorType == bm.colorType()) in test_options()
574 SkASSERT(bm.height() == kExpectedHeight); in test_options()
575 SkASSERT(bm.width() == kExpectedWidth); in test_options()
577 for (int y = 0; y < bm.height(); ++y) { in test_options()
578 for (int x = 0; x < bm.width(); ++x) { in test_options()
579 if (*correctPixels != bm.getColor(x, y)) { in test_options()
701 bool allocPixelRef(SkBitmap* bm, SkColorTable* ct) override { in allocPixelRef() argument
702 SkASSERT(bm); in allocPixelRef()
703 if (bm->info().getSafeSize(bm->rowBytes()) <= fSize) { in allocPixelRef()
704 bm->setPixels(fPixels, ct); in allocPixelRef()
709 return bm->tryAllocPixels(NULL, ct); in allocPixelRef()