1cb93a386Sopenharmony_ci// Copyright 2019 Google LLC. 2cb93a386Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. 3cb93a386Sopenharmony_ci#include "tools/fiddle/examples.h" 4cb93a386Sopenharmony_ci// HASH=f99dcb00296d0c56b6c0e178e94b3534 5cb93a386Sopenharmony_ciREG_FIDDLE(Matrix_mapPoints, 256, 256, false, 0) { 6cb93a386Sopenharmony_civoid draw(SkCanvas* canvas) { 7cb93a386Sopenharmony_ci SkMatrix matrix; 8cb93a386Sopenharmony_ci matrix.reset(); 9cb93a386Sopenharmony_ci const int count = 4; 10cb93a386Sopenharmony_ci SkPoint src[count]; 11cb93a386Sopenharmony_ci matrix.mapRectToQuad(src, {40, 70, 180, 220} ); 12cb93a386Sopenharmony_ci SkPaint paint; 13cb93a386Sopenharmony_ci paint.setARGB(77, 23, 99, 154); 14cb93a386Sopenharmony_ci for (int i = 0; i < 5; ++i) { 15cb93a386Sopenharmony_ci SkPoint dst[count]; 16cb93a386Sopenharmony_ci matrix.mapPoints(dst, src, count); 17cb93a386Sopenharmony_ci canvas->drawPoints(SkCanvas::kPolygon_PointMode, count, dst, paint); 18cb93a386Sopenharmony_ci matrix.preRotate(35, 128, 128); 19cb93a386Sopenharmony_ci } 20cb93a386Sopenharmony_ci} 21cb93a386Sopenharmony_ci} // END FIDDLE 22