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 SkPath p; | 184 SkPath p; |
185 path->transform(m, &p); | 185 path->transform(m, &p); |
186 | 186 |
187 GrPrimitiveEdgeType edgeType = (GrPrimitiveEdgeType) et; | 187 GrPrimitiveEdgeType edgeType = (GrPrimitiveEdgeType) et; |
188 SkAutoTUnref<GrFragmentProcessor> fp(GrConvexPolyEffect::Create(
edgeType, p)); | 188 SkAutoTUnref<GrFragmentProcessor> fp(GrConvexPolyEffect::Create(
edgeType, p)); |
189 if (!fp) { | 189 if (!fp) { |
190 continue; | 190 continue; |
191 } | 191 } |
192 | 192 |
193 GrPipelineBuilder pipelineBuilder; | 193 GrPipelineBuilder pipelineBuilder; |
194 pipelineBuilder.addCoverageProcessor(fp); | 194 pipelineBuilder.addCoverageFragmentProcessor(fp); |
195 pipelineBuilder.setRenderTarget(rt); | 195 pipelineBuilder.setRenderTarget(rt); |
196 | 196 |
197 ConvexPolyTestBatch::Geometry geometry; | 197 ConvexPolyTestBatch::Geometry geometry; |
198 geometry.fColor = color.fColor; | 198 geometry.fColor = color.fColor; |
199 geometry.fBounds = p.getBounds(); | 199 geometry.fBounds = p.getBounds(); |
200 | 200 |
201 SkAutoTUnref<GrDrawBatch> batch(ConvexPolyTestBatch::Create(gp,
geometry)); | 201 SkAutoTUnref<GrDrawBatch> batch(ConvexPolyTestBatch::Create(gp,
geometry)); |
202 | 202 |
203 tt.target()->drawBatch(pipelineBuilder, batch); | 203 tt.target()->drawBatch(pipelineBuilder, batch); |
204 | 204 |
(...skipping 28 matching lines...) Expand all Loading... |
233 } | 233 } |
234 SkRect rect = *iter.get(); | 234 SkRect rect = *iter.get(); |
235 rect.offset(x, y); | 235 rect.offset(x, y); |
236 GrPrimitiveEdgeType edgeType = (GrPrimitiveEdgeType) et; | 236 GrPrimitiveEdgeType edgeType = (GrPrimitiveEdgeType) et; |
237 SkAutoTUnref<GrFragmentProcessor> fp(GrConvexPolyEffect::Create(
edgeType, rect)); | 237 SkAutoTUnref<GrFragmentProcessor> fp(GrConvexPolyEffect::Create(
edgeType, rect)); |
238 if (!fp) { | 238 if (!fp) { |
239 continue; | 239 continue; |
240 } | 240 } |
241 | 241 |
242 GrPipelineBuilder pipelineBuilder; | 242 GrPipelineBuilder pipelineBuilder; |
243 pipelineBuilder.addCoverageProcessor(fp); | 243 pipelineBuilder.addCoverageFragmentProcessor(fp); |
244 pipelineBuilder.setRenderTarget(rt); | 244 pipelineBuilder.setRenderTarget(rt); |
245 | 245 |
246 ConvexPolyTestBatch::Geometry geometry; | 246 ConvexPolyTestBatch::Geometry geometry; |
247 geometry.fColor = color.fColor; | 247 geometry.fColor = color.fColor; |
248 geometry.fBounds = rect; | 248 geometry.fBounds = rect; |
249 | 249 |
250 SkAutoTUnref<GrDrawBatch> batch(ConvexPolyTestBatch::Create(gp,
geometry)); | 250 SkAutoTUnref<GrDrawBatch> batch(ConvexPolyTestBatch::Create(gp,
geometry)); |
251 | 251 |
252 tt.target()->drawBatch(pipelineBuilder, batch); | 252 tt.target()->drawBatch(pipelineBuilder, batch); |
253 | 253 |
(...skipping 18 matching lines...) Expand all Loading... |
272 SkTLList<SkPath> fPaths; | 272 SkTLList<SkPath> fPaths; |
273 SkTLList<SkRect> fRects; | 273 SkTLList<SkRect> fRects; |
274 | 274 |
275 typedef GM INHERITED; | 275 typedef GM INHERITED; |
276 }; | 276 }; |
277 | 277 |
278 DEF_GM(return new ConvexPolyEffect;) | 278 DEF_GM(return new ConvexPolyEffect;) |
279 } | 279 } |
280 | 280 |
281 #endif | 281 #endif |
OLD | NEW |