Flutter Engine
The Flutter Engine
Region_computeRegionComplexity.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(Region_computeRegionComplexity, 256, 256, true, 0) {
5void draw(SkCanvas* canvas) {
6 auto debugster = [](const char* label, const SkRegion& region) -> void {
7 SkDebugf("%s: region complexity %d\n", label, region.computeRegionComplexity());
8 };
10 debugster("initial", region);
11 region.setRect({1, 2, 3, 4});
12 debugster("set rect", region);
13 region.op({2, 3, 4, 5}, SkRegion::kUnion_Op);
14 debugster("op rect", region);
15}
16} // END FIDDLE
REG_FIDDLE(Region_computeRegionComplexity, 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
@ kUnion_Op
target unioned with operand
Definition: SkRegion.h:369
int computeRegionComplexity() const
Definition: SkRegion.cpp:176
bool op(const SkIRect &rect, Op op)
Definition: SkRegion.h:384
bool setRect(const SkIRect &rect)
Definition: SkRegion.cpp:192
ClipOpAndAA opAA SkRegion region
Definition: SkRecords.h:238