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

Unified Diff: src/core/SkMallocPixelRef.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 | « src/core/SkBitmap.cpp ('k') | src/core/SkPixelRef.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkMallocPixelRef.cpp
diff --git a/src/core/SkMallocPixelRef.cpp b/src/core/SkMallocPixelRef.cpp
index d51fb7c68b662335cedc89c10efb8bb996067388..447083a50ac68f725eab23393ae809cd2130cddf 100644
--- a/src/core/SkMallocPixelRef.cpp
+++ b/src/core/SkMallocPixelRef.cpp
@@ -200,21 +200,7 @@ size_t SkMallocPixelRef::getAllocatedSizeInBytes() const {
return this->info().getSafeSize(fRB);
}
-void SkMallocPixelRef::flatten(SkWriteBuffer& buffer) const {
- this->INHERITED::flatten(buffer);
-
- buffer.write32(SkToU32(fRB));
-
- // TODO: replace this bulk write with a chunky one that can trim off any
- // trailing bytes on each scanline (in case rowbytes > width*size)
- size_t size = this->info().getSafeSize(fRB);
- buffer.writeByteArray(fStorage, size);
- buffer.writeBool(fCTable != NULL);
- if (fCTable) {
- fCTable->writeToBuffer(buffer);
- }
-}
-
+#ifdef SK_SUPPORT_LEGACY_PIXELREF_UNFLATTENABLE
SkMallocPixelRef::SkMallocPixelRef(SkReadBuffer& buffer)
: INHERITED(buffer, NULL)
, fReleaseProc(sk_free_releaseproc)
@@ -237,6 +223,7 @@ SkMallocPixelRef::SkMallocPixelRef(SkReadBuffer& buffer)
this->setPreLocked(fStorage, fRB, fCTable);
}
+#endif
///////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « src/core/SkBitmap.cpp ('k') | src/core/SkPixelRef.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698