| 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 "SkData.h" | 9 #include "SkData.h" |
| 10 #include "SkPaint.h" |
| 11 #include "SkPoint.h" |
| 10 #include "SkReadBuffer.h" | 12 #include "SkReadBuffer.h" |
| 11 #include "SkWriteBuffer.h" | 13 #include "SkWriteBuffer.h" |
| 12 #include "SkPoint.h" | |
| 13 #include "SkStream.h" | |
| 14 | 14 |
| 15 SkAnnotation::SkAnnotation(const char key[], SkData* value) : fKey(key) { | 15 SkAnnotation::SkAnnotation(const char key[], SkData* value) : fKey(key) { |
| 16 if (NULL == value) { | 16 if (NULL == value) { |
| 17 value = SkData::NewEmpty(); | 17 value = SkData::NewEmpty(); |
| 18 } else { | 18 } else { |
| 19 value->ref(); | 19 value->ref(); |
| 20 } | 20 } |
| 21 fData = value; | 21 fData = value; |
| 22 } | 22 } |
| 23 | 23 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 } | 78 } |
| 79 | 79 |
| 80 void SkAnnotateLinkToDestination(SkCanvas* canvas, const SkRect& rect, SkData* n
ame) { | 80 void SkAnnotateLinkToDestination(SkCanvas* canvas, const SkRect& rect, SkData* n
ame) { |
| 81 if (NULL == name) { | 81 if (NULL == name) { |
| 82 return; | 82 return; |
| 83 } | 83 } |
| 84 SkPaint paint; | 84 SkPaint paint; |
| 85 annotate_paint(paint, SkAnnotationKeys::Link_Named_Dest_Key(), name); | 85 annotate_paint(paint, SkAnnotationKeys::Link_Named_Dest_Key(), name); |
| 86 canvas->drawRect(rect, paint); | 86 canvas->drawRect(rect, paint); |
| 87 } | 87 } |
| OLD | NEW |