aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkBlendMode.h
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2016-10-05 14:03:43 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-10-05 18:31:17 +0000
commit2b2fc7db4f8a4a4d4a51d7eb4df6aa62e309928d (patch)
treecfa3f2de434cb5dcabf98720460105964f78bfc3 /include/core/SkBlendMode.h
parentdbb84c268bd09d2aa47256b5315a87f891583b6b (diff)
Revert[6] "replace SkXfermode obj with SkBlendMode enum in paints"
- perform version check in CreateProc for XfermodeImageFilter and ArithmeticImageFilter This reverts commit 3ed485f4249e17abb4b11f5018d03175fd1afb44. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2992 Change-Id: Ib4a154cdd5f5d1dcac921ef50d53b79a2d6a1be8 Reviewed-on: https://skia-review.googlesource.com/2992 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'include/core/SkBlendMode.h')
-rw-r--r--include/core/SkBlendMode.h51
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