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=cf0da15f48aa54fd1889e7f913601710 5cb93a386Sopenharmony_ciREG_FIDDLE(Rect_setBounds, 256, 256, true, 0) { 6cb93a386Sopenharmony_civoid draw(SkCanvas* canvas) { 7cb93a386Sopenharmony_ci SkPoint points[] = {{3, 4}, {1, 2}, {5, 6}, {SK_ScalarNaN, 8}}; 8cb93a386Sopenharmony_ci for (int count = 0; count <= (int) SK_ARRAY_COUNT(points); ++count) { 9cb93a386Sopenharmony_ci SkRect rect; 10cb93a386Sopenharmony_ci rect.setBounds(points, count); 11cb93a386Sopenharmony_ci if (count > 0) { 12cb93a386Sopenharmony_ci SkDebugf("added: %3g, %g ", points[count - 1].fX, points[count - 1].fY); 13cb93a386Sopenharmony_ci } else { 14cb93a386Sopenharmony_ci SkDebugf("%14s", " "); 15cb93a386Sopenharmony_ci } 16cb93a386Sopenharmony_ci SkDebugf("count: %d rect: %g, %g, %g, %g\n", count, 17cb93a386Sopenharmony_ci rect.fLeft, rect.fTop, rect.fRight, rect.fBottom); 18cb93a386Sopenharmony_ci } 19cb93a386Sopenharmony_ci} 20cb93a386Sopenharmony_ci} // END FIDDLE 21