Lines Matching refs:bm

27     Result onDecode(SkStream* stream, SkBitmap* bm, Mode mode) override;
155 static SkImageDecoder::Result error_return(const SkBitmap& bm, const char msg[]) { in error_return() argument
158 msg, bm.width(), bm.height(), bm.getPixels(), in error_return()
159 bm.getColorTable()); in error_return()
164 static void gif_warning(const SkBitmap& bm, const char msg[]) { in gif_warning() argument
167 msg, bm.width(), bm.height(), bm.getPixels(), in gif_warning()
168 bm.getColorTable()); in gif_warning()
195 static void sanitize_indexed_bitmap(SkBitmap* bm) { in sanitize_indexed_bitmap() argument
196 if ((kIndex_8_SkColorType == bm->colorType()) && !(bm->empty())) { in sanitize_indexed_bitmap()
197 SkAutoLockPixels alp(*bm); in sanitize_indexed_bitmap()
198 if (bm->getPixels()) { in sanitize_indexed_bitmap()
199 SkColorTable* ct = bm->getColorTable(); // Index8 must have it. in sanitize_indexed_bitmap()
208 uint8_t* addr = static_cast<uint8_t*>(bm->getPixels()); in sanitize_indexed_bitmap()
209 int height = bm->height(); in sanitize_indexed_bitmap()
210 int width = bm->width(); in sanitize_indexed_bitmap()
211 size_t rowBytes = bm->rowBytes(); in sanitize_indexed_bitmap()
225 gif_warning(*bm, "Index out of bounds."); in sanitize_indexed_bitmap()
243 SkImageDecoder::Result SkGIFImageDecoder::onDecode(SkStream* sk_stream, SkBitmap* bm, Mode mode) { argument
250 return error_return(*bm, "DGifOpen");
271 return error_return(*bm, "DGifGetRecordType");
277 return error_return(*bm, "IMAGE_DESC_RECORD_TYPE");
281 return error_return(*bm, "ImageCount < 1");
295 return error_return(*bm, "invalid dimensions");
300 gif_warning(*bm, "image too wide, expanding output to size");
304 gif_warning(*bm, "shifting image left to fit");
307 gif_warning(*bm, "shifting image right to fit");
313 gif_warning(*bm, "image too tall, expanding output to size");
317 gif_warning(*bm, "shifting image up to fit");
320 gif_warning(*bm, "shifting image down to fit");
326 bm->setInfo(SkImageInfo::Make(sampler.scaledWidth(), sampler.scaledHeight(),
355 gif_warning(*bm, "missing colormap");
369 if (!this->allocPixelRef(bm, ctable)) {
370 return error_return(*bm, "allocPixelRef");
376 return error_return(*bm, "non-pos inner width/height");
379 SkAutoLockPixels alp(*bm);
393 memset(bm->getPixels(), fillIndex, bm->getSize());
400 if (!bm->extractSubset(&subset, subsetRect)) {
401 return error_return(*bm, "Extract failed.");
407 workingBitmap = bm;
415 return error_return(*bm, "Sampler failed to begin.");
425 gif_warning(*bm, "interlace DGifGetLine");
442 gif_warning(*bm, "DGifGetLine");
460 sanitize_indexed_bitmap(bm);
471 return error_return(*bm, "DGifGetExtension");
486 return error_return(*bm, "AddExtensionBlock");
489 return error_return(*bm, "DGifGetExtensionNext");
505 sanitize_indexed_bitmap(bm);