Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 183 * not representable as a pair of Coeffs, return false and ignore the | 183 * not representable as a pair of Coeffs, return false and ignore the |
| 184 * src and dst parameters. | 184 * src and dst parameters. |
| 185 */ | 185 */ |
| 186 static bool ModeAsCoeff(Mode mode, Coeff* src, Coeff* dst); | 186 static bool ModeAsCoeff(Mode mode, Coeff* src, Coeff* dst); |
| 187 | 187 |
| 188 SK_ATTR_DEPRECATED("use AsMode(...)") | 188 SK_ATTR_DEPRECATED("use AsMode(...)") |
| 189 static bool IsMode(const SkXfermode* xfer, Mode* mode) { | 189 static bool IsMode(const SkXfermode* xfer, Mode* mode) { |
| 190 return AsMode(xfer, mode); | 190 return AsMode(xfer, mode); |
| 191 } | 191 } |
| 192 | 192 |
| 193 /** A subclass may implement this factory function to work with the GPU back end. It is legal | 193 /** A subclass may implement this factory function to work with the GPU back end. It is legal |
|
bsalomon
2015/01/14 15:18:12
Let's clean this up a bit.
"Implemented by a subc
| |
| 194 to call this with all params NULL to simply test the return value. If ef fect is non-NULL | 194 to call this with all params NULL to simply test the return value. If ef fect is non-NULL |
| 195 then the xfermode may optionally allocate an effect to return and the ca ller as *effect. | 195 then the xfermode may optionally allocate an effect to return and the ca ller as *effect. |
| 196 The caller will install it and own a ref to it. Since the xfermode may o r may not assign | 196 The caller will install it and own a ref to it. Since the xfermode may o r may not assign |
| 197 *effect, the caller should set *effect to NULL beforehand. background sp ecifies the | 197 *effect, the caller should set *effect to NULL beforehand. background sp ecifies the |
| 198 texture to use as the background for compositing, and should be accessed in the effect's | 198 texture to use as the background for compositing, and should be accessed in the effect's |
| 199 fragment shader. If NULL, the effect should request access to destinatio n color | 199 fragment shader. If NULL, the effect should request access to destinatio n color |
| 200 (setWillReadDstColor()), and use that in the fragment shader (builder->d stColor()). | 200 (setWillReadDstColor()), and use that in the fragment shader (builder->d stColor()). |
| 201 */ | 201 */ |
| 202 // TODO: Once all custom xp's have been created the background parameter wil l be required here. | 202 virtual bool asFragmentProcessor(GrFragmentProcessor**, GrTexture* backgroun d) const; |
| 203 // We will always use the XPFactory if there is no background texture and the fragment if | |
| 204 // there is one. | |
| 205 virtual bool asFragmentProcessor(GrFragmentProcessor**, GrTexture* backgroun d = NULL) const; | |
| 206 | 203 |
| 207 /** A subclass may implement this factory function to work with the GPU back end. It is legal | 204 /** A subclass may implement this factory function to work with the GPU back end. It is legal |
| 208 to call this with xpf NULL to simply test the return value. If xpf is no n-NULL then the | 205 to call this with xpf NULL to simply test the return value. If xpf is no n-NULL then the |
| 209 xfermode may optionally allocate a factory to return to the caller as *x pf. The caller | 206 xfermode may optionally allocate a factory to return to the caller as *x pf. The caller |
| 210 will install it and own a ref to it. Since the xfermode may or may not a ssign *xpf, the | 207 will install it and own a ref to it. Since the xfermode may or may not a ssign *xpf, the |
| 211 caller should set *xpf to NULL beforehand. XP's cannot use a background texture since they | 208 caller should set *xpf to NULL beforehand. XP's cannot use a background texture since they |
| 212 have no coord transforms. | 209 have no coord transforms. |
| 213 */ | 210 */ |
| 214 virtual bool asXPFactory(GrXPFactory** xpf) const; | 211 virtual bool asXPFactory(GrXPFactory** xpf) const; |
| 215 | 212 |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 240 | 237 |
| 241 private: | 238 private: |
| 242 enum { | 239 enum { |
| 243 kModeCount = kLastMode + 1 | 240 kModeCount = kLastMode + 1 |
| 244 }; | 241 }; |
| 245 | 242 |
| 246 typedef SkFlattenable INHERITED; | 243 typedef SkFlattenable INHERITED; |
| 247 }; | 244 }; |
| 248 | 245 |
| 249 #endif | 246 #endif |
| OLD | NEW |