aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-04-14 17:29:58 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-04-14 18:08:12 +0000
commit7444c3c51887e6aa5324b6fc6aa82768d7830389 (patch)
tree82f1085cd82c19e50bd566b121445299e8a093e0 /docs
parent520e578b9987ea99b8ee62b485e941b3d5d96e0f (diff)
Revert "Delete getRenderTargetHandle call on SkSurface."
This reverts commit c828109ebd1519134b1c3fa168519ac07a31fe05. Reason for revert: Need to fix flutter Original change's description: > Delete getRenderTargetHandle call on SkSurface. > > All clients and internal code should be switched (once changes land soon) > to the new getBackendRenderTarget call instead. > > Bug: skia: > Change-Id: I6f490b6d26a72f37f97216be04e541483206510d > Reviewed-on: https://skia-review.googlesource.com/121103 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Greg Daniel <egdaniel@google.com> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: skia: Change-Id: I571298f839757fcdedcd8117519e740ac7ef1344 Reviewed-on: https://skia-review.googlesource.com/121480 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/SkSurface_Reference.bmh55
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 ##