diff options
author | Brian Salomon <bsalomon@google.com> | 2018-03-23 15:31:32 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-03-23 20:44:50 +0000 |
commit | 49edccd775a38d93701ae376df28463d7848fd16 (patch) | |
tree | a8b9c58bc7440adfa745ba721b712b6a8cb4a33d /docs | |
parent | f4a00e4b4a0642a9f3e69705632f9cd6e9d1cd4d (diff) |
Remove legacy SkSurface::MakeFromBackendRenderTarget that does not take SkColorType
Bug: skia:6718
Change-Id: Iefec5be49bf7450426c5ddb668f5525876f8ec2d
Reviewed-on: https://skia-review.googlesource.com/116194
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/SkSurface_Reference.bmh | 82 |
1 files changed, 14 insertions, 68 deletions
diff --git a/docs/SkSurface_Reference.bmh b/docs/SkSurface_Reference.bmh index c579ec49af..a7053f69d3 100644 --- a/docs/SkSurface_Reference.bmh +++ b/docs/SkSurface_Reference.bmh @@ -409,60 +409,6 @@ If SK_SUPPORT_GPU is defined as zero, has no effect and returns nullptr. #Method static sk_sp<SkSurface> MakeFromBackendRenderTarget(GrContext* context, const GrBackendRenderTarget& backendRenderTarget, GrSurfaceOrigin origin, - sk_sp<SkColorSpace> colorSpace, - const SkSurfaceProps* surfaceProps) -#In Constructor -#Line # creates Surface from GPU memory buffer ## - -Wraps a GPU-backed buffer into Surface. Caller must ensure render target 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. - -#Param context GPU_Context ## -#Param backendRenderTarget GPU intermediate memory buffer ## -#Param origin one of: kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin ## -#Param colorSpace range of colors ## -#Param surfaceProps LCD striping orientation and setting for device independent - fonts; may be nullptr -## - -#Return Surface if all parameters are valid; otherwise, nullptr ## - -#Example -#ToDo remove !fiddle below once backEndTextureRenderTarget is available ## -#Platform !fiddle gpu - SkPaint paint; - paint.setTextSize(32); - GrContext* context = canvas->getGrContext(); - if (!context) { - canvas->drawString("GPU only!", 20, 40, paint); - return; - } - sk_sp<SkSurface> gpuSurface = SkSurface::MakeFromBackendRenderTarget(context, - backEndRenderTarget, kTopLeft_GrSurfaceOrigin, nullptr, nullptr); - auto surfaceCanvas = gpuSurface->getCanvas(); - surfaceCanvas->drawString("GPU rocks!", 20, 40, paint); - sk_sp<SkImage> image(gpuSurface->makeImageSnapshot()); - canvas->drawImage(image, 0, 0); -## - -#SeeAlso MakeFromBackendTexture MakeRenderTarget - -#Method ## - -# ------------------------------------------------------------------------------ - -#Method static sk_sp<SkSurface> MakeFromBackendRenderTarget(GrContext* context, - const GrBackendRenderTarget& backendRenderTarget, - GrSurfaceOrigin origin, SkColorType colorType, sk_sp<SkColorSpace> colorSpace, const SkSurfaceProps* surfaceProps) @@ -558,20 +504,20 @@ If SK_SUPPORT_GPU is defined as zero, has no effect and returns nullptr. #ToDo example is bogus; gpuSurface should not make image ## #Platform gpu #Image 3 - SkPaint paint;
- paint.setTextSize(32);
- GrContext* context = canvas->getGrContext();
- if (!context) {
- canvas->drawString("GPU only!", 20, 40, paint);
- return;
- }
- sk_sp<SkSurface> gpuSurface = SkSurface::MakeFromBackendTextureAsRenderTarget(
- context, backEndTexture, kTopLeft_GrSurfaceOrigin, 0,
- kRGBA_8888_SkColorType, nullptr, nullptr);
- auto surfaceCanvas = gpuSurface->getCanvas();
- surfaceCanvas->drawString("GPU rocks!", 20, 40, paint);
- sk_sp<SkImage> image(gpuSurface->makeImageSnapshot());
- canvas->drawImage(image, 0, 0);
+ SkPaint paint; + paint.setTextSize(32); + GrContext* context = canvas->getGrContext(); + if (!context) { + canvas->drawString("GPU only!", 20, 40, paint); + return; + } + sk_sp<SkSurface> gpuSurface = SkSurface::MakeFromBackendTextureAsRenderTarget( + context, backEndTexture, kTopLeft_GrSurfaceOrigin, 0, + kRGBA_8888_SkColorType, nullptr, nullptr); + auto surfaceCanvas = gpuSurface->getCanvas(); + surfaceCanvas->drawString("GPU rocks!", 20, 40, paint); + sk_sp<SkImage> image(gpuSurface->makeImageSnapshot()); + canvas->drawImage(image, 0, 0); ## #SeeAlso MakeFromBackendRenderTarget MakeRenderTarget |