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

Unified Diff: src/core/SkMiniData.h

Issue 573323002: Add SkMiniData. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: MSVC doesn't like uint8_t data[0]. Created 6 years, 3 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 | « gyp/tests.gypi ('k') | src/core/SkMiniData.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkMiniData.h
diff --git a/src/core/SkMiniData.h b/src/core/SkMiniData.h
new file mode 100644
index 0000000000000000000000000000000000000000..fd22cea9ca502e8024520c82fe14c0ebdf9c2930
--- /dev/null
+++ b/src/core/SkMiniData.h
@@ -0,0 +1,24 @@
+#ifndef SkMiniData_DEFINED
+#define SkMiniData_DEFINED
+
+// A class that can store any immutable byte string,
+// but optimized to store <=7 bytes.
+
+#include "SkTypes.h"
+
+class SkMiniData {
+public:
+ SkMiniData(const void*, size_t);
+ SkMiniData(const SkMiniData&);
+ ~SkMiniData();
+
+ const void* data() const;
+ size_t len() const;
+
+private:
+ SkMiniData& operator=(const SkMiniData&);
+
+ const uint64_t fRep;
+};
+
+#endif//SkMiniData_DEFINED
« no previous file with comments | « gyp/tests.gypi ('k') | src/core/SkMiniData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698