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=8b3224641cb3053a7b8a5798b6cd1cf6 5cb93a386Sopenharmony_ciREG_FIDDLE(IRect_size, 256, 256, true, 0) { 6cb93a386Sopenharmony_civoid draw(SkCanvas* canvas) { 7cb93a386Sopenharmony_ci auto debugster = [](const char* prefix, const SkIRect& rect) -> void { 8cb93a386Sopenharmony_ci SkISize size = rect.size(); 9cb93a386Sopenharmony_ci SkDebugf("%s ", prefix); 10cb93a386Sopenharmony_ci SkDebugf("rect: %d, %d, %d, %d ", rect.left(), rect.top(), rect.right(), rect.bottom()); 11cb93a386Sopenharmony_ci SkDebugf("size: %d, %d\n", size.width(), size.height()); 12cb93a386Sopenharmony_ci }; 13cb93a386Sopenharmony_ci SkIRect rect = {20, 30, 40, 50}; 14cb93a386Sopenharmony_ci debugster("original", rect); 15cb93a386Sopenharmony_ci rect.offset(20, 20); 16cb93a386Sopenharmony_ci debugster(" offset", rect); 17cb93a386Sopenharmony_ci rect.outset(20, 20); 18cb93a386Sopenharmony_ci debugster(" outset", rect); 19cb93a386Sopenharmony_ci} 20cb93a386Sopenharmony_ci} // END FIDDLE 21