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

Unified Diff: include/gpu/GrEffect.h

Issue 14998007: Make GrGLShaderBuilder check whether GrEffect advertised that it would require the dst color or frag (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Address comments Created 7 years, 7 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 | « include/gpu/GrConfig.h ('k') | src/core/SkXfermode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrEffect.h
diff --git a/include/gpu/GrEffect.h b/include/gpu/GrEffect.h
index 4cef4308ea3441dbb41ccde2118c738f8219c278..20dc5dadc7ef2812cc7cba85eed20e310c3db36a 100644
--- a/include/gpu/GrEffect.h
+++ b/include/gpu/GrEffect.h
@@ -153,7 +153,10 @@ public:
GrTexture* texture(int index) const { return this->textureAccess(index).getTexture(); }
/** Will this effect read the destination pixel value? */
- bool willReadDst() const { return fWillReadDst; }
+ bool willReadDstColor() const { return fWillReadDstColor; }
+
+ /** Will this effect read the fragment position? */
+ bool willReadFragmentPosition() const { return fWillReadFragmentPosition; }
int numVertexAttribs() const { return fVertexAttribTypes.count(); }
@@ -213,7 +216,7 @@ protected:
*/
void addVertexAttrib(GrSLType type);
- GrEffect() : fWillReadDst(false), fEffectRef(NULL) {}
+ GrEffect() : fWillReadDstColor(false), fWillReadFragmentPosition(false), fEffectRef(NULL) {}
/** This should be called by GrEffect subclass factories. See the comment on AutoEffectUnref for
an example factory function. */
@@ -269,7 +272,14 @@ protected:
* from its constructor. Otherwise, when its generated backend-specific effect class attempts
* to generate code that reads the destination pixel it will fail.
*/
- void setWillReadDst() { fWillReadDst = true; }
+ void setWillReadDstColor() { fWillReadDstColor = true; }
+
+ /**
+ * If the effect will generate a backend-specific effect that will read the fragment position
+ * in the FS then it must call this method from its constructor. Otherwise, the request to
+ * access the fragment position will be denied.
+ */
+ void setWillReadFragmentPosition() { fWillReadFragmentPosition = true; }
private:
bool isEqual(const GrEffect& other) const {
@@ -302,7 +312,8 @@ private:
SkSTArray<4, const GrTextureAccess*, true> fTextureAccesses;
SkSTArray<kMaxVertexAttribs, GrSLType, true> fVertexAttribTypes;
- bool fWillReadDst;
+ bool fWillReadDstColor;
+ bool fWillReadFragmentPosition;
GrEffectRef* fEffectRef;
typedef GrRefCnt INHERITED;
« no previous file with comments | « include/gpu/GrConfig.h ('k') | src/core/SkXfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698