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

Side by Side Diff: samplecode/SampleTextOnPath.cpp

Issue 21835004: Blur refactoring (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: hide constant Created 7 years, 4 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 19 matching lines...) Expand all
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(SkFloatToScalar(0.002f),
38 SkFloatToScalar(0.0f), 38 SkFloatToScalar(0.0f),
39 SkFloatToScalar(0.0f), 39 SkFloatToScalar(0.0f),
40 (SkColor)0xFF000000))->unref(); 40 (SkColor)0xFF000000,
41 SkBlurDrawLooper::kNone_BlurFlag))->un ref();
41 42
42 const char* text = "DRAWING STROKED TEXT WITH A BLUR ON A PATH"; 43 const char* text = "DRAWING STROKED TEXT WITH A BLUR ON A PATH";
43 size_t len = strlen(text); 44 size_t len = strlen(text);
44 45
45 canvas->drawTextOnPathHV(text, len, path, 0, 46 canvas->drawTextOnPathHV(text, len, path, 0,
46 SkFloatToScalar(-0.025f), paint); 47 SkFloatToScalar(-0.025f), paint);
47 canvas->restore(); 48 canvas->restore();
48 } 49 }
49 50
50 static void textPathMatrix(SkCanvas* canvas) { 51 static void textPathMatrix(SkCanvas* canvas) {
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 typedef SampleView INHERITED; 166 typedef SampleView INHERITED;
166 }; 167 };
167 168
168 ////////////////////////////////////////////////////////////////////////////// 169 //////////////////////////////////////////////////////////////////////////////
169 170
170 static SkView* MyFactory() { 171 static SkView* MyFactory() {
171 return new TextOnPathView; 172 return new TextOnPathView;
172 } 173 }
173 174
174 static SkViewRegister reg(MyFactory); 175 static SkViewRegister reg(MyFactory);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698