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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 const SkPath* path = iter.get(); | 184 const SkPath* path = iter.get(); |
185 SkScalar x = 0; | 185 SkScalar x = 0; |
186 | 186 |
187 for (int et = 0; et < kGrProcessorEdgeTypeCnt; ++et) { | 187 for (int et = 0; et < kGrProcessorEdgeTypeCnt; ++et) { |
188 GrTestTarget tt; | 188 GrTestTarget tt; |
189 context->getTestTarget(&tt); | 189 context->getTestTarget(&tt); |
190 if (NULL == tt.target()) { | 190 if (NULL == tt.target()) { |
191 SkDEBUGFAIL("Couldn't get Gr test target."); | 191 SkDEBUGFAIL("Couldn't get Gr test target."); |
192 return; | 192 return; |
193 } | 193 } |
194 SkMatrix m; | 194 const SkMatrix m = SkMatrix::MakeTrans(x, y); |
195 SkPath p; | 195 SkPath p; |
196 m.setTranslate(x, y); | |
197 path->transform(m, &p); | 196 path->transform(m, &p); |
198 | 197 |
199 GrPrimitiveEdgeType edgeType = (GrPrimitiveEdgeType) et; | 198 GrPrimitiveEdgeType edgeType = (GrPrimitiveEdgeType) et; |
200 SkAutoTUnref<GrFragmentProcessor> fp(GrConvexPolyEffect::Create(
edgeType, p)); | 199 SkAutoTUnref<GrFragmentProcessor> fp(GrConvexPolyEffect::Create(
edgeType, p)); |
201 if (!fp) { | 200 if (!fp) { |
202 continue; | 201 continue; |
203 } | 202 } |
204 | 203 |
205 GrPipelineBuilder pipelineBuilder; | 204 GrPipelineBuilder pipelineBuilder; |
206 pipelineBuilder.addCoverageProcessor(fp); | 205 pipelineBuilder.addCoverageProcessor(fp); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 SkTLList<SkPath> fPaths; | 283 SkTLList<SkPath> fPaths; |
285 SkTLList<SkRect> fRects; | 284 SkTLList<SkRect> fRects; |
286 | 285 |
287 typedef GM INHERITED; | 286 typedef GM INHERITED; |
288 }; | 287 }; |
289 | 288 |
290 DEF_GM( return SkNEW(ConvexPolyEffect); ) | 289 DEF_GM( return SkNEW(ConvexPolyEffect); ) |
291 } | 290 } |
292 | 291 |
293 #endif | 292 #endif |
OLD | NEW |