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

Unified Diff: include/core/SkAnnotation.h

Issue 181703003: Factory methods for heap-allocated SkAnnotation objects. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 10 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 | « no previous file | src/core/SkAnnotation.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkAnnotation.h
diff --git a/include/core/SkAnnotation.h b/include/core/SkAnnotation.h
index 872bb941a5dc9a490d88c80e1c40e1d64dc220e7..d7b9b84529d3524222331337e6862024b39a266d 100644
--- a/include/core/SkAnnotation.h
+++ b/include/core/SkAnnotation.h
@@ -24,18 +24,27 @@ struct SkPoint;
*/
class SkAnnotation : public SkRefCnt {
public:
- SkAnnotation(const char key[], SkData* value);
virtual ~SkAnnotation();
+ static SkAnnotation* Create(const char key[], SkData* value) {
+ return SkNEW_ARGS(SkAnnotation, (key, value));
+ }
+
+ static SkAnnotation* Create(SkReadBuffer& buffer) {
+ return SkNEW_ARGS(SkAnnotation, (buffer));
+ }
+
/**
* Return the data for the specified key, or NULL.
*/
SkData* find(const char key[]) const;
- SkAnnotation(SkReadBuffer&);
void writeToBuffer(SkWriteBuffer&) const;
private:
+ SkAnnotation(const char key[], SkData* value);
+ SkAnnotation(SkReadBuffer&);
+
SkString fKey;
SkData* fData;
« no previous file with comments | « no previous file | src/core/SkAnnotation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698