aboutsummaryrefslogtreecommitdiffstats
path: root/src/gpu/SkGpuDevice.cpp
diff options
context:
space:
mode:
authorGreg Daniel <egdaniel@google.com>2019-01-03 16:40:42 -0500
committerSkia Commit-Bot <skia-commit-bot@chromium.org>2019-01-04 14:08:25 +0000
commitbe7fc466271b225d4f286856eb14a1cadb103d0a (patch)
tree5fd91c08d5787d824d1a6ea9bde42ff1cd2d6188 /src/gpu/SkGpuDevice.cpp
parent5f1692c60a43bfb9f9039e288862c82a9f7cbc8e (diff)
downloadplatform_external_skqp-be7fc466271b225d4f286856eb14a1cadb103d0a.tar.gz
platform_external_skqp-be7fc466271b225d4f286856eb14a1cadb103d0a.tar.bz2
platform_external_skqp-be7fc466271b225d4f286856eb14a1cadb103d0a.zip
Restrict ops that can be executed when we have a wrapped vulkan secondary command buffer.
Bug: skia: Change-Id: Ib58ba23053d019988a23cfb489808bad3122d867 Reviewed-on: https://skia-review.googlesource.com/c/178936 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/SkGpuDevice.cpp')
-rw-r--r--src/gpu/SkGpuDevice.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 1dd1e4f55b..1524b7b79c 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1230,6 +1230,14 @@ sk_sp<SkSpecialImage> SkGpuDevice::makeSpecial(const SkImage* image) {
}
sk_sp<SkSpecialImage> SkGpuDevice::snapSpecial() {
+ // If we are wrapping a vulkan secondary command buffer, then we can't snap off a special image
+ // since it would require us to make a copy of the underlying VkImage which we don't have access
+ // to. Additionaly we can't stop and start the render pass that is used with the secondary
+ // command buffer.
+ if (this->accessRenderTargetContext()->wrapsVkSecondaryCB()) {
+ return nullptr;
+ }
+
sk_sp<GrTextureProxy> proxy(this->accessRenderTargetContext()->asTextureProxyRef());
if (!proxy) {
// When the device doesn't have a texture, we create a temporary texture.
@@ -1258,14 +1266,18 @@ sk_sp<SkSpecialImage> SkGpuDevice::snapSpecial() {
sk_sp<SkSpecialImage> SkGpuDevice::snapBackImage(const SkIRect& subset) {
GrRenderTargetContext* rtc = this->accessRenderTargetContext();
- if (!rtc) {
+
+ // If we are wrapping a vulkan secondary command buffer, then we can't snap off a special image
+ // since it would require us to make a copy of the underlying VkImage which we don't have access
+ // to. Additionaly we can't stop and start the render pass that is used with the secondary
+ // command buffer.
+ if (rtc->wrapsVkSecondaryCB()) {
return nullptr;
}
+
GrContext* ctx = this->context();
- if (!rtc->asSurfaceProxy()) {
- return nullptr;
- }
+ SkASSERT(rtc->asSurfaceProxy());
auto srcProxy =
GrSurfaceProxy::Copy(ctx, rtc->asSurfaceProxy(), rtc->mipMapped(), subset,