Flutter Engine
The Flutter Engine
SkCubicClipper.h
Go to the documentation of this file.
1/*
2 * Copyright 2009 The Android Open Source Project
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8
9#ifndef SkCubicClipper_DEFINED
10#define SkCubicClipper_DEFINED
11
12#include "include/core/SkRect.h"
15
16struct SkPoint;
17
18/** This class is initialized with a clip rectangle, and then can be fed cubics,
19 which must already be monotonic in Y.
20
21 In the future, it might return a series of segments, allowing it to clip
22 also in X, to ensure that all segments fit in a finite coordinate system.
23 */
25public:
27
28 void setClip(const SkIRect& clip);
29
30 [[nodiscard]] bool clipCubic(const SkPoint src[4], SkPoint dst[4]);
31
32 [[nodiscard]] static bool ChopMonoAtY(const SkPoint pts[4], SkScalar y, SkScalar* t);
33private:
34 SkRect fClip;
35};
36
37#endif // SkCubicClipper_DEFINED
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
Definition: SkPath.cpp:3892
bool clipCubic(const SkPoint src[4], SkPoint dst[4])
void setClip(const SkIRect &clip)
static bool ChopMonoAtY(const SkPoint pts[4], SkScalar y, SkScalar *t)
float SkScalar
Definition: extension.cpp:12
double y
dst
Definition: cp.py:12
Definition: SkRect.h:32