OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google 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 "SampleCode.h" | 8 #include "SampleCode.h" |
9 #include "SkView.h" | 9 #include "SkView.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 return SkShader::CreateBitmapShader(bm, SkShader::kRepeat_TileMode, | 41 return SkShader::CreateBitmapShader(bm, SkShader::kRepeat_TileMode, |
42 SkShader::kRepeat_TileMode); | 42 SkShader::kRepeat_TileMode); |
43 } | 43 } |
44 | 44 |
45 static SkShader* make_shader1(const SkIPoint& size) { | 45 static SkShader* make_shader1(const SkIPoint& size) { |
46 SkPoint pts[] = { { 0, 0 }, | 46 SkPoint pts[] = { { 0, 0 }, |
47 { SkIntToScalar(size.fX), SkIntToScalar(size.fY) } }; | 47 { SkIntToScalar(size.fX), SkIntToScalar(size.fY) } }; |
48 SkColor colors[] = { SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorRED }
; | 48 SkColor colors[] = { SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorRED }
; |
49 return SkGradientShader::CreateLinear(pts, colors, NULL, | 49 return SkGradientShader::CreateLinear(pts, colors, NULL, |
50 SK_ARRAY_COUNT(colors), SkShader::kMirror_TileMode, NULL); | 50 SK_ARRAY_COUNT(colors), SkShader::kMirror_TileMode); |
51 } | 51 } |
52 | 52 |
53 class VerticesView : public SampleView { | 53 class VerticesView : public SampleView { |
54 SkShader* fShader0; | 54 SkShader* fShader0; |
55 SkShader* fShader1; | 55 SkShader* fShader1; |
56 | 56 |
57 public: | 57 public: |
58 VerticesView() { | 58 VerticesView() { |
59 SkIPoint size; | 59 SkIPoint size; |
60 | 60 |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 | 223 |
224 Rec fRecs[3]; | 224 Rec fRecs[3]; |
225 | 225 |
226 typedef SampleView INHERITED; | 226 typedef SampleView INHERITED; |
227 }; | 227 }; |
228 | 228 |
229 ////////////////////////////////////////////////////////////////////////////// | 229 ////////////////////////////////////////////////////////////////////////////// |
230 | 230 |
231 static SkView* MyFactory() { return new VerticesView; } | 231 static SkView* MyFactory() { return new VerticesView; } |
232 static SkViewRegister reg(MyFactory); | 232 static SkViewRegister reg(MyFactory); |
OLD | NEW |