Index: include/gpu/GrContext.h |
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h |
index 45cd599132d32843a5cc988b53228284d80e13ff..366fba993e7dadecef4fe6e46352edfb64c62c73 100644 |
--- a/include/gpu/GrContext.h |
+++ b/include/gpu/GrContext.h |
@@ -1082,7 +1082,7 @@ private: |
* Gets and locks a scratch texture from a descriptor using either exact or approximate criteria. |
* Unlocks texture in the destructor. |
*/ |
-class GrAutoScratchTexture : public ::SkNoncopyable { |
+class SK_API GrAutoScratchTexture : public ::SkNoncopyable { |
public: |
GrAutoScratchTexture() |
: fContext(NULL) |
@@ -1121,24 +1121,7 @@ public: |
* Note that the caller is assumed to accept and manage the ref to the |
* returned texture. |
*/ |
- GrTexture* detach() { |
- if (NULL == fTexture) { |
- return NULL; |
- } |
- GrTexture* texture = fTexture; |
- fTexture = NULL; |
- |
- // This GrAutoScratchTexture has a ref from lockAndRefScratchTexture, which we give up now. |
- // The cache also has a ref which we are lending to the caller of detach(). When the caller |
- // lets go of the ref and the ref count goes to 0 internal_dispose will see this flag is |
- // set and re-ref the texture, thereby restoring the cache's ref. |
- SkASSERT(!texture->unique()); |
- texture->impl()->setFlag((GrTextureFlags) GrTextureImpl::kReturnToCache_FlagBit); |
- texture->unref(); |
- SkASSERT(texture->getCacheEntry()); |
- |
- return texture; |
- } |
+ GrTexture* detach(); |
GrTexture* set(GrContext* context, |
const GrTextureDesc& desc, |