Flutter Engine
The Flutter Engine
Public Types | Public Member Functions | List of all members
SkRuntimeEffect::ChildPtr Class Reference

#include <SkRuntimeEffect.h>

Public Types

using sk_is_trivially_relocatable = std::true_type
 

Public Member Functions

 ChildPtr ()=default
 
 ChildPtr (sk_sp< SkShader > s)
 
 ChildPtr (sk_sp< SkColorFilter > cf)
 
 ChildPtr (sk_sp< SkBlender > b)
 
 ChildPtr (sk_sp< SkFlattenable > f)
 
std::optional< ChildTypetype () const
 
SkShadershader () const
 
SkColorFiltercolorFilter () const
 
SkBlenderblender () const
 
SkFlattenableflattenable () const
 

Detailed Description

Definition at line 185 of file SkRuntimeEffect.h.

Member Typedef Documentation

◆ sk_is_trivially_relocatable

Definition at line 202 of file SkRuntimeEffect.h.

Constructor & Destructor Documentation

◆ ChildPtr() [1/5]

SkRuntimeEffect::ChildPtr::ChildPtr ( )
default

◆ ChildPtr() [2/5]

SkRuntimeEffect::ChildPtr::ChildPtr ( sk_sp< SkShader s)
inline

Definition at line 188 of file SkRuntimeEffect.h.

188: fChild(std::move(s)) {}
struct MyStruct s

◆ ChildPtr() [3/5]

SkRuntimeEffect::ChildPtr::ChildPtr ( sk_sp< SkColorFilter cf)
inline

Definition at line 189 of file SkRuntimeEffect.h.

189: fChild(std::move(cf)) {}

◆ ChildPtr() [4/5]

SkRuntimeEffect::ChildPtr::ChildPtr ( sk_sp< SkBlender b)
inline

Definition at line 190 of file SkRuntimeEffect.h.

190: fChild(std::move(b)) {}
static bool b

◆ ChildPtr() [5/5]

SkRuntimeEffect::ChildPtr::ChildPtr ( sk_sp< SkFlattenable f)

Definition at line 377 of file SkRuntimeEffect.cpp.

377 : fChild(std::move(f)) {
379}
#define SkASSERT(cond)
Definition: SkAssert.h:116
static bool flattenable_is_valid_as_child(const SkFlattenable *f)
T * get() const
Definition: SkRefCnt.h:303

Member Function Documentation

◆ blender()

SkBlender * SkRuntimeEffect::ChildPtr::blender ( ) const

Definition at line 945 of file SkRuntimeEffect.cpp.

945 {
946 return (fChild && fChild->getFlattenableType() == SkFlattenable::kSkBlender_Type)
947 ? static_cast<SkBlender*>(fChild.get())
948 : nullptr;
949}
virtual Type getFlattenableType() const =0

◆ colorFilter()

SkColorFilter * SkRuntimeEffect::ChildPtr::colorFilter ( ) const

Definition at line 939 of file SkRuntimeEffect.cpp.

939 {
940 return (fChild && fChild->getFlattenableType() == SkFlattenable::kSkColorFilter_Type)
941 ? static_cast<SkColorFilter*>(fChild.get())
942 : nullptr;
943}

◆ flattenable()

SkFlattenable * SkRuntimeEffect::ChildPtr::flattenable ( ) const
inline

Definition at line 200 of file SkRuntimeEffect.h.

200{ return fChild.get(); }

◆ shader()

SkShader * SkRuntimeEffect::ChildPtr::shader ( ) const

Definition at line 933 of file SkRuntimeEffect.cpp.

933 {
934 return (fChild && fChild->getFlattenableType() == SkFlattenable::kSkShader_Type)
935 ? static_cast<SkShader*>(fChild.get())
936 : nullptr;
937}

◆ type()

std::optional< ChildType > SkRuntimeEffect::ChildPtr::type ( ) const

Definition at line 917 of file SkRuntimeEffect.cpp.

917 {
918 if (fChild) {
919 switch (fChild->getFlattenableType()) {
921 return ChildType::kShader;
925 return ChildType::kBlender;
926 default:
927 break;
928 }
929 }
930 return std::nullopt;
931}

The documentation for this class was generated from the following files: