skia2/tools/gpu/dawn/DawnTestContext.h
Kevin Lubick 7d4e12544e [dawn] Clean up include paths and dawn_native namespace
Change-Id: I343d878b2ff3b1abf52007c7612b01c53731566b
Bug: dawn:824,dawn:1275,skia:12512
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516916
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-07 14:38:55 +00:00

46 lines
996 B
C++

/*
* 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