From 7a6b96a289fecb1af70b0a6c2aac0f4d9d674079 Mon Sep 17 00:00:00 2001 From: Update Docs Date: Sat, 24 Mar 2018 06:58:25 +0000 Subject: Update markdown files Automatic commit by the Housekeeper-Nightly-Bookmaker bot. TBR=update-docs@skia.org NO_MERGE_BUILDS Change-Id: I23ebdd7299210e1ed5545521d472e0b473bd5566 Reviewed-on: https://skia-review.googlesource.com/116302 Commit-Queue: Update Docs Reviewed-by: Update Docs --- site/user/api/SkSurface_Reference.md | 92 +++++------------------------------- 1 file changed, 11 insertions(+), 81 deletions(-) (limited to 'site') diff --git a/site/user/api/SkSurface_Reference.md b/site/user/api/SkSurface_Reference.md index 1b01fe5f58..363f39b505 100644 --- a/site/user/api/SkSurface_Reference.md +++ b/site/user/api/SkSurface_Reference.md @@ -35,7 +35,6 @@ of the requested dimensions are zero, then nullptr will be returned. | name | description | | --- | --- | -| MakeFromBackendRenderTarget | creates Surface from GPU memory buffer | | MakeFromBackendTexture | creates Surface from GPU texture | | MakeFromBackendTextureAsRenderTarget | creates Surface from GPU back-end render target | | MakeNull | creates Surface without backing pixels | @@ -67,7 +66,6 @@ of the requested dimensions are zero, then nullptr will be returned. | name | description | | --- | --- | -| MakeFromBackendRenderTarget | creates Surface from GPU memory buffer | | MakeFromBackendTexture | creates Surface from GPU texture | | MakeFromBackendTextureAsRenderTarget | creates Surface from GPU back-end render target | | MakeNull | creates Surface without backing pixels | @@ -422,7 +420,7 @@ fonts; may be nullptr ### See Also -GrBackendTexture MakeFromBackendRenderTarget[2] MakeRenderTarget[2][3] +GrBackendTexture MakeFromBackendRenderTarget MakeRenderTarget[2][3] --- @@ -432,13 +430,13 @@ fonts; may be nullptr
 static sk_sp<SkSurface> MakeFromBackendRenderTarget(GrContext* context,
                                                    const GrBackendRenderTarget& backendRenderTarget,
-                                                   GrSurfaceOrigin origin,
+                                                   GrSurfaceOrigin origin, SkColorType colorType,
                                                    sk_sp<SkColorSpace> colorSpace,
                                                    const SkSurfaceProps* surfaceProps)
 
-Wraps a GPU-backed buffer into Surface. Caller must ensure render target is -valid for the lifetime of returned Surface. +Wraps a GPU-backed buffer into Surface. Caller must ensure backendRenderTarget +is valid for the lifetime of returned Surface. Surface is returned if all parameters are valid. backendRenderTarget is valid if its pixel configuration agrees with colorSpace and context; for instance, if @@ -457,82 +455,14 @@ If SK_SUPPORT_GPU is defined as zero, has no effect and returns nullptr. GPU intermediate memory buffer origin one of: kBottomLeft GrSurfaceOrigin, kTopLeft GrSurfaceOrigin - colorSpace -range of colors - surfaceProps -LCD striping orientation and setting for device independent -fonts; may be nullptr - - - -### Return Value - -Surface if all parameters are valid; otherwise, nullptr - -### Example - -
-
-    SkPaint paint;
-    paint.setTextSize(32);
-    GrContext* context = canvas->getGrContext();
-    if (!context) {
-         canvas->drawString("GPU only!", 20, 40, paint);
-         return;
-    }
-    sk_sp gpuSurface = SkSurface::MakeFromBackendRenderTarget(context,
-            backEndRenderTarget, kTopLeft_GrSurfaceOrigin, nullptr, nullptr);
-    auto surfaceCanvas = gpuSurface->getCanvas();
-    surfaceCanvas->drawString("GPU rocks!", 20, 40, paint);
-    sk_sp image(gpuSurface->makeImageSnapshot());
-    canvas->drawImage(image, 0, 0);
-
-
- -### See Also - -MakeFromBackendTexture MakeRenderTarget[2][3] - ---- - - - -
-static sk_sp<SkSurface> MakeFromBackendRenderTarget(GrContext* context,
-                                                   const GrBackendRenderTarget& backendRenderTarget,
-                                                   GrSurfaceOrigin origin, SkColorType colorType,
-                                                   sk_sp<SkColorSpace> colorSpace,
-                                                   const SkSurfaceProps* surfaceProps)
-
- -Wraps a GPU-backed buffer into Surface. Caller must ensure backendRenderTarget -is valid for the lifetime of returned Surface. - -Surface is returned if all parameters are valid. backendRenderTarget is valid if -its pixel configuration agrees with colorSpace and context; for instance, if -backendRenderTarget has an sRGB configuration, then context must support sRGB, -and colorSpace must be present. Further, backendRenderTarget width and height must -not exceed context capabilities, and the context must be able to support -back-end render targets. - -If SK_SUPPORT_GPU is defined as zero, has no effect and returns nullptr. - -### Parameters - - - - - - - @@ -628,7 +558,7 @@ fonts; may be nullptr ### See Also -MakeFromBackendRenderTarget[2]MakeRenderTarget[2][3] +MakeFromBackendRenderTargetMakeRenderTarget[2][3] --- @@ -691,7 +621,7 @@ hint that Surface will host Mip_Map images ### See Also -MakeFromBackendRenderTarget[2]MakeFromBackendTextureAsRenderTarget +MakeFromBackendRenderTargetMakeFromBackendTextureAsRenderTarget --- @@ -747,7 +677,7 @@ or red green blue. ### See Also -MakeFromBackendRenderTarget[2]MakeFromBackendTextureAsRenderTarget +MakeFromBackendRenderTargetMakeFromBackendTextureAsRenderTarget --- @@ -788,7 +718,7 @@ of Raster Surface; width, or height, o ### See Also -MakeFromBackendRenderTarget[2]MakeFromBackendTextureAsRenderTarget +MakeFromBackendRenderTargetMakeFromBackendTextureAsRenderTarget --- -- cgit v1.2.3
context -GPU Context
backendRenderTarget -GPU intermediate memory buffer
origin -one of: kBottomLeft GrSurfaceOrigin, kTopLeft GrSurfaceOrigin
colorType +
colorType one of: kUnknown_SkColorType, kAlpha_8_SkColorType, kRGB_565_SkColorType, kARGB_4444_SkColorType, kRGBA_8888_SkColorType, kRGB_888x_SkColorType, kBGRA_8888_SkColorType, kRGBA_1010102_SkColorType, kRGB_101010x_SkColorType, kGray_8_SkColorType, kRGBA_F16_SkColorType
colorSpace +
colorSpace range of colors
surfaceProps +
surfaceProps LCD striping orientation and setting for device independent fonts; may be nullptr