| * 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 SkCoverageModePriv_DEFINED |
| #define SkCoverageModePriv_DEFINED |
| #include "include/core/SkBlendMode.h" |
| #include "include/core/SkCoverageMode.h" |
| SkBlendMode SkUncorrelatedCoverageModeToBlendMode(SkCoverageMode); |
| // Experimental idea to extend to overlap types |
| Master calculation = X(S,D) + Y(S,D) + Z(S,D) |
| enum class SkCoverageOverlap { |
| kUncorrelated, // S*D S*(1-D) D*(1-S) |
| kConjoint, // min(S,D) max(S-D,0) max(D-S,0) |
| kDisjoint, // max(S+D-1,0) min(S,1-D) min(D,1-S) |
| // The coverage modes each have a set of coefficients to be applied to the general equation (above) |
| // kXor+conjoint = max(S-D,0) + max(D-S,0) ==> abs(D-S) |
| kReverseDifference, // 0,0,1 |