aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu/vk
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-04-04 15:54:55 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-04-04 20:34:28 +0000
commitc5509955b98daa0643da7fcd7ad356a9aa5a42da (patch)
treeb8f9628b518b8efb5c4de5fd566ca4cc10be7b07 /include/gpu/vk
parent1fda0247a77e5c7af57163750a3f7a04fddffdd5 (diff)
Add GrBackendTexture accessor to SkImage (take 2)
This makes accessing the GPU resource behind an SkImage a lot more typesafe. Additionally, the GrBackendObject is being deprecated so this is the path forward. I split the controversial stuff off into https://skia-review.googlesource.com/c/skia/+/118575 (Add SkImage::setLayout call). Change-Id: I297e72770e8fb360fac7c7cd74f050ae759ae133 Reviewed-on: https://skia-review.googlesource.com/118571 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'include/gpu/vk')
-rw-r--r--include/gpu/vk/GrVkTypes.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/gpu/vk/GrVkTypes.h b/include/gpu/vk/GrVkTypes.h
index 70571981b6..bfc3d5ac3e 100644
--- a/include/gpu/vk/GrVkTypes.h
+++ b/include/gpu/vk/GrVkTypes.h
@@ -53,6 +53,12 @@ struct GrVkAlloc {
enum Flag {
kNoncoherent_Flag = 0x1, // memory must be flushed to device after mapping
};
+
+ bool operator==(const GrVkAlloc& that) const {
+ return fMemory == that.fMemory && fOffset == that.fOffset && fSize == that.fSize &&
+ fFlags == that.fFlags && fUsesSystemHeap == that.fUsesSystemHeap;
+ }
+
private:
friend class GrVkHeap; // For access to usesSystemHeap
bool fUsesSystemHeap;
@@ -73,6 +79,12 @@ struct GrVkImageInfo {
// while we're still holding onto the wrapped texture. They will first need to get a handle
// to our internal GrVkImageInfo by calling getTextureHandle on a GrVkTexture.
void updateImageLayout(VkImageLayout layout) { fImageLayout = layout; }
+
+ bool operator==(const GrVkImageInfo& that) const {
+ return fImage == that.fImage && fAlloc == that.fAlloc &&
+ fImageTiling == that.fImageTiling && fImageLayout == that.fImageLayout &&
+ fFormat == that.fFormat && fLevelCount == that.fLevelCount;
+ }
};
GR_STATIC_ASSERT(sizeof(GrBackendObject) >= sizeof(const GrVkImageInfo*));