aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/ClipStackTest.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-02-24 08:37:13 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-02-24 14:21:50 +0000
commit875218ebd816eb8931c64c5018ce2dc9bc8fd695 (patch)
treee2936879d44b66aea231b3098342866b9ddf714c /tests/ClipStackTest.cpp
parente3d4421e67d328fc0994bbfd25deab0ce3964dc2 (diff)
Wrap cached GrTextures in GrTextureProxies (e.g., blur profiles, nine-patch blurs, etc.)
This is pulled out of: https://skia-review.googlesource.com/c/8823/ (Remove GrFragmentProcessor-derived class' GrTexture-based ctors) Change-Id: I5feac04dc1bf54bd74c65febdf6bba9e7ce28f55 Reviewed-on: https://skia-review.googlesource.com/8942 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tests/ClipStackTest.cpp')
-rw-r--r--tests/ClipStackTest.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/ClipStackTest.cpp b/tests/ClipStackTest.cpp
index 744ef18d17..e3980504f2 100644
--- a/tests/ClipStackTest.cpp
+++ b/tests/ClipStackTest.cpp
@@ -1413,7 +1413,7 @@ DEF_TEST(ClipStack, reporter) {
//////////////////////////////////////////////////////////////////////////////
#if SK_SUPPORT_GPU
-sk_sp<GrTexture> GrClipStackClip::testingOnly_createClipMask(GrContext* context) const {
+sk_sp<GrTextureProxy> GrClipStackClip::testingOnly_createClipMask(GrContext* context) const {
const GrReducedClip reducedClip(*fStack, SkRect::MakeWH(512, 512), 0);
return this->createSoftwareClipMask(context, reducedClip);
}
@@ -1440,8 +1440,9 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(ClipMaskCache, reporter, ctxInfo) {
m.setTranslate(0.5, 0.5);
stack.save();
stack.clipPath(path, m, SkClipOp::kIntersect, true);
- auto mask = GrClipStackClip(&stack).testingOnly_createClipMask(context);
- REPORTER_ASSERT(reporter, 0 == strcmp(mask->getUniqueKey().tag(), kTag));
+ sk_sp<GrTextureProxy> mask = GrClipStackClip(&stack).testingOnly_createClipMask(context);
+ GrTexture* tex = mask->instantiate(context->textureProvider());
+ REPORTER_ASSERT(reporter, 0 == strcmp(tex->getUniqueKey().tag(), kTag));
// Make sure mask isn't pinned in cache.
mask.reset(nullptr);
context->flush();