aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkCoverageMode.h
blob: 856b767c28b25297a107a090e66b4348cc1befac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
 * Copyright 2018 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkCoverageMode_DEFINED
#define SkCoverageMode_DEFINED

#include "SkTypes.h"

/**
 *  Describes geometric operations (ala SkRegion::Op) that can be applied to coverage bytes.
 *  These can be thought of as variants of porter-duff (SkBlendMode) modes, but only applied
 *  to the alpha channel.
 *
 *  See SkMaskFilter for ways to use these when combining two different masks.
 */
enum class SkCoverageMode {
    kUnion,             // A ∪ B    A+B-A*B
    kIntersect,         // A ∩ B    A*B
    kDifference,        // A - B    A*(1-B)
    kReverseDifference, // B - A    B*(1-A)
    kXor,               // A ⊕ B    A+B-2*A*B

    kLast = kXor,
};

#endif