aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkBitmap.cpp
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-04-10 23:31:23 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-11 15:00:19 +0000
commit0f3fdfacf32261f943dcac5cdfd14475011f40db (patch)
tree12b45c03cf92c7208c7c7e68aea7cc9fc817d6ad /src/core/SkBitmap.cpp
parentd177ae18d7f2d02e872adbfaf2bd060beba48365 (diff)
remove unused SkBitmap::copyPixelsTo
Needs https://codereview.chromium.org/2812853002/ to land first Bug: skia:6465 Change-Id: I531e33b2848cd995f20844786ed1a8d34d63fb64 Reviewed-on: https://skia-review.googlesource.com/13171 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src/core/SkBitmap.cpp')
-rw-r--r--src/core/SkBitmap.cpp55
1 files changed, 0 insertions, 55 deletions
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp
index 9b8ea7f96c..30c06debcc 100644
--- a/src/core/SkBitmap.cpp
+++ b/src/core/SkBitmap.cpp
@@ -468,61 +468,6 @@ bool SkBitmap::HeapAllocator::allocPixelRef(SkBitmap* dst,
///////////////////////////////////////////////////////////////////////////////
-static bool copy_pixels_to(const SkPixmap& src, void* const dst, size_t dstSize,
- size_t dstRowBytes, bool preserveDstPad) {
- const SkImageInfo& info = src.info();
-
- if (0 == dstRowBytes) {
- dstRowBytes = src.rowBytes();
- }
- if (dstRowBytes < info.minRowBytes()) {
- return false;
- }
-
- if (!preserveDstPad && static_cast<uint32_t>(dstRowBytes) == src.rowBytes()) {
- size_t safeSize = src.getSafeSize();
- if (safeSize > dstSize || safeSize == 0)
- return false;
- else {
- // This implementation will write bytes beyond the end of each row,
- // excluding the last row, if the bitmap's stride is greater than
- // strictly required by the current config.
- memcpy(dst, src.addr(), safeSize);
- return true;
- }
- } else {
- // If destination has different stride than us, then copy line by line.
- if (info.getSafeSize(dstRowBytes) > dstSize) {
- return false;
- } else {
- // Just copy what we need on each line.
- size_t rowBytes = info.minRowBytes();
- const uint8_t* srcP = reinterpret_cast<const uint8_t*>(src.addr());
- uint8_t* dstP = reinterpret_cast<uint8_t*>(dst);
- for (int row = 0; row < info.height(); ++row) {
- memcpy(dstP, srcP, rowBytes);
- srcP += src.rowBytes();
- dstP += dstRowBytes;
- }
-
- return true;
- }
- }
-}
-
-bool SkBitmap::copyPixelsTo(void* dst, size_t dstSize, size_t dstRB, bool preserveDstPad) const {
- if (nullptr == dst) {
- return false;
- }
- SkAutoPixmapUnlock result;
- if (!this->requestLock(&result)) {
- return false;
- }
- return copy_pixels_to(result.pixmap(), dst, dstSize, dstRB, preserveDstPad);
-}
-
-///////////////////////////////////////////////////////////////////////////////
-
bool SkBitmap::isImmutable() const {
return fPixelRef ? fPixelRef->isImmutable() : false;
}