Update getBackendInfo calls on GrBackendTexture to support VkImageLayout better.
The big api level change here is that the getBackendInfo calls now return by value
instead of a pointer. These changes are being made in support of Vulkan so that
the client can update the VkImageLayout on the GrBackendTexture and have that
update get reflected in our internal tracking of the image. This is done by storing
a ref counted GrVkImageLayout object on the GrBackendTexture and the GrVkImage.
Bug: skia:
Change-Id: I8c6158fd3a66eb61fef97ebf09ea5364bca3f1ae
Reviewed-on: https://skia-review.googlesource.com/119101
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/vk/GrVkTextureRenderTarget.h b/src/gpu/vk/GrVkTextureRenderTarget.h
index 4b3e057..0a0ba4d 100644
--- a/src/gpu/vk/GrVkTextureRenderTarget.h
+++ b/src/gpu/vk/GrVkTextureRenderTarget.h
@@ -33,7 +33,8 @@
static sk_sp<GrVkTextureRenderTarget> MakeWrappedTextureRenderTarget(GrVkGpu*,
const GrSurfaceDesc&,
GrWrapOwnership,
- const GrVkImageInfo*);
+ const GrVkImageInfo&,
+ sk_sp<GrVkImageLayout>);
bool updateForMipmap(GrVkGpu* gpu, const GrVkImageInfo& newInfo);
@@ -53,8 +54,10 @@
SkBudgeted budgeted,
const GrSurfaceDesc& desc,
const GrVkImageInfo& info,
+ sk_sp<GrVkImageLayout> layout,
const GrVkImageView* texView,
const GrVkImageInfo& msaaInfo,
+ sk_sp<GrVkImageLayout> msaaLayout,
const GrVkImageView* colorAttachmentView,
const GrVkImageView* resolveAttachmentView,
GrMipMapsStatus,
@@ -64,6 +67,7 @@
SkBudgeted budgeted,
const GrSurfaceDesc& desc,
const GrVkImageInfo& info,
+ sk_sp<GrVkImageLayout> layout,
const GrVkImageView* texView,
const GrVkImageView* colorAttachmentView,
GrMipMapsStatus,
@@ -72,8 +76,10 @@
GrVkTextureRenderTarget(GrVkGpu* gpu,
const GrSurfaceDesc& desc,
const GrVkImageInfo& info,
+ sk_sp<GrVkImageLayout> layout,
const GrVkImageView* texView,
const GrVkImageInfo& msaaInfo,
+ sk_sp<GrVkImageLayout> msaaLayout,
const GrVkImageView* colorAttachmentView,
const GrVkImageView* resolveAttachmentView,
GrMipMapsStatus,
@@ -82,6 +88,7 @@
GrVkTextureRenderTarget(GrVkGpu* gpu,
const GrSurfaceDesc& desc,
const GrVkImageInfo& info,
+ sk_sp<GrVkImageLayout> layout,
const GrVkImageView* texView,
const GrVkImageView* colorAttachmentView,
GrMipMapsStatus,
@@ -90,6 +97,7 @@
static sk_sp<GrVkTextureRenderTarget> Make(GrVkGpu*,
const GrSurfaceDesc&,
const GrVkImageInfo&,
+ sk_sp<GrVkImageLayout>,
GrMipMapsStatus,
SkBudgeted budgeted,
GrBackendObjectOwnership,