Lines Matching defs:bitmap
129 SkBitmap bitmap;
130 if (!brd->decodeRegion(&bitmap, nullptr, SkIRect::MakeXYWH(0, 0, width, height),
134 if (colorType != bitmap.colorType()) {
137 canvas->drawBitmap(bitmap, 0, 0);
185 SkBitmap bitmap;
186 if (!brd->decodeRegion(&bitmap, nullptr, SkIRect::MakeXYWH(decodeLeft,
190 if (colorType != bitmap.colorType()) {
194 canvas->drawBitmapRect(bitmap,
281 void premultiply_if_necessary(SkBitmap& bitmap) {
282 if (kUnpremul_SkAlphaType != bitmap.alphaType()) {
286 switch (bitmap.colorType()) {
288 for (int y = 0; y < bitmap.height(); y++) {
289 uint32_t* row = (uint32_t*) bitmap.getAddr(0, y);
290 SkOpts::RGBA_to_rgbA(row, row, bitmap.width());
294 SkColorTable* colorTable = bitmap.getColorTable();
305 // bitmap as kPremul.
306 bitmap.setAlphaType(kPremul_SkAlphaType);
408 SkBitmap bitmap;
416 if (!bitmap.tryAllocPixels(decodeInfo, factory, colorTable.get())) {
424 switch (codec->getPixels(decodeInfo, bitmap.getPixels(), bitmap.rowBytes(), &options,
435 premultiply_if_necessary(bitmap);
436 canvas->drawBitmap(bitmap, 0, 0);
445 void* dst = bitmap.getAddr(0, 0);
446 size_t rowBytes = bitmap.rowBytes();
459 void* dstPtr = bitmap.getAddr(0, dstY);
463 codec->getScanlines(dstPtr, 1, bitmap.rowBytes());
469 premultiply_if_necessary(bitmap);
470 canvas->drawBitmap(bitmap, 0, 0);
502 codec->getScanlines(bitmap.getAddr(0, startY), linesToRead, bitmap.rowBytes());
516 codec->getScanlines(bitmap.getAddr(0, startY), linesToRead, bitmap.rowBytes());
524 premultiply_if_necessary(bitmap);
525 canvas->drawBitmap(bitmap, 0, 0);
546 codec->getScanlines(bitmap.getAddr(x, 0), height, bitmap.rowBytes());
549 premultiply_if_necessary(bitmap);
550 canvas->drawBitmap(bitmap, 0, 0);
572 // We will reuse pixel memory from bitmap.
573 void* pixels = bitmap.getPixels();
696 SkBitmap bitmap;
697 if (!bitmap.tryAllocPixels(decodeInfo, nullptr, colorTable.get())) {
710 switch (codec->getAndroidPixels(decodeInfo, bitmap.getPixels(), bitmap.rowBytes(),
718 premultiply_if_necessary(bitmap);
719 canvas->drawBitmap(bitmap, 0, 0);
752 void* pixels = bitmap.getAddr(scaledWidthOffset, scaledHeightOffset);
763 switch (codec->getAndroidPixels(subsetDecodeInfo, pixels, bitmap.rowBytes(),
776 premultiply_if_necessary(bitmap);
777 canvas->drawBitmapRect(bitmap, rect, rect, nullptr);
1059 static Error draw_to_canvas(Sink* sink, SkBitmap* bitmap, SkWStream* stream, SkString* log,
1071 return sink->draw(ProxySrc(size, draw), bitmap, stream, log);
1078 // Is *bitmap identical to what you get drawing src into sink?
1079 static Error check_against_reference(const SkBitmap* bitmap, const Src& src, Sink* sink) {
1082 if (FLAGS_check && bitmap) {
1092 SkASSERT(reference.getSize() == bitmap->getSize());
1093 if (reference.getSize() != bitmap->getSize()) {
1097 if (0 != memcmp(reference.getPixels(), bitmap->getPixels(), reference.getSize())) {
1115 Error ViaMatrix::draw(const Src& src, SkBitmap* bitmap, SkWStream* stream, SkString* log) const {
1118 return draw_to_canvas(fSink, bitmap, stream, log, size, [&](SkCanvas* canvas) {
1124 // Undoes any flip or 90 degree rotate without changing the scale of the bitmap.
1128 Error ViaUpright::draw(const Src& src, SkBitmap* bitmap, SkWStream* stream, SkString* log) const {
1129 Error err = fSink->draw(src, bitmap, stream, log);
1145 SkISize size = auto_compute_translate(&upright, bitmap->width(), bitmap->height());
1146 uprighted.allocPixels(bitmap->info().makeWH(size.width(), size.height()));
1152 canvas.drawBitmap(*bitmap, 0, 0, &paint);
1154 *bitmap = uprighted;
1155 bitmap->lockPixels();
1161 Error ViaRemote::draw(const Src& src, SkBitmap* bitmap, SkWStream* stream, SkString* log) const {
1162 return draw_to_canvas(fSink, bitmap, stream, log, src.size(), [&](SkCanvas* target) {
1174 const Src& src, SkBitmap* bitmap, SkWStream* stream, SkString* log) const {
1191 return draw_to_canvas(fSink, bitmap, stream, log, size, [&](SkCanvas* canvas) {
1193 return check_against_reference(bitmap, src, fSink);
1205 Error ViaTiles::draw(const Src& src, SkBitmap* bitmap, SkWStream* stream, SkString* log) const {
1216 return draw_to_canvas(fSink, bitmap, stream, log, src.size(), [&](SkCanvas* canvas) {
1253 Error ViaPicture::draw(const Src& src, SkBitmap* bitmap, SkWStream* stream, SkString* log) const {
1255 return draw_to_canvas(fSink, bitmap, stream, log, size, [&](SkCanvas* canvas) -> Error {
1265 return check_against_reference(bitmap, src, fSink);
1274 const Src& src, SkBitmap* bitmap, SkWStream* stream, SkString* log) const {
1276 return draw_to_canvas(fSink, bitmap, stream, log, size, [&](SkCanvas* canvas) -> Error {
1288 return check_against_reference(bitmap, src, fSink);
1295 Error ViaTwice::draw(const Src& src, SkBitmap* bitmap, SkWStream* stream, SkString* log) const {
1296 return draw_to_canvas(fSink, bitmap, stream, log, src.size(), [&](SkCanvas* canvas) -> Error {
1305 return check_against_reference(bitmap, src, fSink);
1312 Error ViaMojo::draw(const Src& src, SkBitmap* bitmap, SkWStream* stream, SkString* log) const {
1348 return check_against_reference(bitmap, src, fSink);
1350 return draw_to_canvas(fSink, bitmap, stream, log, src.size(), fn);
1395 const Src& src, SkBitmap* bitmap, SkWStream* stream, SkString* log) const {
1397 return draw_to_canvas(fSink, bitmap, stream, log, size, [&](SkCanvas* canvas) -> Error {
1424 return check_against_reference(bitmap, src, fSink);