Cleanup resource flags
Converts GrResourceProvider::Flags and GrResourceCache::ScratchFlags
to "enum class" and fixes a case where we were accidentally using the
wrong type of flag. Makes sure to allocate GrSWMaskHelper proxies with
kNoPendingIO.
Bug: skia:8351
Change-Id: Ibcaa26314a53d0cb31ae22915ab94ab0fc07e76d
Reviewed-on: https://skia-review.googlesource.com/157280
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
diff --git a/src/gpu/GrProxyProvider.h b/src/gpu/GrProxyProvider.h
index df6903b..26dc6e9 100644
--- a/src/gpu/GrProxyProvider.h
+++ b/src/gpu/GrProxyProvider.h
@@ -61,25 +61,13 @@
sk_sp<GrTextureProxy> findOrCreateProxyByUniqueKey(const GrUniqueKey&, GrSurfaceOrigin);
/*
- * Create a texture proxy that is backed by an instantiated GrSurface. This is almost entirely
- * used by Skia's testing code.
- * DDL TODO: remove the remaining Skia-internal use of this method and make it truly
- * testing-only.
- */
- sk_sp<GrTextureProxy> createInstantiatedProxy(const GrSurfaceDesc&, GrSurfaceOrigin,
- SkBackingFit, SkBudgeted,
- GrSurfaceDescFlags = kNone_GrSurfaceFlags);
-
- /*
* Create an un-mipmapped texture proxy with data. The SkImage must be a raster backend image.
* Since the SkImage is ref counted, we simply take a ref on it to keep the data alive until we
* actually upload the data to the gpu.
*/
- sk_sp<GrTextureProxy> createTextureProxy(sk_sp<SkImage> srcImage,
- GrSurfaceDescFlags descFlags,
- int sampleCnt,
- SkBudgeted budgeted,
- SkBackingFit fit);
+ sk_sp<GrTextureProxy> createTextureProxy(
+ sk_sp<SkImage> srcImage, GrSurfaceDescFlags, int sampleCnt, SkBudgeted, SkBackingFit,
+ GrInternalSurfaceFlags = GrInternalSurfaceFlags::kNone);
/*
* Create a mipmapped texture proxy without any data.
@@ -244,8 +232,15 @@
*/
bool recordingDDL() const { return !SkToBool(fResourceProvider); }
+ /*
+ * Create a texture proxy that is backed by an instantiated GrSurface.
+ */
+ sk_sp<GrTextureProxy> testingOnly_createInstantiatedProxy(const GrSurfaceDesc&, GrSurfaceOrigin,
+ SkBackingFit, SkBudgeted);
+
private:
friend class GrAHardwareBufferImageGenerator; // for createWrapped
+ friend class GrResourceProvider; // for createWrapped
sk_sp<GrTextureProxy> createWrapped(sk_sp<GrTexture> tex, GrSurfaceOrigin origin);