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

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

Issue 1455273006: Make specialized SrcOver XPFactory (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « no previous file | include/gpu/effects/GrCustomXfermode.h » ('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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 */ 202 */
203 virtual bool asFragmentProcessor(const GrFragmentProcessor** output, 203 virtual bool asFragmentProcessor(const GrFragmentProcessor** output,
204 const GrFragmentProcessor* dst) const; 204 const GrFragmentProcessor* dst) const;
205 205
206 /** A subclass may implement this factory function to work with the GPU back end. It is legal 206 /** A subclass may implement this factory function to work with the GPU back end. It is legal
207 to call this with xpf NULL to simply test the return value. If xpf is no n-NULL then the 207 to call this with xpf NULL to simply test the return value. If xpf is no n-NULL then the
208 xfermode may optionally allocate a factory to return to the caller as *x pf. The caller 208 xfermode may optionally allocate a factory to return to the caller as *x pf. The caller
209 will install it and own a ref to it. Since the xfermode may or may not a ssign *xpf, the 209 will install it and own a ref to it. Since the xfermode may or may not a ssign *xpf, the
210 caller should set *xpf to NULL beforehand. XferProcessors cannot use a b ackground texture. 210 caller should set *xpf to NULL beforehand. XferProcessors cannot use a b ackground texture.
211 */ 211 */
212 virtual bool asXPFactory(GrXPFactory** xpf) const; 212 virtual bool asXPFactory(const GrXPFactory** xpf) const;
213 213
214 /** Returns true if the xfermode can be expressed as an xfer processor facto ry (xpFactory). 214 /** Returns true if the xfermode can be expressed as an xfer processor facto ry (xpFactory).
215 This helper calls the asXPFactory() virtual. If the xfermode is NULL, it is treated as 215 This helper calls the asXPFactory() virtual. If the xfermode is NULL, it is treated as
216 kSrcOver_Mode. It is legal to call this with xpf param NULL to simply te st the return value. 216 kSrcOver_Mode. It is legal to call this with xpf param NULL to simply te st the return value.
217 */ 217 */
218 static bool AsXPFactory(SkXfermode*, GrXPFactory**); 218 static bool AsXPFactory(SkXfermode*, const GrXPFactory**);
219 219
220 SK_TO_STRING_PUREVIRT() 220 SK_TO_STRING_PUREVIRT()
221 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() 221 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()
222 SK_DEFINE_FLATTENABLE_TYPE(SkXfermode) 222 SK_DEFINE_FLATTENABLE_TYPE(SkXfermode)
223 223
224 protected: 224 protected:
225 SkXfermode() {} 225 SkXfermode() {}
226 /** The default implementation of xfer32/xfer16/xferA8 in turn call this 226 /** The default implementation of xfer32/xfer16/xferA8 in turn call this
227 method, 1 color at a time (upscaled to a SkPMColor). The default 227 method, 1 color at a time (upscaled to a SkPMColor). The default
228 implementation of this method just returns dst. If performance is 228 implementation of this method just returns dst. If performance is
229 important, your subclass should override xfer32/xfer16/xferA8 directly. 229 important, your subclass should override xfer32/xfer16/xferA8 directly.
230 230
231 This method will not be called directly by the client, so it need not 231 This method will not be called directly by the client, so it need not
232 be implemented if your subclass has overridden xfer32/xfer16/xferA8 232 be implemented if your subclass has overridden xfer32/xfer16/xferA8
233 */ 233 */
234 virtual SkPMColor xferColor(SkPMColor src, SkPMColor dst) const; 234 virtual SkPMColor xferColor(SkPMColor src, SkPMColor dst) const;
235 235
236 private: 236 private:
237 enum { 237 enum {
238 kModeCount = kLastMode + 1 238 kModeCount = kLastMode + 1
239 }; 239 };
240 240
241 typedef SkFlattenable INHERITED; 241 typedef SkFlattenable INHERITED;
242 }; 242 };
243 243
244 #endif 244 #endif
OLDNEW
« no previous file with comments | « no previous file | include/gpu/effects/GrCustomXfermode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698