aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/LazyProxyTest.cpp
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-03-09 12:05:04 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-09 18:02:00 +0000
commita8d9211bc3f34fcb3cf331d8fd76e4ea5803fe20 (patch)
tree5e13626cb2fc91f839ecf624953921ee7bf31b1b /tests/LazyProxyTest.cpp
parent33cb22cb2b60255a2755cc88072490fe8d05b0b9 (diff)
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 <egdaniel@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com> Reviewed-by: Cary Clark <caryclark@google.com>
Diffstat (limited to 'tests/LazyProxyTest.cpp')
-rw-r--r--tests/LazyProxyTest.cpp15
1 files changed, 6 insertions, 9 deletions
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<GrTextureProxy> proxy = proxyProvider->createLazyProxy(
@@ -229,10 +230,8 @@ DEF_GPUTEST(LazyProxyReleaseTest, reporter, /* options */) {
*testCountPtr = 1;
return sk_sp<GrTexture>();
},
- 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<LazyUninstantiateTestOp>(lazyProxy));