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; }
|
|
|
|
|
2017-05-15 17:50:35 +00:00
|
|
|
sk_sp<const GrVkBackendContext> getVkBackendContext() {
|
|
|
|
return fVk;
|
|
|
|
}
|
|
|
|
|
2016-10-27 16:30:08 +00:00
|
|
|
const GrVkInterface* vk() const { return fVk->fInterface.get(); }
|
2016-05-11 17:09:18 +00:00
|
|
|
|
|
|
|
protected:
|
2016-09-27 14:52:35 +00:00
|
|
|
VkTestContext(sk_sp<const GrVkBackendContext> vk) : fVk(std::move(vk)) {}
|
2016-05-11 17:09:18 +00:00
|
|
|
|
|
|
|
sk_sp<const GrVkBackendContext> fVk;
|
|
|
|
|
|
|
|
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
|