Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Unified Diff: include/core/SkBlendMode.h

Issue 2396953002: Revert[8] "replace SkXfermode obj with SkBlendMode enum in paints" (Closed)
Patch Set: add tmp virtual to unroll legacy arithmodes Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gyp/skia_for_android_framework_defines.gypi ('k') | include/core/SkCanvas.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkBlendMode.h
diff --git a/include/core/SkBlendMode.h b/include/core/SkBlendMode.h
new file mode 100644
index 0000000000000000000000000000000000000000..eb3469f2560096c8c09f35b5fda2c413fd2917c8
--- /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
« no previous file with comments | « gyp/skia_for_android_framework_defines.gypi ('k') | include/core/SkCanvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698