diff options
author | Matt Sarett <msarett@google.com> | 2017-05-03 13:20:33 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-05-03 19:05:00 +0000 |
commit | 85591831b2fc0f67968116d73c79ee1232a59935 (patch) | |
tree | 8e02304cfe3b63fe15c6932d88bc2743833bedb7 /src/core | |
parent | 0187ae65845ec1922d7417b3c29dd4596e0c950d (diff) |
Delete SkBitmap::copyTo()
Bug: skia:6465
Change-Id: Ied95fe3aaed9126906fde15bfda73bd6597e3347
Reviewed-on: https://skia-review.googlesource.com/15220
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkBitmap.cpp | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp index c23b5e2bdc..51b8826389 100644 --- a/src/core/SkBitmap.cpp +++ b/src/core/SkBitmap.cpp @@ -513,36 +513,6 @@ bool SkBitmap::extractSubset(SkBitmap* result, const SkIRect& subset) const { /////////////////////////////////////////////////////////////////////////////// -bool SkBitmap::canCopyTo(SkColorType dstCT) const { - const SkColorType srcCT = this->colorType(); - - if (srcCT == kUnknown_SkColorType) { - return false; - } - if (srcCT == kAlpha_8_SkColorType && dstCT != kAlpha_8_SkColorType) { - return false; // can't convert from alpha to non-alpha - } - - bool sameConfigs = (srcCT == dstCT); - switch (dstCT) { - case kAlpha_8_SkColorType: - case kRGB_565_SkColorType: - case kRGBA_8888_SkColorType: - case kBGRA_8888_SkColorType: - break; - case kGray_8_SkColorType: - if (!sameConfigs) { - return false; - } - break; - case kARGB_4444_SkColorType: - return sameConfigs || kN32_SkColorType == srcCT || kIndex_8_SkColorType == srcCT; - default: - return false; - } - return true; -} - bool SkBitmap::readPixels(const SkImageInfo& requestedDstInfo, void* dstPixels, size_t dstRB, int x, int y) const { SkPixmap src; @@ -574,46 +544,6 @@ bool SkBitmap::writePixels(const SkPixmap& src, int dstX, int dstY, return true; } -#ifdef SK_SUPPORT_LEGACY_BITMAP_COPYTO -bool SkBitmap::copyTo(SkBitmap* dst, SkColorType dstColorType) const { - if (!this->canCopyTo(dstColorType)) { - return false; - } - - SkPixmap srcPM; - if (!this->peekPixels(&srcPM)) { - return false; - } - - SkBitmap tmpDst; - SkImageInfo dstInfo = srcPM.info().makeColorType(dstColorType); - if (!tmpDst.setInfo(dstInfo)) { - return false; - } - - // allocate colortable if srcConfig == kIndex8_Config - sk_sp<SkColorTable> ctable; - if (dstColorType == kIndex_8_SkColorType) { - ctable.reset(SkRef(srcPM.ctable())); - } - if (!tmpDst.tryAllocPixels(ctable.get())) { - return false; - } - - SkPixmap dstPM; - if (!tmpDst.peekPixels(&dstPM)) { - return false; - } - - if (!srcPM.readPixels(dstPM)) { - return false; - } - - dst->swap(tmpDst); - return true; -} -#endif - /////////////////////////////////////////////////////////////////////////////// static bool GetBitmapAlpha(const SkBitmap& src, uint8_t* SK_RESTRICT alpha, int alphaRowBytes) { |