Fix Vulkan Build in Android

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1935523002

Review-Url: https://codereview.chromium.org/1935523002
This commit is contained in:
liyuqian 2016-04-29 10:00:26 -07:00 committed by Commit bot
parent fb5916486f
commit b138fdc65f
5 changed files with 10 additions and 2 deletions

View File

@ -32,7 +32,11 @@ const char* kDebugLayerNames[] = {
#endif
// the minimum version of Vulkan supported
#ifdef SK_BUILD_FOR_ANDROID
const uint32_t kGrVkMinimumVersion = VK_MAKE_VERSION(1, 0, 3);
#else
const uint32_t kGrVkMinimumVersion = VK_MAKE_VERSION(1, 0, 8);
#endif
// Create the base Vulkan objects needed by the GrVkGpu object
const GrVkBackendContext* GrVkBackendContext::Create(uint32_t* presentQueueIndexPtr,

View File

@ -82,7 +82,9 @@ GrGpu* GrVkGpu::Create(GrBackendContext backendContext, const GrContextOptions&
GrVkGpu::GrVkGpu(GrContext* context, const GrContextOptions& options,
const GrVkBackendContext* backendCtx)
: INHERITED(context)
#ifdef ENABLE_VK_LAYERS
, fVkInstance(backendCtx->fInstance)
#endif
, fDevice(backendCtx->fDevice)
, fQueue(backendCtx->fQueue)
, fResourceProvider(this) {

View File

@ -204,7 +204,9 @@ private:
// These Vulkan objects are provided by the client, and also stored in fBackendContext.
// They're copied here for convenient access.
#ifdef ENABLE_VK_LAYERS
VkInstance fVkInstance;
#endif
VkDevice fDevice;
VkQueue fQueue; // Must be Graphics queue

View File

@ -35,7 +35,7 @@ void Window_android::setTitle(const char* title) {
SkDebugf("Title: %s", title);
}
bool Window_android::attach(BackEndType attachType, int msaaSampleCount, AttachmentInfo*) {
bool Window_android::attach(BackEndType attachType, int msaaSampleCount) {
if (kVulkan_BackendType != attachType) {
return false;
}

View File

@ -29,7 +29,7 @@ public:
void setTitle(const char*) override;
void show() override {}
bool attach(BackEndType attachType, int msaaSampleCount, AttachmentInfo*) override;
bool attach(BackEndType attachType, int msaaSampleCount) override;
void inval() override;
void paintIfNeeded();