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

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

Issue 1316513002: Change SkShader;asFragmentProcessor signature to no longer take skpaint\grcolor* (Closed) Base URL: https://skia.googlesource.com/skia.git@things
Patch Set: Address comments, fix roll(?) Created 5 years, 3 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/SkPerlinNoiseShader.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
11 #include "GrProcessor.h" 11 #include "GrProcessor.h"
12 12
13 class GrCoordTransform; 13 class GrCoordTransform;
14 class GrGLSLCaps; 14 class GrGLSLCaps;
15 class GrGLFragmentProcessor; 15 class GrGLFragmentProcessor;
16 class GrInvariantOutput;
16 class GrProcessorKeyBuilder; 17 class GrProcessorKeyBuilder;
17 18
18 /** Provides custom fragment shader code. Fragment processors receive an input c olor (vec4f) and 19 /** Provides custom fragment shader code. Fragment processors receive an input c olor (vec4f) and
19 produce an output color. They may reference textures and uniforms. They may use 20 produce an output color. They may reference textures and uniforms. They may use
20 GrCoordTransforms to receive a transformation of the local coordinates that map from local space 21 GrCoordTransforms to receive a transformation of the local coordinates that map from local space
21 to the fragment being processed. 22 to the fragment being processed.
22 */ 23 */
23 class GrFragmentProcessor : public GrProcessor { 24 class GrFragmentProcessor : public GrProcessor {
24 public: 25 public:
25 GrFragmentProcessor() 26 GrFragmentProcessor()
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 bool isEqual(const GrFragmentProcessor& that, bool ignoreCoordTransforms) co nst; 76 bool isEqual(const GrFragmentProcessor& that, bool ignoreCoordTransforms) co nst;
76 77
77 /** 78 /**
78 * This function is used to perform optimizations. When called the invarient Ouput param 79 * This function is used to perform optimizations. When called the invarient Ouput param
79 * indicate whether the input components to this processor in the FS will ha ve known values. 80 * indicate whether the input components to this processor in the FS will ha ve known values.
80 * In inout the validFlags member is a bitfield of GrColorComponentFlags. Th e isSingleComponent 81 * In inout the validFlags member is a bitfield of GrColorComponentFlags. Th e isSingleComponent
81 * member indicates whether the input will be 1 or 4 bytes. The function upd ates the members of 82 * member indicates whether the input will be 1 or 4 bytes. The function upd ates the members of
82 * inout to indicate known values of its output. A component of the color me mber only has 83 * inout to indicate known values of its output. A component of the color me mber only has
83 * meaning if the corresponding bit in validFlags is set. 84 * meaning if the corresponding bit in validFlags is set.
84 */ 85 */
85 void computeInvariantOutput(GrInvariantOutput* inout) const; 86 void computeInvariantOutput(GrInvariantOutput* inout) const {
87 this->onComputeInvariantOutput(inout);
88 }
86 89
87 protected: 90 protected:
88 void addTextureAccess(const GrTextureAccess* textureAccess) override; 91 void addTextureAccess(const GrTextureAccess* textureAccess) override;
89 92
90 /** 93 /**
91 * Fragment Processor subclasses call this from their constructor to registe r coordinate 94 * Fragment Processor subclasses call this from their constructor to registe r coordinate
92 * transformations. Coord transforms provide a mechanism for a processor to receive coordinates 95 * transformations. Coord transforms provide a mechanism for a processor to receive coordinates
93 * in their FS code. The matrix expresses a transformation from local space. For a given 96 * in their FS code. The matrix expresses a transformation from local space. For a given
94 * fragment the matrix will be applied to the local coordinate that maps to the fragment. 97 * fragment the matrix will be applied to the local coordinate that maps to the fragment.
95 * 98 *
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 int fNumTransformsExclChildren; 181 int fNumTransformsExclChildren;
179 182
180 // TODO: These must convert their processors to pending-execution refs when the parent is 183 // TODO: These must convert their processors to pending-execution refs when the parent is
181 // converted (do this automatically in GrProgramElement?). 184 // converted (do this automatically in GrProgramElement?).
182 SkTArray<const GrFragmentProcessor*, true> fChildProcessors; 185 SkTArray<const GrFragmentProcessor*, true> fChildProcessors;
183 186
184 typedef GrProcessor INHERITED; 187 typedef GrProcessor INHERITED;
185 }; 188 };
186 189
187 #endif 190 #endif
OLDNEW
« no previous file with comments | « include/effects/SkPerlinNoiseShader.h ('k') | include/gpu/GrInvariantOutput.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698