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

Side by Side Diff: samplecode/SampleFontScalerTest.cpp

Issue 85463005: remove SkFloatToScalar macro (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: add flag to expose SkFloatToScalar to chromium Created 7 years 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
« no previous file with comments | « samplecode/SampleFilterFuzz.cpp ('k') | samplecode/SampleHairline.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkView.h" 9 #include "SkView.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 canvas->translate(-px, -py); 70 canvas->translate(-px, -py);
71 } 71 }
72 72
73 virtual void onDrawContent(SkCanvas* canvas) { 73 virtual void onDrawContent(SkCanvas* canvas) {
74 SkPaint paint; 74 SkPaint paint;
75 75
76 // test handling of obscene cubic values (currently broken) 76 // test handling of obscene cubic values (currently broken)
77 if (false) { 77 if (false) {
78 SkPoint pts[4]; 78 SkPoint pts[4];
79 pts[0].set(1.61061274e+09f, 6291456); 79 pts[0].set(1.61061274e+09f, 6291456);
80 pts[1].set(SkFloatToScalar(-7.18397061e+15f), 80 pts[1].set(-7.18397061e+15f,
81 SkFloatToScalar(-1.53091184e+13f)); 81 -1.53091184e+13f);
82 pts[2].set(SkFloatToScalar(-1.30077315e+16f), 82 pts[2].set(-1.30077315e+16f,
83 SkFloatToScalar(-2.77196141e+13f)); 83 -2.77196141e+13f);
84 pts[3].set(SkFloatToScalar(-1.30077315e+16f), 84 pts[3].set(-1.30077315e+16f,
85 SkFloatToScalar(-2.77196162e+13f)); 85 -2.77196162e+13f);
86 86
87 SkPath path; 87 SkPath path;
88 path.moveTo(pts[0]); 88 path.moveTo(pts[0]);
89 path.cubicTo(pts[1], pts[2], pts[3]); 89 path.cubicTo(pts[1], pts[2], pts[3]);
90 canvas->drawPath(path, paint); 90 canvas->drawPath(path, paint);
91 } 91 }
92 92
93 // paint.setSubpixelText(true); 93 // paint.setSubpixelText(true);
94 paint.setAntiAlias(true); 94 paint.setAntiAlias(true);
95 paint.setLCDRenderText(true); 95 paint.setLCDRenderText(true);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 } 131 }
132 132
133 private: 133 private:
134 typedef SkView INHERITED; 134 typedef SkView INHERITED;
135 }; 135 };
136 136
137 ////////////////////////////////////////////////////////////////////////////// 137 //////////////////////////////////////////////////////////////////////////////
138 138
139 static SkView* MyFactory() { return new FontScalerTestView; } 139 static SkView* MyFactory() { return new FontScalerTestView; }
140 static SkViewRegister reg(MyFactory); 140 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleFilterFuzz.cpp ('k') | samplecode/SampleHairline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698