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

Side by Side Diff: include/core/SkAnnotation.h

Issue 48523008: All SkAnnotations are no-draw. Propose we fold that through. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: deprecate Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | include/core/SkPaint.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkAnnotation_DEFINED 8 #ifndef SkAnnotation_DEFINED
9 #define SkAnnotation_DEFINED 9 #define SkAnnotation_DEFINED
10 10
11 #include "SkRefCnt.h" 11 #include "SkRefCnt.h"
12 #include "SkString.h" 12 #include "SkString.h"
13 13
14 class SkData; 14 class SkData;
15 class SkFlattenableReadBuffer; 15 class SkFlattenableReadBuffer;
16 class SkFlattenableWriteBuffer; 16 class SkFlattenableWriteBuffer;
17 class SkStream; 17 class SkStream;
18 class SkWStream; 18 class SkWStream;
19 struct SkPoint; 19 struct SkPoint;
20 20
21 /** 21 /**
22 * Experimental class for annotating draws. Do not use directly yet. 22 * Experimental class for annotating draws. Do not use directly yet.
23 * Use helper functions at the bottom of this file for now. 23 * Use helper functions at the bottom of this file for now.
24 */ 24 */
25 class SkAnnotation : public SkRefCnt { 25 class SkAnnotation : public SkRefCnt {
26 public: 26 public:
27 enum Flags { 27 SkAnnotation(const char key[], SkData* value);
28 // If set, the associated drawing primitive should not be drawn
29 kNoDraw_Flag = 1 << 0,
30 };
31
32 SkAnnotation(const char key[], SkData* value, uint32_t flags);
33 virtual ~SkAnnotation(); 28 virtual ~SkAnnotation();
34 29
35 uint32_t getFlags() const { return fFlags; }
36
37 bool isNoDraw() const { return SkToBool(fFlags & kNoDraw_Flag); }
38
39 /** 30 /**
40 * Return the data for the specified key, or NULL. 31 * Return the data for the specified key, or NULL.
41 */ 32 */
42 SkData* find(const char key[]) const; 33 SkData* find(const char key[]) const;
43 34
44 SkAnnotation(SkFlattenableReadBuffer&); 35 SkAnnotation(SkFlattenableReadBuffer&);
45 void writeToBuffer(SkFlattenableWriteBuffer&) const; 36 void writeToBuffer(SkFlattenableWriteBuffer&) const;
46 37
47 private: 38 private:
48 SkString fKey; 39 SkString fKey;
49 SkData* fData; 40 SkData* fData;
50 uint32_t fFlags;
51 41
52 typedef SkRefCnt INHERITED; 42 typedef SkRefCnt INHERITED;
53 }; 43 };
54 44
55 /** 45 /**
56 * Experimental collection of predefined Keys into the Annotation dictionary 46 * Experimental collection of predefined Keys into the Annotation dictionary
57 */ 47 */
58 class SkAnnotationKeys { 48 class SkAnnotationKeys {
59 public: 49 public:
60 /** 50 /**
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 * 105 *
116 * If the backend of this canvas does not support annotations, this call is 106 * If the backend of this canvas does not support annotations, this call is
117 * safely ignored. 107 * safely ignored.
118 * 108 *
119 * The caller is responsible for managing its ownership of the SkData. 109 * The caller is responsible for managing its ownership of the SkData.
120 */ 110 */
121 SK_API void SkAnnotateLinkToDestination(SkCanvas*, const SkRect&, SkData*); 111 SK_API void SkAnnotateLinkToDestination(SkCanvas*, const SkRect&, SkData*);
122 112
123 113
124 #endif 114 #endif
OLDNEW
« no previous file with comments | « no previous file | include/core/SkPaint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698