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

Side by Side Diff: gm/convexpolyeffect.cpp

Issue 1988923002: Remove GrRenderTarget from GrPipelineBuilder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update to ToT Created 4 years, 6 months 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/constcolorprocessor.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 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 // This test only works with the GPU backend. 8 // This test only works with the GPU backend.
9 9
10 #include "gm.h" 10 #include "gm.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 GrPrimitiveEdgeType edgeType = (GrPrimitiveEdgeType) et; 175 GrPrimitiveEdgeType edgeType = (GrPrimitiveEdgeType) et;
176 SkAutoTUnref<GrFragmentProcessor> fp(GrConvexPolyEffect::Create( edgeType, p)); 176 SkAutoTUnref<GrFragmentProcessor> fp(GrConvexPolyEffect::Create( edgeType, p));
177 if (!fp) { 177 if (!fp) {
178 continue; 178 continue;
179 } 179 }
180 180
181 GrPipelineBuilder pipelineBuilder; 181 GrPipelineBuilder pipelineBuilder;
182 pipelineBuilder.setXPFactory( 182 pipelineBuilder.setXPFactory(
183 GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->unref (); 183 GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->unref ();
184 pipelineBuilder.addCoverageFragmentProcessor(fp); 184 pipelineBuilder.addCoverageFragmentProcessor(fp);
185 pipelineBuilder.setRenderTarget(drawContext->accessRenderTarget( ));
186 185
187 SkAutoTUnref<GrDrawBatch> batch(new PolyBoundsBatch(p.getBounds( ), 0xff000000)); 186 SkAutoTUnref<GrDrawBatch> batch(new PolyBoundsBatch(p.getBounds( ), 0xff000000));
188 187
189 drawContext->drawContextPriv().testingOnly_drawBatch(pipelineBui lder, batch); 188 drawContext->drawContextPriv().testingOnly_drawBatch(pipelineBui lder, batch);
190 189
191 x += SkScalarCeilToScalar(path->getBounds().width() + kDX); 190 x += SkScalarCeilToScalar(path->getBounds().width() + kDX);
192 } 191 }
193 192
194 // Draw AA and non AA paths using normal API for reference. 193 // Draw AA and non AA paths using normal API for reference.
195 canvas->save(); 194 canvas->save();
(...skipping 20 matching lines...) Expand all
216 GrPrimitiveEdgeType edgeType = (GrPrimitiveEdgeType) et; 215 GrPrimitiveEdgeType edgeType = (GrPrimitiveEdgeType) et;
217 SkAutoTUnref<GrFragmentProcessor> fp(GrConvexPolyEffect::Create( edgeType, rect)); 216 SkAutoTUnref<GrFragmentProcessor> fp(GrConvexPolyEffect::Create( edgeType, rect));
218 if (!fp) { 217 if (!fp) {
219 continue; 218 continue;
220 } 219 }
221 220
222 GrPipelineBuilder pipelineBuilder; 221 GrPipelineBuilder pipelineBuilder;
223 pipelineBuilder.setXPFactory( 222 pipelineBuilder.setXPFactory(
224 GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->unref (); 223 GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->unref ();
225 pipelineBuilder.addCoverageFragmentProcessor(fp); 224 pipelineBuilder.addCoverageFragmentProcessor(fp);
226 pipelineBuilder.setRenderTarget(drawContext->accessRenderTarget( ));
227 225
228 SkAutoTUnref<GrDrawBatch> batch(new PolyBoundsBatch(rect, 0xff00 0000)); 226 SkAutoTUnref<GrDrawBatch> batch(new PolyBoundsBatch(rect, 0xff00 0000));
229 227
230 drawContext->drawContextPriv().testingOnly_drawBatch(pipelineBui lder, batch); 228 drawContext->drawContextPriv().testingOnly_drawBatch(pipelineBui lder, batch);
231 229
232 x += SkScalarCeilToScalar(rect.width() + kDX); 230 x += SkScalarCeilToScalar(rect.width() + kDX);
233 } 231 }
234 232
235 // Draw rect without and with AA using normal API for reference 233 // Draw rect without and with AA using normal API for reference
236 canvas->save(); 234 canvas->save();
(...skipping 15 matching lines...) Expand all
252 PathList fPaths; 250 PathList fPaths;
253 RectList fRects; 251 RectList fRects;
254 252
255 typedef GM INHERITED; 253 typedef GM INHERITED;
256 }; 254 };
257 255
258 DEF_GM(return new ConvexPolyEffect;) 256 DEF_GM(return new ConvexPolyEffect;)
259 } 257 }
260 258
261 #endif 259 #endif
OLDNEW
« no previous file with comments | « gm/constcolorprocessor.cpp ('k') | gm/rrects.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698