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

Side by Side Diff: src/core/SkAnnotation.cpp

Issue 26702002: force readbuffer clients to use specialized readFoo for flattenables (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
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 #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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698