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

Side by Side Diff: samplecode/SampleEffects.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 | « samplecode/SampleDither.cpp ('k') | samplecode/SampleFilter2.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkBlurMask.h" 9 #include "SkBlurMask.h"
10 #include "SkBlurMaskFilter.h" 10 #include "SkBlurMaskFilter.h"
(...skipping 15 matching lines...) Expand all
26 paint->setMaskFilter(SkBlurMaskFilter::Create( 26 paint->setMaskFilter(SkBlurMaskFilter::Create(
27 SkBlurMaskFilter::kNormal_BlurStyle, 27 SkBlurMaskFilter::kNormal_BlurStyle,
28 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(2 ))))->unref(); 28 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(2 ))))->unref();
29 } 29 }
30 30
31 static void paint_proc2(SkPaint* paint) { 31 static void paint_proc2(SkPaint* paint) {
32 SkScalar dir[3] = { 1, 1, 1}; 32 SkScalar dir[3] = { 1, 1, 1};
33 paint->setMaskFilter( 33 paint->setMaskFilter(
34 SkBlurMaskFilter::CreateEmboss(SkBlurMask::ConvertRadiusToSigma(SkIn tToScalar(1)), 34 SkBlurMaskFilter::CreateEmboss(SkBlurMask::ConvertRadiusToSigma(SkIn tToScalar(1)),
35 dir, 35 dir,
36 SkFloatToScalar(0.1f), 36 0.1f,
37 SkFloatToScalar(0.05f)))->unref(); 37 0.05f))->unref();
38 } 38 }
39 39
40 static void paint_proc3(SkPaint* paint) { 40 static void paint_proc3(SkPaint* paint) {
41 SkColor colors[] = { SK_ColorRED, COLOR, SK_ColorBLUE }; 41 SkColor colors[] = { SK_ColorRED, COLOR, SK_ColorBLUE };
42 SkPoint pts[] = { { 3, 0 }, { 7, 5 } }; 42 SkPoint pts[] = { { 3, 0 }, { 7, 5 } };
43 paint->setShader(SkGradientShader::CreateLinear(pts, colors, NULL, SK_ARRAY_ COUNT(colors), 43 paint->setShader(SkGradientShader::CreateLinear(pts, colors, NULL, SK_ARRAY_ COUNT(colors),
44 SkShader::kMirror_TileMode))->unref(); 44 SkShader::kMirror_TileMode))->unref();
45 } 45 }
46 46
47 static void paint_proc5(SkPaint* paint) { 47 static void paint_proc5(SkPaint* paint) {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 } 114 }
115 115
116 private: 116 private:
117 typedef SampleView INHERITED; 117 typedef SampleView INHERITED;
118 }; 118 };
119 119
120 /////////////////////////////////////////////////////////////////////////////// 120 ///////////////////////////////////////////////////////////////////////////////
121 121
122 static SkView* MyFactory() { return new EffectsView; } 122 static SkView* MyFactory() { return new EffectsView; }
123 static SkViewRegister reg(MyFactory); 123 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleDither.cpp ('k') | samplecode/SampleFilter2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698