skia2/docs/examples/skew_x_animated.cpp
Hal Canary 8800042f69 docs/examples: REG_FIDDLE_ANIMATED
I also added the `get_examples.py` script which pulls down new fiddles.

Change-Id: I953e461685a4d118ac4e425453e47d665a485aa2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/264570
Commit-Queue: Hal Canary <halcanary@skia.org>
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
2020-01-15 19:02:25 +00:00

20 lines
628 B
C++

// Copyright 2020 Google LLC.
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
#include "tools/fiddle/examples.h"
REG_FIDDLE_ANIMATED(skew_x_animated, 256, 256, false, 6, 6) {
void draw(SkCanvas* canvas) {
canvas->clear(SK_ColorWHITE);
SkMatrix matrix;
matrix.setAll(2, 5 * cos(6.28318548 * frame), 0,
0, 2, 128,
0, 0, 1);
SkPaint paint;
paint.setShader(
image->makeShader(
SkTileMode::kRepeat,
SkTileMode::kRepeat,
&matrix));
canvas->drawPaint(paint);
}
} // END FIDDLE