remove unused copyPixelsFrom ... (copyPixelsTo is next on the chopping block)

git-svn-id: http://skia.googlecode.com/svn/trunk@2579 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@google.com 2011-11-01 15:53:28 +00:00
parent 873c53233c
commit cad8176281
2 changed files with 0 additions and 52 deletions

View File

@ -243,23 +243,6 @@ public:
bool copyPixelsTo(void* const dst, size_t dstSize, int dstRowBytes = -1)
const;
/** Copies the pixels at location src to the bitmap's pixel buffer.
Returns true if copy if possible (bitmap buffer is large enough),
false otherwise.
Like copyPixelsTo, this function may write values beyond the end of
each row, although never outside the defined buffer.
Always returns false for RLE formats.
@param src Location of the source buffer.
@param srcSize Height of source buffer in pixels.
@param srcRowBytes Width of each line in the buffer. If -1, uses i
bitmap's internal stride.
*/
bool copyPixelsFrom(const void* const src, size_t srcSize,
int srcRowBytes = -1);
/** Use the standard HeapAllocator to create the pixelref that manages the
pixel memory. It will be sized based on the current width/height/config.
If this is called multiple times, a new pixelref object will be created

View File

@ -502,41 +502,6 @@ bool SkBitmap::copyPixelsTo(void* const dst, size_t dstSize, int dstRowBytes)
}
}
bool SkBitmap::copyPixelsFrom(const void* const src, size_t srcSize,
int srcRowBytes) {
if (srcRowBytes == -1)
srcRowBytes = fRowBytes;
SkASSERT(srcRowBytes >= 0);
size_t safeSize = getSafeSize();
uint32_t rowBytes = ComputeRowBytes(getConfig(), fWidth);
if (getConfig() == kRLE_Index8_Config || src == NULL ||
static_cast<uint32_t>(srcRowBytes) < rowBytes ||
safeSize == 0 ||
srcSize < ComputeSafeSize(getConfig(), fWidth, fHeight, srcRowBytes)) {
return false;
}
SkAutoLockPixels lock(*this);
if (static_cast<uint32_t>(srcRowBytes) == fRowBytes) {
// 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(getPixels(), src, safeSize);
} else {
// Just copy the bytes we need on each line.
const uint8_t* srcP = reinterpret_cast<const uint8_t*>(src);
uint8_t* dstP = reinterpret_cast<uint8_t*>(getPixels());
for (uint32_t row = 0; row < fHeight;
row++, srcP += srcRowBytes, dstP += fRowBytes) {
memcpy(dstP, srcP, rowBytes);
}
}
return true;
}
///////////////////////////////////////////////////////////////////////////////
bool SkBitmap::isOpaque() const {