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