Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: gm/convexpolyeffect.cpp

Issue 1471053002: Don't create a GXPFactory when blend is SrcOver (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix compile Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gm/bigrrectaaeffect.cpp ('k') | gm/rrects.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « gm/bigrrectaaeffect.cpp ('k') | gm/rrects.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698