Flutter Engine
The Flutter Engine
Canvas_quickReject_2.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(Canvas_quickReject_2, 256, 256, true, 0) {
5void draw(SkCanvas* canvas) {
6 SkPoint testPoints[] = {{30, 30}, {120, 30}, {120, 129} };
7 SkPoint clipPoints[] = {{30, 130}, {120, 130}, {120, 230} };
8 SkPath testPath, clipPath;
9 testPath.addPoly(testPoints, std::size(testPoints), true);
10 clipPath.addPoly(clipPoints, std::size(clipPoints), true);
11 canvas->save();
12 canvas->clipPath(clipPath);
13 SkDebugf("quickReject %s\n", canvas->quickReject(testPath) ? "true" : "false");
14 canvas->restore();
15 canvas->rotate(10);
16 canvas->clipPath(clipPath);
17 SkDebugf("quickReject %s\n", canvas->quickReject(testPath) ? "true" : "false");
18}
19} // END FIDDLE
REG_FIDDLE(Canvas_quickReject_2, 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
void restore()
Definition: SkCanvas.cpp:461
void rotate(SkScalar degrees)
Definition: SkCanvas.cpp:1300
void clipPath(const SkPath &path, SkClipOp op, bool doAntiAlias)
Definition: SkCanvas.cpp:1456
int save()
Definition: SkCanvas.cpp:447
bool quickReject(const SkRect &rect) const
Definition: SkCanvas.cpp:1557
Definition: SkPath.h:59
SkPath & addPoly(const SkPoint pts[], int count, bool close)
Definition: SkPath.cpp:890
clipPath(r.path, r.opAA.op(), r.opAA.aa())) DRAW(ClipRRect
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259