Missed this in https://codereview.chromium.org/
1072603002/ (Add GM to repro crbug.com/472795)
Review URL: https://codereview.chromium.org/
1078113002
// V38: Added PictureResolution option to SkPictureImageFilter
// V39: Added FilterLevel option to SkPictureImageFilter
// V40: Remove UniqueID serialization from SkImageFilter.
+ // V41: Added serialization of SkBitmapSource's filterQuality parameter
// Note: If the picture version needs to be increased then please follow the
// steps to generate new SKPs in (only accessible to Googlers): http://goo.gl/qATVcw
// Only SKPs within the min/current picture version range (inclusive) can be read.
static const uint32_t MIN_PICTURE_VERSION = 35; // Produced by Chrome M39.
- static const uint32_t CURRENT_PICTURE_VERSION = 40;
+ static const uint32_t CURRENT_PICTURE_VERSION = 41;
void createHeader(SkPictInfo* info) const;
static bool IsValidPictInfo(const SkPictInfo& info);
kPictureImageFilterResolution_Version = 38,
kPictureImageFilterLevel_Version = 39,
kImageFilterNoUniqueID_Version = 40,
+ kBitmapourceFilterQuality_Version = 41
};
/**
}
SkFlattenable* SkBitmapSource::CreateProc(SkReadBuffer& buffer) {
+ SkFilterQuality filterQuality;
+ if (buffer.isVersionLT(SkReadBuffer::kBitmapourceFilterQuality_Version)) {
+ filterQuality = kHigh_SkFilterQuality;
+ } else {
+ filterQuality = (SkFilterQuality)buffer.readInt();
+ }
SkRect src, dst;
buffer.readRect(&src);
buffer.readRect(&dst);
if (!buffer.readBitmap(&bitmap)) {
return NULL;
}
- return SkBitmapSource::Create(bitmap, src, dst);
+ return SkBitmapSource::Create(bitmap, src, dst, filterQuality);
}
void SkBitmapSource::flatten(SkWriteBuffer& buffer) const {
+ buffer.writeInt(fFilterQuality);
buffer.writeRect(fSrcRect);
buffer.writeRect(fDstRect);
buffer.writeBitmap(fBitmap);