Lines Matching refs:bm

244     Result onDecode(SkStream* stream, SkBitmap* bm, Mode) override;
353 const SkBitmap& bm, const char caller[]) {
354 print_jpeg_decoder_errors(cinfo, bm.width(), bm.height(), caller);
360 const SkBitmap& bm, const char caller[]) {
361 print_jpeg_decoder_errors(cinfo, bm.width(), bm.height(), caller);
560 SkImageDecoder::Result SkJPEGImageDecoder::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) {
576 return return_failure(cinfo, *bm, "setjmp");
584 return return_failure(cinfo, *bm, "read_header");
611 bool success = bm->setInfo(SkImageInfo::Make(cinfo.image_width, cinfo.image_height,
637 bool success = bm->setInfo(SkImageInfo::Make(smpl.scaledWidth(), smpl.scaledHeight(),
641 return return_failure(cinfo, *bm, "start_decompress");
651 bm->setInfo(SkImageInfo::Make(sampler.scaledWidth(), sampler.scaledHeight(),
656 if (!this->allocPixelRef(bm, NULL)) {
657 return return_failure(cinfo, *bm, "allocPixelRef");
660 SkAutoLockPixels alp(*bm);
670 JSAMPLE* rowptr = (JSAMPLE*)bm->getPixels();
671 INT32 const bpr = bm->rowBytes();
678 fill_below_level(cinfo.output_scanline, bm);
684 return return_failure(cinfo, *bm, "shouldCancelDecode");
698 return return_failure(cinfo, *bm, "jpeg colorspace");
701 if (!sampler.begin(bm, sc, *this)) {
702 return return_failure(cinfo, *bm, "sampler.begin");
710 return return_failure(cinfo, *bm, "skip rows");
713 // now loop through scanlines until y == bm->height() - 1
720 fill_below_level(y, bm);
726 return return_failure(cinfo, *bm, "shouldCancelDecode");
734 if (bm->height() - 1 == y) {
740 return return_failure(cinfo, *bm, "skip rows");
747 return return_failure(cinfo, *bm, "skip rows");
1026 bool SkJPEGImageDecoder::onDecodeSubset(SkBitmap* bm, const SkIRect& region) {
1081 bool swapOnly = (rect == region) && bm->isNull() &&
1127 bm->swap(bitmap);
1131 return cropBitmap(bm, &bitmap, actualSampleSize, region.x(), region.y(),
1141 return return_false(*cinfo, *bm, "jpeg colorspace");
1186 bm->swap(bitmap);
1189 return cropBitmap(bm, &bitmap, actualSampleSize, region.x(), region.y(),
1345 static WriteScanline ChooseWriter(const SkBitmap& bm) {
1346 switch (bm.colorType()) {
1362 virtual bool onEncode(SkWStream* stream, const SkBitmap& bm, int quality) {
1367 SkAutoLockPixels alp(bm);
1368 if (NULL == bm.getPixels()) {
1386 const WriteScanline writer = ChooseWriter(bm);
1393 cinfo.image_width = bm.width();
1394 cinfo.image_height = bm.height();
1411 const int width = bm.width();
1414 const SkPMColor* colors = bm.getColorTable() ? bm.getColorTable()->readColors() : NULL;
1415 const void* srcRow = bm.getPixels();
1423 srcRow = (const void*)((const char*)srcRow + bm.rowBytes());