Definition at line 96 of file SkottieGM.cpp.
◆ SkottieColorizeGM()
SkottieColorizeGM::SkottieColorizeGM |
( |
const char * |
name, |
|
|
const char * |
resource |
|
) |
| |
|
inline |
Definition at line 98 of file SkottieGM.cpp.
100 , fResource(resource)
101 {}
◆ getISize()
SkISize SkottieColorizeGM::getISize |
( |
| ) |
|
|
inlineoverrideprotectedvirtual |
◆ getName()
SkString SkottieColorizeGM::getName |
( |
| ) |
const |
|
inlineoverrideprotectedvirtual |
◆ onAnimate()
bool SkottieColorizeGM::onAnimate |
( |
double |
nanos | ) |
|
|
inlineoverrideprotectedvirtual |
Reimplemented from skiagm::GM.
Definition at line 132 of file SkottieGM.cpp.
132 {
133 if (!fAnimation) {
134 return false;
135 }
136
139 return true;
140 }
void seek(SkScalar t, sksg::InvalidationController *ic=nullptr)
◆ onChar()
bool SkottieColorizeGM::onChar |
( |
SkUnichar |
uni | ) |
|
|
inlineoverrideprotectedvirtual |
Reimplemented from skiagm::GM.
Definition at line 142 of file SkottieGM.cpp.
142 {
149 };
150
151 if (uni == 'c') {
152 fColorIndex = (fColorIndex + 1) % std::size(kColors);
153 for (
const auto&
prop : fColorProps) {
154 fPropManager->setColor(
prop, kColors[fColorIndex]);
155 }
156 for (
const auto&
prop : fTextProps) {
157 auto txtval = fPropManager->getText(
prop);
158 txtval.fFillColor =
kColors[fColorIndex];
159 fPropManager->setText(
prop, txtval);
160 }
161 return true;
162 }
163
164 return false;
165 }
constexpr SkColor SK_ColorYELLOW
constexpr SkColor SK_ColorCYAN
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorGREEN
static SkScalar prop(SkScalar radius, SkScalar newSize, SkScalar oldSize)
◆ onDraw()
|
inlineoverrideprotectedvirtual |
Reimplemented from skiagm::GM.
Definition at line 121 of file SkottieGM.cpp.
121 {
122 if (!fAnimation) {
123 *errorMsg = "No animation";
124 return DrawResult::kFail;
125 }
126
128 fAnimation->
render(canvas, &dest);
129 return DrawResult::kOk;
130 }
void render(SkCanvas *canvas, const SkRect *dst=nullptr) const
static constexpr SkRect MakeWH(float w, float h)
◆ onOnceBeforeDraw()
void SkottieColorizeGM::onOnceBeforeDraw |
( |
| ) |
|
|
inlineoverrideprotectedvirtual |
Reimplemented from skiagm::GM.
Definition at line 108 of file SkottieGM.cpp.
108 {
110 fPropManager = std::make_unique<skottie_utils::CustomPropertyManager>();
116 fColorProps = fPropManager->getColorProps();
117 fTextProps = fPropManager->getTextProps();
118 }
119 }
std::unique_ptr< SkStreamAsset > GetResourceAsStream(const char *resource, bool useFileStream)
Builder & setPropertyObserver(sk_sp< PropertyObserver >)
Builder & setFontManager(sk_sp< SkFontMgr >)
sk_sp< Animation > make(SkStream *)
Builder & setTextShapingFactory(sk_sp< SkShapers::Factory >)
sk_sp< Factory > BestAvailable()
The documentation for this class was generated from the following file: