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 #include "gm.h" | 9 #include "gm.h" |
10 #include "SkGradientShader.h" | 10 #include "SkGradientShader.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 | 77 |
78 protected: | 78 protected: |
79 SkString onShortName() SK_OVERRIDE { | 79 SkString onShortName() SK_OVERRIDE { |
80 return SkString("patch_primitive"); | 80 return SkString("patch_primitive"); |
81 } | 81 } |
82 | 82 |
83 SkISize onISize() SK_OVERRIDE { | 83 SkISize onISize() SK_OVERRIDE { |
84 return SkISize::Make(800, 800); | 84 return SkISize::Make(800, 800); |
85 } | 85 } |
86 | 86 |
87 uint32_t onGetFlags() const SK_OVERRIDE { | |
88 return kSkipTiled_Flag; | |
89 } | |
90 | |
91 void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 87 void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
92 | 88 |
93 SkPaint paint; | 89 SkPaint paint; |
94 | 90 |
95 // The order of the colors and points is clockwise starting at upper-lef
t corner. | 91 // The order of the colors and points is clockwise starting at upper-lef
t corner. |
96 const SkPoint cubics[SkPatchUtils::kNumCtrlPts] = { | 92 const SkPoint cubics[SkPatchUtils::kNumCtrlPts] = { |
97 //top points | 93 //top points |
98 {100,100},{150,50},{250,150}, {300,100}, | 94 {100,100},{150,50},{250,150}, {300,100}, |
99 //right points | 95 //right points |
100 {250, 150},{350,250}, | 96 {250, 150},{350,250}, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 canvas->restore(); | 150 canvas->restore(); |
155 } | 151 } |
156 | 152 |
157 private: | 153 private: |
158 typedef GM INHERITED; | 154 typedef GM INHERITED; |
159 }; | 155 }; |
160 | 156 |
161 DEF_GM(return SkNEW(SkPatchGM); ) | 157 DEF_GM(return SkNEW(SkPatchGM); ) |
162 | 158 |
163 } | 159 } |
OLD | NEW |