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

Unified Diff: src/core/SkPixelRef.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/SkMallocPixelRef.cpp ('k') | src/core/SkScaledImageCache.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPixelRef.cpp
diff --git a/src/core/SkPixelRef.cpp b/src/core/SkPixelRef.cpp
index 829c3f1b12b21944dbbce747e63307a2a342dc56..3664dfa17f7b4d1e544bd99dac063ae01a6b1770 100644
--- a/src/core/SkPixelRef.cpp
+++ b/src/core/SkPixelRef.cpp
@@ -108,6 +108,7 @@ SkPixelRef::SkPixelRef(const SkImageInfo& info, SkBaseMutex* mutex) : fInfo(info
fPreLocked = false;
}
+#ifdef SK_SUPPORT_LEGACY_PIXELREF_UNFLATTENABLE
static SkImageInfo read_info(SkReadBuffer& buffer) {
SkImageInfo info;
info.unflatten(buffer);
@@ -130,6 +131,7 @@ SkPixelRef::SkPixelRef(SkReadBuffer& buffer, SkBaseMutex* mutex)
fUniqueGenerationID = false; // Conservatively assuming the original still exists.
fPreLocked = false;
}
+#endif
SkPixelRef::~SkPixelRef() {
this->callGenIDChangeListeners();
@@ -159,23 +161,6 @@ void SkPixelRef::setPreLocked(void* pixels, size_t rowBytes, SkColorTable* ctabl
#endif
}
-void SkPixelRef::flatten(SkWriteBuffer& buffer) const {
- this->INHERITED::flatten(buffer);
- fInfo.flatten(buffer);
- buffer.writeBool(fIsImmutable);
- // We write the gen ID into the picture for within-process recording. This
- // is safe since the same genID will never refer to two different sets of
- // pixels (barring overflow). However, each process has its own "namespace"
- // of genIDs. So for cross-process recording we write a zero which will
- // trigger assignment of a new genID in playback.
- if (buffer.isCrossProcess()) {
- buffer.writeUInt(0);
- } else {
- buffer.writeUInt(fGenerationID);
- fUniqueGenerationID = false; // Conservative, a copy is probably about to exist.
- }
-}
-
bool SkPixelRef::lockPixels(LockRec* rec) {
SkASSERT(!fPreLocked || SKPIXELREF_PRELOCKED_LOCKCOUNT == fLockCount);
« no previous file with comments | « src/core/SkMallocPixelRef.cpp ('k') | src/core/SkScaledImageCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698