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

Side by Side Diff: site/user/api/skpaint.md

Issue 1993903002: Fix example code in skpaint.md. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 SkPaint 1 SkPaint
2 ======= 2 =======
3 3
4 *color, stroke, font, effects* 4 *color, stroke, font, effects*
5 5
6 - [SkXfermode](#SkXfermode) - transfer modes 6 - [SkXfermode](#SkXfermode) - transfer modes
7 - [ShShader](#ShShader) - gradients and patterns 7 - [ShShader](#ShShader) - gradients and patterns
8 - [SkMaskFilter](#SkMaskFilter) - modifications to the alpha mask 8 - [SkMaskFilter](#SkMaskFilter) - modifications to the alpha mask
9 - [SkColorFilter](#SkColorFilter) - modify the source color before applying th e 9 - [SkColorFilter](#SkColorFilter) - modify the source color before applying th e
10 - [SkPathEffect](#SkPathEffect) - modify to the geometry before it 10 - [SkPathEffect](#SkPathEffect) - modify to the geometry before it
(...skipping 14 matching lines...) Expand all
25 25
26 <!--?prettify lang=cc?--> 26 <!--?prettify lang=cc?-->
27 27
28 void draw(SkCanvas* canvas) { 28 void draw(SkCanvas* canvas) {
29 canvas->clear(SK_ColorWHITE); 29 canvas->clear(SK_ColorWHITE);
30 30
31 SkPaint paint1, paint2, paint3; 31 SkPaint paint1, paint2, paint3;
32 32
33 paint1.setTextSize(64.0f); 33 paint1.setTextSize(64.0f);
34 paint1.setAntiAlias(true); 34 paint1.setAntiAlias(true);
35 paint1.setColor(SkColorSetRGB(255, 0, 0); 35 paint1.setColor(SkColorSetRGB(255, 0, 0));
36 paint1.setStyle(SkPaint::kFill_Style); 36 paint1.setStyle(SkPaint::kFill_Style);
37 37
38 paint2.setTextSize(64.f); 38 paint2.setTextSize(64.f);
39 paint2.setAntiAlias(true); 39 paint2.setAntiAlias(true);
40 paint2.setColor(SkColorSetRGB(0, 136, 0); 40 paint2.setColor(SkColorSetRGB(0, 136, 0));
41 paint2.setStyle(SkPaint::kStroke_Style); 41 paint2.setStyle(SkPaint::kStroke_Style);
42 paint2.setStrokeWidth(SkIntToScalar(3)); 42 paint2.setStrokeWidth(SkIntToScalar(3));
43 43
44 paint3.setTextSize(64.0f); 44 paint3.setTextSize(64.0f);
45 paint3.setAntiAlias(true); 45 paint3.setAntiAlias(true);
46 paint3.setColor(SkColorSetRGB(136, 136, 136)); 46 paint3.setColor(SkColorSetRGB(136, 136, 136));
47 paint3.setTextScaleX(SkFloatToScalar(1.5f)); 47 paint3.setTextScaleX(SkFloatToScalar(1.5f));
48 48
49 const char text[] = "Skia!"; 49 const char text[] = "Skia!";
50 canvas->drawText(text, strlen(text), 20.0f, 64.0f, paint1); 50 canvas->drawText(text, strlen(text), 20.0f, 64.0f, paint1);
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 paint.setStrokeWidth(2.0f); 688 paint.setStrokeWidth(2.0f);
689 paint.setAntiAlias(true); 689 paint.setAntiAlias(true);
690 canvas->clear(SK_ColorWHITE); 690 canvas->clear(SK_ColorWHITE);
691 SkPath path(star()); 691 SkPath path(star());
692 canvas->drawPath(path, paint); 692 canvas->drawPath(path, paint);
693 } 693 }
694 694
695 <a href='https://fiddle.skia.org/c/@skpaint_sum_path_effect'><img 695 <a href='https://fiddle.skia.org/c/@skpaint_sum_path_effect'><img
696 src='https://fiddle.skia.org/i/@skpaint_sum_path_effect_raster.png'></a> 696 src='https://fiddle.skia.org/i/@skpaint_sum_path_effect_raster.png'></a>
697 697
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698