OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkGradientShader.h" | 10 #include "SkGradientShader.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 public: | 32 public: |
33 VerticesGM(unsigned alpha) : fShader(NULL), fAlpha(alpha) { | 33 VerticesGM(unsigned alpha) : fShader(NULL), fAlpha(alpha) { |
34 } | 34 } |
35 | 35 |
36 virtual ~VerticesGM() { | 36 virtual ~VerticesGM() { |
37 SkSafeUnref(fShader); | 37 SkSafeUnref(fShader); |
38 } | 38 } |
39 | 39 |
40 protected: | 40 protected: |
41 uint32_t onGetFlags() const SK_OVERRIDE { | |
42 return kSkipTiled_Flag; | |
43 } | |
44 | 41 |
45 void onOnceBeforeDraw() SK_OVERRIDE { | 42 void onOnceBeforeDraw() SK_OVERRIDE { |
46 const SkScalar X = 150; | 43 const SkScalar X = 150; |
47 const SkScalar Y = 150; | 44 const SkScalar Y = 150; |
48 | 45 |
49 fPts[0].set(0, 0); fPts[1].set(X/2, 10); fPts[2].set(X, 0); | 46 fPts[0].set(0, 0); fPts[1].set(X/2, 10); fPts[2].set(X, 0); |
50 fPts[3].set(10, Y/2); fPts[4].set(X/2, Y/2); fPts[5].set(X-10, Y/2); | 47 fPts[3].set(10, Y/2); fPts[4].set(X/2, Y/2); fPts[5].set(X-10, Y/2); |
51 fPts[6].set(0, Y); fPts[7].set(X/2, Y-10); fPts[8].set(X, Y); | 48 fPts[6].set(0, Y); fPts[7].set(X/2, Y-10); fPts[8].set(X, Y); |
52 | 49 |
53 const SkScalar w = 200; | 50 const SkScalar w = 200; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 } | 118 } |
122 | 119 |
123 private: | 120 private: |
124 typedef skiagm::GM INHERITED; | 121 typedef skiagm::GM INHERITED; |
125 }; | 122 }; |
126 | 123 |
127 ////////////////////////////////////////////////////////////////////////////////
///// | 124 ////////////////////////////////////////////////////////////////////////////////
///// |
128 | 125 |
129 DEF_GM( return SkNEW_ARGS(VerticesGM, (0xFF)); ) | 126 DEF_GM( return SkNEW_ARGS(VerticesGM, (0xFF)); ) |
130 DEF_GM( return SkNEW_ARGS(VerticesGM, (0x80)); ) | 127 DEF_GM( return SkNEW_ARGS(VerticesGM, (0x80)); ) |
OLD | NEW |