Index: include/gpu/GrTextureProvider.h |
diff --git a/include/gpu/GrTextureProvider.h b/include/gpu/GrTextureProvider.h |
index 3f8c760f9b8c3b29343b8dba324143d1d04942da..1fd3f01bb16c22a609132d22564a0c3331128336 100644 |
--- a/include/gpu/GrTextureProvider.h |
+++ b/include/gpu/GrTextureProvider.h |
@@ -61,24 +61,24 @@ public: |
} |
/** |
- * Enum that determines how closely a returned scratch texture must match |
- * a provided GrSurfaceDesc. TODO: Remove this. createTexture() should be used |
+ * Enum that determines how closely a returned scratch resource must match |
+ * a provided information. TODO: Remove this. createTexture()/createBuffer() should be used |
* for exact match and refScratchTexture() should be replaced with createApproxTexture(). |
*/ |
- enum ScratchTexMatch { |
+ enum ScratchMatch { |
/** |
- * Finds a texture that exactly matches the descriptor. |
+ * Finds a resource that exactly matches the description. |
*/ |
- kExact_ScratchTexMatch, |
+ kExact_ScratchMatch, |
/** |
- * Finds a texture that approximately matches the descriptor. Will be |
- * at least as large in width and height as desc specifies. If desc |
- * specifies that texture is a render target then result will be a |
- * render target. If desc specifies a render target and doesn't set the |
- * no stencil flag then result will have a stencil. Format and aa level |
- * will always match. |
+ * Finds a resource that approximately matches the description. |
+ * For textures, this will be at least as large in width and height as |
+ * desc specifies. If desc specifies that texture is a render target |
+ * then result will be a render target. If desc specifies a render |
+ * target and doesn't set the no stencil flag then result will have |
+ * a stencil. Format and aa level will always match. |
*/ |
- kApprox_ScratchTexMatch |
+ kApprox_ScratchMatch |
}; |
/** |
@@ -94,7 +94,7 @@ public: |
* createApproxTexture() and exact textures should be created with |
* createTexture(). |
*/ |
- GrTexture* refScratchTexture(const GrSurfaceDesc&, ScratchTexMatch match, |
+ GrTexture* refScratchTexture(const GrSurfaceDesc&, ScratchMatch match, |
bool internalFlag = false); |
/////////////////////////////////////////////////////////////////////////// |
@@ -125,6 +125,12 @@ public: |
GrRenderTarget* wrapBackendRenderTarget(const GrBackendRenderTargetDesc& desc); |
protected: |
+ enum ScratchFlags { |
+ kExact_ScratchFlag = 0x1, |
+ kNoPendingIO_ScratchFlag = 0x2, |
+ kNoCreate_ScratchFlag = 0x4, |
+ }; |
+ |
GrTextureProvider(GrGpu* gpu, GrResourceCache* cache) : fCache(cache), fGpu(gpu) {} |
/** |
@@ -160,12 +166,12 @@ protected: |
GrGpu* gpu() { return fGpu; } |
const GrGpu* gpu() const { return fGpu; } |
-private: |
bool isAbandoned() const { |
SkASSERT(SkToBool(fGpu) == SkToBool(fCache)); |
return !SkToBool(fCache); |
} |
+private: |
GrResourceCache* fCache; |
GrGpu* fGpu; |
}; |