OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 #include "SampleCode.h" | 7 #include "SampleCode.h" |
8 #include "SkBlurMask.h" | 8 #include "SkBlurMask.h" |
9 #include "SkBlurMaskFilter.h" | 9 #include "SkBlurMaskFilter.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 canvas->restore(); | 455 canvas->restore(); |
456 | 456 |
457 canvas->translate(0, SkIntToScalar(250)); | 457 canvas->translate(0, SkIntToScalar(250)); |
458 } | 458 } |
459 } | 459 } |
460 | 460 |
461 /////////////////////////////////////////////////////////////////////////////// | 461 /////////////////////////////////////////////////////////////////////////////// |
462 | 462 |
463 static void r0(SkLayerRasterizer::Builder* rastBuilder, SkPaint& p) | 463 static void r0(SkLayerRasterizer::Builder* rastBuilder, SkPaint& p) |
464 { | 464 { |
465 p.setMaskFilter(SkBlurMaskFilter::Create(kNormal_SkBlurStyle, | 465 p.setMaskFilter(SkBlurMaskFilter::Make(kNormal_SkBlurStyle, |
466 SkBlurMask::ConvertRadiusToSigma(Sk
IntToScalar(3))))->unref(); | 466 SkBlurMask::ConvertRadiusToSigma(3)))
; |
467 rastBuilder->addLayer(p, SkIntToScalar(3), SkIntToScalar(3)); | 467 rastBuilder->addLayer(p, SkIntToScalar(3), SkIntToScalar(3)); |
468 | 468 |
469 p.setMaskFilter(nullptr); | 469 p.setMaskFilter(nullptr); |
470 p.setStyle(SkPaint::kStroke_Style); | 470 p.setStyle(SkPaint::kStroke_Style); |
471 p.setStrokeWidth(SK_Scalar1); | 471 p.setStrokeWidth(SK_Scalar1); |
472 rastBuilder->addLayer(p); | 472 rastBuilder->addLayer(p); |
473 | 473 |
474 p.setAlpha(0x11); | 474 p.setAlpha(0x11); |
475 p.setStyle(SkPaint::kFill_Style); | 475 p.setStyle(SkPaint::kFill_Style); |
476 p.setXfermodeMode(SkXfermode::kSrc_Mode); | 476 p.setXfermodeMode(SkXfermode::kSrc_Mode); |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 } | 709 } |
710 | 710 |
711 private: | 711 private: |
712 typedef SampleView INHERITED; | 712 typedef SampleView INHERITED; |
713 }; | 713 }; |
714 | 714 |
715 ////////////////////////////////////////////////////////////////////////////// | 715 ////////////////////////////////////////////////////////////////////////////// |
716 | 716 |
717 static SkView* MyFactory() { return new SlideView; } | 717 static SkView* MyFactory() { return new SlideView; } |
718 static SkViewRegister reg(MyFactory); | 718 static SkViewRegister reg(MyFactory); |
OLD | NEW |