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>
diff --git a/src/gpu/GrAHardwareBufferImageGenerator.cpp b/src/gpu/GrAHardwareBufferImageGenerator.cpp
index 66ba484..f9208b1 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 @@
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 @@
//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 {