Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
docs
examples
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.
3
#include "
tools/fiddle/examples.h
"
4
// HASH=8b3224641cb3053a7b8a5798b6cd1cf6
5
REG_FIDDLE
(IRect_size, 256, 256,
true
, 0) {
6
void
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
SkDebugf
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
draw
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition
aaclip.cpp:27
SkCanvas
Definition
SkCanvas.h:106
examples.h
REG_FIDDLE
#define REG_FIDDLE(NAME, W, H, TEXT, I)
Definition
examples.h:60
SkIRect
Definition
SkRect.h:32
SkISize
Definition
SkSize.h:16
Generated on Fri Apr 26 2024 06:15:42 for Flutter Engine by
1.9.8