From a8d9211bc3f34fcb3cf331d8fd76e4ea5803fe20 Mon Sep 17 00:00:00 2001 From: Greg Daniel Date: Fri, 9 Mar 2018 12:05:04 -0500 Subject: Add promise images for deferred instantiation of wrapped gpu textures This will allow a client to make an SkImage that "wraps" a gpu texture, however the client does need to supply the actual gpu texture at Image creation time. Instead it is retrieve at flush time via a callback. Bug: skia: Change-Id: I6267a55ab7102101a7bd80a6f547b6a870d2df08 Reviewed-on: https://skia-review.googlesource.com/109021 Commit-Queue: Greg Daniel Reviewed-by: Robert Phillips Reviewed-by: Cary Clark --- tests/LazyProxyTest.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'tests/LazyProxyTest.cpp') diff --git a/tests/LazyProxyTest.cpp b/tests/LazyProxyTest.cpp index 88cbd01649..b7c4a9c43c 100644 --- a/tests/LazyProxyTest.cpp +++ b/tests/LazyProxyTest.cpp @@ -217,7 +217,8 @@ DEF_GPUTEST(LazyProxyReleaseTest, reporter, /* options */) { using LazyInstantiationType = GrSurfaceProxy::LazyInstantiationType; for (bool doInstantiate : {true, false}) { for (auto lazyType : {LazyInstantiationType::kSingleUse, - LazyInstantiationType::kMultipleUse}) { + LazyInstantiationType::kMultipleUse, + LazyInstantiationType::kUninstantiate}) { int testCount = 0; int* testCountPtr = &testCount; sk_sp proxy = proxyProvider->createLazyProxy( @@ -229,10 +230,8 @@ DEF_GPUTEST(LazyProxyReleaseTest, reporter, /* options */) { *testCountPtr = 1; return sk_sp(); }, - desc, kTopLeft_GrSurfaceOrigin, GrMipMapped::kNo, SkBackingFit::kExact, - SkBudgeted::kNo); - - proxy->priv().testingOnly_setLazyInstantiationType(lazyType); + desc, kTopLeft_GrSurfaceOrigin, GrMipMapped::kNo, GrRenderTargetFlags::kNone, + SkBackingFit::kExact, SkBudgeted::kNo, lazyType); REPORTER_ASSERT(reporter, 0 == testCount); @@ -423,10 +422,8 @@ DEF_GPUTEST(LazyProxyUninstantiateTest, reporter, /* options */) { texture->setRelease(UninstantiateReleaseProc, releasePtr); return texture; }, - desc, kTopLeft_GrSurfaceOrigin, GrMipMapped::kNo, SkBackingFit::kExact, - SkBudgeted::kNo); - - lazyProxy->priv().testingOnly_setLazyInstantiationType(lazyType); + desc, kTopLeft_GrSurfaceOrigin, GrMipMapped::kNo, GrRenderTargetFlags::kNone, + SkBackingFit::kExact, SkBudgeted::kNo, lazyType); rtc->priv().testingOnly_addDrawOp(skstd::make_unique(lazyProxy)); -- cgit v1.2.3