epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | |
turk@google.com | 4896f9e | 2009-03-02 20:00:00 +0000 | [diff] [blame] | 2 | /* |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 3 | * Copyright 2009 The Android Open Source Project |
turk@google.com | 4896f9e | 2009-03-02 20:00:00 +0000 | [diff] [blame] | 4 | * |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
turk@google.com | 4896f9e | 2009-03-02 20:00:00 +0000 | [diff] [blame] | 7 | */ |
| 8 | |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 9 | |
turk@google.com | 4896f9e | 2009-03-02 20:00:00 +0000 | [diff] [blame] | 10 | #ifndef SkCubicClipper_DEFINED |
| 11 | #define SkCubicClipper_DEFINED |
| 12 | |
| 13 | #include "SkPoint.h" |
| 14 | #include "SkRect.h" |
| 15 | |
| 16 | /** This class is initialized with a clip rectangle, and then can be fed cubics, |
| 17 | which must already be monotonic in Y. |
turk@google.com | 7d3a58a | 2009-03-04 01:33:35 +0000 | [diff] [blame] | 18 | |
turk@google.com | 4896f9e | 2009-03-02 20:00:00 +0000 | [diff] [blame] | 19 | In the future, it might return a series of segments, allowing it to clip |
| 20 | also in X, to ensure that all segments fit in a finite coordinate system. |
| 21 | */ |
| 22 | class SkCubicClipper { |
| 23 | public: |
| 24 | SkCubicClipper(); |
turk@google.com | 7d3a58a | 2009-03-04 01:33:35 +0000 | [diff] [blame] | 25 | |
turk@google.com | 4896f9e | 2009-03-02 20:00:00 +0000 | [diff] [blame] | 26 | void setClip(const SkIRect& clip); |
| 27 | |
| 28 | bool clipCubic(const SkPoint src[4], SkPoint dst[4]); |
| 29 | |
| 30 | private: |
| 31 | SkRect fClip; |
| 32 | }; |
| 33 | |
| 34 | #endif // SkCubicClipper_DEFINED |