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

Unified Diff: include/gpu/GrFragmentProcessor.h

Issue 1298233002: Added fNumTransformsExclChildren and fNumTexturesExclChildren; changed emitChild() to forward search (Closed) Base URL: https://skia.googlesource.com/skia@cs3_emitchild
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include/gpu/GrProcessor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrFragmentProcessor.h
diff --git a/include/gpu/GrFragmentProcessor.h b/include/gpu/GrFragmentProcessor.h
index 8d2a4d42b1d1976f394679bc9f1bc7100e328338..f08d3656b7de5d9281cdf1f88defc7a73f0efc0e 100644
--- a/include/gpu/GrFragmentProcessor.h
+++ b/include/gpu/GrFragmentProcessor.h
@@ -25,7 +25,9 @@ class GrFragmentProcessor : public GrProcessor {
public:
GrFragmentProcessor()
: INHERITED()
- , fUsesLocalCoords(false) {}
+ , fUsesLocalCoords(false)
+ , fNumTexturesExclChildren(0)
+ , fNumTransformsExclChildren(0) {}
GrGLFragmentProcessor* createGLInstance() const;
@@ -40,6 +42,10 @@ public:
}
}
+ int numTexturesExclChildren() const { return fNumTexturesExclChildren; }
tomhudson 2015/08/18 19:36:11 nit: abbreviation in API smells bad - but I can un
bsalomon 2015/08/19 14:22:17 Nonrecursive? I can't come up with anything I rea
+
+ int numTransformsExclChildren() const { return fNumTransformsExclChildren; }
+
int numTransforms() const { return fCoordTransforms.count(); }
/** Returns the coordinate transformation at index. index must be valid according to
@@ -84,6 +90,8 @@ public:
void computeInvariantOutput(GrInvariantOutput* inout) const;
protected:
+ void addTextureAccess(const GrTextureAccess* textureAccess) override;
+
/**
* Fragment Processor subclasses call this from their constructor to register coordinate
* transformations. Coord transforms provide a mechanism for a processor to receive coordinates
@@ -105,7 +113,8 @@ protected:
/**
* FragmentProcessor subclasses call this from their constructor to register any child
- * FragmentProcessors they have.
+ * FragmentProcessors they have. This must be called AFTER all texture accesses and coord
+ * transforms have been added.
* This is for processors whose shader code will be composed of nested processors whose output
* colors will be combined somehow to produce its output color. Registering these child
* processors will allow the ProgramBuilder to automatically handle their transformed coords and
@@ -168,6 +177,9 @@ private:
*/
SkSTArray<4, const GrCoordTransform*, true> fCoordTransforms;
+ int fNumTexturesExclChildren;
+ int fNumTransformsExclChildren;
+
SkTArray<GrFragmentStage, false> fChildProcessors;
typedef GrProcessor INHERITED;
« no previous file with comments | « no previous file | include/gpu/GrProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698