OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 #include "gm.h" | 7 #include "gm.h" |
8 | 8 |
9 #include "SkAnnotation.h" | 9 #include "SkAnnotation.h" |
10 #include "SkData.h" | 10 #include "SkData.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 protected: | 25 protected: |
26 virtual SkString onShortName() { | 26 virtual SkString onShortName() { |
27 return SkString("internal_links"); | 27 return SkString("internal_links"); |
28 } | 28 } |
29 | 29 |
30 virtual SkISize onISize() { | 30 virtual SkISize onISize() { |
31 return SkISize::Make(700, 500); | 31 return SkISize::Make(700, 500); |
32 } | 32 } |
33 | 33 |
34 virtual void onDraw(SkCanvas* canvas) { | 34 virtual void onDraw(SkCanvas* canvas) { |
35 SkAutoTUnref<SkData> name(SkData::NewWithCString("target-a")); | 35 sk_sp<SkData> name(SkData::MakeWithCString("target-a")); |
36 | 36 |
37 canvas->save(); | 37 canvas->save(); |
38 canvas->translate(SkIntToScalar(100), SkIntToScalar(100)); | 38 canvas->translate(SkIntToScalar(100), SkIntToScalar(100)); |
39 drawLabeledRect(canvas, "Link to A", 0, 0); | 39 drawLabeledRect(canvas, "Link to A", 0, 0); |
40 SkRect rect = SkRect::MakeXYWH(0, 0, SkIntToScalar(50), SkIntToScalar(20
)); | 40 SkRect rect = SkRect::MakeXYWH(0, 0, SkIntToScalar(50), SkIntToScalar(20
)); |
41 SkAnnotateLinkToDestination(canvas, rect, name.get()); | 41 SkAnnotateLinkToDestination(canvas, rect, name.get()); |
42 canvas->restore(); | 42 canvas->restore(); |
43 | 43 |
44 canvas->save(); | 44 canvas->save(); |
45 canvas->translate(SkIntToScalar(200), SkIntToScalar(200)); | 45 canvas->translate(SkIntToScalar(200), SkIntToScalar(200)); |
(...skipping 22 matching lines...) Expand all Loading... |
68 | 68 |
69 typedef GM INHERITED; | 69 typedef GM INHERITED; |
70 }; | 70 }; |
71 | 71 |
72 ////////////////////////////////////////////////////////////////////////////// | 72 ////////////////////////////////////////////////////////////////////////////// |
73 | 73 |
74 static GM* MyFactory(void*) { return new InternalLinksGM; } | 74 static GM* MyFactory(void*) { return new InternalLinksGM; } |
75 static GMRegistry reg(MyFactory); | 75 static GMRegistry reg(MyFactory); |
76 | 76 |
77 } | 77 } |
OLD | NEW |