Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Unified Diff: src/core/SkBitmap.cpp

Issue 1020403002: remove SK_SUPPORT_LEGACY_PIXELREF_UNFLATTENABLE code (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkBitmap.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmap.cpp
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp
index 877cfaa6e1e75d05ebc5512c3db879a40bf3f387..c8c651f63852dba71f5b34d0428749d6383dc4fa 100644
--- a/src/core/SkBitmap.cpp
+++ b/src/core/SkBitmap.cpp
@@ -1275,53 +1275,6 @@ enum {
SERIALIZE_PIXELTYPE_REF_DATA
};
-void SkBitmap::legacyUnflatten(SkReadBuffer& buffer) {
-#ifdef SK_SUPPORT_LEGACY_PIXELREF_UNFLATTENABLE
- this->reset();
-
- SkImageInfo info;
- info.unflatten(buffer);
- size_t rowBytes = buffer.readInt();
- if (!buffer.validate((info.width() >= 0) && (info.height() >= 0) &&
- SkColorTypeIsValid(info.fColorType) &&
- SkAlphaTypeIsValid(info.fAlphaType) &&
- SkColorTypeValidateAlphaType(info.fColorType, info.fAlphaType) &&
- info.validRowBytes(rowBytes))) {
- return;
- }
-
- bool configIsValid = this->setInfo(info, rowBytes);
- buffer.validate(configIsValid);
-
- int reftype = buffer.readInt();
- if (buffer.validate((SERIALIZE_PIXELTYPE_REF_DATA == reftype) ||
- (SERIALIZE_PIXELTYPE_NONE == reftype))) {
- switch (reftype) {
- case SERIALIZE_PIXELTYPE_REF_DATA: {
- SkIPoint origin;
- origin.fX = buffer.readInt();
- origin.fY = buffer.readInt();
- size_t offset = origin.fY * rowBytes + origin.fX * info.bytesPerPixel();
- SkPixelRef* pr = buffer.readFlattenable<SkPixelRef>();
- if (!buffer.validate((NULL == pr) ||
- (pr->getAllocatedSizeInBytes() >= (offset + this->getSafeSize())))) {
- origin.setZero();
- }
- SkSafeUnref(this->setPixelRef(pr, origin));
- break;
- }
- case SERIALIZE_PIXELTYPE_NONE:
- break;
- default:
- SkDEBUGFAIL("unrecognized pixeltype in serialized data");
- sk_throw();
- }
- }
-#else
- sk_throw();
-#endif
-}
-
///////////////////////////////////////////////////////////////////////////////
SkBitmap::RLEPixels::RLEPixels(int width, int height) {
« no previous file with comments | « include/core/SkBitmap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698