2016-05-11 17:09:18 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2016 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef VkTestContext_DEFINED
|
|
|
|
#define VkTestContext_DEFINED
|
|
|
|
|
|
|
|
#include "TestContext.h"
|
|
|
|
|
|
|
|
#ifdef SK_VULKAN
|
|
|
|
|
2018-08-01 13:23:57 +00:00
|
|
|
#include "GrVulkanDefines.h"
|
2016-05-11 17:09:18 +00:00
|
|
|
#include "vk/GrVkBackendContext.h"
|
|
|
|
|
|
|
|
namespace sk_gpu_test {
|
|
|
|
class VkTestContext : public TestContext {
|
|
|
|
public:
|
|
|
|
virtual GrBackend backend() override { return kVulkan_GrBackend; }
|
|
|
|
|
2018-07-02 20:15:37 +00:00
|
|
|
const GrVkBackendContext& getVkBackendContext() {
|
2017-05-15 17:50:35 +00:00
|
|
|
return fVk;
|
|
|
|
}
|
|
|
|
|
2016-05-11 17:09:18 +00:00
|
|
|
protected:
|
2018-07-02 20:16:44 +00:00
|
|
|
VkTestContext(const GrVkBackendContext& vk, bool ownsContext,
|
|
|
|
VkDebugReportCallbackEXT debugCallback)
|
|
|
|
: fVk(vk), fOwnsContext(ownsContext), fDebugCallback(debugCallback) {}
|
2016-05-11 17:09:18 +00:00
|
|
|
|
2018-07-02 20:15:37 +00:00
|
|
|
GrVkBackendContext fVk;
|
|
|
|
bool fOwnsContext;
|
2018-07-02 20:16:44 +00:00
|
|
|
VkDebugReportCallbackEXT fDebugCallback = VK_NULL_HANDLE;
|
2016-05-11 17:09:18 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
typedef TestContext INHERITED;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates Vk context object bound to the native Vk library.
|
|
|
|
*/
|
2017-05-15 17:50:35 +00:00
|
|
|
VkTestContext* CreatePlatformVkTestContext(VkTestContext*);
|
2016-05-11 17:09:18 +00:00
|
|
|
|
|
|
|
} // namespace sk_gpu_test
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|