Revert "Update skia to use ifdefs for Vulkan code instead of dummy header"
This reverts commit c0f8e426c5
.
Reason for revert: Experiment to see if this will unblock the Android roll
Original change's description:
> 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>
TBR=egdaniel@google.com,mtklein@google.com,bsalomon@google.com
Change-Id: Ib51c1672570f2071a17b6fbde692a5174b0358ce
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:6721
Reviewed-on: https://skia-review.googlesource.com/19724
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This commit is contained in:
parent
4f8c695736
commit
fad9e3f541
14
BUILD.gn
14
BUILD.gn
@ -55,14 +55,17 @@ declare_args() {
|
||||
}
|
||||
}
|
||||
declare_args() {
|
||||
skia_vulkan_headers = ""
|
||||
if (skia_use_vulkan) {
|
||||
# When buliding on Android we get the header via the NDK so no need for any extra path.
|
||||
if (is_fuchsia) {
|
||||
skia_vulkan_headers = "$fuchsia_vulkan_sdk/include"
|
||||
} else if (is_linux || is_win) {
|
||||
skia_vulkan_headers = "$skia_vulkan_sdk/include"
|
||||
} else {
|
||||
# When buliding on Android we get the header via the NDK
|
||||
skia_vulkan_headers = ""
|
||||
}
|
||||
} else {
|
||||
skia_vulkan_headers = "third_party/vulkan"
|
||||
}
|
||||
}
|
||||
|
||||
@ -88,10 +91,6 @@ skia_public_includes = [
|
||||
"include/utils/mac",
|
||||
]
|
||||
|
||||
if (skia_use_vulkan) {
|
||||
skia_public_includes += [ "include/gpu/vk" ]
|
||||
}
|
||||
|
||||
# Skia public API, generally provided by :skia.
|
||||
config("skia_public") {
|
||||
include_dirs = skia_public_includes
|
||||
@ -749,7 +748,8 @@ if (skia_enable_tools) {
|
||||
skia_h = "$target_gen_dir/skia.h"
|
||||
script = "gn/find_headers.py"
|
||||
args = [ rebase_path(skia_h, root_build_dir) ] +
|
||||
rebase_path(skia_public_includes)
|
||||
rebase_path(skia_public_includes) +
|
||||
[ rebase_path("third_party/vulkan") ]
|
||||
depfile = "$skia_h.deps"
|
||||
outputs = [
|
||||
skia_h,
|
||||
|
@ -24,10 +24,10 @@ blacklist = {
|
||||
|
||||
headers = []
|
||||
for directory in include_dirs:
|
||||
for f in os.listdir(directory):
|
||||
if os.path.isfile(os.path.join(directory, f)):
|
||||
for d, _, files in os.walk(directory):
|
||||
for f in files:
|
||||
if f.endswith('.h') and f not in blacklist:
|
||||
headers.append(os.path.join(directory,f))
|
||||
headers.append(os.path.join(d,f))
|
||||
headers.sort()
|
||||
|
||||
with open(skia_h, "w") as f:
|
||||
|
@ -10,38 +10,31 @@
|
||||
|
||||
#include "GrTypes.h"
|
||||
#include "gl/GrGLTypes.h"
|
||||
|
||||
#ifdef SK_VULKAN
|
||||
#include "vk/GrVkTypes.h"
|
||||
#endif
|
||||
|
||||
class GrBackendTexture {
|
||||
public:
|
||||
GrBackendTexture(int width,
|
||||
int height,
|
||||
GrPixelConfig config,
|
||||
const GrGLTextureInfo& glInfo);
|
||||
const GrVkImageInfo& vkInfo);
|
||||
|
||||
#ifdef SK_VULKAN
|
||||
GrBackendTexture(int width,
|
||||
int height,
|
||||
const GrVkImageInfo& vkInfo);
|
||||
#endif
|
||||
GrPixelConfig config,
|
||||
const GrGLTextureInfo& glInfo);
|
||||
|
||||
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 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
|
||||
|
||||
// If the backend API is GL, this returns a pointer to the GrGLTextureInfo struct. Otherwise
|
||||
// it returns nullptr.
|
||||
const GrGLTextureInfo* getGLTextureInfo() const;
|
||||
|
||||
private:
|
||||
// Temporary constructor which can be used to convert from a GrBackendTextureDesc.
|
||||
@ -57,10 +50,8 @@ private:
|
||||
GrBackend fBackend;
|
||||
|
||||
union {
|
||||
GrGLTextureInfo fGLInfo;
|
||||
#ifdef SK_VULKAN
|
||||
GrVkImageInfo fVkInfo;
|
||||
#endif
|
||||
GrGLTextureInfo fGLInfo;
|
||||
};
|
||||
};
|
||||
|
||||
@ -70,16 +61,14 @@ public:
|
||||
int height,
|
||||
int sampleCnt,
|
||||
int stencilBits,
|
||||
GrPixelConfig config,
|
||||
const GrGLFramebufferInfo& glInfo);
|
||||
const GrVkImageInfo& vkInfo);
|
||||
|
||||
#ifdef SK_VULKAN
|
||||
GrBackendRenderTarget(int width,
|
||||
int height,
|
||||
int sampleCnt,
|
||||
int stencilBits,
|
||||
const GrVkImageInfo& vkInfo);
|
||||
#endif
|
||||
GrPixelConfig config,
|
||||
const GrGLFramebufferInfo& glInfo);
|
||||
|
||||
int width() const { return fWidth; }
|
||||
int height() const { return fHeight; }
|
||||
@ -88,15 +77,13 @@ public:
|
||||
GrPixelConfig config() const { return fConfig; }
|
||||
GrBackend backend() const {return fBackend; }
|
||||
|
||||
// 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
|
||||
|
||||
// If the backend API is GL, this returns a pointer to the GrGLFramebufferInfo struct. Otherwise
|
||||
// it returns nullptr.
|
||||
const GrGLFramebufferInfo* getGLFramebufferInfo() const;
|
||||
|
||||
private:
|
||||
// Temporary constructor which can be used to convert from a GrBackendRenderTargetDesc.
|
||||
@ -115,10 +102,8 @@ private:
|
||||
GrBackend fBackend;
|
||||
|
||||
union {
|
||||
GrGLFramebufferInfo fGLInfo;
|
||||
#ifdef SK_VULKAN
|
||||
GrVkImageInfo fVkInfo;
|
||||
#endif
|
||||
GrGLFramebufferInfo fGLInfo;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -31,6 +31,8 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#include <vulkan/vulkan.h>
|
||||
|
||||
#define SKIA_REQUIRED_VULKAN_HEADER_VERSION 17
|
||||
@ -39,5 +41,3 @@
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -12,16 +12,20 @@
|
||||
#include "vk/GrVkUtil.h"
|
||||
#endif
|
||||
|
||||
#ifdef SK_VULKAN
|
||||
GrBackendTexture::GrBackendTexture(int width,
|
||||
int height,
|
||||
const GrVkImageInfo& vkInfo)
|
||||
: fWidth(width)
|
||||
, fHeight(height)
|
||||
, fConfig(GrVkFormatToPixelConfig(vkInfo.fFormat))
|
||||
, fConfig(
|
||||
#ifdef SK_VULKAN
|
||||
GrVkFormatToPixelConfig(vkInfo.fFormat)
|
||||
#else
|
||||
kUnknown_GrPixelConfig
|
||||
#endif
|
||||
)
|
||||
, fBackend(kVulkan_GrBackend)
|
||||
, fVkInfo(vkInfo) {}
|
||||
#endif
|
||||
|
||||
GrBackendTexture::GrBackendTexture(int width,
|
||||
int height,
|
||||
@ -53,14 +57,12 @@ GrBackendTexture::GrBackendTexture(const GrBackendTextureDesc& desc, GrBackend b
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef SK_VULKAN
|
||||
const GrVkImageInfo* GrBackendTexture::getVkImageInfo() const {
|
||||
if (kVulkan_GrBackend == fBackend) {
|
||||
return &fVkInfo;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
const GrGLTextureInfo* GrBackendTexture::getGLTextureInfo() const {
|
||||
if (kOpenGL_GrBackend == fBackend) {
|
||||
@ -71,7 +73,6 @@ const GrGLTextureInfo* GrBackendTexture::getGLTextureInfo() const {
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef SK_VULKAN
|
||||
GrBackendRenderTarget::GrBackendRenderTarget(int width,
|
||||
int height,
|
||||
int sampleCnt,
|
||||
@ -81,10 +82,15 @@ GrBackendRenderTarget::GrBackendRenderTarget(int width,
|
||||
, fHeight(height)
|
||||
, fSampleCnt(sampleCnt)
|
||||
, fStencilBits(stencilBits)
|
||||
, fConfig(GrVkFormatToPixelConfig(vkInfo.fFormat))
|
||||
, fConfig(
|
||||
#ifdef SK_VULKAN
|
||||
GrVkFormatToPixelConfig(vkInfo.fFormat)
|
||||
#else
|
||||
kUnknown_GrPixelConfig
|
||||
#endif
|
||||
)
|
||||
, fBackend(kVulkan_GrBackend)
|
||||
, fVkInfo(vkInfo) {}
|
||||
#endif
|
||||
|
||||
GrBackendRenderTarget::GrBackendRenderTarget(int width,
|
||||
int height,
|
||||
@ -123,14 +129,12 @@ GrBackendRenderTarget::GrBackendRenderTarget(const GrBackendRenderTargetDesc& de
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef SK_VULKAN
|
||||
const GrVkImageInfo* GrBackendRenderTarget::getVkImageInfo() const {
|
||||
if (kVulkan_GrBackend == fBackend) {
|
||||
return &fVkInfo;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
const GrGLFramebufferInfo* GrBackendRenderTarget::getGLFramebufferInfo() const {
|
||||
if (kOpenGL_GrBackend == fBackend) {
|
||||
|
@ -33,15 +33,14 @@ static GrBackendTexture make_backend_texture_from_handle(GrBackend backend,
|
||||
int width, int height,
|
||||
GrPixelConfig config,
|
||||
GrBackendObject handle) {
|
||||
#if SK_VULKAN
|
||||
if (kVulkan_GrBackend == backend) {
|
||||
if (kOpenGL_GrBackend == backend) {
|
||||
GrGLTextureInfo* glInfo = (GrGLTextureInfo*)(handle);
|
||||
return GrBackendTexture(width, height, config, *glInfo);
|
||||
} else {
|
||||
SkASSERT(kVulkan_GrBackend == backend);
|
||||
GrVkImageInfo* vkInfo = (GrVkImageInfo*)(handle);
|
||||
return GrBackendTexture(width, height, *vkInfo);
|
||||
}
|
||||
#endif
|
||||
SkASSERT(kOpenGL_GrBackend == backend);
|
||||
GrGLTextureInfo* glInfo = (GrGLTextureInfo*)(handle);
|
||||
return GrBackendTexture(width, height, config, *glInfo);
|
||||
}
|
||||
|
||||
std::unique_ptr<SkImageGenerator>
|
||||
|
@ -325,15 +325,15 @@ static GrBackendTexture make_backend_texture_from_handle(GrBackend backend,
|
||||
int width, int height,
|
||||
GrPixelConfig config,
|
||||
GrBackendObject handle) {
|
||||
#if SK_VULKAN
|
||||
if (kVulkan_GrBackend == backend) {
|
||||
|
||||
if (kOpenGL_GrBackend == backend) {
|
||||
GrGLTextureInfo* glInfo = (GrGLTextureInfo*)(handle);
|
||||
return GrBackendTexture(width, height, config, *glInfo);
|
||||
} else {
|
||||
SkASSERT(kVulkan_GrBackend == backend);
|
||||
GrVkImageInfo* vkInfo = (GrVkImageInfo*)(handle);
|
||||
return GrBackendTexture(width, height, *vkInfo);
|
||||
}
|
||||
#endif
|
||||
SkASSERT(kOpenGL_GrBackend == backend);
|
||||
GrGLTextureInfo* glInfo = (GrGLTextureInfo*)(handle);
|
||||
return GrBackendTexture(width, height, config, *glInfo);
|
||||
}
|
||||
|
||||
static sk_sp<SkImage> make_from_yuv_textures_copy(GrContext* ctx, SkYUVColorSpace colorSpace,
|
||||
|
@ -61,15 +61,14 @@ void SetupAlwaysEvictAtlas(GrContext* context) {
|
||||
|
||||
GrBackendTexture CreateBackendTexture(GrBackend backend, int width, int height,
|
||||
GrPixelConfig config, GrBackendObject handle) {
|
||||
#if SK_VULKAN
|
||||
if (kVulkan_GrBackend == backend) {
|
||||
if (kOpenGL_GrBackend == backend) {
|
||||
GrGLTextureInfo* glInfo = (GrGLTextureInfo*)(handle);
|
||||
return GrBackendTexture(width, height, config, *glInfo);
|
||||
} else {
|
||||
SkASSERT(kVulkan_GrBackend == backend);
|
||||
GrVkImageInfo* vkInfo = (GrVkImageInfo*)(handle);
|
||||
return GrBackendTexture(width, height, *vkInfo);
|
||||
}
|
||||
#endif
|
||||
SkASSERT(kOpenGL_GrBackend == backend);
|
||||
GrGLTextureInfo* glInfo = (GrGLTextureInfo*)(handle);
|
||||
return GrBackendTexture(width, height, config, *glInfo);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user