Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Functions
SkBlenderBase.h File Reference
#include "include/core/SkBlender.h"
#include "src/base/SkArenaAlloc.h"
#include <memory>
#include <optional>

Go to the source code of this file.

Classes

class  SkBlenderBase
 

Namespaces

namespace  skgpu
 
namespace  skgpu::graphite
 

Macros

#define SK_ALL_BLENDERS(M)
 
#define M(type)   k ## type,
 

Functions

SkBlenderBaseas_BB (SkBlender *blend)
 
const SkBlenderBaseas_BB (const SkBlender *blend)
 
const SkBlenderBaseas_BB (const sk_sp< SkBlender > &blend)
 

Macro Definition Documentation

◆ M

#define M (   type)    k ## type,

Definition at line 61 of file SkBlenderBase.h.

◆ SK_ALL_BLENDERS

#define SK_ALL_BLENDERS (   M)
Value:
M(BlendMode) \
M(Runtime)
#define M(type)

Definition at line 30 of file SkBlenderBase.h.

38 : public SkBlender {
39public:
40 /**
41 * Returns true if this SkBlender represents any SkBlendMode, and returns the blender's
42 * SkBlendMode in `mode`. Returns false for other types of blends.
43 */
44 virtual std::optional<SkBlendMode> asBlendMode() const { return {}; }
45
46 bool affectsTransparentBlack() const;
47
48 [[nodiscard]] bool appendStages(const SkStageRec& rec) const {
49 return this->onAppendStages(rec);
50 }
51
52 [[nodiscard]] virtual bool onAppendStages(const SkStageRec& rec) const = 0;
53
54 virtual SkRuntimeEffect* asRuntimeEffect() const { return nullptr; }
55
56 static SkFlattenable::Type GetFlattenableType() { return kSkBlender_Type; }
57 SkFlattenable::Type getFlattenableType() const override { return GetFlattenableType(); }
58
59 enum class BlenderType {
60 #define M(type) k ## type,
62 #undef M
63 };
64
65 virtual BlenderType type() const = 0;
66};
67
69 return static_cast<SkBlenderBase*>(blend);
70}
71
72inline const SkBlenderBase* as_BB(const SkBlender* blend) {
73 return static_cast<const SkBlenderBase*>(blend);
74}
75
76inline const SkBlenderBase* as_BB(const sk_sp<SkBlender>& blend) {
77 return static_cast<SkBlenderBase*>(blend.get());
78}
79
80#endif // SkBlenderBase_DEFINED
#define SK_ALL_BLENDERS(M)
SkBlenderBase * as_BB(SkBlender *blend)
static SkColor blend(SkColor dst, SkColor src, void(*mode)(float, float, float, float *, float *, float *))
Definition hsl.cpp:142

Function Documentation

◆ as_BB() [1/3]

const SkBlenderBase * as_BB ( const sk_sp< SkBlender > &  blend)
inline

Definition at line 77 of file SkBlenderBase.h.

77 {
78 return static_cast<SkBlenderBase*>(blend.get());
79}

◆ as_BB() [2/3]

const SkBlenderBase * as_BB ( const SkBlender blend)
inline

Definition at line 73 of file SkBlenderBase.h.

73 {
74 return static_cast<const SkBlenderBase*>(blend);
75}

◆ as_BB() [3/3]

SkBlenderBase * as_BB ( SkBlender blend)
inline

Definition at line 69 of file SkBlenderBase.h.

69 {
70 return static_cast<SkBlenderBase*>(blend);
71}