1 // Copyright 2019 Google LLC.
2 // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
3 #include "tools/fiddle/examples.h"
4 REG_FIDDLE(Matrix_setPerspY, 256, 256, false, 4) {
draw(SkCanvas * canvas)5 void draw(SkCanvas* canvas) {
6 for (SkScalar perspX : { -.003f, 0.f, .003f, .012f } ) {
7 SkMatrix matrix;
8 matrix.setIdentity();
9 matrix.setPerspY(perspX);
10 canvas->save();
11 canvas->concat(matrix);
12 canvas->drawImage(image, 0, 0);
13 canvas->restore();
14 canvas->translate(64, 64);
15 }
16 }
17 } // END FIDDLE
18