Skia
2D Graphics Library
SkCapabilities.h
Go to the documentation of this file.
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 #include "include/core/SkTypes.h"
13 #include "include/sksl/SkSLVersion.h"
14 
15 namespace SkSL { struct ShaderCaps; }
16 
17 #if defined(SK_GRAPHITE)
18 namespace skgpu::graphite { class Caps; }
19 #endif
20 
21 class SK_API SkCapabilities : public SkRefCnt {
22 public:
24 
25  SkSL::Version skslVersion() const { return fSkSLVersion; }
26 
27 protected:
28 #if defined(SK_GRAPHITE)
29  friend class skgpu::graphite::Caps; // for ctor
30 #endif
31 
32  SkCapabilities() = default;
33 
34  void initSkCaps(const SkSL::ShaderCaps*);
35 
36  SkSL::Version fSkSLVersion = SkSL::Version::k100;
37 };
38 
39 #endif
Definition: SkCapabilities.h:21
SkCapabilities()=default
SkSL::Version skslVersion() const
Definition: SkCapabilities.h:25
void initSkCaps(const SkSL::ShaderCaps *)
static sk_sp< const SkCapabilities > RasterBackend()
Definition: SkRefCnt.h:119
Shared pointer class to wrap classes that support a ref()/unref() interface.
Definition: SkRefCnt.h:220
Definition: SkCapabilities.h:15
Definition: SkCanvas.h:73