gfx/skia/trunk/include/pathops/SkPathOps.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /*
     2  * Copyright 2012 Google Inc.
     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 #ifndef SkPathOps_DEFINED
     8 #define SkPathOps_DEFINED
    10 #include "SkPreConfig.h"
    12 class SkPath;
    14 // FIXME: move everything below into the SkPath class
    15 /**
    16   *  The logical operations that can be performed when combining two paths.
    17   */
    18 enum SkPathOp {
    19     kDifference_PathOp,         //!< subtract the op path from the first path
    20     kIntersect_PathOp,          //!< intersect the two paths
    21     kUnion_PathOp,              //!< union (inclusive-or) the two paths
    22     kXOR_PathOp,                //!< exclusive-or the two paths
    23     kReverseDifference_PathOp,  //!< subtract the first path from the op path
    24 };
    26 /** Set this path to the result of applying the Op to this path and the
    27     specified path: this = (this op operand).
    28     The resulting path will be constructed from non-overlapping contours.
    29     The curve order is reduced where possible so that cubics may be turned
    30     into quadratics, and quadratics maybe turned into lines.
    32     Returns true if operation was able to produce a result;
    33     otherwise, result is unmodified.
    35     @param one The first operand (for difference, the minuend)
    36     @param two The second operand (for difference, the subtrahend)
    37     @param result The product of the operands. The result may be one of the
    38                   inputs.
    39     @return True if operation succeeded.
    40   */
    41 bool SK_API Op(const SkPath& one, const SkPath& two, SkPathOp op, SkPath* result);
    43 /** Set this path to a set of non-overlapping contours that describe the
    44     same area as the original path.
    45     The curve order is reduced where possible so that cubics may
    46     be turned into quadratics, and quadratics maybe turned into lines.
    48     Returns true if operation was able to produce a result;
    49     otherwise, result is unmodified.
    51     @param path The path to simplify.
    52     @param result The simplified path. The result may be the input.
    53     @return True if simplification succeeded.
    54   */
    55 bool SK_API Simplify(const SkPath& path, SkPath* result);
    57 #endif

mercurial