diff options
author | Robert Phillips <robertphillips@google.com> | 2018-02-07 17:08:21 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-02-08 12:36:29 +0000 |
commit | 4150eea6c49ecec882a8d3e1c61d6a25fcd1e905 (patch) | |
tree | 21b7089d6745f769be88f8f3d9a127d521ff48be /tests/LazyProxyTest.cpp | |
parent | 1f1bb9c0b8d5f50ac74716e6961a6c92f1d373d8 (diff) |
Move control of explicit GPU resource allocation to GrContextOptions
Change-Id: Ic284acc79bab5936f0007d5ae5fb1e7a9929e2af
Reviewed-on: https://skia-review.googlesource.com/104880
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'tests/LazyProxyTest.cpp')
-rw-r--r-- | tests/LazyProxyTest.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
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<GrContext> ctx = GrContext::MakeMock(&mockOptions, GrContextOptions()); + GrResourceProvider* resourceProvider = ctx->contextPriv().resourceProvider(); GrProxyProvider* proxyProvider = ctx->contextPriv().proxyProvider(); for (bool failInstantiation : {false, true}) { sk_sp<GrRenderTargetContext> 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); } |