Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(328)

Unified Diff: src/gpu/vk/GrVkImage.h

Issue 1925303002: Add mipmap loading to Vulkan. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Some fixups and notes for future work Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/vk/GrVkImage.h
diff --git a/src/gpu/vk/GrVkImage.h b/src/gpu/vk/GrVkImage.h
index 5b3b527202be99236a340485fe93354ec6591baf..d912ce91c35c6b379fd48c1d1f9c5366678c9804 100644
--- a/src/gpu/vk/GrVkImage.h
+++ b/src/gpu/vk/GrVkImage.h
@@ -9,6 +9,8 @@
#define GrVkImage_DEFINED
#include "GrVkResource.h"
+
+#include "GrTypesPriv.h"
#include "SkTypes.h"
#include "vk/GrVkDefines.h"
@@ -25,10 +27,11 @@ public:
kLinearTiling_Flag = 0x01
};
- VkImage fImage;
- VkDeviceMemory fAlloc;
- Flags fFlags;
- VkFormat fFormat;
+ VkImage fImage;
+ VkDeviceMemory fAlloc;
+ Flags fFlags;
+ VkFormat fFormat;
+ GrBackendObjectOwnership fOwnership;
jvanverth1 2016/04/29 13:44:14 I added this here rather than the texture because
Resource()
: INHERITED()
@@ -37,10 +40,13 @@ public:
, fFlags(kNo_Flags)
, fFormat(VK_FORMAT_UNDEFINED) {}
- Resource(VkImage image, VkDeviceMemory alloc, Flags flags, VkFormat format)
- : fImage(image), fAlloc(alloc), fFlags(flags), fFormat(format) {}
+ Resource(VkImage image, VkDeviceMemory alloc, Flags flags, VkFormat format,
+ GrBackendObjectOwnership ownership = GrBackendObjectOwnership::kOwned)
+ : fImage(image), fAlloc(alloc), fFlags(flags), fFormat(format)
+ , fOwnership(ownership) {}
~Resource() override {}
+
private:
void freeGPUData(const GrVkGpu* gpu) const override;
@@ -51,7 +57,8 @@ public:
class BorrowedResource : public Resource {
public:
BorrowedResource(VkImage image, VkDeviceMemory alloc, Flags flags, VkFormat format)
- : Resource(image, alloc, flags, format) {}
+ : Resource(image, alloc, flags, format, GrBackendObjectOwnership::kBorrowed) {
+ }
private:
void freeGPUData(const GrVkGpu* gpu) const override;
};

Powered by Google App Engine
This is Rietveld 408576698