Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
IRect_size.cpp
Go to the documentation of this file.
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.
4// HASH=8b3224641cb3053a7b8a5798b6cd1cf6
5REG_FIDDLE(IRect_size, 256, 256, true, 0) {
6void draw(SkCanvas* canvas) {
7 auto debugster = [](const char* prefix, const SkIRect& rect) -> void {
8 SkISize size = rect.size();
9 SkDebugf("%s ", prefix);
10 SkDebugf("rect: %d, %d, %d, %d ", rect.left(), rect.top(), rect.right(), rect.bottom());
11 SkDebugf("size: %d, %d\n", size.width(), size.height());
12 };
13 SkIRect rect = {20, 30, 40, 50};
14 debugster("original", rect);
15 rect.offset(20, 20);
16 debugster(" offset", rect);
17 rect.outset(20, 20);
18 debugster(" outset", rect);
19}
20} // END FIDDLE
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition aaclip.cpp:27
#define REG_FIDDLE(NAME, W, H, TEXT, I)
Definition examples.h:60