Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
docs
examples
Rect_equal_operator.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=c6c5b40cad7c3a839fdf576b380391a6
5
REG_FIDDLE
(Rect_equal_operator, 256, 256,
true
, 0) {
6
void
draw
(
SkCanvas
* canvas) {
7
auto
debugster = [](
const
SkRect
&
test
) ->
void
{
8
SkRect
negZero = {-0.0f, -0.0f, 2, 2};
9
SkDebugf
(
"{%g, %g, %g, %g} %c= {%g, %g, %g, %g} %s numerically equal\n"
,
10
test
.fLeft,
test
.fTop,
test
.fRight,
test
.fBottom,
11
test
== negZero ?
'='
:
'!'
,
12
negZero.
fLeft
, negZero.
fTop
, negZero.
fRight
, negZero.
fBottom
,
13
(
test
.fLeft == negZero.
fLeft
&&
test
.fTop == negZero.
fTop
&&
14
test
.fRight == negZero.
fRight
&&
test
.fBottom == negZero.
fBottom
) ?
15
"and are"
:
"yet are not"
);
16
};
17
SkRect
tests
[] = {{0, 0, 2, 2}, {-0, -0, 2, 2}, {0.0f, 0.0f, 2, 2}};
18
SkDebugf
(
"tests are %s"
"equal\n"
,
tests
[0] ==
tests
[1] &&
tests
[1] ==
tests
[2] ?
""
:
"not "
);
19
for
(
auto
rect :
tests
) {
20
debugster(rect);
21
}
22
}
23
}
// END FIDDLE
tests
static BlurTest tests[]
Definition
BlurTest.cpp:84
test
#define test(name)
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
test
SkRect
Definition
extension.cpp:13
SkRect::fBottom
SkScalar fBottom
larger y-axis bounds
Definition
extension.cpp:17
SkRect::fLeft
SkScalar fLeft
smaller x-axis bounds
Definition
extension.cpp:14
SkRect::fRight
SkScalar fRight
larger x-axis bounds
Definition
extension.cpp:16
SkRect::fTop
SkScalar fTop
smaller y-axis bounds
Definition
extension.cpp:15
Generated on Fri Apr 26 2024 06:15:51 for Flutter Engine by
1.9.8