diff options
author | Mike Reed <reed@google.com> | 2016-10-03 12:57:32 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-10-03 17:17:10 +0000 |
commit | 0591897548c8fcb7d53cc94053e01702e58f1ac5 (patch) | |
tree | 099bf31c7bf4bd3062d2e7a8b4268a89f1fd61a2 /include/core/SkBlendMode.h | |
parent | a224bb7027f022cf78376cb7afa2fff83d59153e (diff) |
replace SkXfermode obj with SkBlendMode enum in paints
BUG=skia:5814
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2714
Change-Id: I4fb489ba6b3f77b458f7e4a99f79c7ad10859135
Reviewed-on: https://skia-review.googlesource.com/2714
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
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 |