2 * Copyright 2019 Google Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #ifndef DawnTestContext_DEFINED
9 #define DawnTestContext_DEFINED
11 #include "tools/gpu/TestContext.h"
12 #include "dawn/native/DawnNative.h"
16 namespace sk_gpu_test {
17 class DawnTestContext : public TestContext {
19 virtual GrBackend backend() override { return GrBackendApi::kDawn; }
21 const wgpu::Device& getDevice() {
26 DawnTestContext(std::unique_ptr<dawn::native::Instance> instance, const wgpu::Device& device)
27 : fInstance(std::move(instance)), fDevice(device) {}
29 std::unique_ptr<dawn::native::Instance> fInstance;
33 using INHERITED = TestContext;
37 * Creates Dawn context object bound to the Dawn library.
39 DawnTestContext* CreatePlatformDawnTestContext(DawnTestContext*);
41 } // namespace sk_gpu_test