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 11 matching lines...) Expand all Loading... |
22 bm.eraseColor(SK_ColorTRANSPARENT); | 22 bm.eraseColor(SK_ColorTRANSPARENT); |
23 return bm; | 23 return bm; |
24 } | 24 } |
25 | 25 |
26 static SkBitmap make_src() { | 26 static SkBitmap make_src() { |
27 SkBitmap bm = make_bm(); | 27 SkBitmap bm = make_bm(); |
28 SkCanvas canvas(bm); | 28 SkCanvas canvas(bm); |
29 SkPaint paint; | 29 SkPaint paint; |
30 SkPoint pts[] = { {0, 0}, {SkIntToScalar(WW), SkIntToScalar(HH)} }; | 30 SkPoint pts[] = { {0, 0}, {SkIntToScalar(WW), SkIntToScalar(HH)} }; |
31 SkColor colors[] = { | 31 SkColor colors[] = { |
32 SK_ColorBLACK, SK_ColorGREEN, SK_ColorCYAN, | 32 SK_ColorTRANSPARENT, SK_ColorGREEN, SK_ColorCYAN, |
33 SK_ColorRED, SK_ColorMAGENTA, SK_ColorWHITE | 33 SK_ColorRED, SK_ColorMAGENTA, SK_ColorWHITE, |
34 }; | 34 }; |
35 SkShader* s = SkGradientShader::CreateLinear(pts, colors, NULL, SK_ARRAY_COU
NT(colors), | 35 SkShader* s = SkGradientShader::CreateLinear(pts, colors, NULL, SK_ARRAY_COU
NT(colors), |
36 SkShader::kClamp_TileMode); | 36 SkShader::kClamp_TileMode); |
37 paint.setShader(s)->unref(); | 37 paint.setShader(s)->unref(); |
38 canvas.drawPaint(paint); | 38 canvas.drawPaint(paint); |
39 return bm; | 39 return bm; |
40 } | 40 } |
41 | 41 |
42 static SkBitmap make_dst() { | 42 static SkBitmap make_dst() { |
43 SkBitmap bm = make_bm(); | 43 SkBitmap bm = make_bm(); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 } | 130 } |
131 | 131 |
132 private: | 132 private: |
133 typedef GM INHERITED; | 133 typedef GM INHERITED; |
134 }; | 134 }; |
135 | 135 |
136 /////////////////////////////////////////////////////////////////////////////// | 136 /////////////////////////////////////////////////////////////////////////////// |
137 | 137 |
138 static skiagm::GM* MyFactory(void*) { return new ArithmodeGM; } | 138 static skiagm::GM* MyFactory(void*) { return new ArithmodeGM; } |
139 static skiagm::GMRegistry reg(MyFactory); | 139 static skiagm::GMRegistry reg(MyFactory); |
OLD | NEW |