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

Side by Side Diff: gm/matrixconvolution.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 | « gm/imagefiltersgraph.cpp ('k') | gm/ovals.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 2012 Google Inc. 2 * Copyright 2012 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 7
8 #include "gm.h" 8 #include "gm.h"
9 #include "SkColor.h" 9 #include "SkColor.h"
10 #include "SkMatrixConvolutionImageFilter.h" 10 #include "SkMatrixConvolutionImageFilter.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 void draw(SkCanvas* canvas, int x, int y, const SkIPoint& target, 50 void draw(SkCanvas* canvas, int x, int y, const SkIPoint& target,
51 SkMatrixConvolutionImageFilter::TileMode tileMode, bool convolveAl pha, 51 SkMatrixConvolutionImageFilter::TileMode tileMode, bool convolveAl pha,
52 const SkImageFilter::CropRect* cropRect = NULL) { 52 const SkImageFilter::CropRect* cropRect = NULL) {
53 SkScalar kernel[9] = { 53 SkScalar kernel[9] = {
54 SkIntToScalar( 1), SkIntToScalar( 1), SkIntToScalar( 1), 54 SkIntToScalar( 1), SkIntToScalar( 1), SkIntToScalar( 1),
55 SkIntToScalar( 1), SkIntToScalar(-7), SkIntToScalar( 1), 55 SkIntToScalar( 1), SkIntToScalar(-7), SkIntToScalar( 1),
56 SkIntToScalar( 1), SkIntToScalar( 1), SkIntToScalar( 1), 56 SkIntToScalar( 1), SkIntToScalar( 1), SkIntToScalar( 1),
57 }; 57 };
58 SkISize kernelSize = SkISize::Make(3, 3); 58 SkISize kernelSize = SkISize::Make(3, 3);
59 SkScalar gain = SkFloatToScalar(0.3f), bias = SkIntToScalar(100); 59 SkScalar gain = 0.3f, bias = SkIntToScalar(100);
60 SkPaint paint; 60 SkPaint paint;
61 SkAutoTUnref<SkImageFilter> filter( 61 SkAutoTUnref<SkImageFilter> filter(
62 SkNEW_ARGS(SkMatrixConvolutionImageFilter, (kernelSize, 62 SkNEW_ARGS(SkMatrixConvolutionImageFilter, (kernelSize,
63 kernel, 63 kernel,
64 gain, 64 gain,
65 bias, 65 bias,
66 target, 66 target,
67 tileMode, 67 tileMode,
68 convolveAlpha, 68 convolveAlpha,
69 NULL, 69 NULL,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 SkBitmap fBitmap; 108 SkBitmap fBitmap;
109 bool fInitialized; 109 bool fInitialized;
110 }; 110 };
111 111
112 ////////////////////////////////////////////////////////////////////////////// 112 //////////////////////////////////////////////////////////////////////////////
113 113
114 static GM* MyFactory(void*) { return new MatrixConvolutionGM; } 114 static GM* MyFactory(void*) { return new MatrixConvolutionGM; }
115 static GMRegistry reg(MyFactory); 115 static GMRegistry reg(MyFactory);
116 116
117 } 117 }
OLDNEW
« no previous file with comments | « gm/imagefiltersgraph.cpp ('k') | gm/ovals.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698