| Index: src/core/SkDraw.cpp
|
| diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp
|
| index ab2d5cccb30ed5f5173b3c544b9c57f44a4150e3..918ef765ebbf89d93b3d59086ec19b196aea8c53 100644
|
| --- a/src/core/SkDraw.cpp
|
| +++ b/src/core/SkDraw.cpp
|
| @@ -1156,16 +1156,17 @@ void SkDraw::drawBitmapAsMask(const SkBitmap& bitmap,
|
| int ix = SkScalarRoundToInt(fMatrix->getTranslateX());
|
| int iy = SkScalarRoundToInt(fMatrix->getTranslateY());
|
|
|
| - SkAutoLockPixels alp(bitmap);
|
| - if (!bitmap.readyToDraw()) {
|
| + SkAutoPixmapUnlock result;
|
| + if (!bitmap.requestLock(&result)) {
|
| return;
|
| }
|
| -
|
| + const SkPixmap& pmap = result.pixmap();
|
| SkMask mask;
|
| - mask.fBounds.set(ix, iy, ix + bitmap.width(), iy + bitmap.height());
|
| + mask.fBounds.set(ix, iy, ix + pmap.width(), iy + pmap.height());
|
| mask.fFormat = SkMask::kA8_Format;
|
| - mask.fRowBytes = SkToU32(bitmap.rowBytes());
|
| - mask.fImage = bitmap.getAddr8(0, 0);
|
| + mask.fRowBytes = SkToU32(pmap.rowBytes());
|
| + // fImage is typed as writable, but in this case it is used read-only
|
| + mask.fImage = (uint8_t*)pmap.addr8(0, 0);
|
|
|
| this->drawDevMask(mask, paint);
|
| } else { // need to xform the bitmap first
|
|
|