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

Unified Diff: gm/colorfilterimagefilter.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 | « gm/blurroundrect.cpp ('k') | gm/colormatrix.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/colorfilterimagefilter.cpp
diff --git a/gm/colorfilterimagefilter.cpp b/gm/colorfilterimagefilter.cpp
index 6323d33f6d38b1800a9a591a9619376cef87eb80..3227dfba178956b3b2a56d9a7c3ee4e1848386a2 100644
--- a/gm/colorfilterimagefilter.cpp
+++ b/gm/colorfilterimagefilter.cpp
@@ -23,7 +23,7 @@ static SkImageFilter* make_blur(float amount, SkImageFilter* input = NULL) {
}
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,
@@ -35,10 +35,10 @@ static SkImageFilter* make_brightness(float amount, SkImageFilter* input = NULL)
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);
}
@@ -62,7 +62,7 @@ protected:
void drawClippedRect(SkCanvas* canvas, const SkRect& r, const SkPaint& paint, float outset = 0.0f) {
canvas->save();
SkRect clip(r);
- clip.outset(SkFloatToScalar(outset), SkFloatToScalar(outset));
+ clip.outset(outset, outset);
canvas->clipRect(clip);
canvas->drawRect(r, paint);
canvas->restore();
« no previous file with comments | « gm/blurroundrect.cpp ('k') | gm/colormatrix.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698