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=85be528a78945a6dc4f7dccb80a80746 5cb93a386Sopenharmony_ciREG_FIDDLE(Rect_contains, 256, 256, true, 0) { 6cb93a386Sopenharmony_civoid draw(SkCanvas* canvas) { 7cb93a386Sopenharmony_ci SkRect rect = { 30, 50, 40, 60 }; 8cb93a386Sopenharmony_ci SkPoint tests[] = { { 30, 50 }, { 39, 49 }, { 29, 59 } }; 9cb93a386Sopenharmony_ci for (auto contained : tests) { 10cb93a386Sopenharmony_ci SkDebugf("rect: (%g, %g, %g, %g) %s (%g, %g)\n", 11cb93a386Sopenharmony_ci rect.left(), rect.top(), rect.right(), rect.bottom(), 12cb93a386Sopenharmony_ci rect.contains(contained.x(), contained.y()) ? "contains" : "does not contain", 13cb93a386Sopenharmony_ci contained.x(), contained.y()); 14cb93a386Sopenharmony_ci } 15cb93a386Sopenharmony_ci} 16cb93a386Sopenharmony_ci} // END FIDDLE 17