Add GrResourceAllocator class + unit test
Change-Id: I2700e8cb4213479b680519ba67f078cc3fb71376
Reviewed-on: https://skia-review.googlesource.com/23661
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrTextureRenderTargetProxy.cpp b/src/gpu/GrTextureRenderTargetProxy.cpp
index 9c4ccc6..a9a56e1 100644
--- a/src/gpu/GrTextureRenderTargetProxy.cpp
+++ b/src/gpu/GrTextureRenderTargetProxy.cpp
@@ -56,3 +56,20 @@
return true;
}
+
+sk_sp<GrSurface> GrTextureRenderTargetProxy::createSurface(
+ GrResourceProvider* resourceProvider) const {
+ static constexpr GrSurfaceFlags kFlags = kRenderTarget_GrSurfaceFlag;
+
+ sk_sp<GrSurface> surface = this->createSurfaceImpl(resourceProvider, this->numStencilSamples(),
+ kFlags, this->isMipMapped(),
+ this->mipColorMode());
+ if (!surface) {
+ return nullptr;
+ }
+ SkASSERT(surface->asRenderTarget());
+ SkASSERT(surface->asTexture());
+
+ return surface;
+}
+