aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/LazyProxyTest.cpp
diff options
context:
space:
mode:
authorGravatar Chris Dalton <csmartdalton@google.com>2018-06-16 17:22:59 -0600
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-18 15:32:48 +0000
commit4c458b12f68d8704a297c1ec252127c77bdee595 (patch)
tree588efa8ae1870e6d20107c371cc1077662c5ff15 /tests/LazyProxyTest.cpp
parent3567c14a41cd55860fcc836af32d8748c1e3c856 (diff)
ccpr: Use lazy proxies with GrCCAtlas
Bug: skia: Change-Id: I576d9303d451352778de0425e3ecbc561331cd09 Reviewed-on: https://skia-review.googlesource.com/135362 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'tests/LazyProxyTest.cpp')
-rw-r--r--tests/LazyProxyTest.cpp48
1 files changed, 26 insertions, 22 deletions
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<GrTexture>();
- }
- REPORTER_ASSERT(fTest->fReporter, !fTest->fHasOpTexture);
- fTest->fHasOpTexture = true;
- if (nullTexture) {
- return sk_sp<GrTexture>();
- } else {
- GrSurfaceDesc desc;
- desc.fWidth = 1234;
- desc.fHeight = 567;
- desc.fConfig = kRGB_565_GrPixelConfig;
- sk_sp<GrTexture> 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<GrTexture>();
+ }
+ REPORTER_ASSERT(fTest->fReporter, !fTest->fHasOpTexture);
+ fTest->fHasOpTexture = true;
+ if (nullTexture) {
+ return sk_sp<GrTexture>();
+ } else {
+ GrSurfaceDesc desc;
+ desc.fWidth = 1234;
+ desc.fHeight = 567;
+ desc.fConfig = kRGB_565_GrPixelConfig;
+ sk_sp<GrTexture> 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<GrTexture>();
@@ -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);