Index: include/gpu/GrTextureProvider.h |
diff --git a/include/gpu/GrTextureProvider.h b/include/gpu/GrTextureProvider.h |
index 5635583d80fef393a746ae75f32edc0d2a3c8025..46f381da81f1fd5b5c0cdd82ba13829d95f58c52 100644 |
--- a/include/gpu/GrTextureProvider.h |
+++ b/include/gpu/GrTextureProvider.h |
@@ -10,6 +10,8 @@ |
#include "GrTexture.h" |
#include "SkImageFilter.h" |
+ |
+class GrSingleOwner; |
class SK_API GrTextureProvider { |
public: |
@@ -42,15 +44,7 @@ |
} |
/** Finds a texture by unique key. If the texture is found it is ref'ed and returned. */ |
- GrTexture* findAndRefTextureByUniqueKey(const GrUniqueKey& key) { |
- GrGpuResource* resource = this->findAndRefResourceByUniqueKey(key); |
- if (resource) { |
- GrTexture* texture = static_cast<GrSurface*>(resource)->asTexture(); |
- SkASSERT(texture); |
- return texture; |
- } |
- return NULL; |
- } |
+ GrTexture* findAndRefTextureByUniqueKey(const GrUniqueKey& key); |
/** |
* Determines whether a texture is associated with the unique key. If the texture is found it |
@@ -134,7 +128,7 @@ |
GrRenderTarget* wrapBackendRenderTarget(const GrBackendRenderTargetDesc& desc); |
protected: |
- GrTextureProvider(GrGpu* gpu, GrResourceCache* cache) : fCache(cache), fGpu(gpu) {} |
+ GrTextureProvider(GrGpu* gpu, GrResourceCache* cache, GrSingleOwner* singleOwner); |
/** |
* Assigns a unique key to a resource. If the key is associated with another resource that |
@@ -186,6 +180,9 @@ |
private: |
GrResourceCache* fCache; |
GrGpu* fGpu; |
+ |
+ // In debug builds we guard against improper thread handling |
+ SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;) |
}; |
#endif |