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

Unified Diff: bench/ColorFilterBench.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 | « bench/BlurRectBench.cpp ('k') | bench/MatrixBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/ColorFilterBench.cpp
diff --git a/bench/ColorFilterBench.cpp b/bench/ColorFilterBench.cpp
index 6d98a0eabc74f0e2bddab29ee649f02fa9397464..ad27f1580626aea3c6d0970f22d2174debb916ac 100644
--- a/bench/ColorFilterBench.cpp
+++ b/bench/ColorFilterBench.cpp
@@ -28,7 +28,7 @@ protected:
}
static SkImageFilter* make_brightness(float amount, SkImageFilter* input = NULL) {
- SkScalar amount255 = SkScalarMul(SkFloatToScalar(amount), SkIntToScalar(255));
+ SkScalar amount255 = SkScalarMul(amount, SkIntToScalar(255));
SkScalar matrix[20] = { 1, 0, 0, 0, amount255,
0, 1, 0, 0, amount255,
0, 0, 1, 0, amount255,
@@ -40,10 +40,10 @@ protected:
static SkImageFilter* make_grayscale(SkImageFilter* input = 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);
}
« no previous file with comments | « bench/BlurRectBench.cpp ('k') | bench/MatrixBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698