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

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: Fixes to handle mipmap allocations and autogen 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..d54f3936410fe8f5ef46e39476fd239fbda7ab94 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"
@@ -22,13 +24,14 @@ public:
public:
enum Flags {
kNo_Flags = 0,
- kLinearTiling_Flag = 0x01
+ kLinearTiling_Flag = 0x01,
+ kBorrowed_Flag = 0x02
};
- VkImage fImage;
- VkDeviceMemory fAlloc;
- Flags fFlags;
- VkFormat fFormat;
+ VkImage fImage;
+ VkDeviceMemory fAlloc;
+ VkFormat fFormat;
+ uint32_t fFlags;
Resource()
: INHERITED()
@@ -37,10 +40,11 @@ public:
, fFlags(kNo_Flags)
, fFormat(VK_FORMAT_UNDEFINED) {}
- Resource(VkImage image, VkDeviceMemory alloc, Flags flags, VkFormat format)
+ Resource(VkImage image, VkDeviceMemory alloc, uint32_t flags, VkFormat format)
: fImage(image), fAlloc(alloc), fFlags(flags), fFormat(format) {}
~Resource() override {}
+
private:
void freeGPUData(const GrVkGpu* gpu) const override;
@@ -50,8 +54,9 @@ public:
// for wrapped textures
class BorrowedResource : public Resource {
public:
- BorrowedResource(VkImage image, VkDeviceMemory alloc, Flags flags, VkFormat format)
- : Resource(image, alloc, flags, format) {}
+ BorrowedResource(VkImage image, VkDeviceMemory alloc, uint32_t flags, VkFormat format)
+ : Resource(image, alloc, (flags | kBorrowed_Flag), format) {
+ }
private:
void freeGPUData(const GrVkGpu* gpu) const override;
};
« src/gpu/vk/GrVkGpu.cpp ('K') | « src/gpu/vk/GrVkGpu.cpp ('k') | src/gpu/vk/GrVkTexture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698