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
|
|
|
|
|
|
|
|
#include "vk/GrVkBackendContext.h"
|
|
|
|
|
|
|
|
namespace sk_gpu_test {
|
|
|
|
class VkTestContext : public TestContext {
|
|
|
|
public:
|
|
|
|
virtual GrBackend backend() override { return kVulkan_GrBackend; }
|
|
|
|
|
2018-06-28 23:31:00 +00:00
|
|
|
sk_sp<const GrVkBackendContext> getVkBackendContext() {
|
2017-05-15 17:50:35 +00:00
|
|
|
return fVk;
|
|
|
|
}
|
|
|
|
|
2018-06-28 23:31:00 +00:00
|
|
|
const GrVkInterface* vk() const { return fVk->fInterface.get(); }
|
2016-05-11 17:09:18 +00:00
|
|
|
|
|
|
|
protected:
|
2018-06-28 23:31:00 +00:00
|
|
|
VkTestContext(sk_sp<const GrVkBackendContext> vk) : fVk(std::move(vk)) {}
|
2016-05-11 17:09:18 +00:00
|
|
|
|
2018-06-28 23:31:00 +00:00
|
|
|
sk_sp<const GrVkBackendContext> fVk;
|
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
|