Revert "Plumb the use of GrBackendRenderTarget throughout Skia"
This reverts commit fdd77daedbba3b7c53be74a82fb9fae891b51696.
Reason for revert: Apparently I have a few more build files to update before this can land.
Original change's description:
> Plumb the use of GrBackendRenderTarget throughout Skia
>
> Bug: skia:
> Change-Id: Ib99a58d9552f5c7b8d77c09dcc72fa88326c26aa
> Reviewed-on: https://skia-review.googlesource.com/14148
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>
>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Change-Id: I984e1909870182474c4c3cce257f01b6a9d8581f
Reviewed-on: https://skia-review.googlesource.com/14531
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index 1eec506..be5b0c7 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -815,36 +815,32 @@
return GrVkTextureRenderTarget::MakeWrappedTextureRenderTarget(this, surfDesc, ownership, info);
}
-sk_sp<GrRenderTarget> GrVkGpu::onWrapBackendRenderTarget(const GrBackendRenderTarget& backendRT,
- GrSurfaceOrigin origin){
+sk_sp<GrRenderTarget> GrVkGpu::onWrapBackendRenderTarget(const GrBackendRenderTargetDesc& wrapDesc){
// Currently the Vulkan backend does not support wrapping of msaa render targets directly. In
// general this is not an issue since swapchain images in vulkan are never multisampled. Thus if
// you want a multisampled RT it is best to wrap the swapchain images and then let Skia handle
// creating and owning the MSAA images.
- if (backendRT.sampleCnt()) {
+ if (wrapDesc.fSampleCnt) {
return nullptr;
}
- const GrVkImageInfo* info = backendRT.getVkImageInfo();
- if (!info) {
- return nullptr;
- }
+ const GrVkImageInfo* info =
+ reinterpret_cast<const GrVkImageInfo*>(wrapDesc.fRenderTargetHandle);
if (VK_NULL_HANDLE == info->fImage) {
return nullptr;
}
GrSurfaceDesc desc;
- desc.fConfig = backendRT.config();
+ desc.fConfig = wrapDesc.fConfig;
desc.fFlags = kCheckAllocation_GrSurfaceFlag | kRenderTarget_GrSurfaceFlag;
- desc.fWidth = backendRT.width();
- desc.fHeight = backendRT.height();
+ desc.fWidth = wrapDesc.fWidth;
+ desc.fHeight = wrapDesc.fHeight;
desc.fSampleCnt = 0;
- SkASSERT(kDefault_GrSurfaceOrigin != origin);
- desc.fOrigin = origin;
+ desc.fOrigin = resolve_origin(wrapDesc.fOrigin);
sk_sp<GrVkRenderTarget> tgt = GrVkRenderTarget::MakeWrappedRenderTarget(this, desc, info);
- if (tgt && backendRT.stencilBits()) {
+ if (tgt && wrapDesc.fStencilBits) {
if (!createStencilAttachmentForRenderTarget(tgt.get(), desc.fWidth, desc.fHeight)) {
return nullptr;
}
@@ -857,9 +853,6 @@
int sampleCnt) {
const GrVkImageInfo* info = tex.getVkImageInfo();
- if (!info) {
- return nullptr;
- }
if (VK_NULL_HANDLE == info->fImage) {
return nullptr;
}