diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/SkSurface_Reference.bmh | 55 |
1 files changed, 53 insertions, 2 deletions
diff --git a/docs/SkSurface_Reference.bmh b/docs/SkSurface_Reference.bmh index d3fb13529f..e9c520106b 100644 --- a/docs/SkSurface_Reference.bmh +++ b/docs/SkSurface_Reference.bmh @@ -989,7 +989,7 @@ Caller must overwrite the entire back-end object. canvas->drawString(str, 20, y += 20, paint); ## -#SeeAlso getTextureHandle +#SeeAlso getTextureHandle getRenderTargetHandle #Enum ## @@ -1032,7 +1032,58 @@ or when Surface is deleted. } ## -#SeeAlso GrBackendObject BackendHandleAccess +#SeeAlso getRenderTargetHandle GrBackendObject BackendHandleAccess + +#Method ## + +# ------------------------------------------------------------------------------ + +#Method bool getRenderTargetHandle(GrBackendObject* backendObject, + BackendHandleAccess backendHandleAccess) +#In Property +#Line # returns the GPU reference to render target ## + +Returns true and stores the GPU back-end reference of the render target used +by Surface in backendObject. + +Return false if Surface is not backed by a GPU render target, and leaves +backendObject unchanged. + +The returned render target handle is only valid until the next draw into Surface, +or when Surface is deleted. + +In OpenGL this returns the frame buffer object ID. + +#Param backendObject GPU intermediate memory buffer ## +#Param backendHandleAccess one of: kFlushRead_BackendHandleAccess, + kFlushWrite_BackendHandleAccess, kDiscardWrite_BackendHandleAccess +## + +#Return true if Surface is backed by GPU texture ## + +#Example +#Platform gpu +#Height 64 + SkPaint paint; + paint.setTextSize(32); + GrContext* context = canvas->getGrContext(); + if (!context) { + canvas->drawString("GPU only!", 20, 40, paint); + return; + } + sk_sp<SkSurface> gpuSurface = SkSurface::MakeRenderTarget( + context, SkBudgeted::kYes, SkImageInfo::MakeN32Premul(10, 10)); + GrBackendObject backendObject; + if (gpuSurface->getRenderTargetHandle(&backendObject, + SkSurface::kFlushRead_BackendHandleAccess)) { + SkString str; + str.printf("backendObject=%ld", backendObject); + paint.setTextSize(16); + canvas->drawString(str, 20, 40, paint); + } +## + +#SeeAlso getTextureHandle GrBackendObject BackendHandleAccess #Method ## |