Revert "Revert "Plumb the use of GrBackendRenderTarget throughout Skia""
This reverts commit e3bd422fafc74dd3410c3de24a576635be92c3b4.
Reason for revert: Pre-req changes have all landed in other projects at this point.
Original change's description:
> 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>
>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,reviews@skia.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Ib7ab94aada8a7cb80fe38f24daf32f9208c5b169
Reviewed-on: https://skia-review.googlesource.com/14826
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/tests/VkWrapTests.cpp b/tests/VkWrapTests.cpp
index 44b5e72..0ae3402 100644
--- a/tests/VkWrapTests.cpp
+++ b/tests/VkWrapTests.cpp
@@ -93,30 +93,24 @@
true);
const GrVkImageInfo* backendTex = reinterpret_cast<const GrVkImageInfo*>(backendObj);
- // check basic borrowed creation
- GrBackendRenderTargetDesc desc;
- desc.fWidth = kW;
- desc.fHeight = kH;
- desc.fConfig = kPixelConfig;
- desc.fOrigin = kTopLeft_GrSurfaceOrigin;
- desc.fSampleCnt = 0;
- desc.fStencilBits = 0;
- desc.fRenderTargetHandle = backendObj;
- sk_sp<GrRenderTarget> rt = gpu->wrapBackendRenderTarget(desc);
+ GrBackendRenderTarget backendRT(kW, kH, 0, 0, *backendTex);
+
+ sk_sp<GrRenderTarget> rt = gpu->wrapBackendRenderTarget(backendRT, kTopLeft_GrSurfaceOrigin);
REPORTER_ASSERT(reporter, rt);
// image is null
GrVkImageInfo backendCopy = *backendTex;
backendCopy.fImage = VK_NULL_HANDLE;
- desc.fRenderTargetHandle = (GrBackendObject)&backendCopy;
- rt = gpu->wrapBackendRenderTarget(desc);
+ GrBackendRenderTarget backendRT2(kW, kH, 0, 0, backendCopy);
+ rt = gpu->wrapBackendRenderTarget(backendRT2, kTopLeft_GrSurfaceOrigin);
REPORTER_ASSERT(reporter, !rt);
// alloc is null
backendCopy.fImage = backendTex->fImage;
backendCopy.fAlloc = { VK_NULL_HANDLE, 0, 0, 0 };
// can wrap null alloc
- rt = gpu->wrapBackendRenderTarget(desc);
+ GrBackendRenderTarget backendRT3(kW, kH, 0, 0, backendCopy);
+ rt = gpu->wrapBackendRenderTarget(backendRT3, kTopLeft_GrSurfaceOrigin);
REPORTER_ASSERT(reporter, rt);
// When we wrapBackendRenderTarget it is always borrowed, so we must make sure to free the