From 807371c15bd742efb98a9df6e1dee73e8bda8af5 Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Thu, 20 Jul 2017 20:48:12 +0000 Subject: Revert "Remove GrBackendRenderTargetDesc in favor of GrBackendRenderTarget." This reverts commit e2d37c2a07f5473e5fc6fb65e9e23e14127580e9. Reason for revert: Original change's description: > Remove GrBackendRenderTargetDesc in favor of GrBackendRenderTarget. > > Also removes a reference to GrBackendTextureDesc in a comment and updates markdown docs. > > Docs-Preview: https://skia.org/?cl=24861 > Bug: skia: > Change-Id: Ic6490d5ef46953450e6dee69271397bb2b94d0d6 > Reviewed-on: https://skia-review.googlesource.com/24861 > Commit-Queue: Brian Salomon > Reviewed-by: Robert Phillips TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com Change-Id: I4b85b529727f0bf5aec21d87e725a8195666e2e5 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/25182 Reviewed-by: Brian Salomon Commit-Queue: Brian Salomon --- site/user/sample/color.md | 11 ++++++----- site/user/special/vulkan.md | 16 +++++++--------- 2 files changed, 13 insertions(+), 14 deletions(-) (limited to 'site/user') diff --git a/site/user/sample/color.md b/site/user/sample/color.md index 3f4d869504..28d86d396d 100644 --- a/site/user/sample/color.md +++ b/site/user/sample/color.md @@ -116,9 +116,11 @@ can be in any gamut, but must have a linear transfer function. sk_sp MakeFromEncoded(sk_sp encoded); // Create an image from a texture in a particular color space - sk_sp MakeFromTexture(GrContext*, const GrBackendTexture&, - GrSurfaceOrigin, SkAlphaType, sk_sp, - ...); + // Caution: There are versions of this constructor that do not take an + // SkColorSpace. But without an SkColorSpace, Skia does not have + // enough information to draw correctly. + sk_sp MakeFromTexture(GrContext*, const GrBackendTextureDesc&, + SkAlphaType, sk_sp, ...); **SkBitmap** is another (not preferred) representation for image sources. Be careful to not forget the color space. @@ -188,5 +190,4 @@ cannot know how to draw without knowing the color space of the source. It is possible to create **an object that is both a source and destination**, if Skia will both draw into it and then draw it somewhere else. The same rules from above still apply, but it is subtle that the color space tag could have an effect (or no effect) depending on how the object is -used. - +used. \ No newline at end of file diff --git a/site/user/special/vulkan.md b/site/user/special/vulkan.md index 45f613f4fe..8dfd26a46b 100644 --- a/site/user/special/vulkan.md +++ b/site/user/special/vulkan.md @@ -33,16 +33,14 @@ To create a GrContext that is backed by Vulkan the client creates a Vulkan devic sk_sp context = GrContext::Create(kVulkan_GrBackend, (GrBackendContext) vkBackendContext); -When using the Vulkan backend, GrVkImageInfo is used to construct GrBackendTexture -and GrBackendRenderTarget objects that in turn are used to create SkSurface and SkImage -objects that refer to VkImages created by the Skia client. +When using the Vulkan backend the GrBackendObject field in +GrBackendRenderTargetDesc and GrBackendTextureDesc is interpeted as a pointer +to a GrVkImageInfo object. GrVkImageInfo specifies a VkImage and associated +state (tiling, layout, format, etc). This allows the client to import +externally created Vulkan images as destinations for Skia rendering via +SkSurface factory functions or for to composite Skia rendered content using +SkImage::getTextureHandle(). -The GrBackendObject returned by SkImage::getTextureHandle(), -SkSurface::getTextureHandle(), and SkSurface::getRenderTargetHandle() should be -interpreted as a GrVkImageInfo*. This allows a client to get the backing VkImage -of a SkImage or SkSurface. - -GrVkImageInfo specifies a VkImage and associated state (tiling, layout, format, etc). After getting a GrVkImageInfo* via getTextureHandle() or getRenderTargetHandle(), the client should check the fImageLayout field to know what layout Skia left the VkImage in before using the VkImage. If the client -- cgit v1.2.3