You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
994 B
46 lines
994 B
4 months ago
|
/*
|
||
|
* Copyright 2019 Google Inc.
|
||
|
*
|
||
|
* Use of this source code is governed by a BSD-style license that can be
|
||
|
* found in the LICENSE file.
|
||
|
*/
|
||
|
|
||
|
#ifndef DawnTestContext_DEFINED
|
||
|
#define DawnTestContext_DEFINED
|
||
|
|
||
|
#include "tools/gpu/TestContext.h"
|
||
|
#include <dawn_native/DawnNative.h>
|
||
|
|
||
|
#ifdef SK_DAWN
|
||
|
|
||
|
namespace sk_gpu_test {
|
||
|
class DawnTestContext : public TestContext {
|
||
|
public:
|
||
|
virtual GrBackend backend() override { return GrBackendApi::kDawn; }
|
||
|
|
||
|
const wgpu::Device& getDevice() {
|
||
|
return fDevice;
|
||
|
}
|
||
|
|
||
|
protected:
|
||
|
DawnTestContext(std::unique_ptr<dawn_native::Instance> instance, const wgpu::Device& device)
|
||
|
: fInstance(std::move(instance)), fDevice(device) {}
|
||
|
|
||
|
std::unique_ptr<dawn_native::Instance> fInstance;
|
||
|
wgpu::Device fDevice;
|
||
|
|
||
|
private:
|
||
|
using INHERITED = TestContext;
|
||
|
};
|
||
|
|
||
|
/**
|
||
|
* Creates Dawn context object bound to the Dawn library.
|
||
|
*/
|
||
|
DawnTestContext* CreatePlatformDawnTestContext(DawnTestContext*);
|
||
|
|
||
|
} // namespace sk_gpu_test
|
||
|
|
||
|
#endif
|
||
|
|
||
|
#endif
|