diff options
author | Robert Phillips <robertphillips@google.com> | 2018-01-17 13:35:46 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-01-17 19:43:57 +0000 |
commit | adbe1328789071d1f742023edd93b6948eed9470 (patch) | |
tree | 952806d1cb29fc01b5743b433f6bfaabc6d6869e /src/gpu/GrAHardwareBufferImageGenerator.cpp | |
parent | fe266c2bce2b8ac4ef953f16c8e1a7801da9c57d (diff) |
Remove GrSurfaceProxy::MakeWrapped (take 2)
TBR=bsalomon@google.com
Change-Id: I26fd911da502fb00addacb8b2c1a263efc5aa4ec
Reviewed-on: https://skia-review.googlesource.com/95881
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/GrAHardwareBufferImageGenerator.cpp')
-rw-r--r-- | src/gpu/GrAHardwareBufferImageGenerator.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gpu/GrAHardwareBufferImageGenerator.cpp b/src/gpu/GrAHardwareBufferImageGenerator.cpp index 66ba484198..f9208b144b 100644 --- a/src/gpu/GrAHardwareBufferImageGenerator.cpp +++ b/src/gpu/GrAHardwareBufferImageGenerator.cpp @@ -17,6 +17,7 @@ #include "GrBackendSurface.h" #include "GrContext.h" #include "GrContextPriv.h" +#include "GrProxyProvider.h" #include "GrResourceCache.h" #include "GrResourceProvider.h" #include "GrTexture.h" @@ -151,9 +152,12 @@ sk_sp<GrTextureProxy> GrAHardwareBufferImageGenerator::makeProxy(GrContext* cont return nullptr; } + auto proxyProvider = context->contextPriv().proxyProvider(); + // return a cached GrTexture if invoked with the same context if (fOriginalTexture && fOwningContextID == context->uniqueID()) { - return GrSurfaceProxy::MakeWrapped(sk_ref_sp(fOriginalTexture), kTopLeft_GrSurfaceOrigin); + return proxyProvider->createWrapped(sk_ref_sp(fOriginalTexture), + kTopLeft_GrSurfaceOrigin); } while (GL_NO_ERROR != glGetError()) {} //clear GL errors @@ -241,7 +245,7 @@ sk_sp<GrTextureProxy> GrAHardwareBufferImageGenerator::makeProxy(GrContext* cont //TODO: GrResourceCache should delete GrTexture, when GrContext is deleted. Currently //TODO: SkMessageBus ignores messages for deleted contexts and GrTexture will leak. context->contextPriv().getResourceCache()->insertCrossContextGpuResource(fOriginalTexture); - return GrSurfaceProxy::MakeWrapped(std::move(tex), kTopLeft_GrSurfaceOrigin); + return proxyProvider->createWrapped(std::move(tex), kTopLeft_GrSurfaceOrigin); } bool GrAHardwareBufferImageGenerator::onIsValid(GrContext* context) const { |