Home | History | Annotate | Download | only in images

Lines Matching refs:bm

27     virtual bool onDecode(SkStream* stream, SkBitmap* bm, Mode mode) SK_OVERRIDE;
155 static bool error_return(const SkBitmap& bm, const char msg[]) {
158 msg, bm.width(), bm.height(), bm.getPixels(),
159 bm.getColorTable());
163 static void gif_warning(const SkBitmap& bm, const char msg[]) {
166 msg, bm.width(), bm.height(), bm.getPixels(),
167 bm.getColorTable());
194 static void sanitize_indexed_bitmap(SkBitmap* bm) {
195 if ((kIndex_8_SkColorType == bm->colorType()) && !(bm->empty())) {
196 SkAutoLockPixels alp(*bm);
197 if (bm->getPixels()) {
198 SkColorTable* ct = bm->getColorTable(); // Index8 must have it.
207 uint8_t* addr = static_cast<uint8_t*>(bm->getPixels());
208 int height = bm->height();
209 int width = bm->width();
210 size_t rowBytes = bm->rowBytes();
224 gif_warning(*bm, "Index out of bounds.");
231 bool SkGIFImageDecoder::onDecode(SkStream* sk_stream, SkBitmap* bm, Mode mode) {
238 return error_return(*bm, "DGifOpen");
259 return error_return(*bm, "DGifGetRecordType");
265 return error_return(*bm, "IMAGE_DESC_RECORD_TYPE");
269 return error_return(*bm, "ImageCount < 1");
283 return error_return(*bm, "invalid dimensions");
288 gif_warning(*bm, "image too wide, expanding output to size");
292 gif_warning(*bm, "shifting image left to fit");
295 gif_warning(*bm, "shifting image right to fit");
301 gif_warning(*bm, "image too tall, expanding output to size");
305 gif_warning(*bm, "shifting image up to fit");
308 gif_warning(*bm, "shifting image down to fit");
315 return error_return(*bm, "chooseFromOneChoice");
321 bm->setInfo(SkImageInfo::Make(sampler.scaledWidth(), sampler.scaledHeight(),
351 gif_warning(*bm, "missing colormap");
368 if (!this->allocPixelRef(bm, ctable)) {
369 return error_return(*bm, "allocPixelRef");
375 return error_return(*bm, "non-pos inner width/height");
378 SkAutoLockPixels alp(*bm);
392 memset(bm->getPixels(), fillIndex, bm->getSize());
399 if (!bm->extractSubset(&subset, subsetRect)) {
400 return error_return(*bm, "Extract failed.");
406 workingBitmap = bm;
409 // bm is already locked, but if we had to take a subset, it must be locked also,
414 return error_return(*bm, "Sampler failed to begin.");
424 gif_warning(*bm, "interlace DGifGetLine");
441 gif_warning(*bm, "DGifGetLine");
459 sanitize_indexed_bitmap(bm);
470 return error_return(*bm, "DGifGetExtension");
485 return error_return(*bm, "AddExtensionBlock");
488 return error_return(*bm, "DGifGetExtensionNext");
504 sanitize_indexed_bitmap(bm);