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 "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 Loading... |
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 Loading... |
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); |
OLD | NEW |