OLD | NEW |
1 | |
2 /* | 1 /* |
3 * Copyright 2012 Intel Inc. | 2 * Copyright 2012 Intel Inc. |
4 * | 3 * |
5 * 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 |
6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
7 */ | 6 */ |
8 #include "gm.h" | 7 #include "gm.h" |
9 #include "SkBlurDrawLooper.h" | 8 #include "SkBlurDrawLooper.h" |
10 #include "SkBlurMask.h" | 9 #include "SkBlurMask.h" |
11 #include "SkBlurMaskFilter.h" | 10 #include "SkBlurMaskFilter.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 // Draw a giant AA circle as the background. | 147 // Draw a giant AA circle as the background. |
149 SkISize size = this->getISize(); | 148 SkISize size = this->getISize(); |
150 SkScalar giantRadius = SkTMin(SkIntToScalar(size.fWidth), | 149 SkScalar giantRadius = SkTMin(SkIntToScalar(size.fWidth), |
151 SkIntToScalar(size.fHeight)) / 2.f; | 150 SkIntToScalar(size.fHeight)) / 2.f; |
152 SkPoint giantCenter = SkPoint::Make(SkIntToScalar(size.fWidth/2), | 151 SkPoint giantCenter = SkPoint::Make(SkIntToScalar(size.fWidth/2), |
153 SkIntToScalar(size.fHeight/2)); | 152 SkIntToScalar(size.fHeight/2)); |
154 SkPaint giantPaint; | 153 SkPaint giantPaint; |
155 giantPaint.setAntiAlias(true); | 154 giantPaint.setAntiAlias(true); |
156 giantPaint.setColor(0x80808080); | 155 giantPaint.setColor(0x80808080); |
157 canvas->drawCircle(giantCenter.fX, giantCenter.fY, giantRadius, giantPai
nt); | 156 canvas->drawCircle(giantCenter.fX, giantCenter.fY, giantRadius, giantPai
nt); |
158 | 157 |
159 SkRandom rand; | 158 SkRandom rand; |
160 canvas->translate(20 * SK_Scalar1, 20 * SK_Scalar1); | 159 canvas->translate(20 * SK_Scalar1, 20 * SK_Scalar1); |
161 int i; | 160 int i; |
162 for (i = 0; i < fPaints.count(); ++i) { | 161 for (i = 0; i < fPaints.count(); ++i) { |
163 canvas->save(); | 162 canvas->save(); |
164 // position the path, and make it at off-integer coords. | 163 // position the path, and make it at off-integer coords. |
165 canvas->translate(SK_Scalar1 * 200 * (i % 5) + SK_Scalar1 / 4, | 164 canvas->translate(SK_Scalar1 * 200 * (i % 5) + SK_Scalar1 / 4, |
166 SK_Scalar1 * 200 * (i / 5) + 3 * SK_Scalar1 / 4); | 165 SK_Scalar1 * 200 * (i / 5) + 3 * SK_Scalar1 / 4); |
167 SkColor color = rand.nextU(); | 166 SkColor color = rand.nextU(); |
168 color |= 0xff000000; | 167 color |= 0xff000000; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 SkTArray<SkPaint> fPaints; | 201 SkTArray<SkPaint> fPaints; |
203 SkTArray<SkMatrix> fMatrices; | 202 SkTArray<SkMatrix> fMatrices; |
204 }; | 203 }; |
205 | 204 |
206 ////////////////////////////////////////////////////////////////////////////// | 205 ////////////////////////////////////////////////////////////////////////////// |
207 | 206 |
208 static GM* MyFactory(void*) { return new CircleGM; } | 207 static GM* MyFactory(void*) { return new CircleGM; } |
209 static GMRegistry reg(MyFactory); | 208 static GMRegistry reg(MyFactory); |
210 | 209 |
211 } | 210 } |
OLD | NEW |