Revert "Remove GrBackendObject and all related functions from Skia."
This reverts commit ccd4cfc23ebbbecbc6b292359352aad335ad7b73.
Reason for revert: Fuchsia not building again. (Flutter roll may have been reverted?)
Original change's description:
> Remove GrBackendObject and all related functions from Skia.
>
> Bug: skia:
> Change-Id: I59434b7477c0bc26fd982bd81eb97ab94bbba073
> Reviewed-on: https://skia-review.googlesource.com/125822
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
Change-Id: Ie2c518b84b0c9513c0c622082de2831088b1ad8d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/127480
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/tests/VkBackendSurfaceTest.cpp b/tests/VkBackendSurfaceTest.cpp
index 3b3a9ce..6b442a9 100644
--- a/tests/VkBackendSurfaceTest.cpp
+++ b/tests/VkBackendSurfaceTest.cpp
@@ -84,6 +84,19 @@
backendTexImage.setVkImageLayout(VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL);
REPORTER_ASSERT(reporter, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL == vkTexture->currentLayout());
+#ifdef SK_SUPPORT_LEGACY_BACKEND_OBJECTS
+ // Verify that modifying the layout via the old textureHandle sitll works in is reflected in the
+ // GrVkTexture and GrBackendTexture.
+ GrVkImageInfo* backendInfo = (GrVkImageInfo*)wrappedImage->getTextureHandle(false);
+ REPORTER_ASSERT(reporter, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL == backendInfo->fImageLayout);
+
+ backendInfo->updateImageLayout(VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);
+ REPORTER_ASSERT(reporter,
+ VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL == vkTexture->currentLayout());
+ REPORTER_ASSERT(reporter, backendTexImage.getVkImageInfo(&info));
+ REPORTER_ASSERT(reporter, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL == info.fImageLayout);
+#endif
+
vkTexture->updateImageLayout(initLayout);
REPORTER_ASSERT(reporter, backendTex.getVkImageInfo(&info));