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 "gm.h" | 7 #include "gm.h" |
8 #include "SkCanvas.h" | 8 #include "SkCanvas.h" |
9 #include "SkGradientShader.h" | 9 #include "SkGradientShader.h" |
10 #include "SkPath.h" | |
11 | 10 |
12 namespace skiagm { | 11 namespace skiagm { |
13 | 12 |
14 static void makebm(SkBitmap* bm, int w, int h) { | 13 static void makebm(SkBitmap* bm, int w, int h) { |
15 bm->allocN32Pixels(w, h); | 14 bm->allocN32Pixels(w, h); |
16 bm->eraseColor(SK_ColorTRANSPARENT); | 15 bm->eraseColor(SK_ColorTRANSPARENT); |
17 | 16 |
18 SkCanvas canvas(*bm); | 17 SkCanvas canvas(*bm); |
19 SkScalar s = SkIntToScalar(SkMin32(w, h)); | 18 SkScalar s = SkIntToScalar(SkMin32(w, h)); |
20 static const SkPoint kPts0[] = { { 0, 0 }, { s, s } }; | 19 static const SkPoint kPts0[] = { { 0, 0 }, { s, s } }; |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 | 201 |
203 private: | 202 private: |
204 typedef GM INHERITED; | 203 typedef GM INHERITED; |
205 }; | 204 }; |
206 | 205 |
207 /////////////////////////////////////////////////////////////////////////////// | 206 /////////////////////////////////////////////////////////////////////////////// |
208 | 207 |
209 static GM* MyFactory(void*) { return new ShaderText2GM; } | 208 static GM* MyFactory(void*) { return new ShaderText2GM; } |
210 static GMRegistry reg(MyFactory); | 209 static GMRegistry reg(MyFactory); |
211 } | 210 } |
OLD | NEW |