• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2022 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 SkCapabilities_DEFINED
9 #define SkCapabilities_DEFINED
10 
11 #include "include/core/SkRefCnt.h"
12 
13 #ifdef SK_ENABLE_SKSL
14 #include "include/sksl/SkSLVersion.h"
15 namespace SkSL { struct ShaderCaps; }
16 #endif
17 
18 #if defined(SK_GRAPHITE)
19 namespace skgpu::graphite { class Caps; }
20 #endif
21 
22 class SK_API SkCapabilities : public SkRefCnt {
23 public:
24     static sk_sp<const SkCapabilities> RasterBackend();
25 
26 #ifdef SK_ENABLE_SKSL
skslVersion()27     SkSL::Version skslVersion() const { return fSkSLVersion; }
28 #endif
29 
30 protected:
31 #if defined(SK_GRAPHITE)
32     friend class skgpu::graphite::Caps; // for ctor
33 #endif
34 
35     SkCapabilities() = default;
36 
37 #ifdef SK_ENABLE_SKSL
38     void initSkCaps(const SkSL::ShaderCaps*);
39 
40     SkSL::Version fSkSLVersion = SkSL::Version::k100;
41 #endif
42 };
43 
44 #endif
45