aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/gpu/GrBackendSurface.h24
-rw-r--r--include/gpu/gl/GrGLTypes.h6
-rw-r--r--include/gpu/vk/GrVkDefines.h4
3 files changed, 17 insertions, 17 deletions
diff --git a/include/gpu/GrBackendSurface.h b/include/gpu/GrBackendSurface.h
index d9302dafc2..fd99a4312a 100644
--- a/include/gpu/GrBackendSurface.h
+++ b/include/gpu/GrBackendSurface.h
@@ -9,8 +9,9 @@
#define GrBackendSurface_DEFINED
#include "GrTypes.h"
-#include "gl/GrGLTypes.h"
-#include "vk/GrVkTypes.h"
+
+struct GrVkImageInfo;
+struct GrGLTextureInfo;
class GrBackendTexture {
public:
@@ -62,18 +63,22 @@ private:
class GrBackendRenderTarget {
public:
+ // The passed in GrVkImageInfo must live until the GrBackendTexture is no longer used in
+ // creation of SkImages or SkSurfaces.
GrBackendRenderTarget(int width,
int height,
int sampleCnt,
int stencilBits,
- const GrVkImageInfo& vkInfo);
+ const GrVkImageInfo* vkInfo);
+ // The passed in GrGLTextureInfo must live until the GrBackendTexture is no longer used in
+ // creation of SkImages or SkSurfaces.
GrBackendRenderTarget(int width,
int height,
int sampleCnt,
int stencilBits,
GrPixelConfig config,
- const GrGLFramebufferInfo& glInfo);
+ const GrGLTextureInfo* glInfo);
int width() const { return fWidth; }
int height() const { return fHeight; }
@@ -83,12 +88,12 @@ public:
GrBackend backend() const {return fBackend; }
// If the backend API is Vulkan, this returns a pointer to the GrVkImageInfo struct. Otherwise
- // it returns nullptr
+ // it returns nullptr.
const GrVkImageInfo* getVkImageInfo() const;
- // If the backend API is GL, this returns a pointer to the GrGLFramebufferInfo struct. Otherwise
+ // If the backend API is GL, this returns a pointer to the GrGLTextureInfo struct. Otherwise
// it returns nullptr.
- const GrGLFramebufferInfo* getGLFramebufferInfo() const;
+ const GrGLTextureInfo* getGLTextureInfo() const;
private:
// Temporary constructor which can be used to convert from a GrBackendRenderTargetDesc.
@@ -107,8 +112,9 @@ private:
GrBackend fBackend;
union {
- GrVkImageInfo fVkInfo;
- GrGLFramebufferInfo fGLInfo;
+ const GrVkImageInfo* fVkInfo;
+ const GrGLTextureInfo* fGLInfo;
+ GrBackendObject fHandle;
};
};
diff --git a/include/gpu/gl/GrGLTypes.h b/include/gpu/gl/GrGLTypes.h
index 345364b050..f2b339eccc 100644
--- a/include/gpu/gl/GrGLTypes.h
+++ b/include/gpu/gl/GrGLTypes.h
@@ -135,10 +135,4 @@ protected:
GR_STATIC_ASSERT(sizeof(GrBackendObject) >= sizeof(const GrGLTextureInfo*));
-struct GrGLFramebufferInfo {
- GrGLuint fFBOID;
-};
-
-GR_STATIC_ASSERT(sizeof(GrBackendObject) >= sizeof(const GrGLFramebufferInfo*));
-
#endif
diff --git a/include/gpu/vk/GrVkDefines.h b/include/gpu/vk/GrVkDefines.h
index 7defed2ad5..7b9ee8dadf 100644
--- a/include/gpu/vk/GrVkDefines.h
+++ b/include/gpu/vk/GrVkDefines.h
@@ -9,8 +9,6 @@
#ifndef GrVkDefines_DEFINED
#define GrVkDefines_DEFINED
-#ifdef SK_VULKAN
-
#if defined(SK_BUILD_FOR_WIN) || defined(SK_BUILD_FOR_WIN32)
# if !defined(VK_USE_PLATFORM_WIN32_KHR)
# define VK_USE_PLATFORM_WIN32_KHR
@@ -31,6 +29,8 @@
# endif
#endif
+#if defined(Bool) || defined(Status) || defined(True) || defined(False)
+# pragma error "Macros unexpectedly defined."
#endif
#include <vulkan/vulkan.h>