OLD | NEW |
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 #include "SkAnnotation.h" | 8 #include "SkAnnotation.h" |
9 #include "SkDataSet.h" | 9 #include "SkDataSet.h" |
10 #include "SkFlattenableBuffers.h" | 10 #include "SkFlattenableBuffers.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 SkAnnotation::~SkAnnotation() { | 24 SkAnnotation::~SkAnnotation() { |
25 fDataSet->unref(); | 25 fDataSet->unref(); |
26 } | 26 } |
27 | 27 |
28 SkData* SkAnnotation::find(const char name[]) const { | 28 SkData* SkAnnotation::find(const char name[]) const { |
29 return fDataSet->find(name); | 29 return fDataSet->find(name); |
30 } | 30 } |
31 | 31 |
32 SkAnnotation::SkAnnotation(SkFlattenableReadBuffer& buffer) : INHERITED(buffer)
{ | 32 SkAnnotation::SkAnnotation(SkFlattenableReadBuffer& buffer) : INHERITED(buffer)
{ |
33 fFlags = buffer.readUInt(); | 33 fFlags = buffer.readUInt(); |
34 fDataSet = buffer.readFlattenableT<SkDataSet>(); | 34 fDataSet = buffer.readDataSet(); |
35 } | 35 } |
36 | 36 |
37 void SkAnnotation::flatten(SkFlattenableWriteBuffer& buffer) const { | 37 void SkAnnotation::flatten(SkFlattenableWriteBuffer& buffer) const { |
38 buffer.writeUInt(fFlags); | 38 buffer.writeUInt(fFlags); |
39 buffer.writeFlattenable(fDataSet); | 39 buffer.writeFlattenable(fDataSet); |
40 } | 40 } |
41 | 41 |
42 const char* SkAnnotationKeys::URL_Key() { | 42 const char* SkAnnotationKeys::URL_Key() { |
43 return "SkAnnotationKey_URL"; | 43 return "SkAnnotationKey_URL"; |
44 }; | 44 }; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 } | 83 } |
84 | 84 |
85 void SkAnnotateLinkToDestination(SkCanvas* canvas, const SkRect& rect, SkData* n
ame) { | 85 void SkAnnotateLinkToDestination(SkCanvas* canvas, const SkRect& rect, SkData* n
ame) { |
86 if (NULL == name) { | 86 if (NULL == name) { |
87 return; | 87 return; |
88 } | 88 } |
89 SkPaint paint; | 89 SkPaint paint; |
90 annotate_paint(paint, SkAnnotationKeys::Link_Named_Dest_Key(), name); | 90 annotate_paint(paint, SkAnnotationKeys::Link_Named_Dest_Key(), name); |
91 canvas->drawRect(rect, paint); | 91 canvas->drawRect(rect, paint); |
92 } | 92 } |
OLD | NEW |