michael@0: michael@0: /* michael@0: * Copyright 2009 The Android Open Source Project michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: michael@0: #ifndef SkCubicClipper_DEFINED michael@0: #define SkCubicClipper_DEFINED michael@0: michael@0: #include "SkPoint.h" michael@0: #include "SkRect.h" michael@0: michael@0: /** This class is initialized with a clip rectangle, and then can be fed cubics, michael@0: which must already be monotonic in Y. michael@0: michael@0: In the future, it might return a series of segments, allowing it to clip michael@0: also in X, to ensure that all segments fit in a finite coordinate system. michael@0: */ michael@0: class SkCubicClipper { michael@0: public: michael@0: SkCubicClipper(); michael@0: michael@0: void setClip(const SkIRect& clip); michael@0: michael@0: bool clipCubic(const SkPoint src[4], SkPoint dst[4]); michael@0: michael@0: private: michael@0: SkRect fClip; michael@0: }; michael@0: michael@0: #endif // SkCubicClipper_DEFINED