| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2012 Intel Inc. | 3 * Copyright 2012 Intel 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 "gm.h" | 8 #include "gm.h" |
| 9 #include "SkBlurDrawLooper.h" | 9 #include "SkBlurDrawLooper.h" |
| 10 #include "SkBlurMask.h" | 10 #include "SkBlurMask.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 } | 145 } |
| 146 | 146 |
| 147 { | 147 { |
| 148 SkMatrix m; | 148 SkMatrix m; |
| 149 m.setRotate(SkIntToScalar(30)); | 149 m.setRotate(SkIntToScalar(30)); |
| 150 fMatrices.push_back(m); | 150 fMatrices.push_back(m); |
| 151 } | 151 } |
| 152 } | 152 } |
| 153 | 153 |
| 154 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 154 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
| 155 SkRandom rand; | 155 SkLCGRandom rand; |
| 156 canvas->translate(20 * SK_Scalar1, 20 * SK_Scalar1); | 156 canvas->translate(20 * SK_Scalar1, 20 * SK_Scalar1); |
| 157 | |
| 158 int i; | 157 int i; |
| 159 for (i = 0; i < fPaints.count(); ++i) { | 158 for (i = 0; i < fPaints.count(); ++i) { |
| 160 canvas->save(); | 159 canvas->save(); |
| 161 // position the path, and make it at off-integer coords. | 160 // position the path, and make it at off-integer coords. |
| 162 canvas->translate(SK_Scalar1 * 200 * (i % 5) + SK_Scalar1 / 4, | 161 canvas->translate(SK_Scalar1 * 200 * (i % 5) + SK_Scalar1 / 4, |
| 163 SK_Scalar1 * 200 * (i / 5) + 3 * SK_Scalar1 / 4); | 162 SK_Scalar1 * 200 * (i / 5) + 3 * SK_Scalar1 / 4); |
| 164 SkColor color = rand.nextU(); | 163 SkColor color = rand.nextU(); |
| 165 color |= 0xff000000; | 164 color |= 0xff000000; |
| 166 fPaints[i].setColor(color); | 165 fPaints[i].setColor(color); |
| 167 | 166 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 SkTArray<SkPaint> fPaints; | 198 SkTArray<SkPaint> fPaints; |
| 200 SkTArray<SkMatrix> fMatrices; | 199 SkTArray<SkMatrix> fMatrices; |
| 201 }; | 200 }; |
| 202 | 201 |
| 203 ////////////////////////////////////////////////////////////////////////////// | 202 ////////////////////////////////////////////////////////////////////////////// |
| 204 | 203 |
| 205 static GM* MyFactory(void*) { return new CircleGM; } | 204 static GM* MyFactory(void*) { return new CircleGM; } |
| 206 static GMRegistry reg(MyFactory); | 205 static GMRegistry reg(MyFactory); |
| 207 | 206 |
| 208 } | 207 } |
| 208 |
| OLD | NEW |