| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 | 7 |
| 8 #include "gm.h" | 8 #include "gm.h" |
| 9 #include "SkBlurMaskFilter.h" | 9 #include "SkBlurMaskFilter.h" |
| 10 #include "SkColorFilter.h" | 10 #include "SkColorFilter.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 return SkString("blurredclippedcircle"); | 27 return SkString("blurredclippedcircle"); |
| 28 } | 28 } |
| 29 | 29 |
| 30 SkISize onISize() override { | 30 SkISize onISize() override { |
| 31 return SkISize::Make(kWidth, kHeight); | 31 return SkISize::Make(kWidth, kHeight); |
| 32 } | 32 } |
| 33 | 33 |
| 34 void onDraw(SkCanvas* canvas) override { | 34 void onDraw(SkCanvas* canvas) override { |
| 35 SkPaint whitePaint; | 35 SkPaint whitePaint; |
| 36 whitePaint.setColor(SK_ColorWHITE); | 36 whitePaint.setColor(SK_ColorWHITE); |
| 37 whitePaint.setXfermode(SkXfermode::Create(SkXfermode::kSrc_Mode))->unref
(); | 37 whitePaint.setXfermode(SkXfermode::Make(SkXfermode::kSrc_Mode)); |
| 38 whitePaint.setAntiAlias(true); | 38 whitePaint.setAntiAlias(true); |
| 39 | 39 |
| 40 // This scale exercises precision limits in the circle blur effect (crbu
g.com/560651) | 40 // This scale exercises precision limits in the circle blur effect (crbu
g.com/560651) |
| 41 static const float kScale = 2.0f; | 41 static const float kScale = 2.0f; |
| 42 canvas->scale(kScale, kScale); | 42 canvas->scale(kScale, kScale); |
| 43 | 43 |
| 44 canvas->save(); | 44 canvas->save(); |
| 45 SkRect clipRect1 = SkRect::MakeLTRB(0, 0, | 45 SkRect clipRect1 = SkRect::MakeLTRB(0, 0, |
| 46 SkIntToScalar(kWidth), SkIntToSc
alar(kHeight)); | 46 SkIntToScalar(kWidth), SkIntToSc
alar(kHeight)); |
| 47 | 47 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 static const int kWidth = 1164; | 83 static const int kWidth = 1164; |
| 84 static const int kHeight = 802; | 84 static const int kHeight = 802; |
| 85 | 85 |
| 86 typedef GM INHERITED; | 86 typedef GM INHERITED; |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 ////////////////////////////////////////////////////////////////////////////// | 89 ////////////////////////////////////////////////////////////////////////////// |
| 90 | 90 |
| 91 DEF_GM(return new BlurredClippedCircleGM;) | 91 DEF_GM(return new BlurredClippedCircleGM;) |
| 92 } | 92 } |
| OLD | NEW |