share constructors/enum in both variants of SkReadBuffer
Bug: skia:
Change-Id: I5a90e1f9a9687df2dd2f69d96ac805bf244cec50
Reviewed-on: https://skia-review.googlesource.com/c/179844
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
diff --git a/src/core/SkReadBuffer.h b/src/core/SkReadBuffer.h
index bbb036f..83b684c 100644
--- a/src/core/SkReadBuffer.h
+++ b/src/core/SkReadBuffer.h
@@ -25,8 +25,6 @@
class SkData;
class SkImage;
-#ifndef SK_DISABLE_READBUFFER
-
class SkReadBuffer {
public:
SkReadBuffer();
@@ -47,6 +45,8 @@
kSerializeFonts_Version = 67,
};
+#ifndef SK_DISABLE_READBUFFER
+
/**
* Returns true IFF the version is older than the specified version.
*/
@@ -227,30 +227,9 @@
}
bool fError = false;
-};
#else // #ifndef SK_DISABLE_READBUFFER
-class SkReadBuffer {
-public:
- SkReadBuffer() {}
- SkReadBuffer(const void*, size_t) {}
-
- enum Version {
- kTileModeInBlurImageFilter_Version = 56,
- kTileInfoInSweepGradient_Version = 57,
- k2PtConicalNoFlip_Version = 58,
- kRemovePictureImageFilterLocalSpace = 59,
- kRemoveHeaderFlags_Version = 60,
- kTwoColorDrawShadow_Version = 61,
- kDontNegateImageSize_Version = 62,
- kStoreImageBounds_Version = 63,
- kRemoveOccluderFromBlurMaskFilter = 64,
- kFloat4PaintColor_Version = 65,
- kSaveBehind_Version = 66,
- kSerializeFonts_Version = 67,
- };
-
bool isVersionLT(Version) const { return false; }
uint32_t getVersion() const { return 0xffffffff; }
void setVersion(int) {}
@@ -332,8 +311,7 @@
static const SkDeserialProcs procs;
return procs;
}
+#endif
};
-#endif // #ifndef SK_DISABLE_READBUFFER
-
#endif // SkReadBuffer_DEFINED