Chromium Code Reviews| 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 |