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

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

Issue 1293413003: No need to re-declare pure virtual name(). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 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 | « no previous file | no next file » | 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 GrFragmentProcessor() 26 GrFragmentProcessor()
27 : INHERITED() 27 : INHERITED()
28 , fUsesLocalCoords(false) 28 , fUsesLocalCoords(false)
29 , fNumTexturesExclChildren(0) 29 , fNumTexturesExclChildren(0)
30 , fNumTransformsExclChildren(0) {} 30 , fNumTransformsExclChildren(0) {}
31 31
32 GrGLFragmentProcessor* createGLInstance() const; 32 GrGLFragmentProcessor* createGLInstance() const;
33 33
34 /** Human-meaningful string to identify this GrFragmentProcessor; may be emb edded
35 in generated shader code. */
36 virtual const char* name() const = 0;
37
38 void getGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) con st { 34 void getGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) con st {
39 this->onGetGLProcessorKey(caps, b); 35 this->onGetGLProcessorKey(caps, b);
40 for (int i = 0; i < fChildProcessors.count(); ++i) { 36 for (int i = 0; i < fChildProcessors.count(); ++i) {
41 fChildProcessors[i].processor()->getGLProcessorKey(caps, b); 37 fChildProcessors[i].processor()->getGLProcessorKey(caps, b);
42 } 38 }
43 } 39 }
44 40
45 int numTexturesExclChildren() const { return fNumTexturesExclChildren; } 41 int numTexturesExclChildren() const { return fNumTexturesExclChildren; }
46 42
47 int numTransformsExclChildren() const { return fNumTransformsExclChildren; } 43 int numTransformsExclChildren() const { return fNumTransformsExclChildren; }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 protected: 88 protected:
93 void addTextureAccess(const GrTextureAccess* textureAccess) override; 89 void addTextureAccess(const GrTextureAccess* textureAccess) override;
94 90
95 /** 91 /**
96 * Fragment Processor subclasses call this from their constructor to registe r coordinate 92 * Fragment Processor subclasses call this from their constructor to registe r coordinate
97 * transformations. Coord transforms provide a mechanism for a processor to receive coordinates 93 * transformations. Coord transforms provide a mechanism for a processor to receive coordinates
98 * in their FS code. The matrix expresses a transformation from local space. For a given 94 * in their FS code. The matrix expresses a transformation from local space. For a given
99 * fragment the matrix will be applied to the local coordinate that maps to the fragment. 95 * fragment the matrix will be applied to the local coordinate that maps to the fragment.
100 * 96 *
101 * When the transformation has perspective, the transformed coordinates will have 97 * When the transformation has perspective, the transformed coordinates will have
102 * 3 components. Otherwise they'll have 2. 98 * 3 components. Otherwise they'll have 2.
103 * 99 *
104 * This must only be called from the constructor because GrProcessors are im mutable. The 100 * This must only be called from the constructor because GrProcessors are im mutable. The
105 * processor subclass manages the lifetime of the transformations (this func tion only stores a 101 * processor subclass manages the lifetime of the transformations (this func tion only stores a
106 * pointer). The GrCoordTransform is typically a member field of the GrProce ssor subclass. 102 * pointer). The GrCoordTransform is typically a member field of the GrProce ssor subclass.
107 * 103 *
108 * A processor subclass that has multiple methods of construction should alw ays add its coord 104 * A processor subclass that has multiple methods of construction should alw ays add its coord
109 * transforms in a consistent order. The non-virtual implementation of isEqu al() automatically 105 * transforms in a consistent order. The non-virtual implementation of isEqu al() automatically
110 * compares transforms and will assume they line up across the two processor instances. 106 * compares transforms and will assume they line up across the two processor instances.
111 */ 107 */
112 void addCoordTransform(const GrCoordTransform*); 108 void addCoordTransform(const GrCoordTransform*);
113 109
114 /** 110 /**
115 * FragmentProcessor subclasses call this from their constructor to register any child 111 * FragmentProcessor subclasses call this from their constructor to register any child
116 * FragmentProcessors they have. This must be called AFTER all texture acces ses and coord 112 * FragmentProcessors they have. This must be called AFTER all texture acces ses and coord
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 175
180 int fNumTexturesExclChildren; 176 int fNumTexturesExclChildren;
181 int fNumTransformsExclChildren; 177 int fNumTransformsExclChildren;
182 178
183 SkTArray<GrFragmentStage, false> fChildProcessors; 179 SkTArray<GrFragmentStage, false> fChildProcessors;
184 180
185 typedef GrProcessor INHERITED; 181 typedef GrProcessor INHERITED;
186 }; 182 };
187 183
188 #endif 184 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698