Flutter Engine
The Flutter Engine
Canvas_quickReject.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, 256, 256, true, 0) {
5void draw(SkCanvas* canvas) {
6 SkRect testRect = {30, 30, 120, 129 };
7 SkRect clipRect = {30, 130, 120, 230 };
8 canvas->save();
9 canvas->clipRect(clipRect);
10 SkDebugf("quickReject %s\n", canvas->quickReject(testRect) ? "true" : "false");
11 canvas->restore();
12 canvas->rotate(10);
13 canvas->clipRect(clipRect);
14 SkDebugf("quickReject %s\n", canvas->quickReject(testRect) ? "true" : "false");
15}
16} // END FIDDLE
REG_FIDDLE(Canvas_quickReject, 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 clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
Definition: SkCanvas.cpp:1361
void restore()
Definition: SkCanvas.cpp:461
void rotate(SkScalar degrees)
Definition: SkCanvas.cpp:1300
int save()
Definition: SkCanvas.cpp:447
bool quickReject(const SkRect &rect) const
Definition: SkCanvas.cpp:1557
clipRect(r.rect, r.opAA.op(), r.opAA.aa())) template<> void Draw