| Index: src/core/SkBitmapDevice.cpp
|
| diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp
|
| index 96f4e40298914e52b2e7009a1ea138109b656011..476a124647ca8bea0c24a0f378a9d51410968868 100644
|
| --- a/src/core/SkBitmapDevice.cpp
|
| +++ b/src/core/SkBitmapDevice.cpp
|
| @@ -199,75 +199,6 @@ bool SkBitmapDevice::onReadPixels(const SkBitmap& bitmap,
|
| return true;
|
| }
|
|
|
| -#ifdef SK_SUPPORT_LEGACY_WRITEPIXELSCONFIG
|
| -void SkBitmapDevice::writePixels(const SkBitmap& bitmap,
|
| - int x, int y,
|
| - SkCanvas::Config8888 config8888) {
|
| - if (bitmap.isNull() || bitmap.getTexture()) {
|
| - return;
|
| - }
|
| - const SkBitmap* sprite = &bitmap;
|
| - // check whether we have to handle a config8888 that doesn't match SkPMColor
|
| - if (SkBitmap::kARGB_8888_Config == bitmap.config() &&
|
| - SkCanvas::kNative_Premul_Config8888 != config8888 &&
|
| - kPMColorAlias != config8888) {
|
| -
|
| - // We're going to have to convert from a config8888 to the native config
|
| - // First we clip to the device bounds.
|
| - SkBitmap dstBmp = this->accessBitmap(true);
|
| - SkIRect spriteRect = SkIRect::MakeXYWH(x, y,
|
| - bitmap.width(), bitmap.height());
|
| - SkIRect devRect = SkIRect::MakeWH(dstBmp.width(), dstBmp.height());
|
| - if (!spriteRect.intersect(devRect)) {
|
| - return;
|
| - }
|
| -
|
| - // write directly to the device if it has pixels and is SkPMColor
|
| - bool drawSprite;
|
| - if (SkBitmap::kARGB_8888_Config == dstBmp.config() && !dstBmp.isNull()) {
|
| - // we can write directly to the dst when doing the conversion
|
| - dstBmp.extractSubset(&dstBmp, spriteRect);
|
| - drawSprite = false;
|
| - } else {
|
| - // we convert to a temporary bitmap and draw that as a sprite
|
| - if (!dstBmp.allocPixels(SkImageInfo::MakeN32Premul(spriteRect.width(),
|
| - spriteRect.height()))) {
|
| - return;
|
| - }
|
| - drawSprite = true;
|
| - }
|
| -
|
| - // copy pixels to dstBmp and convert from config8888 to native config.
|
| - SkAutoLockPixels alp(bitmap);
|
| - uint32_t* srcPixels = bitmap.getAddr32(spriteRect.fLeft - x,
|
| - spriteRect.fTop - y);
|
| - SkCopyConfig8888ToBitmap(dstBmp,
|
| - srcPixels,
|
| - bitmap.rowBytes(),
|
| - config8888);
|
| -
|
| - if (drawSprite) {
|
| - // we've clipped the sprite when we made a copy
|
| - x = spriteRect.fLeft;
|
| - y = spriteRect.fTop;
|
| - sprite = &dstBmp;
|
| - } else {
|
| - return;
|
| - }
|
| - }
|
| -
|
| - SkPaint paint;
|
| - paint.setXfermodeMode(SkXfermode::kSrc_Mode);
|
| - SkRasterClip clip(SkIRect::MakeWH(fBitmap.width(), fBitmap.height()));
|
| - SkDraw draw;
|
| - draw.fRC = &clip;
|
| - draw.fClip = &clip.bwRgn();
|
| - draw.fBitmap = &fBitmap; // canvas should have already called accessBitmap
|
| - draw.fMatrix = &SkMatrix::I();
|
| - this->drawSprite(draw, *sprite, x, y, paint);
|
| -}
|
| -#endif
|
| -
|
| void* SkBitmapDevice::onAccessPixels(SkImageInfo* info, size_t* rowBytes) {
|
| if (fBitmap.getPixels()) {
|
| *info = fBitmap.info();
|
|
|