Lines Matching refs:bm

28     SkBitmap bm;
31 REPORTER_ASSERT(reporter, !bm.peekPixels(nullptr));
32 REPORTER_ASSERT(reporter, !bm.peekPixels(&pmap));
35 bm.setInfo(SkImageInfo::MakeN32Premul(10, 10));
36 REPORTER_ASSERT(reporter, !bm.peekPixels(nullptr));
37 REPORTER_ASSERT(reporter, !bm.peekPixels(&pmap));
40 bm.allocPixels(info);
41 REPORTER_ASSERT(reporter, bm.peekPixels(nullptr));
42 REPORTER_ASSERT(reporter, bm.peekPixels(&pmap));
43 REPORTER_ASSERT(reporter, pmap.info() == bm.info());
44 REPORTER_ASSERT(reporter, pmap.addr() == bm.getPixels());
45 REPORTER_ASSERT(reporter, pmap.rowBytes() == bm.rowBytes());
54 SkBitmap bm;
55 REPORTER_ASSERT(reporter, !bm.tryAllocPixels(info));
67 SkBitmap bm;
68 bm.setInfo(info);
69 REPORTER_ASSERT(reporter, info.minRowBytes() == bm.rowBytes());
70 bm.allocPixels();
71 REPORTER_ASSERT(reporter, info.minRowBytes() == bm.rowBytes());
72 bm.reset();
73 bm.allocPixels(info);
74 REPORTER_ASSERT(reporter, info.minRowBytes() == bm.rowBytes());
76 bm.setInfo(info, explicitRowBytes);
77 REPORTER_ASSERT(reporter, explicitRowBytes == bm.rowBytes());
78 bm.allocPixels();
79 REPORTER_ASSERT(reporter, explicitRowBytes == bm.rowBytes());
80 bm.reset();
81 bm.allocPixels(info, explicitRowBytes);
82 REPORTER_ASSERT(reporter, explicitRowBytes == bm.rowBytes());
84 bm.reset();
85 bm.setInfo(info, 0);
86 REPORTER_ASSERT(reporter, info.minRowBytes() == bm.rowBytes());
87 bm.reset();
88 bm.allocPixels(info, 0);
89 REPORTER_ASSERT(reporter, info.minRowBytes() == bm.rowBytes());
91 bm.reset();
92 bool success = bm.setInfo(info, info.minRowBytes() - 1); // invalid for 32bit
94 REPORTER_ASSERT(reporter, bm.isNull());
118 bm.reset();
119 success = bm.setInfo(imageInfo, imageInfo.minRowBytes() + rowBytesPadding);
122 success = bm.tryAllocPixels();
127 REPORTER_ASSERT(reporter, bm.isNull());
134 SkBitmap bm;
138 REPORTER_ASSERT(reporter, bm.setInfo(info));
139 REPORTER_ASSERT(reporter, bm.setInfo(info.makeColorType(kRGB_565_SkColorType)));
147 REPORTER_ASSERT(reporter, !bm.setInfo(info.makeColorType(kN32_SkColorType)));
154 SkBitmap bm;
155 bool setConf = bm.setInfo(SkImageInfo::MakeN32Premul(width, height));
158 bm.allocPixels();
160 REPORTER_ASSERT(reporter, SkToBool(width & height) != bm.empty());
193 SkBitmap bm;
194 bm.allocPixels(SkImageInfo::Make(1, 1, ct, kPremul_SkAlphaType));
195 bm.eraseColor(input);
196 INFOF(reporter, "expected: %x actual: %x\n", expected, bm.getColor(0, 0));
197 REPORTER_ASSERT(reporter, bm.getColor(0, 0) == expected);
217 SkBitmap bm;
219 bm.allocPixels(SkImageInfo::Make(13, 17, ct, at));
220 bm.eraseColor(SkColorSetARGB(255, 10, 20, 30));
221 REPORTER_ASSERT(r, SkBitmap::ComputeIsOpaque(bm));
223 bm.eraseColor(SkColorSetARGB(128, 255, 255, 255));
224 bool isOpaque = SkBitmap::ComputeIsOpaque(bm);
234 SkBitmap bm;
235 bm.allocPixels(SkImageInfo::Make(1, 1, kRGBA_F16_SkColorType, kPremul_SkAlphaType));
236 REPORTER_ASSERT(r, bm.peekPixels(&pm));
256 SkBitmap bm;
258 bm.allocPixels(SkImageInfo::Make(1, 1, kN32_SkColorType, kPremul_SkAlphaType,
261 bm.eraseColor(SK_ColorRED);
264 REPORTER_ASSERT(r, bm.getColor(0, 0) == SK_ColorBLUE);
269 SkBitmap bm;
270 bm.allocPixels(SkImageInfo::MakeN32Premul(100,100));
271 bm.setPixelRef(nullptr, 0, 0);
272 SkDEBUGCODE(bm.validate();)
291 SkBitmap bm;
292 bm.allocPixels(info);
294 bm.eraseColor(0x00000000);
296 REPORTER_ASSERT(r, bm.getColor(0,0) == 0xff000000);
298 REPORTER_ASSERT(r, bm.getColor(0,0) == 0x00000000);
301 bm.eraseColor(0xaabbccdd);
302 REPORTER_ASSERT(r, bm.getColor(0,0) != 0xff000000);
303 REPORTER_ASSERT(r, bm.getColor(0,0) != 0x00000000);
307 static void check_alphas(skiatest::Reporter* reporter, const SkBitmap& bm,
309 SkASSERT(bm.width() == 16);
310 SkASSERT(bm.height() == 16);
316 float actual = bm.getAlphaf(x, y);
347 SkBitmap bm;
348 bm.allocPixels(info);
353 *bm.getAddr32(x, y) = alpha++ << 24;
404 tmp.allocPixels(bm.info().makeColorType(rec.fColorType));
405 if (bm.readPixels(tmp.pixmap())) {
437 SkBitmap bm;
438 bm.setInfo(info, r.rowbytes);
439 REPORTER_ASSERT(reporter, size == bm.computeByteSize());
443 bm.allocPixels();
444 sk_bzero(bm.getPixels(), size);