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 | 7 |
8 #include "gm.h" | 8 #include "gm.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 canvas->drawLine(W/2, H/2, W/2 + x, H/2 + y, paint); | 55 canvas->drawLine(W/2, H/2, W/2 + x, H/2 + y, paint); |
56 } | 56 } |
57 | 57 |
58 return H; | 58 return H; |
59 } | 59 } |
60 | 60 |
61 static SkShader* make_bg_shader() { | 61 static SkShader* make_bg_shader() { |
62 SkBitmap bm; | 62 SkBitmap bm; |
63 bm.allocN32Pixels(2, 2); | 63 bm.allocN32Pixels(2, 2); |
64 *bm.getAddr32(0, 0) = *bm.getAddr32(1, 1) = 0xFFFFFFFF; | 64 *bm.getAddr32(0, 0) = *bm.getAddr32(1, 1) = 0xFFFFFFFF; |
65 *bm.getAddr32(1, 0) = *bm.getAddr32(0, 1) = SkPackARGB32(0xFF, 0xCC, 0xCC, 0
xCC); | 65 *bm.getAddr32(1, 0) = *bm.getAddr32(0, 1) = SkPackARGB32(0xFF, 0xCE, 0xCF, 0
xCE); |
66 | 66 |
67 SkMatrix m; | 67 SkMatrix m; |
68 m.setScale(SkIntToScalar(6), SkIntToScalar(6)); | 68 m.setScale(SkIntToScalar(6), SkIntToScalar(6)); |
69 return SkShader::CreateBitmapShader(bm, | 69 return SkShader::CreateBitmapShader(bm, |
70 SkShader::kRepeat_TileMode, | 70 SkShader::kRepeat_TileMode, |
71 SkShader::kRepeat_TileMode, | 71 SkShader::kRepeat_TileMode, |
72 &m); | 72 &m); |
73 } | 73 } |
74 | 74 |
75 namespace skiagm { | 75 namespace skiagm { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 private: | 124 private: |
125 typedef GM INHERITED; | 125 typedef GM INHERITED; |
126 }; | 126 }; |
127 | 127 |
128 ////////////////////////////////////////////////////////////////////////////
// | 128 ////////////////////////////////////////////////////////////////////////////
// |
129 | 129 |
130 static GM* MyFactory(void*) { return new HairModesGM; } | 130 static GM* MyFactory(void*) { return new HairModesGM; } |
131 static GMRegistry reg(MyFactory); | 131 static GMRegistry reg(MyFactory); |
132 | 132 |
133 } | 133 } |
OLD | NEW |