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 SkCoverageModePriv_DEFINED 9#define SkCoverageModePriv_DEFINED 10 11#include "SkBlendMode.h" 12#include "SkCoverageMode.h" 13 14const SkBlendMode gUncorrelatedCoverageToBlend[] = { 15 SkBlendMode::kSrcOver, // or DstOver 16 SkBlendMode::kSrcIn, // or kDstIn 17 SkBlendMode::kSrcOut, 18 SkBlendMode::kDstOut, 19 SkBlendMode::kXor, 20}; 21 22#if 0 23// Experimental idea to extend to overlap types 24 25Master calculation = X(S,D) + Y(S,D) + Z(S,D) 26 27enum class SkCoverageOverlap { 28 // X Y Z 29 kUncorrelated, // S*D S*(1-D) D*(1-S) 30 kConjoint, // min(S,D) max(S-D,0) max(D-S,0) 31 kDisjoint, // max(S+D-1,0) min(S,1-D) min(D,1-S) 32 33 kLast = kDisjoint 34}; 35 36// The coverage modes each have a set of coefficients to be applied to the general equation (above) 37// 38// e.g. 39// kXor+conjoint = max(S-D,0) + max(D-S,0) ==> abs(D-S) 40// 41kUnion, // 1,1,1 42kIntersect, // 1,0,0 43kDifference, // 0,1,0 44kReverseDifference, // 0,0,1 45kXor, // 0,1,1 46 47#endif 48 49#endif 50