Flutter Engine
The Flutter Engine
Rect_joinPossiblyEmptyRect.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.
4REG_FIDDLE(Rect_joinPossiblyEmptyRect, 256, 256, true, 0) {
5void draw(SkCanvas* canvas) {
6 SkRect rect = { 10, 100, 15, 0};
7 SkRect sorted = rect.makeSorted();
8 SkRect toJoin = { 50, 60, 55, 65 };
9 rect.joinPossiblyEmptyRect(toJoin);
10 SkDebugf("rect: %g, %g, %g, %g\n", rect.fLeft, rect.fTop, rect.fRight, rect.fBottom);
11 sorted.joinPossiblyEmptyRect(toJoin);
12 SkDebugf("sorted: %g, %g, %g, %g\n", sorted.fLeft, sorted.fTop, sorted.fRight, sorted.fBottom);
13}
14} // END FIDDLE
REG_FIDDLE(Rect_joinPossiblyEmptyRect, 256, 256, true, 0)
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
void joinPossiblyEmptyRect(const SkRect &r)
Definition: SkRect.h:1174
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