From 6738c702423226619ee0172c12a3a007c5f68e57 Mon Sep 17 00:00:00 2001 From: robertphillips Date: Wed, 27 Jul 2016 12:13:51 -0700 Subject: Rename GrContext's newDrawContext & drawContext to makeDrawContext These both return sk_sp. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2186073002 Review-Url: https://codereview.chromium.org/2186073002 --- tests/ClearTest.cpp | 2 +- tests/DFPathRendererTest.cpp | 18 ++++++------- tests/GLProgramsTest.cpp | 24 ++++++++--------- tests/PrimitiveProcessorTest.cpp | 6 ++--- tests/RectangleTextureTest.cpp | 4 +-- tests/SRGBMipMapTest.cpp | 12 ++++----- tests/TessellatingPathRendererTests.cpp | 48 ++++++++++++++++----------------- 7 files changed, 57 insertions(+), 57 deletions(-) (limited to 'tests') diff --git a/tests/ClearTest.cpp b/tests/ClearTest.cpp index 4afbabaa56..4dba4bbb95 100644 --- a/tests/ClearTest.cpp +++ b/tests/ClearTest.cpp @@ -45,7 +45,7 @@ static bool reset_dc(sk_sp* dc, GrContext* context, int w, int h) } context->freeGpuResources(); - *dc = context->newDrawContext(SkBackingFit::kExact, w, h, kRGBA_8888_GrPixelConfig, nullptr); + *dc = context->makeDrawContext(SkBackingFit::kExact, w, h, kRGBA_8888_GrPixelConfig, nullptr); SkASSERT((*dc)->accessRenderTarget()->getUniqueID() != oldID); diff --git a/tests/DFPathRendererTest.cpp b/tests/DFPathRendererTest.cpp index e1af6acd93..d36c16845e 100644 --- a/tests/DFPathRendererTest.cpp +++ b/tests/DFPathRendererTest.cpp @@ -63,22 +63,22 @@ DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(AADistanceFieldPathRenderer, reporter, ctxInfo) if (!ctxInfo.grContext()->caps()->shaderCaps()->shaderDerivativeSupport()) { return; } - sk_sp drawContext(ctxInfo.grContext()->newDrawContext(SkBackingFit::kApprox, - 800, 800, - kSkia8888_GrPixelConfig, - nullptr, - 0, - kTopLeft_GrSurfaceOrigin)); - if (!drawContext) { + sk_sp dc(ctxInfo.grContext()->makeDrawContext(SkBackingFit::kApprox, + 800, 800, + kSkia8888_GrPixelConfig, + nullptr, + 0, + kTopLeft_GrSurfaceOrigin)); + if (!dc) { return; } GrAADistanceFieldPathRenderer dfpr; GrTestTarget tt; - ctxInfo.grContext()->getTestTarget(&tt, drawContext); + ctxInfo.grContext()->getTestTarget(&tt, dc); GrResourceProvider* rp = tt.resourceProvider(); - test_far_from_origin(drawContext.get(), &dfpr, rp); + test_far_from_origin(dc.get(), &dfpr, rp); ctxInfo.grContext()->flush(); } #endif diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp index 393de53b74..2d62a5b3c3 100644 --- a/tests/GLProgramsTest.cpp +++ b/tests/GLProgramsTest.cpp @@ -154,13 +154,13 @@ static sk_sp random_draw_context(GrContext* context, : kBottomLeft_GrSurfaceOrigin; int sampleCnt = random->nextBool() ? SkTMin(4, caps->maxSampleCount()) : 0; - sk_sp drawContext(context->newDrawContext(SkBackingFit::kExact, - kRenderTargetWidth, - kRenderTargetHeight, - kRGBA_8888_GrPixelConfig, - nullptr, - sampleCnt, - origin)); + sk_sp drawContext(context->makeDrawContext(SkBackingFit::kExact, + kRenderTargetWidth, + kRenderTargetHeight, + kRGBA_8888_GrPixelConfig, + nullptr, + sampleCnt, + origin)); return drawContext; } @@ -343,11 +343,11 @@ bool GrDrawingManager::ProgramUnitTest(GrContext* context, int maxStages) { drawingManager->flush(); // Validate that GrFPs work correctly without an input. - sk_sp drawContext(context->newDrawContext(SkBackingFit::kExact, - kRenderTargetWidth, - kRenderTargetHeight, - kRGBA_8888_GrPixelConfig, - nullptr)); + sk_sp drawContext(context->makeDrawContext(SkBackingFit::kExact, + kRenderTargetWidth, + kRenderTargetHeight, + kRGBA_8888_GrPixelConfig, + nullptr)); if (!drawContext) { SkDebugf("Could not allocate a drawContext"); return false; diff --git a/tests/PrimitiveProcessorTest.cpp b/tests/PrimitiveProcessorTest.cpp index acaf9e98af..7a080c57ac 100644 --- a/tests/PrimitiveProcessorTest.cpp +++ b/tests/PrimitiveProcessorTest.cpp @@ -104,9 +104,9 @@ private: DEF_GPUTEST_FOR_ALL_CONTEXTS(VertexAttributeCount, reporter, ctxInfo) { GrContext* context = ctxInfo.grContext(); - sk_sp drawContext(context->newDrawContext(SkBackingFit::kApprox, - 1, 1, kRGBA_8888_GrPixelConfig, - nullptr)); + sk_sp drawContext(context->makeDrawContext(SkBackingFit::kApprox, + 1, 1, kRGBA_8888_GrPixelConfig, + nullptr)); if (!drawContext) { ERRORF(reporter, "Could not create draw context."); return; diff --git a/tests/RectangleTextureTest.cpp b/tests/RectangleTextureTest.cpp index b42b3bac6c..2dbb888425 100644 --- a/tests/RectangleTextureTest.cpp +++ b/tests/RectangleTextureTest.cpp @@ -90,8 +90,8 @@ static void test_clear(skiatest::Reporter* reporter, GrContext* context, GrTexture* rectangleTexture) { if (rectangleTexture->asRenderTarget()) { sk_sp dc( - context->drawContext(sk_ref_sp(rectangleTexture->asRenderTarget()), - nullptr)); + context->makeDrawContext(sk_ref_sp(rectangleTexture->asRenderTarget()), + nullptr)); if (!dc) { ERRORF(reporter, "Could not get GrDrawContext for rectangle texture."); return; diff --git a/tests/SRGBMipMapTest.cpp b/tests/SRGBMipMapTest.cpp index 12f23adbbf..6eb4b2114a 100644 --- a/tests/SRGBMipMapTest.cpp +++ b/tests/SRGBMipMapTest.cpp @@ -121,12 +121,12 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SRGBMipMaps, reporter, ctxInfo) { // Create two draw contexts (L32 and S32) sk_sp srgbColorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); - sk_sp l32DrawContext = context->newDrawContext(SkBackingFit::kExact, rtS, rtS, - kSkia8888_GrPixelConfig, - nullptr); - sk_sp s32DrawContext = context->newDrawContext(SkBackingFit::kExact, rtS, rtS, - kSkiaGamma8888_GrPixelConfig, - std::move(srgbColorSpace)); + sk_sp l32DrawContext = context->makeDrawContext(SkBackingFit::kExact, rtS, rtS, + kSkia8888_GrPixelConfig, + nullptr); + sk_sp s32DrawContext = context->makeDrawContext(SkBackingFit::kExact, rtS, rtS, + kSkiaGamma8888_GrPixelConfig, + std::move(srgbColorSpace)); SkRect rect = SkRect::MakeWH(SkIntToScalar(rtS), SkIntToScalar(rtS)); GrNoClip noClip; diff --git a/tests/TessellatingPathRendererTests.cpp b/tests/TessellatingPathRendererTests.cpp index 5e8d952f32..d9afcc4d3d 100644 --- a/tests/TessellatingPathRendererTests.cpp +++ b/tests/TessellatingPathRendererTests.cpp @@ -254,35 +254,35 @@ static void test_path(GrDrawContext* drawContext, GrResourceProvider* rp, const } DEF_GPUTEST_FOR_ALL_CONTEXTS(TessellatingPathRendererTests, reporter, ctxInfo) { - sk_sp drawContext(ctxInfo.grContext()->newDrawContext(SkBackingFit::kApprox, - 800, 800, - kSkia8888_GrPixelConfig, - nullptr, - 0, - kTopLeft_GrSurfaceOrigin)); - if (!drawContext) { + sk_sp dc(ctxInfo.grContext()->makeDrawContext(SkBackingFit::kApprox, + 800, 800, + kSkia8888_GrPixelConfig, + nullptr, + 0, + kTopLeft_GrSurfaceOrigin)); + if (!dc) { return; } GrTestTarget tt; - ctxInfo.grContext()->getTestTarget(&tt, drawContext); + ctxInfo.grContext()->getTestTarget(&tt, dc); GrResourceProvider* rp = tt.resourceProvider(); - test_path(drawContext.get(), rp, create_path_0()); - test_path(drawContext.get(), rp, create_path_1()); - test_path(drawContext.get(), rp, create_path_2()); - test_path(drawContext.get(), rp, create_path_3()); - test_path(drawContext.get(), rp, create_path_4()); - test_path(drawContext.get(), rp, create_path_5()); - test_path(drawContext.get(), rp, create_path_6()); - test_path(drawContext.get(), rp, create_path_7()); - test_path(drawContext.get(), rp, create_path_8()); - test_path(drawContext.get(), rp, create_path_9()); - test_path(drawContext.get(), rp, create_path_10()); - test_path(drawContext.get(), rp, create_path_11()); - test_path(drawContext.get(), rp, create_path_12()); - test_path(drawContext.get(), rp, create_path_13()); - test_path(drawContext.get(), rp, create_path_14()); - test_path(drawContext.get(), rp, create_path_15()); + test_path(dc.get(), rp, create_path_0()); + test_path(dc.get(), rp, create_path_1()); + test_path(dc.get(), rp, create_path_2()); + test_path(dc.get(), rp, create_path_3()); + test_path(dc.get(), rp, create_path_4()); + test_path(dc.get(), rp, create_path_5()); + test_path(dc.get(), rp, create_path_6()); + test_path(dc.get(), rp, create_path_7()); + test_path(dc.get(), rp, create_path_8()); + test_path(dc.get(), rp, create_path_9()); + test_path(dc.get(), rp, create_path_10()); + test_path(dc.get(), rp, create_path_11()); + test_path(dc.get(), rp, create_path_12()); + test_path(dc.get(), rp, create_path_13()); + test_path(dc.get(), rp, create_path_14()); + test_path(dc.get(), rp, create_path_15()); } #endif -- cgit v1.2.3