2018-01-26 16:42:38 +00:00
|
|
|
|
/*
|
|
|
|
|
* 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
|
|
|
|
|
|
2019-04-23 17:05:21 +00:00
|
|
|
|
#include "include/core/SkTypes.h"
|
2018-01-26 16:42:38 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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
|
2018-02-06 02:13:28 +00:00
|
|
|
|
kIntersect, // A ∩ B A*B
|
2018-01-26 16:42:38 +00:00
|
|
|
|
kDifference, // A - B A*(1-B)
|
|
|
|
|
kReverseDifference, // B - A B*(1-A)
|
|
|
|
|
kXor, // A ⊕ B A+B-2*A*B
|
|
|
|
|
|
2018-05-21 15:56:57 +00:00
|
|
|
|
kLast = kXor,
|
2018-01-26 16:42:38 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|