2016-03-18 18:57:24 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2016 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
// This is a GPU-backend specific test. It relies on static intializers to work
|
|
|
|
|
|
|
|
#include "SkTypes.h"
|
|
|
|
|
2017-06-22 16:52:46 +00:00
|
|
|
#if SK_SUPPORT_GPU && defined(SK_VULKAN)
|
2016-03-18 18:57:24 +00:00
|
|
|
|
|
|
|
#include "GrContextFactory.h"
|
2017-07-26 19:48:41 +00:00
|
|
|
#include "GrRenderTarget.h"
|
2016-03-18 18:57:24 +00:00
|
|
|
#include "GrTest.h"
|
2017-06-13 16:44:56 +00:00
|
|
|
#include "GrTexture.h"
|
|
|
|
|
2016-03-18 18:57:24 +00:00
|
|
|
#include "Test.h"
|
|
|
|
#include "vk/GrVkCaps.h"
|
|
|
|
#include "vk/GrVkGpu.h"
|
|
|
|
#include "vk/GrVkMemory.h"
|
|
|
|
#include "vk/GrVkTypes.h"
|
|
|
|
|
2016-03-31 15:08:20 +00:00
|
|
|
using sk_gpu_test::GrContextFactory;
|
|
|
|
|
2016-03-18 18:57:24 +00:00
|
|
|
const int kW = 1024;
|
|
|
|
const int kH = 1024;
|
|
|
|
const GrPixelConfig kPixelConfig = kRGBA_8888_GrPixelConfig;
|
|
|
|
|
|
|
|
void wrap_tex_test(skiatest::Reporter* reporter, GrContext* context) {
|
|
|
|
|
|
|
|
GrVkGpu* gpu = static_cast<GrVkGpu*>(context->getGpu());
|
|
|
|
|
2016-06-24 16:22:31 +00:00
|
|
|
GrBackendObject backendObj = gpu->createTestingOnlyBackendTexture(nullptr, kW, kH, kPixelConfig,
|
|
|
|
false);
|
Revert "Revert "Plumb GrBackendTexture throughout skia.""
This reverts commit 7fa5c31c2c9af834bee66d5fcf476e250076c8d6.
Reason for revert: Relanding this change now that other fixes have landed.
Original change's description:
> Revert "Plumb GrBackendTexture throughout skia."
>
> This reverts commit 7da62b9059f3c1d31624a0e4da96ee5f908f9c12.
>
> Reason for revert: fix android roll
>
> Original change's description:
> > Plumb GrBackendTexture throughout skia.
> >
> > Bug: skia:
> > Change-Id: I1bae6768ee7229818a83ba608035a1f7867e6875
> > Reviewed-on: https://skia-review.googlesource.com/13645
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> >
>
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,brianosman@google.com,reviews@skia.org,stani@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Change-Id: I5cb8763cc837c83ebc6d10366fe2dd3efe35fb89
> Reviewed-on: https://skia-review.googlesource.com/13773
> Reviewed-by: Stan Iliev <stani@google.com>
> Commit-Queue: Stan Iliev <stani@google.com>
>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,reviews@skia.org,brianosman@google.com,stani@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I92bc074e4fe37fa5c83186afadc472c03802e8f2
Reviewed-on: https://skia-review.googlesource.com/13975
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-04-20 16:41:55 +00:00
|
|
|
const GrVkImageInfo* imageInfo = reinterpret_cast<const GrVkImageInfo*>(backendObj);
|
|
|
|
|
2017-04-26 17:29:21 +00:00
|
|
|
GrBackendTexture backendTex = GrBackendTexture(kW, kH, *imageInfo);
|
2017-08-01 13:51:44 +00:00
|
|
|
sk_sp<GrTexture> tex = gpu->wrapBackendTexture(backendTex,
|
|
|
|
kTopLeft_GrSurfaceOrigin,
|
|
|
|
kBorrow_GrWrapOwnership);
|
2016-03-18 18:57:24 +00:00
|
|
|
REPORTER_ASSERT(reporter, tex);
|
|
|
|
|
|
|
|
// image is null
|
Revert "Revert "Plumb GrBackendTexture throughout skia.""
This reverts commit 7fa5c31c2c9af834bee66d5fcf476e250076c8d6.
Reason for revert: Relanding this change now that other fixes have landed.
Original change's description:
> Revert "Plumb GrBackendTexture throughout skia."
>
> This reverts commit 7da62b9059f3c1d31624a0e4da96ee5f908f9c12.
>
> Reason for revert: fix android roll
>
> Original change's description:
> > Plumb GrBackendTexture throughout skia.
> >
> > Bug: skia:
> > Change-Id: I1bae6768ee7229818a83ba608035a1f7867e6875
> > Reviewed-on: https://skia-review.googlesource.com/13645
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> >
>
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,brianosman@google.com,reviews@skia.org,stani@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Change-Id: I5cb8763cc837c83ebc6d10366fe2dd3efe35fb89
> Reviewed-on: https://skia-review.googlesource.com/13773
> Reviewed-by: Stan Iliev <stani@google.com>
> Commit-Queue: Stan Iliev <stani@google.com>
>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,reviews@skia.org,brianosman@google.com,stani@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I92bc074e4fe37fa5c83186afadc472c03802e8f2
Reviewed-on: https://skia-review.googlesource.com/13975
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-04-20 16:41:55 +00:00
|
|
|
GrVkImageInfo backendCopy = *imageInfo;
|
2016-03-18 18:57:24 +00:00
|
|
|
backendCopy.fImage = VK_NULL_HANDLE;
|
2017-04-26 17:29:21 +00:00
|
|
|
backendTex = GrBackendTexture(kW, kH, backendCopy);
|
2017-08-01 13:51:44 +00:00
|
|
|
tex = gpu->wrapBackendTexture(backendTex,
|
|
|
|
kTopLeft_GrSurfaceOrigin,
|
|
|
|
kBorrow_GrWrapOwnership);
|
2016-03-18 18:57:24 +00:00
|
|
|
REPORTER_ASSERT(reporter, !tex);
|
2017-08-01 13:51:44 +00:00
|
|
|
tex = gpu->wrapBackendTexture(backendTex,
|
|
|
|
kTopLeft_GrSurfaceOrigin,
|
|
|
|
kAdopt_GrWrapOwnership);
|
2016-03-18 18:57:24 +00:00
|
|
|
REPORTER_ASSERT(reporter, !tex);
|
|
|
|
|
|
|
|
// alloc is null
|
Revert "Revert "Plumb GrBackendTexture throughout skia.""
This reverts commit 7fa5c31c2c9af834bee66d5fcf476e250076c8d6.
Reason for revert: Relanding this change now that other fixes have landed.
Original change's description:
> Revert "Plumb GrBackendTexture throughout skia."
>
> This reverts commit 7da62b9059f3c1d31624a0e4da96ee5f908f9c12.
>
> Reason for revert: fix android roll
>
> Original change's description:
> > Plumb GrBackendTexture throughout skia.
> >
> > Bug: skia:
> > Change-Id: I1bae6768ee7229818a83ba608035a1f7867e6875
> > Reviewed-on: https://skia-review.googlesource.com/13645
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> >
>
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,brianosman@google.com,reviews@skia.org,stani@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Change-Id: I5cb8763cc837c83ebc6d10366fe2dd3efe35fb89
> Reviewed-on: https://skia-review.googlesource.com/13773
> Reviewed-by: Stan Iliev <stani@google.com>
> Commit-Queue: Stan Iliev <stani@google.com>
>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,reviews@skia.org,brianosman@google.com,stani@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I92bc074e4fe37fa5c83186afadc472c03802e8f2
Reviewed-on: https://skia-review.googlesource.com/13975
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-04-20 16:41:55 +00:00
|
|
|
backendCopy.fImage = imageInfo->fImage;
|
2016-09-20 20:18:00 +00:00
|
|
|
backendCopy.fAlloc = { VK_NULL_HANDLE, 0, 0, 0 };
|
2017-05-02 15:39:10 +00:00
|
|
|
backendTex = GrBackendTexture(kW, kH, backendCopy);
|
2017-08-01 13:51:44 +00:00
|
|
|
tex = gpu->wrapBackendTexture(backendTex,
|
|
|
|
kTopLeft_GrSurfaceOrigin,
|
|
|
|
kBorrow_GrWrapOwnership);
|
2016-03-18 18:57:24 +00:00
|
|
|
REPORTER_ASSERT(reporter, !tex);
|
2017-08-01 13:51:44 +00:00
|
|
|
tex = gpu->wrapBackendTexture(backendTex,
|
|
|
|
kTopLeft_GrSurfaceOrigin,
|
|
|
|
kAdopt_GrWrapOwnership);
|
2016-03-18 18:57:24 +00:00
|
|
|
REPORTER_ASSERT(reporter, !tex);
|
2017-04-19 00:23:39 +00:00
|
|
|
// check adopt creation
|
Revert "Revert "Plumb GrBackendTexture throughout skia.""
This reverts commit 7fa5c31c2c9af834bee66d5fcf476e250076c8d6.
Reason for revert: Relanding this change now that other fixes have landed.
Original change's description:
> Revert "Plumb GrBackendTexture throughout skia."
>
> This reverts commit 7da62b9059f3c1d31624a0e4da96ee5f908f9c12.
>
> Reason for revert: fix android roll
>
> Original change's description:
> > Plumb GrBackendTexture throughout skia.
> >
> > Bug: skia:
> > Change-Id: I1bae6768ee7229818a83ba608035a1f7867e6875
> > Reviewed-on: https://skia-review.googlesource.com/13645
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> >
>
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,brianosman@google.com,reviews@skia.org,stani@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Change-Id: I5cb8763cc837c83ebc6d10366fe2dd3efe35fb89
> Reviewed-on: https://skia-review.googlesource.com/13773
> Reviewed-by: Stan Iliev <stani@google.com>
> Commit-Queue: Stan Iliev <stani@google.com>
>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,reviews@skia.org,brianosman@google.com,stani@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I92bc074e4fe37fa5c83186afadc472c03802e8f2
Reviewed-on: https://skia-review.googlesource.com/13975
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-04-20 16:41:55 +00:00
|
|
|
backendCopy.fAlloc = imageInfo->fAlloc;
|
2017-05-02 15:39:10 +00:00
|
|
|
backendTex = GrBackendTexture(kW, kH, backendCopy);
|
2017-08-01 13:51:44 +00:00
|
|
|
tex = gpu->wrapBackendTexture(backendTex,
|
|
|
|
kTopLeft_GrSurfaceOrigin,
|
|
|
|
kAdopt_GrWrapOwnership);
|
Revert "Revert "Plumb GrBackendTexture throughout skia.""
This reverts commit 7fa5c31c2c9af834bee66d5fcf476e250076c8d6.
Reason for revert: Relanding this change now that other fixes have landed.
Original change's description:
> Revert "Plumb GrBackendTexture throughout skia."
>
> This reverts commit 7da62b9059f3c1d31624a0e4da96ee5f908f9c12.
>
> Reason for revert: fix android roll
>
> Original change's description:
> > Plumb GrBackendTexture throughout skia.
> >
> > Bug: skia:
> > Change-Id: I1bae6768ee7229818a83ba608035a1f7867e6875
> > Reviewed-on: https://skia-review.googlesource.com/13645
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> >
>
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,brianosman@google.com,reviews@skia.org,stani@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Change-Id: I5cb8763cc837c83ebc6d10366fe2dd3efe35fb89
> Reviewed-on: https://skia-review.googlesource.com/13773
> Reviewed-by: Stan Iliev <stani@google.com>
> Commit-Queue: Stan Iliev <stani@google.com>
>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,reviews@skia.org,brianosman@google.com,stani@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I92bc074e4fe37fa5c83186afadc472c03802e8f2
Reviewed-on: https://skia-review.googlesource.com/13975
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-04-20 16:41:55 +00:00
|
|
|
|
2016-03-18 18:57:24 +00:00
|
|
|
REPORTER_ASSERT(reporter, tex);
|
|
|
|
|
|
|
|
gpu->deleteTestingOnlyBackendTexture(backendObj, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
void wrap_rt_test(skiatest::Reporter* reporter, GrContext* context) {
|
|
|
|
GrVkGpu* gpu = static_cast<GrVkGpu*>(context->getGpu());
|
|
|
|
|
2016-06-24 16:22:31 +00:00
|
|
|
GrBackendObject backendObj = gpu->createTestingOnlyBackendTexture(nullptr, kW, kH, kPixelConfig,
|
|
|
|
true);
|
2016-05-13 18:30:37 +00:00
|
|
|
const GrVkImageInfo* backendTex = reinterpret_cast<const GrVkImageInfo*>(backendObj);
|
2016-03-18 18:57:24 +00:00
|
|
|
|
2017-05-01 13:50:58 +00:00
|
|
|
GrBackendRenderTarget backendRT(kW, kH, 0, 0, *backendTex);
|
|
|
|
|
2017-08-01 13:51:44 +00:00
|
|
|
sk_sp<GrRenderTarget> rt = gpu->wrapBackendRenderTarget(backendRT, kTopLeft_GrSurfaceOrigin);
|
2016-03-18 18:57:24 +00:00
|
|
|
REPORTER_ASSERT(reporter, rt);
|
|
|
|
|
|
|
|
// image is null
|
2016-05-13 18:30:37 +00:00
|
|
|
GrVkImageInfo backendCopy = *backendTex;
|
2016-03-18 18:57:24 +00:00
|
|
|
backendCopy.fImage = VK_NULL_HANDLE;
|
2017-05-01 13:50:58 +00:00
|
|
|
GrBackendRenderTarget backendRT2(kW, kH, 0, 0, backendCopy);
|
2017-08-01 13:51:44 +00:00
|
|
|
rt = gpu->wrapBackendRenderTarget(backendRT2, kTopLeft_GrSurfaceOrigin);
|
2016-03-18 18:57:24 +00:00
|
|
|
REPORTER_ASSERT(reporter, !rt);
|
|
|
|
|
|
|
|
// alloc is null
|
|
|
|
backendCopy.fImage = backendTex->fImage;
|
2016-09-20 20:18:00 +00:00
|
|
|
backendCopy.fAlloc = { VK_NULL_HANDLE, 0, 0, 0 };
|
2017-03-10 13:30:22 +00:00
|
|
|
// can wrap null alloc
|
2017-05-01 13:50:58 +00:00
|
|
|
GrBackendRenderTarget backendRT3(kW, kH, 0, 0, backendCopy);
|
2017-08-01 13:51:44 +00:00
|
|
|
rt = gpu->wrapBackendRenderTarget(backendRT3, kTopLeft_GrSurfaceOrigin);
|
2016-03-18 18:57:24 +00:00
|
|
|
REPORTER_ASSERT(reporter, rt);
|
|
|
|
|
2017-03-27 20:18:03 +00:00
|
|
|
// When we wrapBackendRenderTarget it is always borrowed, so we must make sure to free the
|
|
|
|
// resource when we're done.
|
|
|
|
gpu->deleteTestingOnlyBackendTexture(backendObj, false);
|
2016-03-18 18:57:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void wrap_trt_test(skiatest::Reporter* reporter, GrContext* context) {
|
|
|
|
GrVkGpu* gpu = static_cast<GrVkGpu*>(context->getGpu());
|
|
|
|
|
2016-06-24 16:22:31 +00:00
|
|
|
GrBackendObject backendObj = gpu->createTestingOnlyBackendTexture(nullptr, kW, kH, kPixelConfig,
|
|
|
|
true);
|
Revert "Revert "Plumb GrBackendTexture throughout skia.""
This reverts commit 7fa5c31c2c9af834bee66d5fcf476e250076c8d6.
Reason for revert: Relanding this change now that other fixes have landed.
Original change's description:
> Revert "Plumb GrBackendTexture throughout skia."
>
> This reverts commit 7da62b9059f3c1d31624a0e4da96ee5f908f9c12.
>
> Reason for revert: fix android roll
>
> Original change's description:
> > Plumb GrBackendTexture throughout skia.
> >
> > Bug: skia:
> > Change-Id: I1bae6768ee7229818a83ba608035a1f7867e6875
> > Reviewed-on: https://skia-review.googlesource.com/13645
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> >
>
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,brianosman@google.com,reviews@skia.org,stani@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Change-Id: I5cb8763cc837c83ebc6d10366fe2dd3efe35fb89
> Reviewed-on: https://skia-review.googlesource.com/13773
> Reviewed-by: Stan Iliev <stani@google.com>
> Commit-Queue: Stan Iliev <stani@google.com>
>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,reviews@skia.org,brianosman@google.com,stani@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I92bc074e4fe37fa5c83186afadc472c03802e8f2
Reviewed-on: https://skia-review.googlesource.com/13975
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-04-20 16:41:55 +00:00
|
|
|
const GrVkImageInfo* imageInfo = reinterpret_cast<const GrVkImageInfo*>(backendObj);
|
|
|
|
|
2017-04-26 17:29:21 +00:00
|
|
|
GrBackendTexture backendTex = GrBackendTexture(kW, kH, *imageInfo);
|
2017-08-01 13:51:44 +00:00
|
|
|
sk_sp<GrTexture> tex = gpu->wrapRenderableBackendTexture(backendTex,
|
|
|
|
kTopLeft_GrSurfaceOrigin,
|
|
|
|
0,
|
2017-07-19 22:28:58 +00:00
|
|
|
kBorrow_GrWrapOwnership);
|
2016-03-18 18:57:24 +00:00
|
|
|
REPORTER_ASSERT(reporter, tex);
|
|
|
|
|
|
|
|
// image is null
|
Revert "Revert "Plumb GrBackendTexture throughout skia.""
This reverts commit 7fa5c31c2c9af834bee66d5fcf476e250076c8d6.
Reason for revert: Relanding this change now that other fixes have landed.
Original change's description:
> Revert "Plumb GrBackendTexture throughout skia."
>
> This reverts commit 7da62b9059f3c1d31624a0e4da96ee5f908f9c12.
>
> Reason for revert: fix android roll
>
> Original change's description:
> > Plumb GrBackendTexture throughout skia.
> >
> > Bug: skia:
> > Change-Id: I1bae6768ee7229818a83ba608035a1f7867e6875
> > Reviewed-on: https://skia-review.googlesource.com/13645
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> >
>
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,brianosman@google.com,reviews@skia.org,stani@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Change-Id: I5cb8763cc837c83ebc6d10366fe2dd3efe35fb89
> Reviewed-on: https://skia-review.googlesource.com/13773
> Reviewed-by: Stan Iliev <stani@google.com>
> Commit-Queue: Stan Iliev <stani@google.com>
>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,reviews@skia.org,brianosman@google.com,stani@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I92bc074e4fe37fa5c83186afadc472c03802e8f2
Reviewed-on: https://skia-review.googlesource.com/13975
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-04-20 16:41:55 +00:00
|
|
|
GrVkImageInfo backendCopy = *imageInfo;
|
2016-03-18 18:57:24 +00:00
|
|
|
backendCopy.fImage = VK_NULL_HANDLE;
|
2017-04-26 17:29:21 +00:00
|
|
|
backendTex = GrBackendTexture(kW, kH, backendCopy);
|
2017-08-01 13:51:44 +00:00
|
|
|
tex = gpu->wrapRenderableBackendTexture(backendTex,
|
|
|
|
kTopLeft_GrSurfaceOrigin,
|
|
|
|
0,
|
|
|
|
kBorrow_GrWrapOwnership);
|
2016-03-18 18:57:24 +00:00
|
|
|
REPORTER_ASSERT(reporter, !tex);
|
2017-08-01 13:51:44 +00:00
|
|
|
tex = gpu->wrapRenderableBackendTexture(backendTex,
|
|
|
|
kTopLeft_GrSurfaceOrigin,
|
|
|
|
0,
|
|
|
|
kAdopt_GrWrapOwnership);
|
2016-03-18 18:57:24 +00:00
|
|
|
REPORTER_ASSERT(reporter, !tex);
|
|
|
|
|
|
|
|
// alloc is null
|
Revert "Revert "Plumb GrBackendTexture throughout skia.""
This reverts commit 7fa5c31c2c9af834bee66d5fcf476e250076c8d6.
Reason for revert: Relanding this change now that other fixes have landed.
Original change's description:
> Revert "Plumb GrBackendTexture throughout skia."
>
> This reverts commit 7da62b9059f3c1d31624a0e4da96ee5f908f9c12.
>
> Reason for revert: fix android roll
>
> Original change's description:
> > Plumb GrBackendTexture throughout skia.
> >
> > Bug: skia:
> > Change-Id: I1bae6768ee7229818a83ba608035a1f7867e6875
> > Reviewed-on: https://skia-review.googlesource.com/13645
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> >
>
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,brianosman@google.com,reviews@skia.org,stani@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Change-Id: I5cb8763cc837c83ebc6d10366fe2dd3efe35fb89
> Reviewed-on: https://skia-review.googlesource.com/13773
> Reviewed-by: Stan Iliev <stani@google.com>
> Commit-Queue: Stan Iliev <stani@google.com>
>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,reviews@skia.org,brianosman@google.com,stani@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I92bc074e4fe37fa5c83186afadc472c03802e8f2
Reviewed-on: https://skia-review.googlesource.com/13975
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-04-20 16:41:55 +00:00
|
|
|
backendCopy.fImage = imageInfo->fImage;
|
2016-09-20 20:18:00 +00:00
|
|
|
backendCopy.fAlloc = { VK_NULL_HANDLE, 0, 0, 0 };
|
2017-05-02 15:39:10 +00:00
|
|
|
backendTex = GrBackendTexture(kW, kH, backendCopy);
|
2017-08-01 13:51:44 +00:00
|
|
|
tex = gpu->wrapRenderableBackendTexture(backendTex,
|
|
|
|
kTopLeft_GrSurfaceOrigin,
|
|
|
|
0,
|
|
|
|
kBorrow_GrWrapOwnership);
|
2016-03-18 18:57:24 +00:00
|
|
|
REPORTER_ASSERT(reporter, !tex);
|
2017-08-01 13:51:44 +00:00
|
|
|
tex = gpu->wrapRenderableBackendTexture(backendTex,
|
|
|
|
kTopLeft_GrSurfaceOrigin,
|
|
|
|
0,
|
|
|
|
kAdopt_GrWrapOwnership);
|
2016-03-18 18:57:24 +00:00
|
|
|
REPORTER_ASSERT(reporter, !tex);
|
|
|
|
|
|
|
|
// check adopt creation
|
Revert "Revert "Plumb GrBackendTexture throughout skia.""
This reverts commit 7fa5c31c2c9af834bee66d5fcf476e250076c8d6.
Reason for revert: Relanding this change now that other fixes have landed.
Original change's description:
> Revert "Plumb GrBackendTexture throughout skia."
>
> This reverts commit 7da62b9059f3c1d31624a0e4da96ee5f908f9c12.
>
> Reason for revert: fix android roll
>
> Original change's description:
> > Plumb GrBackendTexture throughout skia.
> >
> > Bug: skia:
> > Change-Id: I1bae6768ee7229818a83ba608035a1f7867e6875
> > Reviewed-on: https://skia-review.googlesource.com/13645
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> >
>
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,brianosman@google.com,reviews@skia.org,stani@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Change-Id: I5cb8763cc837c83ebc6d10366fe2dd3efe35fb89
> Reviewed-on: https://skia-review.googlesource.com/13773
> Reviewed-by: Stan Iliev <stani@google.com>
> Commit-Queue: Stan Iliev <stani@google.com>
>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,reviews@skia.org,brianosman@google.com,stani@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I92bc074e4fe37fa5c83186afadc472c03802e8f2
Reviewed-on: https://skia-review.googlesource.com/13975
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-04-20 16:41:55 +00:00
|
|
|
backendCopy.fAlloc = imageInfo->fAlloc;
|
2017-05-02 15:39:10 +00:00
|
|
|
backendTex = GrBackendTexture(kW, kH, backendCopy);
|
2017-08-01 13:51:44 +00:00
|
|
|
tex = gpu->wrapRenderableBackendTexture(backendTex,
|
|
|
|
kTopLeft_GrSurfaceOrigin,
|
|
|
|
0,
|
|
|
|
kAdopt_GrWrapOwnership);
|
2016-03-18 18:57:24 +00:00
|
|
|
REPORTER_ASSERT(reporter, tex);
|
|
|
|
|
|
|
|
gpu->deleteTestingOnlyBackendTexture(backendObj, true);
|
|
|
|
}
|
|
|
|
|
2016-04-11 21:21:33 +00:00
|
|
|
DEF_GPUTEST_FOR_VULKAN_CONTEXT(VkWrapTests, reporter, ctxInfo) {
|
2016-05-11 13:33:06 +00:00
|
|
|
wrap_tex_test(reporter, ctxInfo.grContext());
|
|
|
|
wrap_rt_test(reporter, ctxInfo.grContext());
|
|
|
|
wrap_trt_test(reporter, ctxInfo.grContext());
|
2016-03-18 18:57:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|