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

Side by Side Diff: include/gpu/GrFragmentProcessor.h

Issue 1368423003: Use child processors to implement compose color filter. (Closed) Base URL: https://skia.googlesource.com/skia.git@upm
Patch Set: Address comments Created 5 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 unified diff | Download patch
« no previous file with comments | « include/effects/SkModeColorFilter.h ('k') | src/core/SkColorFilter.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 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef GrFragmentProcessor_DEFINED 8 #ifndef GrFragmentProcessor_DEFINED
9 #define GrFragmentProcessor_DEFINED 9 #define GrFragmentProcessor_DEFINED
10 10
(...skipping 23 matching lines...) Expand all
34 static const GrFragmentProcessor* MulOutputByInputAlpha(const GrFragmentProc essor*); 34 static const GrFragmentProcessor* MulOutputByInputAlpha(const GrFragmentProc essor*);
35 35
36 /** 36 /**
37 * Similar to the above but it modulates the output r,g,b of the child proc essor by the input 37 * Similar to the above but it modulates the output r,g,b of the child proc essor by the input
38 * rgb and then multiplies all the components by the input alpha. This effe ctively modulates 38 * rgb and then multiplies all the components by the input alpha. This effe ctively modulates
39 * the child processor's premul color by a unpremul'ed input and produces a premul output 39 * the child processor's premul color by a unpremul'ed input and produces a premul output
40 */ 40 */
41 static const GrFragmentProcessor* MulOutputByInputUnpremulColor(const GrFrag mentProcessor*); 41 static const GrFragmentProcessor* MulOutputByInputUnpremulColor(const GrFrag mentProcessor*);
42 42
43 /** 43 /**
44 * Returns a parent fragment processor that adopts the passed fragment proce ssor as a child. The 44 * Returns a parent fragment processor that adopts the passed fragment proc essor as a child.
45 * parent will ignore its input color and instead feed the passed in color a s input to the 45 * The parent will ignore its input color and instead feed the passed in co lor as input to the
46 * child. 46 * child.
47 */ 47 */
48 static const GrFragmentProcessor* OverrideInput(const GrFragmentProcessor*, GrColor); 48 static const GrFragmentProcessor* OverrideInput(const GrFragmentProcessor*, GrColor);
49 49
50 /**
51 * Returns a fragment processor that runs the passed in array of fragment pr ocessors in a
52 * series. The original input is passed to the first, the first's output is passed to the
53 * second, etc. The output of the returned processor is the output of the la st processor of the
54 * series.
55 */
56 static const GrFragmentProcessor* RunInSeries(const GrFragmentProcessor*[], int cnt);
57
50 GrFragmentProcessor() 58 GrFragmentProcessor()
51 : INHERITED() 59 : INHERITED()
52 , fUsesLocalCoords(false) 60 , fUsesLocalCoords(false)
53 , fNumTexturesExclChildren(0) 61 , fNumTexturesExclChildren(0)
54 , fNumTransformsExclChildren(0) {} 62 , fNumTransformsExclChildren(0) {}
55 63
56 ~GrFragmentProcessor() override; 64 ~GrFragmentProcessor() override;
57 65
58 GrGLFragmentProcessor* createGLInstance() const; 66 GrGLFragmentProcessor* createGLInstance() const;
59 67
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 int fNumTransformsExclChildren; 213 int fNumTransformsExclChildren;
206 214
207 // TODO: These must convert their processors to pending-execution refs when the parent is 215 // TODO: These must convert their processors to pending-execution refs when the parent is
208 // converted (do this automatically in GrProgramElement?). 216 // converted (do this automatically in GrProgramElement?).
209 SkTArray<const GrFragmentProcessor*, true> fChildProcessors; 217 SkTArray<const GrFragmentProcessor*, true> fChildProcessors;
210 218
211 typedef GrProcessor INHERITED; 219 typedef GrProcessor INHERITED;
212 }; 220 };
213 221
214 #endif 222 #endif
OLDNEW
« no previous file with comments | « include/effects/SkModeColorFilter.h ('k') | src/core/SkColorFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698