aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrBackendTextureImageGenerator.cpp
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-01-30 09:28:44 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-30 14:50:00 +0000
commit6a0176bf033c780bb92396220db8140f30948345 (patch)
treee1ddcf9e3ca552d5063542d18ce30028e1ca0ca7 /src/gpu/GrBackendTextureImageGenerator.cpp
parentaa71c899fdf55e0a6cce60a2aed1ad904d23646d (diff)
Add ref counted wrapped around GrTexture ReleaseProc
Bug: skia: Change-Id: I0cd11a539fd6b16d4b3f9512694f84e0a429518c Reviewed-on: https://skia-review.googlesource.com/101341 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrBackendTextureImageGenerator.cpp')
-rw-r--r--src/gpu/GrBackendTextureImageGenerator.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gpu/GrBackendTextureImageGenerator.cpp b/src/gpu/GrBackendTextureImageGenerator.cpp
index 064727e248..262250ce4d 100644
--- a/src/gpu/GrBackendTextureImageGenerator.cpp
+++ b/src/gpu/GrBackendTextureImageGenerator.cpp
@@ -162,9 +162,15 @@ sk_sp<GrTextureProxy> GrBackendTextureImageGenerator::onGenerateTexture(
}
refHelper->fBorrowedTexture = tex.get();
+ sk_sp<GrReleaseProcHelper> releaseHelper(
+ new GrReleaseProcHelper(ReleaseRefHelper_TextureReleaseProc, refHelper));
+
// By setting this release proc on the texture we are passing our ref on the
// refHelper to the texture.
- tex->setRelease(ReleaseRefHelper_TextureReleaseProc, refHelper);
+ // DDL TODO: Once we are start reusing Lazy Proxies, we need to add a ref to the
+ // refHelper here, we'll still move the releaseHelper though since the texture
+ // will be the only one ever calling that release proc.
+ tex->setRelease(std::move(releaseHelper));
}
return tex;