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

Side by Side Diff: samplecode/SampleTextOnPath.cpp

Issue 23701006: Push sigma-based blur interface into our GMs/benches/tests/samplecode (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Cleaned up Created 7 years, 3 months 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
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 "SkBlurDrawLooper.h" 9 #include "SkBlurDrawLooper.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 16 matching lines...) Expand all
27 path.addArc(rect, SkIntToScalar(280), SkIntToScalar(350)); 27 path.addArc(rect, SkIntToScalar(280), SkIntToScalar(350));
28 28
29 paint.setAntiAlias(true); 29 paint.setAntiAlias(true);
30 paint.setStyle(SkPaint::kStroke_Style); 30 paint.setStyle(SkPaint::kStroke_Style);
31 paint.setColor(0xFFFF0000); 31 paint.setColor(0xFFFF0000);
32 paint.setTextSize(SkFloatToScalar(0.085f)); 32 paint.setTextSize(SkFloatToScalar(0.085f));
33 paint.setStrokeWidth(SkFloatToScalar(.005f)); 33 paint.setStrokeWidth(SkFloatToScalar(.005f));
34 34
35 canvas->drawPath(path, paint); 35 canvas->drawPath(path, paint);
36 36
37 paint.setLooper(new SkBlurDrawLooper(SkFloatToScalar(0.002f), 37 paint.setLooper(new SkBlurDrawLooper(SK_ColorBLACK,
38 SkFloatToScalar(0.0f), 38 SkFloatToScalar(0.5011f),
39 SkFloatToScalar(0.0f), 39 SkFloatToScalar(0.0f),
40 (SkColor)0xFF000000))->unref(); 40 SkFloatToScalar(0.0f)))->unref();
41 41
42 const char* text = "DRAWING STROKED TEXT WITH A BLUR ON A PATH"; 42 const char* text = "DRAWING STROKED TEXT WITH A BLUR ON A PATH";
43 size_t len = strlen(text); 43 size_t len = strlen(text);
44 44
45 canvas->drawTextOnPathHV(text, len, path, 0, 45 canvas->drawTextOnPathHV(text, len, path, 0,
46 SkFloatToScalar(-0.025f), paint); 46 SkFloatToScalar(-0.025f), paint);
47 canvas->restore(); 47 canvas->restore();
48 } 48 }
49 49
50 static void textPathMatrix(SkCanvas* canvas) { 50 static void textPathMatrix(SkCanvas* canvas) {
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 typedef SampleView INHERITED; 165 typedef SampleView INHERITED;
166 }; 166 };
167 167
168 ////////////////////////////////////////////////////////////////////////////// 168 //////////////////////////////////////////////////////////////////////////////
169 169
170 static SkView* MyFactory() { 170 static SkView* MyFactory() {
171 return new TextOnPathView; 171 return new TextOnPathView;
172 } 172 }
173 173
174 static SkViewRegister reg(MyFactory); 174 static SkViewRegister reg(MyFactory);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698