aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/LazyProxyTest.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-02-13 11:13:51 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-02-13 21:25:53 +0000
commitce5209a8a5711fde34f28c740f5cd74bdb560e21 (patch)
tree772f3427bf4f1a73d2c7db727b3750b7c56b65d0 /tests/LazyProxyTest.cpp
parent6a46fb210b810553b2a03a5f316109ccd9710ebc (diff)
Make fully lazy proxies possess an origin
Change-Id: Icd3d68bce78568562aa12167a58b6d6e5064b124 Reviewed-on: https://skia-review.googlesource.com/106901 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tests/LazyProxyTest.cpp')
-rw-r--r--tests/LazyProxyTest.cpp35
1 files changed, 17 insertions, 18 deletions
diff --git a/tests/LazyProxyTest.cpp b/tests/LazyProxyTest.cpp
index 5a0211d717..aca9b56e13 100644
--- a/tests/LazyProxyTest.cpp
+++ b/tests/LazyProxyTest.cpp
@@ -58,13 +58,12 @@ public:
Op(GrProxyProvider* proxyProvider, LazyProxyTest* test, bool nullTexture)
: GrDrawOp(ClassID()), fTest(test) {
fProxy = proxyProvider->createFullyLazyProxy([this, nullTexture](
- GrResourceProvider* rp, GrSurfaceOrigin* origin) {
+ GrResourceProvider* rp) {
if (!rp) {
return sk_sp<GrTexture>();
}
REPORTER_ASSERT(fTest->fReporter, !fTest->fHasOpTexture);
fTest->fHasOpTexture = true;
- *origin = kTopLeft_GrSurfaceOrigin;
if (nullTexture) {
return sk_sp<GrTexture>();
} else {
@@ -77,7 +76,7 @@ public:
REPORTER_ASSERT(fTest->fReporter, texture);
return texture;
}
- }, GrProxyProvider::Renderable::kNo, kRGB_565_GrPixelConfig);
+ }, GrProxyProvider::Renderable::kNo, kTopLeft_GrSurfaceOrigin, kRGB_565_GrPixelConfig);
this->setBounds(SkRectPriv::MakeLargest(), GrOp::HasAABloat::kNo, GrOp::IsZeroArea::kNo);
}
@@ -112,17 +111,19 @@ public:
, fProxyProvider(proxyProvider)
, fTest(test)
, fAtlas(atlas) {
- fLazyProxy = proxyProvider->createFullyLazyProxy([this](GrResourceProvider* rp,
- GrSurfaceOrigin* origin) {
- if (!rp) {
- return sk_sp<GrTexture>();
- }
- REPORTER_ASSERT(fTest->fReporter, !fTest->fHasClipTexture);
- fTest->fHasClipTexture = true;
- *origin = kBottomLeft_GrSurfaceOrigin;
- fAtlas->instantiate(rp);
- return sk_ref_sp(fAtlas->priv().peekTexture());
- }, GrProxyProvider::Renderable::kYes, kAlpha_half_GrPixelConfig);
+ fLazyProxy = proxyProvider->createFullyLazyProxy(
+ [this](GrResourceProvider* rp) {
+ if (!rp) {
+ return sk_sp<GrTexture>();
+ }
+ REPORTER_ASSERT(fTest->fReporter, !fTest->fHasClipTexture);
+ fTest->fHasClipTexture = true;
+ fAtlas->instantiate(rp);
+ return sk_ref_sp(fAtlas->priv().peekTexture());
+ },
+ GrProxyProvider::Renderable::kYes,
+ kBottomLeft_GrSurfaceOrigin,
+ kAlpha_half_GrPixelConfig);
fAccess.reset(fLazyProxy, GrSamplerState::Filter::kNearest,
GrSamplerState::WrapMode::kClamp, kFragment_GrShaderFlag);
this->addTextureSampler(&fAccess);
@@ -220,8 +221,7 @@ DEF_GPUTEST(LazyProxyReleaseTest, reporter, /* options */) {
int testCount = 0;
int* testCountPtr = &testCount;
sk_sp<GrTextureProxy> proxy = proxyProvider->createLazyProxy(
- [testCountPtr](GrResourceProvider* resourceProvider,
- GrSurfaceOrigin* /*outOrigin*/) {
+ [testCountPtr](GrResourceProvider* resourceProvider) {
if (!resourceProvider) {
*testCountPtr = -1;
return sk_sp<GrTexture>();
@@ -267,8 +267,7 @@ public:
desc.fConfig = kRGBA_8888_GrPixelConfig;
fLazyProxy = proxyProvider->createLazyProxy(
- [testExecuteValue, shouldFailInstantiation, desc] (
- GrResourceProvider* rp, GrSurfaceOrigin* /*origin*/) {
+ [testExecuteValue, shouldFailInstantiation, desc] (GrResourceProvider* rp) {
if (!rp) {
return sk_sp<GrTexture>();
}