OLD | NEW |
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 "SkView.h" | 9 #include "SkBlurMask.h" |
| 10 #include "SkBlurMaskFilter.h" |
10 #include "SkCanvas.h" | 11 #include "SkCanvas.h" |
11 #include "SkDevice.h" | 12 #include "SkDevice.h" |
12 #include "SkFlattenableBuffers.h" | 13 #include "SkFlattenableBuffers.h" |
| 14 #include "SkGradientShader.h" |
| 15 #include "SkLayerRasterizer.h" |
13 #include "SkPaint.h" | 16 #include "SkPaint.h" |
| 17 #include "SkView.h" |
14 | 18 |
15 #define BG_COLOR 0xFFDDDDDD | 19 #define BG_COLOR 0xFFDDDDDD |
16 | 20 |
17 typedef void (*SlideProc)(SkCanvas*); | 21 typedef void (*SlideProc)(SkCanvas*); |
18 | 22 |
19 /////////////////////////////////////////////////////////////////////////////// | 23 /////////////////////////////////////////////////////////////////////////////// |
20 | 24 |
21 #include "Sk1DPathEffect.h" | 25 #include "Sk1DPathEffect.h" |
22 #include "Sk2DPathEffect.h" | 26 #include "Sk2DPathEffect.h" |
23 #include "SkCornerPathEffect.h" | 27 #include "SkCornerPathEffect.h" |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 fRecs[i].fVerts, fRecs[i].fTexs, | 468 fRecs[i].fVerts, fRecs[i].fTexs, |
465 NULL, NULL, NULL, 0, paint); | 469 NULL, NULL, NULL, 0, paint); |
466 canvas->restore(); | 470 canvas->restore(); |
467 | 471 |
468 canvas->translate(0, SkIntToScalar(250)); | 472 canvas->translate(0, SkIntToScalar(250)); |
469 } | 473 } |
470 } | 474 } |
471 | 475 |
472 /////////////////////////////////////////////////////////////////////////////// | 476 /////////////////////////////////////////////////////////////////////////////// |
473 | 477 |
474 #include "SkGradientShader.h" | |
475 #include "SkLayerRasterizer.h" | |
476 #include "SkBlurMaskFilter.h" | |
477 | |
478 static void r0(SkLayerRasterizer* rast, SkPaint& p) | 478 static void r0(SkLayerRasterizer* rast, SkPaint& p) |
479 { | 479 { |
480 p.setMaskFilter(SkBlurMaskFilter::Create(SkIntToScalar(3), | 480 p.setMaskFilter(SkBlurMaskFilter::Create(SkBlurMaskFilter::kNormal_BlurStyle
, |
481 SkBlurMaskFilter::kNormal_BlurStyle
))->unref(); | 481 SkBlurMask::ConvertRadiusToSigma(Sk
IntToScalar(3))))->unref(); |
482 rast->addLayer(p, SkIntToScalar(3), SkIntToScalar(3)); | 482 rast->addLayer(p, SkIntToScalar(3), SkIntToScalar(3)); |
483 | 483 |
484 p.setMaskFilter(NULL); | 484 p.setMaskFilter(NULL); |
485 p.setStyle(SkPaint::kStroke_Style); | 485 p.setStyle(SkPaint::kStroke_Style); |
486 p.setStrokeWidth(SK_Scalar1); | 486 p.setStrokeWidth(SK_Scalar1); |
487 rast->addLayer(p); | 487 rast->addLayer(p); |
488 | 488 |
489 p.setAlpha(0x11); | 489 p.setAlpha(0x11); |
490 p.setStyle(SkPaint::kFill_Style); | 490 p.setStyle(SkPaint::kFill_Style); |
491 p.setXfermodeMode(SkXfermode::kSrc_Mode); | 491 p.setXfermodeMode(SkXfermode::kSrc_Mode); |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 } | 725 } |
726 | 726 |
727 private: | 727 private: |
728 typedef SampleView INHERITED; | 728 typedef SampleView INHERITED; |
729 }; | 729 }; |
730 | 730 |
731 ////////////////////////////////////////////////////////////////////////////// | 731 ////////////////////////////////////////////////////////////////////////////// |
732 | 732 |
733 static SkView* MyFactory() { return new SlideView; } | 733 static SkView* MyFactory() { return new SlideView; } |
734 static SkViewRegister reg(MyFactory); | 734 static SkViewRegister reg(MyFactory); |
OLD | NEW |