Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(250)

Unified Diff: src/gpu/GrGpu.h

Issue 1433353005: Fix leaks in unit tests of GrGLTextureInfos (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/gpu/GrTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | src/gpu/GrTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698