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