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

Unified Diff: src/core/SkBitmap.cpp

Issue 320873003: change pixelref to not inherit from SkFlattenable (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 5 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/gpu/SkGrPixelRef.h ('k') | src/core/SkMallocPixelRef.cpp » ('j') | 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 316878bad0efd1ee0323f2acda3df44ac3e8a952..e525ea2f1da9ebe5ad69347918d85bfd341e94ff 100644
--- a/src/core/SkBitmap.cpp
+++ b/src/core/SkBitmap.cpp
@@ -1292,6 +1292,7 @@ enum {
};
void SkBitmap::legacyUnflatten(SkReadBuffer& buffer) {
+#ifdef SK_SUPPORT_LEGACY_PIXELREF_UNFLATTENABLE
this->reset();
SkImageInfo info;
@@ -1317,7 +1318,7 @@ void SkBitmap::legacyUnflatten(SkReadBuffer& buffer) {
origin.fX = buffer.readInt();
origin.fY = buffer.readInt();
size_t offset = origin.fY * rowBytes + origin.fX * info.bytesPerPixel();
- SkPixelRef* pr = buffer.readPixelRef();
+ SkPixelRef* pr = buffer.readFlattenable<SkPixelRef>();
if (!buffer.validate((NULL == pr) ||
(pr->getAllocatedSizeInBytes() >= (offset + this->getSafeSize())))) {
origin.setZero();
@@ -1332,6 +1333,9 @@ void SkBitmap::legacyUnflatten(SkReadBuffer& buffer) {
sk_throw();
}
}
+#else
+ sk_throw();
+#endif
}
///////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « include/gpu/SkGrPixelRef.h ('k') | src/core/SkMallocPixelRef.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698