• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2021 Google LLC
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 skiatest_graphite_GraphiteTestContext_DEFINED
9 #define skiatest_graphite_GraphiteTestContext_DEFINED
10 
11 #include "experimental/graphite/include/GraphiteTypes.h"
12 #include "include/core/SkRefCnt.h"
13 
14 namespace skgpu { class Context; }
15 
16 namespace skiatest::graphite {
17 
18 /**
19  * An offscreen 3D context. This class is intended for Skia's internal testing needs and not
20  * for general use.
21  */
22 class GraphiteTestContext {
23 public:
24     GraphiteTestContext(const GraphiteTestContext&) = delete;
25     GraphiteTestContext& operator=(const GraphiteTestContext&) = delete;
26 
27     virtual ~GraphiteTestContext();
28 
29     virtual skgpu::BackendApi backend() = 0;
30 
31     virtual sk_sp<skgpu::Context> makeContext() = 0;
32 
33 protected:
34     GraphiteTestContext();
35 };
36 
37 
38 }  // namespace skiatest::graphite
39 
40 #endif // skiatest_graphite_GraphiteTestContext_DEFINED
41