diff -r 000000000000 -r 6474c204b198 gfx/skia/trunk/src/core/SkCubicClipper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gfx/skia/trunk/src/core/SkCubicClipper.h Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,34 @@ + +/* + * Copyright 2009 The Android Open Source Project + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + + +#ifndef SkCubicClipper_DEFINED +#define SkCubicClipper_DEFINED + +#include "SkPoint.h" +#include "SkRect.h" + +/** This class is initialized with a clip rectangle, and then can be fed cubics, + which must already be monotonic in Y. + + In the future, it might return a series of segments, allowing it to clip + also in X, to ensure that all segments fit in a finite coordinate system. + */ +class SkCubicClipper { +public: + SkCubicClipper(); + + void setClip(const SkIRect& clip); + + bool clipCubic(const SkPoint src[4], SkPoint dst[4]); + +private: + SkRect fClip; +}; + +#endif // SkCubicClipper_DEFINED