From 6be756b673b823881e90a2ef68c12b640ddde549 Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Tue, 16 Jan 2018 15:07:54 -0500 Subject: Move resourceProvider accessor to GrContextPriv (take 2) TBR=bsalomon@google.com Change-Id: I3fd46ebfad0d04b8a2bfa6190f81308f3a6be620 Reviewed-on: https://skia-review.googlesource.com/95121 Commit-Queue: Robert Phillips Reviewed-by: Greg Daniel --- tests/ProcessorTest.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'tests/ProcessorTest.cpp') diff --git a/tests/ProcessorTest.cpp b/tests/ProcessorTest.cpp index e675335118..26f10a383a 100644 --- a/tests/ProcessorTest.cpp +++ b/tests/ProcessorTest.cpp @@ -158,6 +158,7 @@ void testingOnly_getIORefCnts(GrTextureProxy* proxy, int* refCnt, int* readCnt, DEF_GPUTEST_FOR_ALL_CONTEXTS(ProcessorRefTest, reporter, ctxInfo) { GrContext* context = ctxInfo.grContext(); GrProxyProvider* proxyProvider = context->contextPriv().proxyProvider(); + GrResourceProvider* resourceProvider = context->contextPriv().resourceProvider(); GrSurfaceDesc desc; desc.fOrigin = kTopLeft_GrSurfaceOrigin; @@ -181,7 +182,7 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(ProcessorRefTest, reporter, ctxInfo) { sk_sp proxy4 = proxyProvider->createProxy(desc, SkBackingFit::kExact, SkBudgeted::kYes); sk_sp buffer(texelBufferSupport - ? context->resourceProvider()->createBuffer( + ? resourceProvider->createBuffer( 1024, GrBufferType::kTexel_GrBufferType, GrAccessPattern::kStatic_GrAccessPattern, 0) : nullptr); @@ -352,6 +353,7 @@ sk_sp make_input_texture(GrProxyProvider* proxyProvider, int wid DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ProcessorOptimizationValidationTest, reporter, ctxInfo) { GrContext* context = ctxInfo.grContext(); GrProxyProvider* proxyProvider = context->contextPriv().proxyProvider(); + auto resourceProvider = context->contextPriv().resourceProvider(); using FPFactory = GrFragmentProcessorTestFactory; uint32_t seed = 0; @@ -391,7 +393,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ProcessorOptimizationValidationTest, repor } for (int j = 0; j < timesToInvokeFactory; ++j) { fp = FPFactory::MakeIdx(i, &testData); - if (!fp->instantiate(context->resourceProvider())) { + if (!fp->instantiate(resourceProvider)) { continue; } @@ -490,6 +492,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ProcessorOptimizationValidationTest, repor DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ProcessorCloneTest, reporter, ctxInfo) { GrContext* context = ctxInfo.grContext(); GrProxyProvider* proxyProvider = context->contextPriv().proxyProvider(); + auto resourceProvider = context->contextPriv().resourceProvider(); SkRandom random; @@ -522,8 +525,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ProcessorCloneTest, reporter, ctxInfo) { continue; } const char* name = fp->name(); - if (!fp->instantiate(context->resourceProvider()) || - !clone->instantiate(context->resourceProvider())) { + if (!fp->instantiate(resourceProvider) || !clone->instantiate(resourceProvider)) { continue; } REPORTER_ASSERT(reporter, !strcmp(fp->name(), clone->name())); -- cgit v1.2.3