remove SK_SUPPORT_LEGACY_BITMAPFLATTEN code

BUG=skia:
R=scroggo@google.com, reed@google.com

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/303563002

git-svn-id: http://skia.googlecode.com/svn/trunk@14888 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
commit-bot@chromium.org 2014-05-27 14:03:51 +00:00
parent 067fe48266
commit 851155c28e
4 changed files with 5 additions and 41 deletions

View File

@ -24,8 +24,6 @@ class SkRegion;
class SkString;
class GrTexture;
//#define SK_SUPPORT_LEGACY_BITMAPFLATTEN
/** \class SkBitmap
The SkBitmap class specifies a raster bitmap. A bitmap has an integer width
@ -688,21 +686,6 @@ public:
bool extractAlpha(SkBitmap* dst, const SkPaint* paint, Allocator* allocator,
SkIPoint* offset) const;
#ifdef SK_SUPPORT_LEGACY_BITMAPFLATTEN
/** The following two functions provide the means to both flatten and
unflatten the bitmap AND its pixels into the provided buffer.
It is recommended that you do not call these functions directly,
but instead call the write/readBitmap functions on the respective
buffers as they can optimize the recording process and avoid recording
duplicate bitmaps and pixelRefs.
*/
void flatten(SkWriteBuffer&) const;
#else
private:
#endif
void unflatten(SkReadBuffer&);
public:
SkDEBUGCODE(void validate() const;)
class Allocator : public SkRefCnt {
@ -799,6 +782,8 @@ private:
void freePixels();
void updatePixelsFromRef() const;
void legacyUnflatten(SkReadBuffer&);
static void WriteRawPixels(SkWriteBuffer*, const SkBitmap&);
static bool ReadRawPixels(SkReadBuffer*, SkBitmap*);

View File

@ -1347,28 +1347,7 @@ enum {
SERIALIZE_PIXELTYPE_REF_DATA
};
#ifdef SK_SUPPORT_LEGACY_BITMAPFLATTEN
void SkBitmap::flatten(SkWriteBuffer& buffer) const {
fInfo.flatten(buffer);
buffer.writeInt(fRowBytes);
if (fPixelRef) {
if (fPixelRef->getFactory()) {
buffer.writeInt(SERIALIZE_PIXELTYPE_REF_DATA);
buffer.writeInt(fPixelRefOrigin.fX);
buffer.writeInt(fPixelRefOrigin.fY);
buffer.writeFlattenable(fPixelRef);
return;
}
// if we get here, we can't record the pixels
buffer.writeInt(SERIALIZE_PIXELTYPE_NONE);
} else {
buffer.writeInt(SERIALIZE_PIXELTYPE_NONE);
}
}
#endif
void SkBitmap::unflatten(SkReadBuffer& buffer) {
void SkBitmap::legacyUnflatten(SkReadBuffer& buffer) {
this->reset();
SkImageInfo info;

View File

@ -266,7 +266,7 @@ bool SkReadBuffer::readBitmap(SkBitmap* bitmap) {
// A size of zero means the SkBitmap was simply flattened.
if (this->isVersionLT(kNoMoreBitmapFlatten_Version)) {
SkBitmap tmp;
tmp.unflatten(*this);
tmp.legacyUnflatten(*this);
// just throw this guy away
} else {
if (SkBitmap::ReadRawPixels(this, bitmap)) {

View File

@ -28,7 +28,7 @@ SkBitmapSource::SkBitmapSource(const SkBitmap& bitmap, const SkRect& srcRect, co
SkBitmapSource::SkBitmapSource(SkReadBuffer& buffer) : INHERITED(0, buffer) {
if (buffer.isVersionLT(SkReadBuffer::kNoMoreBitmapFlatten_Version)) {
fBitmap.unflatten(buffer);
fBitmap.legacyUnflatten(buffer);
} else {
buffer.readBitmap(&fBitmap);
}