• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2019 Google Inc.
3  *
4  * Use of this source code is governed by a BSD-style license that can be
5  * found in the LICENSE file.
6  */
7 
8 #ifndef DawnTestContext_DEFINED
9 #define DawnTestContext_DEFINED
10 
11 #include "tools/gpu/TestContext.h"
12 
13 #ifdef SK_DAWN
14 
15 namespace sk_gpu_test {
16 class DawnTestContext : public TestContext {
17 public:
backend()18     virtual GrBackend backend() override { return GrBackendApi::kDawn; }
19 
getDevice()20     const dawn::Device& getDevice() {
21         return fDevice;
22     }
23 
24 protected:
DawnTestContext(const dawn::Device & device)25     DawnTestContext(const dawn::Device& device) : fDevice(device) {}
26 
27     dawn::Device fDevice;
28 
29 private:
30     typedef TestContext INHERITED;
31 };
32 
33 /**
34  * Creates Dawn context object bound to the Dawn library.
35  */
36 DawnTestContext* CreatePlatformDawnTestContext(DawnTestContext*);
37 
38 }  // namespace sk_gpu_test
39 
40 #endif
41 
42 #endif
43