| 1 |
/* |
| 2 |
* Copyright 2018 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 |
|
| 8 |
#ifndef SkCoverageMode_DEFINED |
| 9 |
#define SkCoverageMode_DEFINED |
| 10 |
|
| 11 |
/** |
| 12 |
* Describes geometric operations (ala SkRegion::Op) that can be applied to coverage bytes. |
| 13 |
* These can be thought of as variants of porter-duff (SkBlendMode) modes, but only applied |
| 14 |
* to the alpha channel. |
| 15 |
* |
| 16 |
* See SkMaskFilter for ways to use these when combining two different masks. |
| 17 |
*/ |
| 18 |
enum class SkCoverageMode { |
| 19 |
kUnion, // A ∪ B A+B-A*B |
| 20 |
kIntersect, // A ∩ B A*B |
| 21 |
kDifference, // A - B A*(1-B) |
| 22 |
kReverseDifference, // B - A B*(1-A) |
| 23 |
kXor, // A ⊕ B A+B-2*A*B |
| 24 |
|
| 25 |
kLast = kXor, |
| 26 |
}; |
| 27 |
|
| 28 |
#endif |