diff options
author | reed <reed@google.com> | 2016-10-05 17:33:02 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-10-05 17:33:03 -0700 |
commit | 374772bd61951f01bf84fe17bf53d8867681c9ae (patch) | |
tree | ade94be090be12f7503fd35e77c4dae2dc1f0a47 /include/core/SkBlendMode.h | |
parent | 61c21cdcc31081a1bd4a3a7480b482d135f7df33 (diff) |
Revert[8] "replace SkXfermode obj with SkBlendMode enum in paints"
This reverts commit c245574ba3d0e2ade6c94b2812de3baa383bf4c4.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2396953002
TBR=
Review-Url: https://codereview.chromium.org/2396953002
Diffstat (limited to 'include/core/SkBlendMode.h')
-rw-r--r-- | include/core/SkBlendMode.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/include/core/SkBlendMode.h b/include/core/SkBlendMode.h new file mode 100644 index 0000000000..eb3469f256 --- /dev/null +++ b/include/core/SkBlendMode.h @@ -0,0 +1,51 @@ +/* + * Copyright 2016 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#ifndef SkBlendMode_DEFINED +#define SkBlendMode_DEFINED + +enum class SkBlendMode { + kClear, //!< [0, 0] + kSrc, //!< [Sa, Sc] + kDst, //!< [Da, Dc] + kSrcOver, //!< [Sa + Da * (1 - Sa), Sc + Dc * (1 - Sa)] + kDstOver, //!< [Da + Sa * (1 - Da), Dc + Sc * (1 - Da)] + kSrcIn, //!< [Sa * Da, Sc * Da] + kDstIn, //!< [Da * Sa, Dc * Sa] + kSrcOut, //!< [Sa * (1 - Da), Sc * (1 - Da)] + kDstOut, //!< [Da * (1 - Sa), Dc * (1 - Sa)] + kSrcATop, //!< [Da, Sc * Da + Dc * (1 - Sa)] + kDstATop, //!< [Sa, Dc * Sa + Sc * (1 - Da)] + kXor, //!< [Sa + Da - 2 * Sa * Da, Sc * (1 - Da) + Dc * (1 - Sa)] + kPlus, //!< [Sa + Da, Sc + Dc] + kModulate, // multiplies all components (= alpha and color) + + // Following blend modes are defined in the CSS Compositing standard: + // https://dvcs.w3.org/hg/FXTF/rawfile/tip/compositing/index.html#blending + kScreen, + kLastCoeffMode = kScreen, + + kOverlay, + kDarken, + kLighten, + kColorDodge, + kColorBurn, + kHardLight, + kSoftLight, + kDifference, + kExclusion, + kMultiply, + kLastSeparableMode = kMultiply, + + kHue, + kSaturation, + kColor, + kLuminosity, + kLastMode = kLuminosity +}; + +#endif |