| 1 |
/* |
| 2 |
* Copyright 2017 Google Inc. |
| 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 |
#include "include/core/SkCanvas.h" |
| 9 |
#include "include/core/SkFont.h" |
| 10 |
#include "include/core/SkPaint.h" |
| 11 |
#include "include/core/SkPath.h" |
| 12 |
#include "src/base/SkRandom.h" |
| 13 |
#include "src/base/SkVx.h" |
| 14 |
#include "src/core/SkPathPriv.h" |
| 15 |
#include "src/core/SkStrike.h" |
| 16 |
#include "src/core/SkStrikeCache.h" |
| 17 |
#include "src/core/SkStrikeSpec.h" |
| 18 |
#include "src/core/SkTaskGroup.h" |
| 19 |
#include "tools/ToolUtils.h" |
| 20 |
#include "tools/fonts/FontToolUtils.h" |
| 21 |
#include "tools/viewer/Slide.h" |
| 22 |
|
| 23 |
//////////////////////////////////////////////////////////////////////////////////////////////////// |
| 24 |
// Static text from paths. |
| 25 |
class PathTextSlide : public Slide { |
| 26 |
constexpr static int kNumPaths = 1500; |
| 27 |
SkSize fSize; |
| 28 |
|
| 29 |
public: |
| 30 |
PathTextSlide() { fName = "PathText"; } |
| 31 |
|
| 32 |
virtual void reset() { |
| 33 |
for (Glyph& glyph : fGlyphs) { |
| 34 |
glyph.reset(fRand, fSize.width(), fSize.height()); |
| 35 |
} |
| 36 |
fGlyphAnimator->reset(&fRand, fSize.width(), fSize.height()); |
| 37 |
} |
| 38 |
|
| 39 |
void load(SkScalar w, SkScalar h) final { |
| 40 |
fSize = {w, h}; |
| 41 |
|
| 42 |
SkFont defaultFont = ToolUtils::DefaultFont(); |
| 43 |
SkStrikeSpec strikeSpec = SkStrikeSpec::MakeWithNoDevice(defaultFont); |
| 44 |
SkBulkGlyphMetricsAndPaths pathMaker{strikeSpec}; |
| 45 |
SkPath glyphPaths[52]; |
| 46 |
for (int i = 0; i < 52; ++i) { |
| 47 |
// I and l are rects on OS X ... |
| 48 |
char c = "aQCDEFGH7JKLMNOPBRZTUVWXYSAbcdefghijk1mnopqrstuvwxyz"[i]; |
| 49 |
SkGlyphID id(defaultFont.unicharToGlyph(c)); |
| 50 |
const SkGlyph* glyph = pathMaker.glyph(id); |
| 51 |
if (glyph->path()) { |
| 52 |
glyphPaths[i] = *glyph->path(); |
| 53 |
} |
| 54 |
} |
| 55 |
|
| 56 |
for (int i = 0; i < kNumPaths; ++i) { |
| 57 |
const SkPath& p = glyphPaths[i % 52]; |
| 58 |
fGlyphs[i].init(fRand, p); |
| 59 |
} |
| 60 |
this->reset(); |
| 61 |
} |
| 62 |
|
| 63 |
void resize(SkScalar w, SkScalar h) final { |
| 64 |
fSize = {w, h}; |
| 65 |
this->reset(); |
| 66 |
} |
| 67 |
|
| 68 |
bool onChar(SkUnichar) override; |
| 69 |
|
| 70 |
bool animate(double nanos) final { |
| 71 |
return fGlyphAnimator->animate(nanos, fSize.width(), fSize.height()); |
| 72 |
} |
| 73 |
|
| 74 |
void draw(SkCanvas* canvas) override { |
| 75 |
if (fDoClip) { |
| 76 |
SkPath deviceSpaceClipPath = fClipPath.makeTransform( |
| 77 |
SkMatrix::Scale(fSize.width(), fSize.height())); |
| 78 |
canvas->save(); |
| 79 |
canvas->clipPath(deviceSpaceClipPath, SkClipOp::kDifference, true); |
| 80 |
canvas->clear(SK_ColorBLACK); |
| 81 |
canvas->restore(); |
| 82 |
canvas->clipPath(deviceSpaceClipPath, SkClipOp::kIntersect, true); |
| 83 |
} |
| 84 |
fGlyphAnimator->draw(canvas); |
| 85 |
} |
| 86 |
|
| 87 |
protected: |
| 88 |
struct Glyph { |
| 89 |
void init(SkRandom& rand, const SkPath& path); |
| 90 |
void reset(SkRandom& rand, int w, int h); |
| 91 |
|
| 92 |
SkPath fPath; |
| 93 |
SkPaint fPaint; |
| 94 |
SkPoint fPosition; |
| 95 |
SkScalar fZoom; |
| 96 |
SkScalar fSpin; |
| 97 |
SkPoint fMidpt; |
| 98 |
}; |
| 99 |
|
| 100 |
class GlyphAnimator { |
| 101 |
public: |
| 102 |
GlyphAnimator(Glyph* glyphs) : fGlyphs(glyphs) {} |
| 103 |
virtual void reset(SkRandom*, int screenWidth, int screenHeight) {} |
| 104 |
virtual bool animate(double nanos, int screenWidth, int screenHeight) { return false; } |
| 105 |
virtual void draw(SkCanvas* canvas) { |
| 106 |
for (int i = 0; i < kNumPaths; ++i) { |
| 107 |
Glyph& glyph = fGlyphs[i]; |
| 108 |
SkAutoCanvasRestore acr(canvas, true); |
| 109 |
canvas->translate(glyph.fPosition.x(), glyph.fPosition.y()); |
| 110 |
canvas->scale(glyph.fZoom, glyph.fZoom); |
| 111 |
canvas->rotate(glyph.fSpin); |
| 112 |
canvas->translate(-glyph.fMidpt.x(), -glyph.fMidpt.y()); |
| 113 |
canvas->drawPath(glyph.fPath, glyph.fPaint); |
| 114 |
} |
| 115 |
} |
| 116 |
virtual ~GlyphAnimator() {} |
| 117 |
|
| 118 |
protected: |
| 119 |
Glyph* const fGlyphs; |
| 120 |
}; |
| 121 |
|
| 122 |
class MovingGlyphAnimator; |
| 123 |
class WavyGlyphAnimator; |
| 124 |
|
| 125 |
Glyph fGlyphs[kNumPaths]; |
| 126 |
SkRandom fRand{25}; |
| 127 |
SkPath fClipPath = ToolUtils::make_star(SkRect{0, 0, 1, 1}, 11, 3); |
| 128 |
bool fDoClip = false; |
| 129 |
std::unique_ptr<GlyphAnimator> fGlyphAnimator = std::make_unique<GlyphAnimator>(fGlyphs); |
| 130 |
}; |
| 131 |
|
| 132 |
void PathTextSlide::Glyph::init(SkRandom& rand, const SkPath& path) { |
| 133 |
fPath = path; |
| 134 |
fPaint.setAntiAlias(true); |
| 135 |
fPaint.setColor(rand.nextU() | 0x80808080); |
| 136 |
} |
| 137 |
|
| 138 |
void PathTextSlide::Glyph::reset(SkRandom& rand, int w, int h) { |
| 139 |
int screensize = std::max(w, h); |
| 140 |
const SkRect& bounds = fPath.getBounds(); |
| 141 |
SkScalar t; |
| 142 |
|
| 143 |
fPosition = {rand.nextF() * w, rand.nextF() * h}; |
| 144 |
t = pow(rand.nextF(), 100); |
| 145 |
fZoom = ((1 - t) * screensize / 50 + t * screensize / 3) / |
| 146 |
std::max(bounds.width(), bounds.height()); |
| 147 |
fSpin = rand.nextF() * 360; |
| 148 |
fMidpt = {bounds.centerX(), bounds.centerY()}; |
| 149 |
} |
| 150 |
|
| 151 |
//////////////////////////////////////////////////////////////////////////////////////////////////// |
| 152 |
// Text from paths with animated transformation matrices. |
| 153 |
class PathTextSlide::MovingGlyphAnimator : public PathTextSlide::GlyphAnimator { |
| 154 |
public: |
| 155 |
MovingGlyphAnimator(Glyph* glyphs) |
| 156 |
: GlyphAnimator(glyphs) |
| 157 |
, fFrontMatrices(new SkMatrix[kNumPaths]) |
| 158 |
, fBackMatrices(new SkMatrix[kNumPaths]) { |
| 159 |
} |
| 160 |
|
| 161 |
~MovingGlyphAnimator() override { |
| 162 |
fBackgroundAnimationTask.wait(); |
| 163 |
} |
| 164 |
|
| 165 |
void reset(SkRandom* rand, int screenWidth, int screenHeight) override { |
| 166 |
const SkScalar screensize = static_cast<SkScalar>(std::max(screenWidth, screenHeight)); |
| 167 |
|
| 168 |
for (auto& v : fVelocities) { |
| 169 |
for (SkScalar* d : {&v.fDx, &v.fDy}) { |
| 170 |
SkScalar t = pow(rand->nextF(), 3); |
| 171 |
*d = ((1 - t) / 60 + t / 10) * (rand->nextBool() ? screensize : -screensize); |
| 172 |
} |
| 173 |
|
| 174 |
SkScalar t = pow(rand->nextF(), 25); |
| 175 |
v.fDSpin = ((1 - t) * 360 / 7.5 + t * 360 / 1.5) * (rand->nextBool() ? 1 : -1); |
| 176 |
} |
| 177 |
|
| 178 |
// Get valid front data. |
| 179 |
fBackgroundAnimationTask.wait(); |
| 180 |
this->runAnimationTask(0, 0, screenWidth, screenHeight); |
| 181 |
std::copy_n(fBackMatrices.get(), kNumPaths, fFrontMatrices.get()); |
| 182 |
fLastTick = 0; |
| 183 |
} |
| 184 |
|
| 185 |
bool animate(double nanos, int screenWidth, int screenHeight) final { |
| 186 |
fBackgroundAnimationTask.wait(); |
| 187 |
this->swapAnimationBuffers(); |
| 188 |
|
| 189 |
const double tsec = 1e-9 * nanos; |
| 190 |
const double dt = fLastTick ? (1e-9 * nanos - fLastTick) : 0; |
| 191 |
fBackgroundAnimationTask.add(std::bind(&MovingGlyphAnimator::runAnimationTask, this, tsec, |
| 192 |
dt, screenWidth, screenHeight)); |
| 193 |
fLastTick = 1e-9 * nanos; |
| 194 |
return true; |
| 195 |
} |
| 196 |
|
| 197 |
/** |
| 198 |
* Called on a background thread. Here we can only modify fBackMatrices. |
| 199 |
*/ |
| 200 |
virtual void runAnimationTask(double t, double dt, int w, int h) { |
| 201 |
for (int idx = 0; idx < kNumPaths; ++idx) { |
| 202 |
Velocity* v = &fVelocities[idx]; |
| 203 |
Glyph* glyph = &fGlyphs[idx]; |
| 204 |
SkMatrix* backMatrix = &fBackMatrices[idx]; |
| 205 |
|
| 206 |
glyph->fPosition.fX += v->fDx * dt; |
| 207 |
if (glyph->fPosition.x() < 0) { |
| 208 |
glyph->fPosition.fX -= 2 * glyph->fPosition.x(); |
| 209 |
v->fDx = -v->fDx; |
| 210 |
} else if (glyph->fPosition.x() > w) { |
| 211 |
glyph->fPosition.fX -= 2 * (glyph->fPosition.x() - w); |
| 212 |
v->fDx = -v->fDx; |
| 213 |
} |
| 214 |
|
| 215 |
glyph->fPosition.fY += v->fDy * dt; |
| 216 |
if (glyph->fPosition.y() < 0) { |
| 217 |
glyph->fPosition.fY -= 2 * glyph->fPosition.y(); |
| 218 |
v->fDy = -v->fDy; |
| 219 |
} else if (glyph->fPosition.y() > h) { |
| 220 |
glyph->fPosition.fY -= 2 * (glyph->fPosition.y() - h); |
| 221 |
v->fDy = -v->fDy; |
| 222 |
} |
| 223 |
|
| 224 |
glyph->fSpin += v->fDSpin * dt; |
| 225 |
|
| 226 |
backMatrix->setTranslate(glyph->fPosition.x(), glyph->fPosition.y()); |
| 227 |
backMatrix->preScale(glyph->fZoom, glyph->fZoom); |
| 228 |
backMatrix->preRotate(glyph->fSpin); |
| 229 |
backMatrix->preTranslate(-glyph->fMidpt.x(), -glyph->fMidpt.y()); |
| 230 |
} |
| 231 |
} |
| 232 |
|
| 233 |
virtual void swapAnimationBuffers() { |
| 234 |
std::swap(fFrontMatrices, fBackMatrices); |
| 235 |
} |
| 236 |
|
| 237 |
void draw(SkCanvas* canvas) override { |
| 238 |
for (int i = 0; i < kNumPaths; ++i) { |
| 239 |
SkAutoCanvasRestore acr(canvas, true); |
| 240 |
canvas->concat(fFrontMatrices[i]); |
| 241 |
canvas->drawPath(fGlyphs[i].fPath, fGlyphs[i].fPaint); |
| 242 |
} |
| 243 |
} |
| 244 |
|
| 245 |
protected: |
| 246 |
struct Velocity { |
| 247 |
SkScalar fDx, fDy; |
| 248 |
SkScalar fDSpin; |
| 249 |
}; |
| 250 |
|
| 251 |
Velocity fVelocities[kNumPaths]; |
| 252 |
std::unique_ptr<SkMatrix[]> fFrontMatrices; |
| 253 |
std::unique_ptr<SkMatrix[]> fBackMatrices; |
| 254 |
SkTaskGroup fBackgroundAnimationTask; |
| 255 |
double fLastTick; |
| 256 |
}; |
| 257 |
|
| 258 |
|
| 259 |
//////////////////////////////////////////////////////////////////////////////////////////////////// |
| 260 |
// Text from paths with animated control points. |
| 261 |
class PathTextSlide::WavyGlyphAnimator : public PathTextSlide::MovingGlyphAnimator { |
| 262 |
public: |
| 263 |
WavyGlyphAnimator(Glyph* glyphs) |
| 264 |
: MovingGlyphAnimator(glyphs) |
| 265 |
, fFrontPaths(new SkPath[kNumPaths]) |
| 266 |
, fBackPaths(new SkPath[kNumPaths]) { |
| 267 |
} |
| 268 |
|
| 269 |
~WavyGlyphAnimator() override { |
| 270 |
fBackgroundAnimationTask.wait(); |
| 271 |
} |
| 272 |
|
| 273 |
void reset(SkRandom* rand, int screenWidth, int screenHeight) override { |
| 274 |
fWaves.reset(*rand, screenWidth, screenHeight); |
| 275 |
this->MovingGlyphAnimator::reset(rand, screenWidth, screenHeight); |
| 276 |
std::copy(fBackPaths.get(), fBackPaths.get() + kNumPaths, fFrontPaths.get()); |
| 277 |
} |
| 278 |
|
| 279 |
/** |
| 280 |
* Called on a background thread. Here we can only modify fBackPaths. |
| 281 |
*/ |
| 282 |
void runAnimationTask(double t, double dt, int width, int height) override { |
| 283 |
const float tsec = static_cast<float>(t); |
| 284 |
this->MovingGlyphAnimator::runAnimationTask(t, 0.5 * dt, width, height); |
| 285 |
|
| 286 |
for (int i = 0; i < kNumPaths; ++i) { |
| 287 |
const Glyph& glyph = fGlyphs[i]; |
| 288 |
const SkMatrix& backMatrix = fBackMatrices[i]; |
| 289 |
|
| 290 |
const skvx::float2 matrix[3] = { |
| 291 |
skvx::float2(backMatrix.getScaleX(), backMatrix.getSkewY()), |
| 292 |
skvx::float2(backMatrix.getSkewX(), backMatrix.getScaleY()), |
| 293 |
skvx::float2(backMatrix.getTranslateX(), backMatrix.getTranslateY()) |
| 294 |
}; |
| 295 |
|
| 296 |
SkPathBuilder builder(SkPathFillType::kEvenOdd); |
| 297 |
|
| 298 |
for (auto [verb, pts, w] : SkPathPriv::Iterate(glyph.fPath)) { |
| 299 |
switch (verb) { |
| 300 |
case SkPathVerb::kMove: { |
| 301 |
SkPoint pt = fWaves.apply(tsec, matrix, pts[0]); |
| 302 |
builder.moveTo(pt.x(), pt.y()); |
| 303 |
break; |
| 304 |
} |
| 305 |
case SkPathVerb::kLine: { |
| 306 |
SkPoint endpt = fWaves.apply(tsec, matrix, pts[1]); |
| 307 |
builder.lineTo(endpt.x(), endpt.y()); |
| 308 |
break; |
| 309 |
} |
| 310 |
case SkPathVerb::kQuad: { |
| 311 |
SkPoint controlPt = fWaves.apply(tsec, matrix, pts[1]); |
| 312 |
SkPoint endpt = fWaves.apply(tsec, matrix, pts[2]); |
| 313 |
builder.quadTo(controlPt.x(), controlPt.y(), endpt.x(), endpt.y()); |
| 314 |
break; |
| 315 |
} |
| 316 |
case SkPathVerb::kClose: { |
| 317 |
builder.close(); |
| 318 |
break; |
| 319 |
} |
| 320 |
case SkPathVerb::kCubic: |
| 321 |
case SkPathVerb::kConic: |
| 322 |
SK_ABORT("Unexpected path verb"); |
| 323 |
break; |
| 324 |
} |
| 325 |
} |
| 326 |
fBackPaths[i] = builder.detach(); |
| 327 |
} |
| 328 |
} |
| 329 |
|
| 330 |
void swapAnimationBuffers() override { |
| 331 |
this->MovingGlyphAnimator::swapAnimationBuffers(); |
| 332 |
std::swap(fFrontPaths, fBackPaths); |
| 333 |
} |
| 334 |
|
| 335 |
void draw(SkCanvas* canvas) override { |
| 336 |
for (int i = 0; i < kNumPaths; ++i) { |
| 337 |
canvas->drawPath(fFrontPaths[i], fGlyphs[i].fPaint); |
| 338 |
} |
| 339 |
} |
| 340 |
|
| 341 |
private: |
| 342 |
/** |
| 343 |
* Describes 4 stacked sine waves that can offset a point as a function of wall time. |
| 344 |
*/ |
| 345 |
class Waves { |
| 346 |
public: |
| 347 |
void reset(SkRandom& rand, int w, int h); |
| 348 |
SkPoint apply(float tsec, const skvx::float2 matrix[3], const SkPoint& pt) const; |
| 349 |
|
| 350 |
private: |
| 351 |
constexpr static double kAverageAngle = SK_ScalarPI / 8.0; |
| 352 |
constexpr static double kMaxOffsetAngle = SK_ScalarPI / 3.0; |
| 353 |
|
| 354 |
float fAmplitudes[4]; |
| 355 |
float fFrequencies[4]; |
| 356 |
float fDirsX[4]; |
| 357 |
float fDirsY[4]; |
| 358 |
float fSpeeds[4]; |
| 359 |
float fOffsets[4]; |
| 360 |
}; |
| 361 |
|
| 362 |
std::unique_ptr<SkPath[]> fFrontPaths; |
| 363 |
std::unique_ptr<SkPath[]> fBackPaths; |
| 364 |
Waves fWaves; |
| 365 |
}; |
| 366 |
|
| 367 |
void PathTextSlide::WavyGlyphAnimator::Waves::reset(SkRandom& rand, int w, int h) { |
| 368 |
const double pixelsPerMeter = 0.06 * std::max(w, h); |
| 369 |
const double medianWavelength = 8 * pixelsPerMeter; |
| 370 |
const double medianWaveAmplitude = 0.05 * 4 * pixelsPerMeter; |
| 371 |
const double gravity = 9.8 * pixelsPerMeter; |
| 372 |
|
| 373 |
for (int i = 0; i < 4; ++i) { |
| 374 |
const double offsetAngle = (rand.nextF() * 2 - 1) * kMaxOffsetAngle; |
| 375 |
const double intensity = pow(2, rand.nextF() * 2 - 1); |
| 376 |
const double wavelength = intensity * medianWavelength; |
| 377 |
|
| 378 |
fAmplitudes[i] = intensity * medianWaveAmplitude; |
| 379 |
fFrequencies[i] = 2 * SK_ScalarPI / wavelength; |
| 380 |
fDirsX[i] = cosf(kAverageAngle + offsetAngle); |
| 381 |
fDirsY[i] = sinf(kAverageAngle + offsetAngle); |
| 382 |
fSpeeds[i] = -sqrt(gravity * 2 * SK_ScalarPI / wavelength); |
| 383 |
fOffsets[i] = rand.nextF() * 2 * SK_ScalarPI; |
| 384 |
} |
| 385 |
} |
| 386 |
|
| 387 |
SkPoint PathTextSlide::WavyGlyphAnimator::Waves::apply(float tsec, const skvx::float2 matrix[3], |
| 388 |
const SkPoint& pt) const { |
| 389 |
constexpr static int kTablePeriod = 1 << 12; |
| 390 |
static float sin2table[kTablePeriod + 1]; |
| 391 |
static SkOnce initTable; |
| 392 |
initTable([]() { |
| 393 |
for (int i = 0; i <= kTablePeriod; ++i) { |
| 394 |
const double sintheta = sin(i * (SK_ScalarPI / kTablePeriod)); |
| 395 |
sin2table[i] = static_cast<float>(sintheta * sintheta - 0.5); |
| 396 |
} |
| 397 |
}); |
| 398 |
|
| 399 |
const auto amplitudes = skvx::float4::Load(fAmplitudes); |
| 400 |
const auto frequencies = skvx::float4::Load(fFrequencies); |
| 401 |
const auto dirsX = skvx::float4::Load(fDirsX); |
| 402 |
const auto dirsY = skvx::float4::Load(fDirsY); |
| 403 |
const auto speeds = skvx::float4::Load(fSpeeds); |
| 404 |
const auto offsets = skvx::float4::Load(fOffsets); |
| 405 |
|
| 406 |
float devicePt[2]; |
| 407 |
(matrix[0] * pt.x() + matrix[1] * pt.y() + matrix[2]).store(devicePt); |
| 408 |
|
| 409 |
const skvx::float4 t = abs(frequencies * (dirsX * devicePt[0] + dirsY * devicePt[1]) + |
| 410 |
speeds * tsec + offsets) * (float(kTablePeriod) / SK_ScalarPI); |
| 411 |
|
| 412 |
const skvx::int4 ipart = skvx::cast<int32_t>(t); |
| 413 |
const skvx::float4 fpart = t - skvx::cast<float>(ipart); |
| 414 |
|
| 415 |
int32_t indices[4]; |
| 416 |
(ipart & (kTablePeriod-1)).store(indices); |
| 417 |
|
| 418 |
const skvx::float4 left(sin2table[indices[0]], sin2table[indices[1]], |
| 419 |
sin2table[indices[2]], sin2table[indices[3]]); |
| 420 |
const skvx::float4 right(sin2table[indices[0] + 1], sin2table[indices[1] + 1], |
| 421 |
sin2table[indices[2] + 1], sin2table[indices[3] + 1]); |
| 422 |
const auto height = amplitudes * (left * (1.f - fpart) + right * fpart); |
| 423 |
|
| 424 |
auto dy = height * dirsY; |
| 425 |
auto dx = height * dirsX; |
| 426 |
|
| 427 |
float offsetY[4], offsetX[4]; |
| 428 |
(dy + skvx::shuffle<2,3,0,1>(dy)).store(offsetY); // accumulate. |
| 429 |
(dx + skvx::shuffle<2,3,0,1>(dx)).store(offsetX); |
| 430 |
|
| 431 |
return {devicePt[0] + offsetY[0] + offsetY[1], devicePt[1] - offsetX[0] - offsetX[1]}; |
| 432 |
} |
| 433 |
|
| 434 |
bool PathTextSlide::onChar(SkUnichar unichar) { |
| 435 |
switch (unichar) { |
| 436 |
case 'X': |
| 437 |
fDoClip = !fDoClip; |
| 438 |
return true; |
| 439 |
case 'S': |
| 440 |
fGlyphAnimator = std::make_unique<GlyphAnimator>(fGlyphs); |
| 441 |
fGlyphAnimator->reset(&fRand, fSize.width(), fSize.height()); |
| 442 |
return true; |
| 443 |
case 'M': |
| 444 |
fGlyphAnimator = std::make_unique<MovingGlyphAnimator>(fGlyphs); |
| 445 |
fGlyphAnimator->reset(&fRand, fSize.width(), fSize.height()); |
| 446 |
return true; |
| 447 |
case 'W': |
| 448 |
fGlyphAnimator = std::make_unique<WavyGlyphAnimator>(fGlyphs); |
| 449 |
fGlyphAnimator->reset(&fRand, fSize.width(), fSize.height()); |
| 450 |
return true; |
| 451 |
} |
| 452 |
return false; |
| 453 |
} |
| 454 |
|
| 455 |
//////////////////////////////////////////////////////////////////////////////////////////////////// |
| 456 |
|
| 457 |
DEF_SLIDE( return new PathTextSlide; ) |