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

Side by Side Diff: gm/internal_links.cpp

Issue 2206633004: Move off SK_SUPPORT_LEGACY_DATA_FACTORIES. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Gotta catch 'em all. Created 4 years, 4 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
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698