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

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

Issue 1348583002: Make skpaint->grpaint flow work for composing draws (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove unused inheriteds to satisfy clang 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/gpu/GrColor.h ('k') | include/gpu/GrInvariantOutput.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 * 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 13 matching lines...) Expand all
24 class GrFragmentProcessor : public GrProcessor { 24 class GrFragmentProcessor : public GrProcessor {
25 public: 25 public:
26 /** 26 /**
27 * In many instances (e.g. SkShader::asFragmentProcessor() implementations) it is desirable to 27 * In many instances (e.g. SkShader::asFragmentProcessor() implementations) it is desirable to
28 * only consider the input color's alpha. However, there is a competing desi re to have reusable 28 * only consider the input color's alpha. However, there is a competing desi re to have reusable
29 * GrFragmentProcessor subclasses that can be used in other scenarios where the entire input 29 * GrFragmentProcessor subclasses that can be used in other scenarios where the entire input
30 * color is considered. This function exists to filter the input color and p ass it to a FP. It 30 * color is considered. This function exists to filter the input color and p ass it to a FP. It
31 * does so by returning a parent FP that multiplies the passed in FPs output by the parent's 31 * does so by returning a parent FP that multiplies the passed in FPs output by the parent's
32 * input alpha. The passed in FP will not receive an input color. 32 * input alpha. The passed in FP will not receive an input color.
33 */ 33 */
34 static const GrFragmentProcessor* MulOuputByInputAlpha(const GrFragmentProce ssor*); 34 static const GrFragmentProcessor* MulOutputByInputAlpha(const GrFragmentProc essor*);
35
36 /**
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
39 * the child processor's premul color by a unpremul'ed input and produces a premul output
40 */
41 static const GrFragmentProcessor* MulOutputByInputUnpremulColor(const GrFrag mentProcessor*);
42
43 /**
44 * Returns a parent fragment processor that adopts the passed fragment proce ssor as a child. The
45 * parent will ignore its input color and instead feed the passed in color a s input to the
46 * child.
47 */
48 static const GrFragmentProcessor* OverrideInput(const GrFragmentProcessor*, GrColor);
35 49
36 GrFragmentProcessor() 50 GrFragmentProcessor()
37 : INHERITED() 51 : INHERITED()
38 , fUsesLocalCoords(false) 52 , fUsesLocalCoords(false)
39 , fNumTexturesExclChildren(0) 53 , fNumTexturesExclChildren(0)
40 , fNumTransformsExclChildren(0) {} 54 , fNumTransformsExclChildren(0) {}
41 55
42 ~GrFragmentProcessor() override; 56 ~GrFragmentProcessor() override;
43 57
44 GrGLFragmentProcessor* createGLInstance() const; 58 GrGLFragmentProcessor* createGLInstance() const;
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 int fNumTransformsExclChildren; 205 int fNumTransformsExclChildren;
192 206
193 // TODO: These must convert their processors to pending-execution refs when the parent is 207 // TODO: These must convert their processors to pending-execution refs when the parent is
194 // converted (do this automatically in GrProgramElement?). 208 // converted (do this automatically in GrProgramElement?).
195 SkTArray<const GrFragmentProcessor*, true> fChildProcessors; 209 SkTArray<const GrFragmentProcessor*, true> fChildProcessors;
196 210
197 typedef GrProcessor INHERITED; 211 typedef GrProcessor INHERITED;
198 }; 212 };
199 213
200 #endif 214 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrColor.h ('k') | include/gpu/GrInvariantOutput.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698