Flutter Engine
The Flutter Engine
PrecompileBlender.h
Go to the documentation of this file.
1/*
2 * Copyright 2024 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 skgpu_graphite_precompile_PrecompileBlender_DEFINED
9#define skgpu_graphite_precompile_PrecompileBlender_DEFINED
10
13
14#include <optional>
15
16namespace skgpu::graphite {
17
18class PrecompileBlenderPriv;
19
20/** \class PrecompileBlender
21 This class corresponds to the SkBlender class in the main API.
22*/
24public:
25 // Provides access to functions that aren't part of the public API.
27 const PrecompileBlenderPriv priv() const; // NOLINT(readability-const-return-type)
28
29protected:
31
32 virtual std::optional<SkBlendMode> asBlendMode() const { return {}; }
33
36};
37
38//--------------------------------------------------------------------------------------------------
39// This is the Precompile correlate to the SkBlenders namespace in the main API
40namespace PrecompileBlenders {
41
42 // This factory creates a Precompilation object that represents the Arithmetic SkBlender from
43 // the main API. Note that the actual Arithmetic parameters (i.e., k1, k2, k3 and k4) are
44 // abstracted away since they do not impact the generated shader.
46
47 // This is the Precompilation correlate to the SkBlender::Mode factory in the main API. It
48 // creates an object that represents SkBlendMode-based blending.
50
51} // namespace PrecompileBlenders
52
53
54} // namespace skgpu::graphite
55
56#endif // skgpu_graphite_precompile_PrecompileBlender_DEFINED
#define SK_API
Definition: SkAPI.h:35
SkBlendMode
Definition: SkBlendMode.h:38
virtual std::optional< SkBlendMode > asBlendMode() const
FlPixelBufferTexturePrivate * priv
SK_API sk_sp< PrecompileBlender > Arithmetic()
SK_API sk_sp< PrecompileBlender > Mode(SkBlendMode)