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

Side by Side Diff: include/core/SkXfermode.h

Issue 12393049: Added support for non-separable blending modes and fixed scalar issue (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gm/xfermodes.cpp ('k') | src/core/SkXfermode.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkXfermode_DEFINED 10 #ifndef SkXfermode_DEFINED
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 kDst_Mode, //!< [Da, Dc] 92 kDst_Mode, //!< [Da, Dc]
93 kSrcOver_Mode, //!< [Sa + Da - Sa*Da, Rc = Sc + (1 - Sa)*Dc] 93 kSrcOver_Mode, //!< [Sa + Da - Sa*Da, Rc = Sc + (1 - Sa)*Dc]
94 kDstOver_Mode, //!< [Sa + Da - Sa*Da, Rc = Dc + (1 - Da)*Sc] 94 kDstOver_Mode, //!< [Sa + Da - Sa*Da, Rc = Dc + (1 - Da)*Sc]
95 kSrcIn_Mode, //!< [Sa * Da, Sc * Da] 95 kSrcIn_Mode, //!< [Sa * Da, Sc * Da]
96 kDstIn_Mode, //!< [Sa * Da, Sa * Dc] 96 kDstIn_Mode, //!< [Sa * Da, Sa * Dc]
97 kSrcOut_Mode, //!< [Sa * (1 - Da), Sc * (1 - Da)] 97 kSrcOut_Mode, //!< [Sa * (1 - Da), Sc * (1 - Da)]
98 kDstOut_Mode, //!< [Da * (1 - Sa), Dc * (1 - Sa)] 98 kDstOut_Mode, //!< [Da * (1 - Sa), Dc * (1 - Sa)]
99 kSrcATop_Mode, //!< [Da, Sc * Da + (1 - Sa) * Dc] 99 kSrcATop_Mode, //!< [Da, Sc * Da + (1 - Sa) * Dc]
100 kDstATop_Mode, //!< [Sa, Sa * Dc + Sc * (1 - Da)] 100 kDstATop_Mode, //!< [Sa, Sa * Dc + Sc * (1 - Da)]
101 kXor_Mode, //!< [Sa + Da - 2 * Sa * Da, Sc * (1 - Da) + (1 - Sa) * Dc] 101 kXor_Mode, //!< [Sa + Da - 2 * Sa * Da, Sc * (1 - Da) + (1 - Sa) * Dc]
102 102 kPlus_Mode, //!< [Sa + Da, Sc + Dc]
103 // all remaining modes are defined in the SVG Compositing standard
104 // http://www.w3.org/TR/2009/WD-SVGCompositing-20090430/
105 kPlus_Mode,
106 kModulate_Mode, // multiplies all components (= alpha and color) 103 kModulate_Mode, // multiplies all components (= alpha and color)
107 104
108 // all above modes can be expressed as pair of src/dst Coeffs 105 // all above modes can be expressed as pair of src/dst Coeffs
109 kCoeffModesCnt, 106 kCoeffModesCnt,
110 107
108 // Following blend modes are defined in the CSS Compositing standard:
109 // https://dvcs.w3.org/hg/FXTF/rawfile/tip/compositing/index.html#blendi ng
111 kScreen_Mode = kCoeffModesCnt, 110 kScreen_Mode = kCoeffModesCnt,
112 kOverlay_Mode, 111 kOverlay_Mode,
113 kDarken_Mode, 112 kDarken_Mode,
114 kLighten_Mode, 113 kLighten_Mode,
115 kColorDodge_Mode, 114 kColorDodge_Mode,
116 kColorBurn_Mode, 115 kColorBurn_Mode,
117 kHardLight_Mode, 116 kHardLight_Mode,
118 kSoftLight_Mode, 117 kSoftLight_Mode,
119 kDifference_Mode, 118 kDifference_Mode,
120 kExclusion_Mode, 119 kExclusion_Mode,
121 kMultiply_Mode, 120 kMultiply_Mode,
122 121
123 kLastMode = kMultiply_Mode 122 kHue_Mode,
123 kSaturation_Mode,
124 kColor_Mode,
125 kLuminosity_Mode,
126
127 kLastMode = kLuminosity_Mode
124 }; 128 };
125 129
126 /** 130 /**
127 * If the xfermode is one of the modes in the Mode enum, then asMode() 131 * If the xfermode is one of the modes in the Mode enum, then asMode()
128 * returns true and sets (if not null) mode accordingly. Otherwise it 132 * returns true and sets (if not null) mode accordingly. Otherwise it
129 * returns false and ignores the mode parameter. 133 * returns false and ignores the mode parameter.
130 */ 134 */
131 virtual bool asMode(Mode* mode) const; 135 virtual bool asMode(Mode* mode) const;
132 136
133 /** 137 /**
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 fProc = proc; 236 fProc = proc;
233 } 237 }
234 238
235 private: 239 private:
236 SkXfermodeProc fProc; 240 SkXfermodeProc fProc;
237 241
238 typedef SkXfermode INHERITED; 242 typedef SkXfermode INHERITED;
239 }; 243 };
240 244
241 #endif 245 #endif
OLDNEW
« no previous file with comments | « gm/xfermodes.cpp ('k') | src/core/SkXfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698