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

Side by Side Diff: gm/convexpolyeffect.cpp

Issue 1754563003: Begin weaning GrClipMaskManager off of GrDrawTarget (take 2) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix fAuditTrail uses Created 4 years, 9 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 /* 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
11 #include "gm.h" 11 #include "gm.h"
12 12
13 #if SK_SUPPORT_GPU 13 #if SK_SUPPORT_GPU
14 14
15 #include "GrContext.h" 15 #include "GrContext.h"
16 #include "GrDefaultGeoProcFactory.h" 16 #include "GrDefaultGeoProcFactory.h"
17 #include "GrDrawContext.h" 17 #include "GrDrawContextPriv.h"
18 #include "GrPathUtils.h" 18 #include "GrPathUtils.h"
19 #include "GrTest.h" 19 #include "GrTest.h"
20 #include "SkColorPriv.h" 20 #include "SkColorPriv.h"
21 #include "SkDevice.h" 21 #include "SkDevice.h"
22 #include "SkGeometry.h" 22 #include "SkGeometry.h"
23 #include "SkTLList.h" 23 #include "SkTLList.h"
24 24
25 #include "batches/GrTestBatch.h" 25 #include "batches/GrTestBatch.h"
26 #include "batches/GrVertexBatch.h" 26 #include "batches/GrVertexBatch.h"
27 27
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 pipelineBuilder.addCoverageFragmentProcessor(fp); 198 pipelineBuilder.addCoverageFragmentProcessor(fp);
199 pipelineBuilder.setRenderTarget(rt); 199 pipelineBuilder.setRenderTarget(rt);
200 200
201 ConvexPolyTestBatch::Geometry geometry; 201 ConvexPolyTestBatch::Geometry geometry;
202 geometry.fColor = color.fColor; 202 geometry.fColor = color.fColor;
203 geometry.fRect = p.getBounds(); 203 geometry.fRect = p.getBounds();
204 geometry.fBounds = p.getBounds(); 204 geometry.fBounds = p.getBounds();
205 205
206 SkAutoTUnref<GrDrawBatch> batch(ConvexPolyTestBatch::Create(gp, geometry)); 206 SkAutoTUnref<GrDrawBatch> batch(ConvexPolyTestBatch::Create(gp, geometry));
207 207
208 drawContext->internal_drawBatch(pipelineBuilder, batch); 208 drawContext->drawContextPriv().testingOnly_drawBatch(pipelineBui lder, batch);
209 209
210 x += SkScalarCeilToScalar(path->getBounds().width() + 10.f); 210 x += SkScalarCeilToScalar(path->getBounds().width() + 10.f);
211 } 211 }
212 212
213 // Draw AA and non AA paths using normal API for reference. 213 // Draw AA and non AA paths using normal API for reference.
214 canvas->save(); 214 canvas->save();
215 canvas->translate(x, y); 215 canvas->translate(x, y);
216 SkPaint paint; 216 SkPaint paint;
217 canvas->drawPath(*path, paint); 217 canvas->drawPath(*path, paint);
218 canvas->translate(path->getBounds().width() + 10.f, 0); 218 canvas->translate(path->getBounds().width() + 10.f, 0);
(...skipping 26 matching lines...) Expand all
245 pipelineBuilder.setRenderTarget(rt); 245 pipelineBuilder.setRenderTarget(rt);
246 246
247 ConvexPolyTestBatch::Geometry geometry; 247 ConvexPolyTestBatch::Geometry geometry;
248 geometry.fColor = color.fColor; 248 geometry.fColor = color.fColor;
249 geometry.fRect = rect; 249 geometry.fRect = rect;
250 geometry.fBounds = rect; 250 geometry.fBounds = rect;
251 geometry.fBounds.sort(); 251 geometry.fBounds.sort();
252 252
253 SkAutoTUnref<GrDrawBatch> batch(ConvexPolyTestBatch::Create(gp, geometry)); 253 SkAutoTUnref<GrDrawBatch> batch(ConvexPolyTestBatch::Create(gp, geometry));
254 254
255 drawContext->internal_drawBatch(pipelineBuilder, batch); 255 drawContext->drawContextPriv().testingOnly_drawBatch(pipelineBui lder, batch);
256 256
257 x += SkScalarCeilToScalar(rect.width() + 10.f); 257 x += SkScalarCeilToScalar(rect.width() + 10.f);
258 } 258 }
259 259
260 // Draw rect without and with AA using normal API for reference 260 // Draw rect without and with AA using normal API for reference
261 canvas->save(); 261 canvas->save();
262 canvas->translate(x, y); 262 canvas->translate(x, y);
263 SkPaint paint; 263 SkPaint paint;
264 canvas->drawRect(*iter.get(), paint); 264 canvas->drawRect(*iter.get(), paint);
265 x += SkScalarCeilToScalar(iter.get()->width() + 10.f); 265 x += SkScalarCeilToScalar(iter.get()->width() + 10.f);
(...skipping 11 matching lines...) Expand all
277 PathList fPaths; 277 PathList fPaths;
278 RectList fRects; 278 RectList fRects;
279 279
280 typedef GM INHERITED; 280 typedef GM INHERITED;
281 }; 281 };
282 282
283 DEF_GM(return new ConvexPolyEffect;) 283 DEF_GM(return new ConvexPolyEffect;)
284 } 284 }
285 285
286 #endif 286 #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