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

Unified Diff: include/gpu/GrTypes.h

Issue 1862043002: Refactor to separate backend object lifecycle and GpuResource budget decision (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 4 years, 8 months 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
Index: include/gpu/GrTypes.h
diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h
index 47c13ec02d91888bcd8d0738862976847f09e2b3..ed00774c03b802e3be77536d93e4b03eecbc2da9 100644
--- a/include/gpu/GrTypes.h
+++ b/include/gpu/GrTypes.h
@@ -425,6 +425,29 @@ GR_MAKE_BITFIELD_OPS(GrSurfaceFlags)
// opaque type for 3D API object handles
typedef intptr_t GrBackendObject;
+enum class GrBackendObjectLifeCycle {
bsalomon 2016/04/19 14:37:46 Seems a bit concusing that we call this BackendObj
Kimmo Kinnunen 2016/04/20 12:04:55 The "backend object" here means GL object or Vulka
+ /**
+ * The object is created and owned by Skia. Objects with this status may be kept alive
+ * by the cache as either part of scratch or unique resources even when there are no refs to
+ * the resources.
+ * The cache may release the resources whenever there are no refs.
+ */
+ kInternal,
+
+ /**
+ * Skia does not manage the lifetime of the backend 3D API object. The client is
+ * responsible for freeing the object. Used to inject client- created GPU resources into Skia
+ * (e.g. to render to a client-created texture).
+ */
+ kBorrowed,
+
+ /**
+ * An external object with ownership transfered into Skia. Skia will free the object.
+ */
+ kAdopted
+};
+
+
/**
* Some textures will be stored such that the upper and left edges of the content meet at the
* the origin (in texture coord space) and for other textures the lower and left edges meet at
« include/gpu/GrGpuResource.h ('K') | « include/gpu/GrTexture.h ('k') | src/gpu/GrGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698