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

Unified Diff: include/core/SkFlattenable.h

Issue 134163010: Refactor read and write buffers. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: whoops, read buffers have .size() Created 6 years, 11 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/SkEmptyShader.h ('k') | include/core/SkFlattenableBuffers.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkFlattenable.h
diff --git a/include/core/SkFlattenable.h b/include/core/SkFlattenable.h
index 5a6e2ae889ef6f19234a886766ab57bea4eaaaa3..ee7a4337100abbbe2724dc564754543f64b6c5d4 100644
--- a/include/core/SkFlattenable.h
+++ b/include/core/SkFlattenable.h
@@ -12,8 +12,8 @@
#include "SkRefCnt.h"
-class SkFlattenableReadBuffer;
-class SkFlattenableWriteBuffer;
+class SkReadBuffer;
+class SkWriteBuffer;
#define SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(flattenable) \
SkFlattenable::Registrar(#flattenable, flattenable::CreateProc, \
@@ -32,7 +32,7 @@ class SkFlattenableWriteBuffer;
#define SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(flattenable) \
virtual Factory getFactory() const SK_OVERRIDE { return CreateProc; } \
- static SkFlattenable* CreateProc(SkFlattenableReadBuffer& buffer) { \
+ static SkFlattenable* CreateProc(SkReadBuffer& buffer) { \
return SkNEW_ARGS(flattenable, (buffer)); \
}
@@ -67,7 +67,7 @@ public:
SK_DECLARE_INST_COUNT(SkFlattenable)
- typedef SkFlattenable* (*Factory)(SkFlattenableReadBuffer&);
+ typedef SkFlattenable* (*Factory)(SkReadBuffer&);
SkFlattenable() {}
@@ -94,19 +94,19 @@ public:
}
};
-protected:
- SkFlattenable(SkFlattenableReadBuffer&) {}
/** Override this to write data specific to your subclass into the buffer,
being sure to call your super-class' version first. This data will later
be passed to your Factory function, returned by getFactory().
*/
- virtual void flatten(SkFlattenableWriteBuffer&) const;
+ virtual void flatten(SkWriteBuffer&) const;
+
+protected:
+ SkFlattenable(SkReadBuffer&) {}
private:
static void InitializeFlattenablesIfNeeded();
friend class SkGraphics;
- friend class SkFlattenableWriteBuffer;
typedef SkRefCnt INHERITED;
};
« no previous file with comments | « include/core/SkEmptyShader.h ('k') | include/core/SkFlattenableBuffers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698