From 5ec9def2dd7bba572398ff2aa9361fbbb3b478ed Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Tue, 20 Dec 2016 15:34:05 -0500 Subject: Rename files, macros, types, and functions related to GrDrawOp testing. Make the test factories use sk_sp. Change-Id: Idba630b84deb2848f2203a80fd72e1efa5fc6acf Reviewed-on: https://skia-review.googlesource.com/6342 Reviewed-by: Brian Osman Commit-Queue: Brian Salomon --- src/gpu/ops/GrAAConvexPathRenderer.cpp | 6 +++--- src/gpu/ops/GrAADistanceFieldPathRenderer.cpp | 7 +++---- src/gpu/ops/GrAAFillRectOp.cpp | 10 +++++----- src/gpu/ops/GrAAHairLinePathRenderer.cpp | 7 +++---- src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp | 7 +++---- src/gpu/ops/GrAAStrokeRectOp.cpp | 6 +++--- src/gpu/ops/GrAnalyticRectOp.cpp | 6 +++--- src/gpu/ops/GrDashOp.cpp | 6 +++--- src/gpu/ops/GrDefaultPathRenderer.cpp | 7 +++---- src/gpu/ops/GrDrawAtlasOp.cpp | 7 +++---- src/gpu/ops/GrDrawVerticesOp.cpp | 7 +++---- src/gpu/ops/GrNonAAFillRectOp.cpp | 7 +++---- src/gpu/ops/GrNonAAFillRectPerspectiveOp.cpp | 7 +++---- src/gpu/ops/GrNonAAStrokeRectOp.cpp | 7 +++---- src/gpu/ops/GrOvalOpFactory.cpp | 19 +++++++++---------- src/gpu/ops/GrPLSPathRenderer.cpp | 6 +++--- src/gpu/ops/GrShadowRRectOp.cpp | 11 +++++------ src/gpu/ops/GrTessellatingPathRenderer.cpp | 6 +++--- 18 files changed, 64 insertions(+), 75 deletions(-) (limited to 'src/gpu/ops') diff --git a/src/gpu/ops/GrAAConvexPathRenderer.cpp b/src/gpu/ops/GrAAConvexPathRenderer.cpp index 40f4284b31..fd4083bf80 100644 --- a/src/gpu/ops/GrAAConvexPathRenderer.cpp +++ b/src/gpu/ops/GrAAConvexPathRenderer.cpp @@ -8,10 +8,10 @@ #include "GrAAConvexPathRenderer.h" #include "GrAAConvexTessellator.h" -#include "GrBatchTest.h" #include "GrCaps.h" #include "GrContext.h" #include "GrDefaultGeoProcFactory.h" +#include "GrDrawOpTest.h" #include "GrGeometryProcessor.h" #include "GrInvariantOutput.h" #include "GrOpFlushState.h" @@ -1007,12 +1007,12 @@ bool GrAAConvexPathRenderer::onDrawPath(const DrawPathArgs& args) { #ifdef GR_TEST_UTILS -DRAW_BATCH_TEST_DEFINE(AAConvexPathOp) { +DRAW_OP_TEST_DEFINE(AAConvexPathOp) { GrColor color = GrRandomColor(random); SkMatrix viewMatrix = GrTest::TestMatrixInvertible(random); SkPath path = GrTest::TestPathConvex(random); - return AAConvexPathOp::Make(color, viewMatrix, path).release(); + return AAConvexPathOp::Make(color, viewMatrix, path); } #endif diff --git a/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp b/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp index 678c920867..00d3ed7b97 100644 --- a/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp +++ b/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp @@ -7,9 +7,9 @@ #include "GrAADistanceFieldPathRenderer.h" -#include "GrBatchTest.h" #include "GrBuffer.h" #include "GrContext.h" +#include "GrDrawOpTest.h" #include "GrOpFlushState.h" #include "GrPipelineBuilder.h" #include "GrResourceProvider.h" @@ -581,7 +581,7 @@ struct PathTestStruct { ShapeDataList fShapeList; }; -DRAW_BATCH_TEST_DEFINE(AADistanceFieldPathOp) { +DRAW_OP_TEST_DEFINE(AADistanceFieldPathOp) { static PathTestStruct gTestStruct; if (context->uniqueID() != gTestStruct.fContextID) { @@ -608,8 +608,7 @@ DRAW_BATCH_TEST_DEFINE(AADistanceFieldPathOp) { gTestStruct.fAtlas.get(), &gTestStruct.fShapeCache, &gTestStruct.fShapeList, - gammaCorrect) - .release(); + gammaCorrect); } #endif diff --git a/src/gpu/ops/GrAAFillRectOp.cpp b/src/gpu/ops/GrAAFillRectOp.cpp index 9f7b0e0205..d45954ca72 100644 --- a/src/gpu/ops/GrAAFillRectOp.cpp +++ b/src/gpu/ops/GrAAFillRectOp.cpp @@ -386,23 +386,23 @@ sk_sp MakeWithLocalRect(GrColor color, #ifdef GR_TEST_UTILS -#include "GrBatchTest.h" +#include "GrDrawOpTest.h" -DRAW_BATCH_TEST_DEFINE(AAFillRectOp) { +DRAW_OP_TEST_DEFINE(AAFillRectOp) { GrColor color = GrRandomColor(random); SkMatrix viewMatrix = GrTest::TestMatrixInvertible(random); SkRect rect = GrTest::TestRect(random); SkRect devRect = GrTest::TestRect(random); - return GrAAFillRectOp::Make(color, viewMatrix, rect, devRect).release(); + return GrAAFillRectOp::Make(color, viewMatrix, rect, devRect); } -DRAW_BATCH_TEST_DEFINE(AAFillRectOpLocalMatrix) { +DRAW_OP_TEST_DEFINE(AAFillRectOpLocalMatrix) { GrColor color = GrRandomColor(random); SkMatrix viewMatrix = GrTest::TestMatrixInvertible(random); SkMatrix localMatrix = GrTest::TestMatrix(random); SkRect rect = GrTest::TestRect(random); SkRect devRect = GrTest::TestRect(random); - return GrAAFillRectOp::Make(color, viewMatrix, localMatrix, rect, devRect).release(); + return GrAAFillRectOp::Make(color, viewMatrix, localMatrix, rect, devRect); } #endif diff --git a/src/gpu/ops/GrAAHairLinePathRenderer.cpp b/src/gpu/ops/GrAAHairLinePathRenderer.cpp index 7707afa6e2..b5a797859e 100644 --- a/src/gpu/ops/GrAAHairLinePathRenderer.cpp +++ b/src/gpu/ops/GrAAHairLinePathRenderer.cpp @@ -7,11 +7,11 @@ #include "GrAAHairLinePathRenderer.h" -#include "GrBatchTest.h" #include "GrBuffer.h" #include "GrCaps.h" #include "GrContext.h" #include "GrDefaultGeoProcFactory.h" +#include "GrDrawOpTest.h" #include "GrOpFlushState.h" #include "GrPathUtils.h" #include "GrPipelineBuilder.h" @@ -972,14 +972,13 @@ bool GrAAHairLinePathRenderer::onDrawPath(const DrawPathArgs& args) { #ifdef GR_TEST_UTILS -DRAW_BATCH_TEST_DEFINE(AAHairlineOp) { +DRAW_OP_TEST_DEFINE(AAHairlineOp) { GrColor color = GrRandomColor(random); SkMatrix viewMatrix = GrTest::TestMatrix(random); SkPath path = GrTest::TestPath(random); SkIRect devClipBounds; devClipBounds.setEmpty(); - return AAHairlineOp::Make(color, viewMatrix, path, GrStyle::SimpleHairline(), devClipBounds) - .release(); + return AAHairlineOp::Make(color, viewMatrix, path, GrStyle::SimpleHairline(), devClipBounds); } #endif diff --git a/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp b/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp index c2473535f7..8f2ab86a8b 100644 --- a/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp +++ b/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp @@ -8,9 +8,9 @@ #include "GrAALinearizingConvexPathRenderer.h" #include "GrAAConvexTessellator.h" -#include "GrBatchTest.h" #include "GrContext.h" #include "GrDefaultGeoProcFactory.h" +#include "GrDrawOpTest.h" #include "GrGeometryProcessor.h" #include "GrInvariantOutput.h" #include "GrOpFlushState.h" @@ -374,7 +374,7 @@ bool GrAALinearizingConvexPathRenderer::onDrawPath(const DrawPathArgs& args) { #ifdef GR_TEST_UTILS -DRAW_BATCH_TEST_DEFINE(AAFlatteningConvexPathOp) { +DRAW_OP_TEST_DEFINE(AAFlatteningConvexPathOp) { GrColor color = GrRandomColor(random); SkMatrix viewMatrix = GrTest::TestMatrixPreservesRightAngles(random); SkPath path = GrTest::TestPathConvex(random); @@ -400,8 +400,7 @@ DRAW_BATCH_TEST_DEFINE(AAFlatteningConvexPathOp) { } return AAFlatteningConvexPathOp::Make(color, viewMatrix, path, strokeWidth, style, join, - miterLimit) - .release(); + miterLimit); } #endif diff --git a/src/gpu/ops/GrAAStrokeRectOp.cpp b/src/gpu/ops/GrAAStrokeRectOp.cpp index 252889240c..56606795f2 100644 --- a/src/gpu/ops/GrAAStrokeRectOp.cpp +++ b/src/gpu/ops/GrAAStrokeRectOp.cpp @@ -587,9 +587,9 @@ sk_sp Make(GrColor color, #ifdef GR_TEST_UTILS -#include "GrBatchTest.h" +#include "GrDrawOpTest.h" -DRAW_BATCH_TEST_DEFINE(AAStrokeRectOp) { +DRAW_OP_TEST_DEFINE(AAStrokeRectOp) { bool miterStroke = random->nextBool(); // Create either a empty rect or a non-empty rect. @@ -605,7 +605,7 @@ DRAW_BATCH_TEST_DEFINE(AAStrokeRectOp) { rec.setStrokeParams(SkPaint::kButt_Cap, miterStroke ? SkPaint::kMiter_Join : SkPaint::kBevel_Join, 1.f); SkMatrix matrix = GrTest::TestMatrixRectStaysRect(random); - return GrAAStrokeRectOp::Make(color, matrix, rect, rec).release(); + return GrAAStrokeRectOp::Make(color, matrix, rect, rec); } #endif diff --git a/src/gpu/ops/GrAnalyticRectOp.cpp b/src/gpu/ops/GrAnalyticRectOp.cpp index 63e15482b2..9c4e66cc84 100644 --- a/src/gpu/ops/GrAnalyticRectOp.cpp +++ b/src/gpu/ops/GrAnalyticRectOp.cpp @@ -7,7 +7,7 @@ #include "GrAnalyticRectOp.h" -#include "GrBatchTest.h" +#include "GrDrawOpTest.h" #include "GrGeometryProcessor.h" #include "GrInvariantOutput.h" #include "GrOpFlushState.h" @@ -390,13 +390,13 @@ sk_sp GrAnalyticRectOp::Make(GrColor color, #ifdef GR_TEST_UTILS -DRAW_BATCH_TEST_DEFINE(AnalyticRectOp) { +DRAW_OP_TEST_DEFINE(AnalyticRectOp) { SkMatrix viewMatrix = GrTest::TestMatrix(random); GrColor color = GrRandomColor(random); SkRect rect = GrTest::TestSquare(random); SkRect croppedRect = GrTest::TestSquare(random); SkRect bounds = GrTest::TestSquare(random); - return new AnalyticRectOp(color, viewMatrix, rect, croppedRect, bounds); + return sk_sp(new AnalyticRectOp(color, viewMatrix, rect, croppedRect, bounds)); } #endif diff --git a/src/gpu/ops/GrDashOp.cpp b/src/gpu/ops/GrDashOp.cpp index 92184825ac..8052795ead 100644 --- a/src/gpu/ops/GrDashOp.cpp +++ b/src/gpu/ops/GrDashOp.cpp @@ -7,11 +7,11 @@ #include "GrDashOp.h" -#include "GrBatchTest.h" #include "GrCaps.h" #include "GrContext.h" #include "GrCoordTransform.h" #include "GrDefaultGeoProcFactory.h" +#include "GrDrawOpTest.h" #include "GrGeometryProcessor.h" #include "GrInvariantOutput.h" #include "GrOpFlushState.h" @@ -1210,7 +1210,7 @@ static sk_sp make_dash_gp(GrColor color, #ifdef GR_TEST_UTILS -DRAW_BATCH_TEST_DEFINE(DashOp) { +DRAW_OP_TEST_DEFINE(DashOp) { GrColor color = GrRandomColor(random); SkMatrix viewMatrix = GrTest::TestMatrixPreservesRightAngles(random); AAMode aaMode = static_cast(random->nextULessThan(GrDashOp::kAAModeCnt)); @@ -1275,7 +1275,7 @@ DRAW_BATCH_TEST_DEFINE(DashOp) { GrStyle style(p); - return GrDashOp::MakeDashLineOp(color, viewMatrix, pts, aaMode, style).release(); + return GrDashOp::MakeDashLineOp(color, viewMatrix, pts, aaMode, style); } #endif diff --git a/src/gpu/ops/GrDefaultPathRenderer.cpp b/src/gpu/ops/GrDefaultPathRenderer.cpp index b979d9171d..4803c0da4e 100644 --- a/src/gpu/ops/GrDefaultPathRenderer.cpp +++ b/src/gpu/ops/GrDefaultPathRenderer.cpp @@ -7,9 +7,9 @@ #include "GrDefaultPathRenderer.h" -#include "GrBatchTest.h" #include "GrContext.h" #include "GrDefaultGeoProcFactory.h" +#include "GrDrawOpTest.h" #include "GrFixedClip.h" #include "GrMesh.h" #include "GrOpFlushState.h" @@ -618,7 +618,7 @@ void GrDefaultPathRenderer::onStencilPath(const StencilPathArgs& args) { #ifdef GR_TEST_UTILS -DRAW_BATCH_TEST_DEFINE(DefaultPathOp) { +DRAW_OP_TEST_DEFINE(DefaultPathOp) { GrColor color = GrRandomColor(random); SkMatrix viewMatrix = GrTest::TestMatrix(random); @@ -634,8 +634,7 @@ DRAW_BATCH_TEST_DEFINE(DefaultPathOp) { viewMatrix.mapRect(&bounds); uint8_t coverage = GrRandomCoverage(random); - return DefaultPathOp::Make(color, path, srcSpaceTol, coverage, viewMatrix, true, bounds) - .release(); + return DefaultPathOp::Make(color, path, srcSpaceTol, coverage, viewMatrix, true, bounds); } #endif diff --git a/src/gpu/ops/GrDrawAtlasOp.cpp b/src/gpu/ops/GrDrawAtlasOp.cpp index 3dafbda732..e01ad73671 100644 --- a/src/gpu/ops/GrDrawAtlasOp.cpp +++ b/src/gpu/ops/GrDrawAtlasOp.cpp @@ -6,7 +6,7 @@ */ #include "GrDrawAtlasOp.h" -#include "GrBatchTest.h" +#include "GrDrawOpTest.h" #include "GrOpFlushState.h" #include "SkGr.h" #include "SkRSXform.h" @@ -235,7 +235,7 @@ static void randomize_params(uint32_t count, SkRandom* random, SkTArraynextRangeU(1, 100); SkTArray xforms(spriteCount); @@ -250,8 +250,7 @@ DRAW_BATCH_TEST_DEFINE(GrDrawAtlasOp) { GrColor color = GrRandomColor(random); return GrDrawAtlasOp::Make(color, viewMatrix, spriteCount, xforms.begin(), texRects.begin(), - hasColors ? colors.begin() : nullptr) - .release(); + hasColors ? colors.begin() : nullptr); } #endif diff --git a/src/gpu/ops/GrDrawVerticesOp.cpp b/src/gpu/ops/GrDrawVerticesOp.cpp index 37be6d0d17..c6ae1c1efa 100644 --- a/src/gpu/ops/GrDrawVerticesOp.cpp +++ b/src/gpu/ops/GrDrawVerticesOp.cpp @@ -213,7 +213,7 @@ bool GrDrawVerticesOp::onCombineIfPossible(GrOp* t, const GrCaps& caps) { #ifdef GR_TEST_UTILS -#include "GrBatchTest.h" +#include "GrDrawOpTest.h" static uint32_t seed_vertices(GrPrimitiveType type) { switch (type) { @@ -274,7 +274,7 @@ static void randomize_params(size_t count, size_t maxVertex, SkScalar min, SkSca } } -DRAW_BATCH_TEST_DEFINE(VerticesOp) { +DRAW_OP_TEST_DEFINE(VerticesOp) { GrPrimitiveType type = GrPrimitiveType(random->nextULessThan(kLast_GrPrimitiveType + 1)); uint32_t primitiveCount = random->nextRangeU(1, 100); @@ -312,8 +312,7 @@ DRAW_BATCH_TEST_DEFINE(VerticesOp) { GrColor color = GrRandomColor(random); return GrDrawVerticesOp::Make(color, type, viewMatrix, positions.begin(), vertexCount, indices.begin(), hasIndices ? vertexCount : 0, colors.begin(), - texCoords.begin(), bounds) - .release(); + texCoords.begin(), bounds); } #endif diff --git a/src/gpu/ops/GrNonAAFillRectOp.cpp b/src/gpu/ops/GrNonAAFillRectOp.cpp index de000e2ce7..e672985507 100644 --- a/src/gpu/ops/GrNonAAFillRectOp.cpp +++ b/src/gpu/ops/GrNonAAFillRectOp.cpp @@ -203,9 +203,9 @@ sk_sp Make(GrColor color, #ifdef GR_TEST_UTILS -#include "GrBatchTest.h" +#include "GrDrawOpTest.h" -DRAW_BATCH_TEST_DEFINE(NonAAFillRectOp) { +DRAW_OP_TEST_DEFINE(NonAAFillRectOp) { GrColor color = GrRandomColor(random); SkRect rect = GrTest::TestRect(random); SkRect localRect = GrTest::TestRect(random); @@ -218,8 +218,7 @@ DRAW_BATCH_TEST_DEFINE(NonAAFillRectOp) { viewMatrix, rect, hasLocalRect ? &localRect : nullptr, - hasLocalMatrix ? &localMatrix : nullptr) - .release(); + hasLocalMatrix ? &localMatrix : nullptr); } #endif diff --git a/src/gpu/ops/GrNonAAFillRectPerspectiveOp.cpp b/src/gpu/ops/GrNonAAFillRectPerspectiveOp.cpp index 443c511ec4..fde4328abf 100644 --- a/src/gpu/ops/GrNonAAFillRectPerspectiveOp.cpp +++ b/src/gpu/ops/GrNonAAFillRectPerspectiveOp.cpp @@ -246,9 +246,9 @@ sk_sp MakeWithPerspective(GrColor color, #ifdef GR_TEST_UTILS -#include "GrBatchTest.h" +#include "GrDrawOpTest.h" -DRAW_BATCH_TEST_DEFINE(NonAAFillRectPerspectiveOp) { +DRAW_OP_TEST_DEFINE(NonAAFillRectPerspectiveOp) { GrColor color = GrRandomColor(random); SkRect rect = GrTest::TestRect(random); SkRect localRect = GrTest::TestRect(random); @@ -263,8 +263,7 @@ DRAW_BATCH_TEST_DEFINE(NonAAFillRectPerspectiveOp) { bool hasLocalRect = random->nextBool(); return GrNonAAFillRectOp::MakeWithPerspective(color, viewMatrix, rect, hasLocalRect ? &localRect : nullptr, - hasLocalMatrix ? &localMatrix : nullptr) - .release(); + hasLocalMatrix ? &localMatrix : nullptr); } #endif diff --git a/src/gpu/ops/GrNonAAStrokeRectOp.cpp b/src/gpu/ops/GrNonAAStrokeRectOp.cpp index b74cd502c8..065f08a9ee 100644 --- a/src/gpu/ops/GrNonAAStrokeRectOp.cpp +++ b/src/gpu/ops/GrNonAAStrokeRectOp.cpp @@ -7,9 +7,9 @@ #include "GrNonAAStrokeRectOp.h" -#include "GrBatchTest.h" #include "GrColor.h" #include "GrDefaultGeoProcFactory.h" +#include "GrDrawOpTest.h" #include "GrMeshDrawOp.h" #include "GrOpFlushState.h" #include "SkRandom.h" @@ -198,7 +198,7 @@ sk_sp Make(GrColor color, #ifdef GR_TEST_UTILS -DRAW_BATCH_TEST_DEFINE(NonAAStrokeRectOp) { +DRAW_OP_TEST_DEFINE(NonAAStrokeRectOp) { SkMatrix viewMatrix = GrTest::TestMatrix(random); GrColor color = GrRandomColor(random); SkRect rect = GrTest::TestRect(random); @@ -208,8 +208,7 @@ DRAW_BATCH_TEST_DEFINE(NonAAStrokeRectOp) { paint.setStyle(SkPaint::kStroke_Style); paint.setStrokeJoin(SkPaint::kMiter_Join); SkStrokeRec strokeRec(paint); - return GrNonAAStrokeRectOp::Make(color, viewMatrix, rect, strokeRec, random->nextBool()) - .release(); + return GrNonAAStrokeRectOp::Make(color, viewMatrix, rect, strokeRec, random->nextBool()); } #endif diff --git a/src/gpu/ops/GrOvalOpFactory.cpp b/src/gpu/ops/GrOvalOpFactory.cpp index 7a53ca6655..10fc37572a 100644 --- a/src/gpu/ops/GrOvalOpFactory.cpp +++ b/src/gpu/ops/GrOvalOpFactory.cpp @@ -7,7 +7,7 @@ #include "GrOvalOpFactory.h" -#include "GrBatchTest.h" +#include "GrDrawOpTest.h" #include "GrGeometryProcessor.h" #include "GrInvariantOutput.h" #include "GrOpFlushState.h" @@ -2425,7 +2425,7 @@ sk_sp GrOvalOpFactory::MakeArcOp(GrColor color, const SkMatrix& viewMa #ifdef GR_TEST_UTILS -DRAW_BATCH_TEST_DEFINE(CircleOp) { +DRAW_OP_TEST_DEFINE(CircleOp) { do { SkScalar rotate = random->nextSScalar1() * 360.f; SkScalar translateX = random->nextSScalar1() * 1000.f; @@ -2451,32 +2451,31 @@ DRAW_BATCH_TEST_DEFINE(CircleOp) { sk_sp op = CircleOp::Make(color, viewMatrix, center, radius, GrStyle(stroke, nullptr), arcParams); if (op) { - return op.release(); + return op; } } while (true); } -DRAW_BATCH_TEST_DEFINE(EllipseOp) { +DRAW_OP_TEST_DEFINE(EllipseOp) { SkMatrix viewMatrix = GrTest::TestMatrixRectStaysRect(random); GrColor color = GrRandomColor(random); SkRect ellipse = GrTest::TestSquare(random); - return EllipseOp::Make(color, viewMatrix, ellipse, GrTest::TestStrokeRec(random)).release(); + return EllipseOp::Make(color, viewMatrix, ellipse, GrTest::TestStrokeRec(random)); } -DRAW_BATCH_TEST_DEFINE(DIEllipseOp) { +DRAW_OP_TEST_DEFINE(DIEllipseOp) { SkMatrix viewMatrix = GrTest::TestMatrix(random); GrColor color = GrRandomColor(random); SkRect ellipse = GrTest::TestSquare(random); - return DIEllipseOp::Make(color, viewMatrix, ellipse, GrTest::TestStrokeRec(random)).release(); + return DIEllipseOp::Make(color, viewMatrix, ellipse, GrTest::TestStrokeRec(random)); } -DRAW_BATCH_TEST_DEFINE(RRectOp) { +DRAW_OP_TEST_DEFINE(RRectOp) { SkMatrix viewMatrix = GrTest::TestMatrixRectStaysRect(random); GrColor color = GrRandomColor(random); const SkRRect& rrect = GrTest::TestRRectSimple(random); bool needsDistance = random->nextBool(); - return make_rrect_op(color, needsDistance, viewMatrix, rrect, GrTest::TestStrokeRec(random)) - .release(); + return make_rrect_op(color, needsDistance, viewMatrix, rrect, GrTest::TestStrokeRec(random)); } #endif diff --git a/src/gpu/ops/GrPLSPathRenderer.cpp b/src/gpu/ops/GrPLSPathRenderer.cpp index 38b3075698..e4d11de3b1 100644 --- a/src/gpu/ops/GrPLSPathRenderer.cpp +++ b/src/gpu/ops/GrPLSPathRenderer.cpp @@ -7,10 +7,10 @@ #include "GrPLSPathRenderer.h" -#include "GrBatchTest.h" #include "GrCaps.h" #include "GrContext.h" #include "GrDefaultGeoProcFactory.h" +#include "GrDrawOpTest.h" #include "GrInvariantOutput.h" #include "GrOpFlushState.h" #include "GrPLSGeometryProcessor.h" @@ -948,12 +948,12 @@ bool GrPLSPathRenderer::onDrawPath(const DrawPathArgs& args) { #ifdef GR_TEST_UTILS -DRAW_BATCH_TEST_DEFINE(PLSPathOp) { +DRAW_OP_TEST_DEFINE(PLSPathOp) { GrColor color = GrRandomColor(random); SkMatrix vm = GrTest::TestMatrixInvertible(random); SkPath path = GrTest::TestPathConvex(random); - return PLSPathOp::Make(color, path, vm).release(); + return PLSPathOp::Make(color, path, vm); } #endif diff --git a/src/gpu/ops/GrShadowRRectOp.cpp b/src/gpu/ops/GrShadowRRectOp.cpp index e099edb000..302f1741e3 100755 --- a/src/gpu/ops/GrShadowRRectOp.cpp +++ b/src/gpu/ops/GrShadowRRectOp.cpp @@ -7,7 +7,7 @@ #include "GrShadowRRectOp.h" -#include "GrBatchTest.h" +#include "GrDrawOpTest.h" #include "GrOpFlushState.h" #include "GrResourceProvider.h" #include "GrStyle.h" @@ -931,7 +931,7 @@ sk_sp Make(GrColor color, #ifdef GR_TEST_UTILS -DRAW_BATCH_TEST_DEFINE(ShadowCircleOp) { +DRAW_OP_TEST_DEFINE(ShadowCircleOp) { do { SkScalar rotate = random->nextSScalar1() * 360.f; SkScalar translateX = random->nextSScalar1() * 1000.f; @@ -950,19 +950,18 @@ DRAW_BATCH_TEST_DEFINE(ShadowCircleOp) { sk_sp op = ShadowCircleOp::Make(color, viewMatrix, center, radius, blurRadius, GrStyle(stroke, nullptr)); if (op) { - return op.release(); + return op; } } while (true); } -DRAW_BATCH_TEST_DEFINE(ShadowRRectOp) { +DRAW_OP_TEST_DEFINE(ShadowRRectOp) { SkMatrix viewMatrix = GrTest::TestMatrixRectStaysRect(random); GrColor color = GrRandomColor(random); const SkRRect& rrect = GrTest::TestRRectSimple(random); SkScalar blurRadius = random->nextSScalar1() * 72.f; return make_shadow_rrect_batch(color, viewMatrix, rrect, blurRadius, - GrTest::TestStrokeRec(random)) - .release(); + GrTest::TestStrokeRec(random)); } #endif diff --git a/src/gpu/ops/GrTessellatingPathRenderer.cpp b/src/gpu/ops/GrTessellatingPathRenderer.cpp index 5f6eb581e3..1de24da1c1 100644 --- a/src/gpu/ops/GrTessellatingPathRenderer.cpp +++ b/src/gpu/ops/GrTessellatingPathRenderer.cpp @@ -8,9 +8,9 @@ #include "GrTessellatingPathRenderer.h" #include "GrAuditTrail.h" -#include "GrBatchTest.h" #include "GrClip.h" #include "GrDefaultGeoProcFactory.h" +#include "GrDrawOpTest.h" #include "GrMesh.h" #include "GrOpFlushState.h" #include "GrPathUtils.h" @@ -376,7 +376,7 @@ bool GrTessellatingPathRenderer::onDrawPath(const DrawPathArgs& args) { #ifdef GR_TEST_UTILS -DRAW_BATCH_TEST_DEFINE(TesselatingPathOp) { +DRAW_OP_TEST_DEFINE(TesselatingPathOp) { GrColor color = GrRandomColor(random); SkMatrix viewMatrix = GrTest::TestMatrixInvertible(random); SkPath path = GrTest::TestPath(random); @@ -389,7 +389,7 @@ DRAW_BATCH_TEST_DEFINE(TesselatingPathOp) { GrTest::TestStyle(random, &style); } while (!style.isSimpleFill()); GrShape shape(path, style); - return TessellatingPathOp::Make(color, shape, viewMatrix, devClipBounds, antiAlias).release(); + return TessellatingPathOp::Make(color, shape, viewMatrix, devClipBounds, antiAlias); } #endif -- cgit v1.2.3