Index: src/gpu/GrGpu.h |
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h |
index a2d1fafb872ba110a57071dd7fbe556fbad57e6f..c5fa61bd99851d9b9e5a58d56d14f5a7c7f7573b 100644 |
--- a/src/gpu/GrGpu.h |
+++ b/src/gpu/GrGpu.h |
@@ -363,12 +363,18 @@ public: |
Stats* stats() { return &fStats; } |
- // creation and deletion of raw texture for testing |
- // only to be used in GPU-specific tests |
+ /** Creates a texture directly in the backend API without wrapping it in a GrTexture. This is |
+ only to be used for testing (particularly for testing the methods that import an externally |
+ created texture into Skia. Must be matched with a call to deleteTestingOnlyTexture(). */ |
virtual GrBackendObject createTestingOnlyBackendTexture(void* pixels, int w, int h, |
GrPixelConfig config) const = 0; |
- virtual bool isTestingOnlyBackendTexture(GrBackendObject id) const = 0; |
- virtual void deleteTestingOnlyBackendTexture(GrBackendObject id) const = 0; |
+ /** Check a handle represents an actual texture in the backend API that has not been freed. */ |
+ virtual bool isTestingOnlyBackendTexture(GrBackendObject) const = 0; |
+ /** If ownership of the backend texture has been transferred pass true for abandonTexture. This |
+ will do any necessary cleanup of the handle without freeing the texture in the backend |
+ API. */ |
+ virtual void deleteTestingOnlyBackendTexture(GrBackendObject, |
+ bool abandonTexture = false) const = 0; |
// width and height may be larger than rt (if underlying API allows it). |
// Returns nullptr if compatible sb could not be created, otherwise the caller owns the ref on |