From 4c458b12f68d8704a297c1ec252127c77bdee595 Mon Sep 17 00:00:00 2001 From: Chris Dalton Date: Sat, 16 Jun 2018 17:22:59 -0600 Subject: ccpr: Use lazy proxies with GrCCAtlas Bug: skia: Change-Id: I576d9303d451352778de0425e3ecbc561331cd09 Reviewed-on: https://skia-review.googlesource.com/135362 Reviewed-by: Greg Daniel Commit-Queue: Chris Dalton --- tests/LazyProxyTest.cpp | 48 ++++++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 22 deletions(-) (limited to 'tests/LazyProxyTest.cpp') diff --git a/tests/LazyProxyTest.cpp b/tests/LazyProxyTest.cpp index c0dcbf9647..9349457be4 100644 --- a/tests/LazyProxyTest.cpp +++ b/tests/LazyProxyTest.cpp @@ -76,26 +76,30 @@ public: Op(GrProxyProvider* proxyProvider, LazyProxyTest* test, bool nullTexture) : GrDrawOp(ClassID()), fTest(test) { - fProxy = proxyProvider->createFullyLazyProxy([this, nullTexture]( - GrResourceProvider* rp) { - if (!rp) { - return sk_sp(); - } - REPORTER_ASSERT(fTest->fReporter, !fTest->fHasOpTexture); - fTest->fHasOpTexture = true; - if (nullTexture) { - return sk_sp(); - } else { - GrSurfaceDesc desc; - desc.fWidth = 1234; - desc.fHeight = 567; - desc.fConfig = kRGB_565_GrPixelConfig; - sk_sp texture = rp->createTexture(desc, SkBudgeted::kYes); - REPORTER_ASSERT(fTest->fReporter, texture); - return texture; - } - }, GrProxyProvider::Renderable::kNo, kTopLeft_GrSurfaceOrigin, kRGB_565_GrPixelConfig); - this->setBounds(SkRectPriv::MakeLargest(), GrOp::HasAABloat::kNo, GrOp::IsZeroArea::kNo); + fProxy = GrProxyProvider::MakeFullyLazyProxy( + [this, nullTexture](GrResourceProvider* rp) { + if (!rp) { + return sk_sp(); + } + REPORTER_ASSERT(fTest->fReporter, !fTest->fHasOpTexture); + fTest->fHasOpTexture = true; + if (nullTexture) { + return sk_sp(); + } else { + GrSurfaceDesc desc; + desc.fWidth = 1234; + desc.fHeight = 567; + desc.fConfig = kRGB_565_GrPixelConfig; + sk_sp texture = rp->createTexture(desc, SkBudgeted::kYes); + REPORTER_ASSERT(fTest->fReporter, texture); + return texture; + } + }, + GrProxyProvider::Renderable::kNo, kTopLeft_GrSurfaceOrigin, + kRGB_565_GrPixelConfig, *proxyProvider->caps()); + + this->setBounds(SkRectPriv::MakeLargest(), GrOp::HasAABloat::kNo, + GrOp::IsZeroArea::kNo); } const char* name() const override { return "LazyProxyTest::Op"; } @@ -118,7 +122,7 @@ public: , fProxyProvider(proxyProvider) , fTest(test) , fAtlas(atlas) { - fLazyProxy = proxyProvider->createFullyLazyProxy( + fLazyProxy = GrProxyProvider::MakeFullyLazyProxy( [this](GrResourceProvider* rp) { if (!rp) { return sk_sp(); @@ -130,7 +134,7 @@ public: }, GrProxyProvider::Renderable::kYes, kBottomLeft_GrSurfaceOrigin, - kAlpha_half_GrPixelConfig); + kAlpha_half_GrPixelConfig, *proxyProvider->caps()); fAccess.reset(fLazyProxy, GrSamplerState::Filter::kNearest, GrSamplerState::WrapMode::kClamp, kFragment_GrShaderFlag); this->addTextureSampler(&fAccess); -- cgit v1.2.3