aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2017-06-13 13:47:53 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-13 18:50:03 +0000
commitc0f8e426c59eec6c720b8e1329dcb966cf1b6800 (patch)
tree78aa6ac1eb1196c0a9b86c5f20d893d004456130 /include
parent3809bab7ed344ad140346c38e149dabf10bd525f (diff)
Update skia to use ifdefs for Vulkan code instead of dummy header
Bug: skia:6721 Change-Id: I80a4c9f2acc09c174497f625c50ed12a8bb76505 Reviewed-on: https://skia-review.googlesource.com/19547 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/gpu/GrBackendSurface.h47
-rw-r--r--include/gpu/vk/GrVkDefines.h4
2 files changed, 33 insertions, 18 deletions
diff --git a/include/gpu/GrBackendSurface.h b/include/gpu/GrBackendSurface.h
index 232f220282..60a9eb5009 100644
--- a/include/gpu/GrBackendSurface.h
+++ b/include/gpu/GrBackendSurface.h
@@ -10,32 +10,39 @@
#include "GrTypes.h"
#include "gl/GrGLTypes.h"
+
+#ifdef SK_VULKAN
#include "vk/GrVkTypes.h"
+#endif
class GrBackendTexture {
public:
GrBackendTexture(int width,
int height,
- const GrVkImageInfo& vkInfo);
+ GrPixelConfig config,
+ const GrGLTextureInfo& glInfo);
+#ifdef SK_VULKAN
GrBackendTexture(int width,
int height,
- GrPixelConfig config,
- const GrGLTextureInfo& glInfo);
+ const GrVkImageInfo& vkInfo);
+#endif
int width() const { return fWidth; }
int height() const { return fHeight; }
GrPixelConfig config() const { return fConfig; }
GrBackend backend() const {return fBackend; }
- // If the backend API is Vulkan, this returns a pointer to the GrVkImageInfo struct. Otherwise
- // it returns nullptr.
- const GrVkImageInfo* getVkImageInfo() const;
-
// If the backend API is GL, this returns a pointer to the GrGLTextureInfo struct. Otherwise
// it returns nullptr.
const GrGLTextureInfo* getGLTextureInfo() const;
+#ifdef SK_VULKAN
+ // If the backend API is Vulkan, this returns a pointer to the GrVkImageInfo struct. Otherwise
+ // it returns nullptr.
+ const GrVkImageInfo* getVkImageInfo() const;
+#endif
+
private:
// Temporary constructor which can be used to convert from a GrBackendTextureDesc.
GrBackendTexture(const GrBackendTextureDesc& desc, GrBackend backend);
@@ -50,8 +57,10 @@ private:
GrBackend fBackend;
union {
- GrVkImageInfo fVkInfo;
GrGLTextureInfo fGLInfo;
+#ifdef SK_VULKAN
+ GrVkImageInfo fVkInfo;
+#endif
};
};
@@ -61,14 +70,16 @@ public:
int height,
int sampleCnt,
int stencilBits,
- const GrVkImageInfo& vkInfo);
+ GrPixelConfig config,
+ const GrGLFramebufferInfo& glInfo);
+#ifdef SK_VULKAN
GrBackendRenderTarget(int width,
int height,
int sampleCnt,
int stencilBits,
- GrPixelConfig config,
- const GrGLFramebufferInfo& glInfo);
+ const GrVkImageInfo& vkInfo);
+#endif
int width() const { return fWidth; }
int height() const { return fHeight; }
@@ -77,14 +88,16 @@ public:
GrPixelConfig config() const { return fConfig; }
GrBackend backend() const {return fBackend; }
- // If the backend API is Vulkan, this returns a pointer to the GrVkImageInfo struct. Otherwise
- // it returns nullptr
- const GrVkImageInfo* getVkImageInfo() const;
-
// If the backend API is GL, this returns a pointer to the GrGLFramebufferInfo struct. Otherwise
// it returns nullptr.
const GrGLFramebufferInfo* getGLFramebufferInfo() const;
+#ifdef SK_VULKAN
+ // If the backend API is Vulkan, this returns a pointer to the GrVkImageInfo struct. Otherwise
+ // it returns nullptr
+ const GrVkImageInfo* getVkImageInfo() const;
+#endif
+
private:
// Temporary constructor which can be used to convert from a GrBackendRenderTargetDesc.
GrBackendRenderTarget(const GrBackendRenderTargetDesc& desc, GrBackend backend);
@@ -102,8 +115,10 @@ private:
GrBackend fBackend;
union {
- GrVkImageInfo fVkInfo;
GrGLFramebufferInfo fGLInfo;
+#ifdef SK_VULKAN
+ GrVkImageInfo fVkInfo;
+#endif
};
};
diff --git a/include/gpu/vk/GrVkDefines.h b/include/gpu/vk/GrVkDefines.h
index 7defed2ad5..0bc6fb0343 100644
--- a/include/gpu/vk/GrVkDefines.h
+++ b/include/gpu/vk/GrVkDefines.h
@@ -31,8 +31,6 @@
# endif
#endif
-#endif
-
#include <vulkan/vulkan.h>
#define SKIA_REQUIRED_VULKAN_HEADER_VERSION 17
@@ -41,3 +39,5 @@
#endif
#endif
+
+#endif