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

Unified Diff: tests/ImageFilterTest.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, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/DrawTextTest.cpp ('k') | tests/LayerDrawLooperTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ImageFilterTest.cpp
diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp
index 2328627d7cff6be4439ff8631bc6d6b99b8bbc1d..69afe47c279c72598098ec9933a91b2f54d63967 100644
--- a/tests/ImageFilterTest.cpp
+++ b/tests/ImageFilterTest.cpp
@@ -58,7 +58,7 @@ public:
}
static SkImageFilter* make_scale(float amount, SkImageFilter* input = NULL) {
- SkScalar s = SkFloatToScalar(amount);
+ SkScalar s = amount;
SkScalar matrix[20] = { s, 0, 0, 0, 0,
0, s, 0, 0, 0,
0, 0, s, 0, 0,
@@ -70,10 +70,10 @@ public:
static SkImageFilter* make_grayscale(SkImageFilter* input = NULL, const SkImageFilter::CropRect* cropRect = NULL) {
SkScalar matrix[20];
memset(matrix, 0, 20 * sizeof(SkScalar));
- matrix[0] = matrix[5] = matrix[10] = SkFloatToScalar(0.2126f);
- matrix[1] = matrix[6] = matrix[11] = SkFloatToScalar(0.7152f);
- matrix[2] = matrix[7] = matrix[12] = SkFloatToScalar(0.0722f);
- matrix[18] = SkFloatToScalar(1.0f);
+ matrix[0] = matrix[5] = matrix[10] = 0.2126f;
+ matrix[1] = matrix[6] = matrix[11] = 0.7152f;
+ matrix[2] = matrix[7] = matrix[12] = 0.0722f;
+ matrix[18] = 1.0f;
SkAutoTUnref<SkColorFilter> filter(new SkColorMatrixFilter(matrix));
return SkColorFilterImageFilter::Create(filter, input, cropRect);
}
@@ -128,12 +128,12 @@ public:
// 2 ) location and target at same value
SkPoint3 target(location.fX, location.fY, location.fZ);
// 3 ) large negative specular exponent value
- SkScalar specularExponent = SkFloatToScalar(-1000);
+ SkScalar specularExponent = -1000;
SkAutoTUnref<SkImageFilter> bmSrc(new SkBitmapSource(bitmap));
SkPaint paint;
paint.setImageFilter(SkLightingImageFilter::CreateSpotLitSpecular(
- location, target, specularExponent, SkFloatToScalar(180),
+ location, target, specularExponent, 180,
0xFFFFFFFF, SK_Scalar1, SK_Scalar1, SK_Scalar1,
bmSrc))->unref();
SkCanvas canvas(result);
@@ -144,7 +144,7 @@ public:
{
// This tests for scale bringing width to 0
- SkSize scale = SkSize::Make(SkFloatToScalar(-0.001f), SK_Scalar1);
+ SkSize scale = SkSize::Make(-0.001f, SK_Scalar1);
SkAutoTUnref<SkImageFilter> bmSrc(new SkBitmapSource(bitmap));
SkAutoTUnref<SkBicubicImageFilter> bicubic(
SkBicubicImageFilter::CreateMitchell(scale, bmSrc));
« no previous file with comments | « tests/DrawTextTest.cpp ('k') | tests/LayerDrawLooperTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698