diff options
Diffstat (limited to 'include/gpu')
-rw-r--r-- | include/gpu/GrBackendSurface.h | 6 | ||||
-rw-r--r-- | include/gpu/GrTypes.h | 33 |
2 files changed, 39 insertions, 0 deletions
diff --git a/include/gpu/GrBackendSurface.h b/include/gpu/GrBackendSurface.h index 55cec78548..c9a9ad02e6 100644 --- a/include/gpu/GrBackendSurface.h +++ b/include/gpu/GrBackendSurface.h @@ -108,6 +108,12 @@ public: #endif private: + // Temporary constructor which can be used to convert from a GrBackendRenderTargetDesc. + GrBackendRenderTarget(const GrBackendRenderTargetDesc& desc, GrBackend backend); + + // Friending for access to above constructor taking a GrBackendRenderTargetDesc + friend class SkSurface; + int fWidth; //<! width in pixels int fHeight; //<! height in pixels diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h index 8d76364e20..a343f03817 100644 --- a/include/gpu/GrTypes.h +++ b/include/gpu/GrTypes.h @@ -647,6 +647,39 @@ enum GrWrapOwnership { /////////////////////////////////////////////////////////////////////////////// /** + * Gr can wrap an existing render target created by the client in the 3D API + * with a GrRenderTarget object. The client is responsible for ensuring that the + * underlying 3D API object lives at least as long as the GrRenderTarget object + * wrapping it. We require the client to explicitly provide information about + * the target, such as width, height, and pixel config rather than querying the + * 3D API for these values. We expect these properties to be immutable even if + * the 3D API doesn't require this (OpenGL). + */ + +struct GrBackendRenderTargetDesc { + GrBackendRenderTargetDesc() { memset(this, 0, sizeof(*this)); } + int fWidth; //<! width in pixels + int fHeight; //<! height in pixels + GrPixelConfig fConfig; //<! color format + GrSurfaceOrigin fOrigin; //<! pixel origin + /** + * The number of samples per pixel. Gr uses this to influence decisions + * about applying other forms of anti-aliasing. + */ + int fSampleCnt; + /** + * Number of bits of stencil per-pixel. + */ + int fStencilBits; + /** + * Handle to the 3D API object. + * OpenGL: FBO ID + * Vulkan: GrVkImageInfo* + */ + GrBackendObject fRenderTargetHandle; +}; + +/** * The GrContext's cache of backend context state can be partially invalidated. * These enums are specific to the GL backend and we'd add a new set for an alternative backend. */ |