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

Side by Side Diff: samplecode/SampleFilterFuzz.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/SampleFilter2.cpp ('k') | samplecode/SampleFontScalerTest.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 * 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 "SampleCode.h" 7 #include "SampleCode.h"
8 #include "SkBicubicImageFilter.h" 8 #include "SkBicubicImageFilter.h"
9 #include "SkBitmapDevice.h" 9 #include "SkBitmapDevice.h"
10 #include "SkBitmapSource.h" 10 #include "SkBitmapSource.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 case 3: v = 10000.0f; break; 73 case 3: v = 10000.0f; break;
74 case 4: v = 2000000000.0f; break; 74 case 4: v = 2000000000.0f; break;
75 case 5: v = huge(); break; 75 case 5: v = huge(); break;
76 } 76 }
77 77
78 if (!positiveOnly && (R(4) == 1)) v = -v; 78 if (!positiveOnly && (R(4) == 1)) v = -v;
79 return v; 79 return v;
80 } 80 }
81 81
82 static SkScalar make_scalar(bool positiveOnly = false) { 82 static SkScalar make_scalar(bool positiveOnly = false) {
83 return SkFloatToScalar(make_number(positiveOnly)); 83 return make_number(positiveOnly);
84 } 84 }
85 85
86 static SkRect make_rect(int offset = 1) { 86 static SkRect make_rect(int offset = 1) {
87 return SkRect::MakeWH(SkIntToScalar(R(static_cast<float>(kBitmapSize))+offse t), 87 return SkRect::MakeWH(SkIntToScalar(R(static_cast<float>(kBitmapSize))+offse t),
88 SkIntToScalar(R(static_cast<float>(kBitmapSize))+offse t)); 88 SkIntToScalar(R(static_cast<float>(kBitmapSize))+offse t));
89 } 89 }
90 90
91 static SkXfermode::Mode make_xfermode() { 91 static SkXfermode::Mode make_xfermode() {
92 return static_cast<SkXfermode::Mode>(R(SkXfermode::kLastMode+1)); 92 return static_cast<SkXfermode::Mode>(R(SkXfermode::kLastMode+1));
93 } 93 }
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 } 323 }
324 324
325 private: 325 private:
326 typedef SkView INHERITED; 326 typedef SkView INHERITED;
327 }; 327 };
328 328
329 ////////////////////////////////////////////////////////////////////////////// 329 //////////////////////////////////////////////////////////////////////////////
330 330
331 static SkView* MyFactory() { return new ImageFilterFuzzView; } 331 static SkView* MyFactory() { return new ImageFilterFuzzView; }
332 static SkViewRegister reg(MyFactory); 332 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleFilter2.cpp ('k') | samplecode/SampleFontScalerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698