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

Side by Side Diff: src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp

Issue 2092893003: Retract PipelineBuilder some more (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 4 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 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 #include "GrAALinearizingConvexPathRenderer.h" 8 #include "GrAALinearizingConvexPathRenderer.h"
9 9
10 #include "GrAAConvexTessellator.h" 10 #include "GrAAConvexTessellator.h"
11 #include "GrBatchFlushState.h" 11 #include "GrBatchFlushState.h"
12 #include "GrBatchTest.h" 12 #include "GrBatchTest.h"
13 #include "GrContext.h" 13 #include "GrContext.h"
14 #include "GrDefaultGeoProcFactory.h" 14 #include "GrDefaultGeoProcFactory.h"
15 #include "GrGeometryProcessor.h" 15 #include "GrGeometryProcessor.h"
16 #include "GrInvariantOutput.h" 16 #include "GrInvariantOutput.h"
17 #include "GrPathUtils.h" 17 #include "GrPathUtils.h"
18 #include "GrProcessor.h" 18 #include "GrProcessor.h"
19 #include "GrPipelineBuilder.h"
20 #include "GrStyle.h" 19 #include "GrStyle.h"
21 #include "SkGeometry.h" 20 #include "SkGeometry.h"
22 #include "SkString.h" 21 #include "SkString.h"
23 #include "SkTraceEvent.h" 22 #include "SkTraceEvent.h"
24 #include "SkPathPriv.h" 23 #include "SkPathPriv.h"
25 #include "batches/GrVertexBatch.h" 24 #include "batches/GrVertexBatch.h"
26 #include "glsl/GrGLSLGeometryProcessor.h" 25 #include "glsl/GrGLSLGeometryProcessor.h"
27 26
28 static const int DEFAULT_BUFFER_SIZE = 100; 27 static const int DEFAULT_BUFFER_SIZE = 100;
29 28
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 const SkStrokeRec& stroke = args.fShape->style().strokeRec(); 330 const SkStrokeRec& stroke = args.fShape->style().strokeRec();
332 SkScalar strokeWidth = fill ? -1.0f : stroke.getWidth(); 331 SkScalar strokeWidth = fill ? -1.0f : stroke.getWidth();
333 SkPaint::Join join = fill ? SkPaint::Join::kMiter_Join : stroke.getJoin(); 332 SkPaint::Join join = fill ? SkPaint::Join::kMiter_Join : stroke.getJoin();
334 SkScalar miterLimit = stroke.getMiter(); 333 SkScalar miterLimit = stroke.getMiter();
335 334
336 SkAutoTUnref<GrDrawBatch> batch(new AAFlatteningConvexPathBatch(args.fPaint- >getColor(), 335 SkAutoTUnref<GrDrawBatch> batch(new AAFlatteningConvexPathBatch(args.fPaint- >getColor(),
337 *args.fViewM atrix, 336 *args.fViewM atrix,
338 path, stroke Width, join, 337 path, stroke Width, join,
339 miterLimit)) ; 338 miterLimit)) ;
340 339
341 GrPipelineBuilder pipelineBuilder(*args.fPaint); 340 args.fDrawContext->drawBatch(*args.fPaint, *args.fClip, *args.fUserStencilSe ttings, batch);
342 pipelineBuilder.setUserStencil(args.fUserStencilSettings);
343
344 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch);
345
346 return true; 341 return true;
347 } 342 }
348 343
349 //////////////////////////////////////////////////////////////////////////////// /////////////////// 344 //////////////////////////////////////////////////////////////////////////////// ///////////////////
350 345
351 #ifdef GR_TEST_UTILS 346 #ifdef GR_TEST_UTILS
352 347
353 DRAW_BATCH_TEST_DEFINE(AAFlatteningConvexPathBatch) { 348 DRAW_BATCH_TEST_DEFINE(AAFlatteningConvexPathBatch) {
354 GrColor color = GrRandomColor(random); 349 GrColor color = GrRandomColor(random);
355 SkMatrix viewMatrix = GrTest::TestMatrixInvertible(random); 350 SkMatrix viewMatrix = GrTest::TestMatrixInvertible(random);
356 SkPath path = GrTest::TestPathConvex(random); 351 SkPath path = GrTest::TestPathConvex(random);
357 SkScalar strokeWidth = random->nextBool() ? -1.f : 2.f; 352 SkScalar strokeWidth = random->nextBool() ? -1.f : 2.f;
358 SkPaint::Join join = SkPaint::kMiter_Join; 353 SkPaint::Join join = SkPaint::kMiter_Join;
359 SkScalar miterLimit = 0.5f; 354 SkScalar miterLimit = 0.5f;
360 return new AAFlatteningConvexPathBatch(color, viewMatrix, path, strokeWidth, join, miterLimit); 355 return new AAFlatteningConvexPathBatch(color, viewMatrix, path, strokeWidth, join, miterLimit);
361 } 356 }
362 357
363 #endif 358 #endif
OLDNEW
« no previous file with comments | « src/gpu/batches/GrAAHairLinePathRenderer.cpp ('k') | src/gpu/batches/GrDashLinePathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698