gfx/skia/trunk/src/core/SkCubicClipper.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/skia/trunk/src/core/SkCubicClipper.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,34 @@
     1.4 +
     1.5 +/*
     1.6 + * Copyright 2009 The Android Open Source Project
     1.7 + *
     1.8 + * Use of this source code is governed by a BSD-style license that can be
     1.9 + * found in the LICENSE file.
    1.10 + */
    1.11 +
    1.12 +
    1.13 +#ifndef SkCubicClipper_DEFINED
    1.14 +#define SkCubicClipper_DEFINED
    1.15 +
    1.16 +#include "SkPoint.h"
    1.17 +#include "SkRect.h"
    1.18 +
    1.19 +/** This class is initialized with a clip rectangle, and then can be fed cubics,
    1.20 +    which must already be monotonic in Y.
    1.21 +
    1.22 +    In the future, it might return a series of segments, allowing it to clip
    1.23 +    also in X, to ensure that all segments fit in a finite coordinate system.
    1.24 + */
    1.25 +class SkCubicClipper {
    1.26 +public:
    1.27 +    SkCubicClipper();
    1.28 +
    1.29 +    void setClip(const SkIRect& clip);
    1.30 +
    1.31 +    bool clipCubic(const SkPoint src[4], SkPoint dst[4]);
    1.32 +
    1.33 +private:
    1.34 +    SkRect      fClip;
    1.35 +};
    1.36 +
    1.37 +#endif  // SkCubicClipper_DEFINED

mercurial