From 4150eea6c49ecec882a8d3e1c61d6a25fcd1e905 Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Wed, 7 Feb 2018 17:08:21 -0500 Subject: Move control of explicit GPU resource allocation to GrContextOptions Change-Id: Ic284acc79bab5936f0007d5ae5fb1e7a9929e2af Reviewed-on: https://skia-review.googlesource.com/104880 Commit-Queue: Robert Phillips Reviewed-by: Brian Salomon Reviewed-by: Greg Daniel --- tests/LazyProxyTest.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'tests/LazyProxyTest.cpp') diff --git a/tests/LazyProxyTest.cpp b/tests/LazyProxyTest.cpp index 5c0532701d..1994eeb5c9 100644 --- a/tests/LazyProxyTest.cpp +++ b/tests/LazyProxyTest.cpp @@ -298,6 +298,7 @@ private: DEF_GPUTEST(LazyProxyFailedInstantiationTest, reporter, /* options */) { GrMockOptions mockOptions; sk_sp ctx = GrContext::MakeMock(&mockOptions, GrContextOptions()); + GrResourceProvider* resourceProvider = ctx->contextPriv().resourceProvider(); GrProxyProvider* proxyProvider = ctx->contextPriv().proxyProvider(); for (bool failInstantiation : {false, true}) { sk_sp rtc = @@ -314,13 +315,13 @@ DEF_GPUTEST(LazyProxyFailedInstantiationTest, reporter, /* options */) { ctx->flush(); if (failInstantiation) { -#ifdef SK_DISABLE_EXPLICIT_GPU_RESOURCE_ALLOCATION - // When we disable explicit gpu resource allocation we don't throw away ops that have - // uninstantiated proxies. - REPORTER_ASSERT(reporter, 2 == executeTestValue); -#else - REPORTER_ASSERT(reporter, 1 == executeTestValue); -#endif + if (resourceProvider->explicitlyAllocateGPUResources()) { + REPORTER_ASSERT(reporter, 1 == executeTestValue); + } else { + // When we disable explicit gpu resource allocation we don't throw away ops that + // have uninstantiated proxies. + REPORTER_ASSERT(reporter, 2 == executeTestValue); + } } else { REPORTER_ASSERT(reporter, 2 == executeTestValue); } -- cgit v1.2.3