OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "sk_tool_utils.h" | 8 #include "sk_tool_utils.h" |
9 #include "SkBlurImageFilter.h" | 9 #include "SkBlurImageFilter.h" |
10 #include "SkColor.h" | 10 #include "SkColor.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 void onOnceBeforeDraw() override { | 46 void onOnceBeforeDraw() override { |
47 fCheckerboard = SkImage::MakeFromBitmap( | 47 fCheckerboard = SkImage::MakeFromBitmap( |
48 sk_tool_utils::create_checkerboard_bitmap(64, 64, 0xFFA0A0A0, 0xFF40
4040, 8)); | 48 sk_tool_utils::create_checkerboard_bitmap(64, 64, 0xFFA0A0A0, 0xFF40
4040, 8)); |
49 fGradientCircle = MakeGradientCircle(64, 64); | 49 fGradientCircle = MakeGradientCircle(64, 64); |
50 } | 50 } |
51 | 51 |
52 void onDraw(SkCanvas* canvas) override { | 52 void onDraw(SkCanvas* canvas) override { |
53 canvas->clear(SK_ColorBLACK); | 53 canvas->clear(SK_ColorBLACK); |
54 | 54 |
55 SkAutoTUnref<SkImageFilter> gradient(SkImageSource::Create(fGradientCirc
le.get())); | 55 sk_sp<SkImageFilter> gradient(SkImageSource::Make(fGradientCircle)); |
56 SkAutoTUnref<SkImageFilter> checkerboard(SkImageSource::Create(fCheckerb
oard.get())); | 56 sk_sp<SkImageFilter> checkerboard(SkImageSource::Make(fCheckerboard)); |
57 sk_sp<SkShader> noise(SkPerlinNoiseShader::MakeFractalNoise( | 57 sk_sp<SkShader> noise(SkPerlinNoiseShader::MakeFractalNoise( |
58 SkDoubleToScalar(0.1), SkDoubleToScalar(0.05), 1, 0)); | 58 SkDoubleToScalar(0.1), SkDoubleToScalar(0.05), 1, 0)); |
59 SkPaint noisePaint; | 59 SkPaint noisePaint; |
60 noisePaint.setShader(noise); | 60 noisePaint.setShader(noise); |
61 | 61 |
62 SkPoint3 pointLocation = SkPoint3::Make(0, 0, SkIntToScalar(10)); | 62 SkPoint3 pointLocation = SkPoint3::Make(0, 0, SkIntToScalar(10)); |
63 SkPoint3 spotLocation = SkPoint3::Make(SkIntToScalar(-10), | 63 SkPoint3 spotLocation = SkPoint3::Make(SkIntToScalar(-10), |
64 SkIntToScalar(-10), | 64 SkIntToScalar(-10), |
65 SkIntToScalar(20)); | 65 SkIntToScalar(20)); |
66 SkPoint3 spotTarget = SkPoint3::Make(SkIntToScalar(40), SkIntToScalar(40
), 0); | 66 SkPoint3 spotTarget = SkPoint3::Make(SkIntToScalar(40), SkIntToScalar(40
), 0); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 155 |
156 sk_sp<SkImage> fCheckerboard, fGradientCircle; | 156 sk_sp<SkImage> fCheckerboard, fGradientCircle; |
157 | 157 |
158 typedef GM INHERITED; | 158 typedef GM INHERITED; |
159 }; | 159 }; |
160 | 160 |
161 ////////////////////////////////////////////////////////////////////////////// | 161 ////////////////////////////////////////////////////////////////////////////// |
162 | 162 |
163 DEF_GM(return new ImageFiltersScaledGM;) | 163 DEF_GM(return new ImageFiltersScaledGM;) |
164 } | 164 } |
OLD | NEW |