OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 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 | 8 |
9 // This test only works with the GPU backend. | 9 // This test only works with the GPU backend. |
10 | 10 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 return SkString("patch_primitive"); | 75 return SkString("patch_primitive"); |
76 } | 76 } |
77 | 77 |
78 virtual SkISize onISize() SK_OVERRIDE { | 78 virtual SkISize onISize() SK_OVERRIDE { |
79 return SkISize::Make(800, 800); | 79 return SkISize::Make(800, 800); |
80 } | 80 } |
81 | 81 |
82 virtual uint32_t onGetFlags() const SK_OVERRIDE { | 82 virtual uint32_t onGetFlags() const SK_OVERRIDE { |
83 return kSkipTiled_Flag; | 83 return kSkipTiled_Flag; |
84 } | 84 } |
85 | 85 |
86 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 86 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
87 | 87 |
88 SkPaint paint; | 88 SkPaint paint; |
89 | 89 SkColor colors[4] = { |
90 // The order of the colors and points is clockwise starting at upper-lef
t corner. | |
91 SkColor colors[SkPatch::kNumColors] = { | |
92 SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorCYAN | 90 SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorCYAN |
93 }; | 91 }; |
| 92 |
94 SkPoint points[SkPatch::kNumCtrlPts] = { | 93 SkPoint points[SkPatch::kNumCtrlPts] = { |
95 //top points | 94 //top points |
96 {50,50},{75,20},{125,80}, {150,50}, | 95 {50,50},{75,20},{125,80}, {150,50}, |
97 //right points | 96 //right points |
98 {120,75},{180,125}, | 97 {120,75},{180,125}, |
99 //bottom points | 98 //bottom points |
100 {150,150},{125,120},{75,180},{50,150}, | 99 {150,150},{125,120},{75,180},{50,150}, |
101 //left points | 100 //left points |
102 {20,125},{80,75} | 101 {20,125},{80,75} |
103 }; | 102 }; |
(...skipping 28 matching lines...) Expand all Loading... |
132 | 131 |
133 private: | 132 private: |
134 typedef GM INHERITED; | 133 typedef GM INHERITED; |
135 }; | 134 }; |
136 | 135 |
137 DEF_GM(return SkNEW(SkPatchGM); ) | 136 DEF_GM(return SkNEW(SkPatchGM); ) |
138 | 137 |
139 } | 138 } |
140 | 139 |
141 #endif | 140 #endif |
OLD | NEW |