Flutter Engine
The Flutter Engine
Functions
Rect_equal_operator.cpp File Reference
#include "tools/fiddle/examples.h"

Go to the source code of this file.

Functions

 REG_FIDDLE (Rect_equal_operator, 256, 256, true, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Rect_equal_operator  ,
256  ,
256  ,
true  ,
 
)

Definition at line 4 of file Rect_equal_operator.cpp.

4 {
5void draw(SkCanvas* canvas) {
6 auto debugster = [](const SkRect& test) -> void {
7 SkRect negZero = {-0.0f, -0.0f, 2, 2};
8 SkDebugf("{%g, %g, %g, %g} %c= {%g, %g, %g, %g} %s numerically equal\n",
9 test.fLeft, test.fTop, test.fRight, test.fBottom,
10 test == negZero ? '=' : '!',
11 negZero.fLeft, negZero.fTop, negZero.fRight, negZero.fBottom,
12 (test.fLeft == negZero.fLeft && test.fTop == negZero.fTop &&
13 test.fRight == negZero.fRight && test.fBottom == negZero.fBottom) ?
14 "and are" : "yet are not");
15 };
16 SkRect tests[] = {{0, 0, 2, 2}, {-0, -0, 2, 2}, {0.0f, 0.0f, 2, 2}};
17 SkDebugf("tests are %s" "equal\n", tests[0] == tests[1] && tests[1] == tests[2] ? "" : "not ");
18 for (auto rect : tests) {
19 debugster(rect);
20 }
21}
22} // END FIDDLE
static BlurTest tests[]
Definition: BlurTest.cpp:84
#define test(name)
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
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350
SkScalar fBottom
larger y-axis bounds
Definition: extension.cpp:17
SkScalar fLeft
smaller x-axis bounds
Definition: extension.cpp:14
SkScalar fRight
larger x-axis bounds
Definition: extension.cpp:16
SkScalar fTop
smaller y-axis bounds
Definition: extension.cpp:15