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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 if (NULL == rt) { | 107 if (NULL == rt) { |
108 return; | 108 return; |
109 } | 109 } |
110 GrContext* context = rt->getContext(); | 110 GrContext* context = rt->getContext(); |
111 if (NULL == context) { | 111 if (NULL == context) { |
112 return; | 112 return; |
113 } | 113 } |
114 | 114 |
115 SkScalar y = 0; | 115 SkScalar y = 0; |
116 for (SkTLList<SkPath>::Iter iter(fPaths, SkTLList<SkPath>::Iter::kHead_I
terStart); | 116 for (SkTLList<SkPath>::Iter iter(fPaths, SkTLList<SkPath>::Iter::kHead_I
terStart); |
117 NULL != iter.get(); | 117 iter.get(); |
118 iter.next()) { | 118 iter.next()) { |
119 const SkPath* path = iter.get(); | 119 const SkPath* path = iter.get(); |
120 SkScalar x = 0; | 120 SkScalar x = 0; |
121 | 121 |
122 for (int et = 0; et < kGrEffectEdgeTypeCnt; ++et) { | 122 for (int et = 0; et < kGrEffectEdgeTypeCnt; ++et) { |
123 GrTestTarget tt; | 123 GrTestTarget tt; |
124 context->getTestTarget(&tt); | 124 context->getTestTarget(&tt); |
125 if (NULL == tt.target()) { | 125 if (NULL == tt.target()) { |
126 SkDEBUGFAIL("Couldn't get Gr test target."); | 126 SkDEBUGFAIL("Couldn't get Gr test target."); |
127 return; | 127 return; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 canvas->drawPath(*path, paint); | 165 canvas->drawPath(*path, paint); |
166 canvas->translate(path->getBounds().width() + 10.f, 0); | 166 canvas->translate(path->getBounds().width() + 10.f, 0); |
167 paint.setAntiAlias(true); | 167 paint.setAntiAlias(true); |
168 canvas->drawPath(*path, paint); | 168 canvas->drawPath(*path, paint); |
169 canvas->restore(); | 169 canvas->restore(); |
170 | 170 |
171 y += SkScalarCeilToScalar(path->getBounds().height() + 20.f); | 171 y += SkScalarCeilToScalar(path->getBounds().height() + 20.f); |
172 } | 172 } |
173 | 173 |
174 for (SkTLList<SkRect>::Iter iter(fRects, SkTLList<SkRect>::Iter::kHead_I
terStart); | 174 for (SkTLList<SkRect>::Iter iter(fRects, SkTLList<SkRect>::Iter::kHead_I
terStart); |
175 NULL != iter.get(); | 175 iter.get(); |
176 iter.next()) { | 176 iter.next()) { |
177 | 177 |
178 SkScalar x = 0; | 178 SkScalar x = 0; |
179 | 179 |
180 for (int et = 0; et < kGrEffectEdgeTypeCnt; ++et) { | 180 for (int et = 0; et < kGrEffectEdgeTypeCnt; ++et) { |
181 GrTestTarget tt; | 181 GrTestTarget tt; |
182 context->getTestTarget(&tt); | 182 context->getTestTarget(&tt); |
183 if (NULL == tt.target()) { | 183 if (NULL == tt.target()) { |
184 SkDEBUGFAIL("Couldn't get Gr test target."); | 184 SkDEBUGFAIL("Couldn't get Gr test target."); |
185 return; | 185 return; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 SkTLList<SkPath> fPaths; | 229 SkTLList<SkPath> fPaths; |
230 SkTLList<SkRect> fRects; | 230 SkTLList<SkRect> fRects; |
231 | 231 |
232 typedef GM INHERITED; | 232 typedef GM INHERITED; |
233 }; | 233 }; |
234 | 234 |
235 DEF_GM( return SkNEW(ConvexPolyEffect); ) | 235 DEF_GM( return SkNEW(ConvexPolyEffect); ) |
236 } | 236 } |
237 | 237 |
238 #endif | 238 #endif |
OLD | NEW |