Lines Matching refs:bm
53 virtual Result onDecode(SkStream* stream, SkBitmap* bm, Mode);
76 static void force_opaque(SkBitmap* bm) { in force_opaque() argument
77 SkAutoLockPixels alp(*bm); in force_opaque()
78 if (!bm->getPixels()) { in force_opaque()
83 switch (bm->colorType()) { in force_opaque()
98 char* row = (char*)bm->getPixels(); in force_opaque()
99 for (int y = 0; y < bm->height(); ++y) { in force_opaque()
100 proc(row, bm->width()); in force_opaque()
101 row += bm->rowBytes(); in force_opaque()
103 bm->setAlphaType(kOpaque_SkAlphaType); in force_opaque()
134 SkImageDecoder::Result SkImageDecoder_CG::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) { in onDecode() argument
160 bm->setInfo(SkImageInfo::MakeN32Premul(width, height, cpType)); in onDecode()
165 if (!this->allocPixelRef(bm, NULL)) { in onDecode()
169 SkAutoLockPixels alp(*bm); in onDecode()
171 if (!SkCopyPixelsFromCGImage(bm->info(), bm->rowBytes(), bm->getPixels(), image)) { in onDecode()
183 force_opaque(bm); in onDecode()
187 if (SkBitmap::ComputeIsOpaque(*bm)) { in onDecode()
188 bm->setAlphaType(kOpaque_SkAlphaType); in onDecode()
191 if (!bm->isOpaque() && this->getRequireUnpremultipliedColors()) { in onDecode()
196 uint32_t* addr = bm->getAddr32(i, j); in onDecode()
200 bm->setAlphaType(kUnpremul_SkAlphaType); in onDecode()
261 virtual bool onEncode(SkWStream* stream, const SkBitmap& bm, int quality);
271 bool SkImageEncoder_CG::onEncode(SkWStream* stream, const SkBitmap& bm, in onEncode() argument
274 const SkBitmap* bmPtr = &bm; in onEncode()
297 if (bm.colorType() == kARGB_4444_SkColorType) { in onEncode()
298 bm.copyTo(&bitmap8888, kN32_SkColorType); in onEncode()