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

Unified Diff: src/gpu/effects/GrSingleTextureEffect.h

Issue 12531015: Adds local coords to GrEffect system. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 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 | « src/gpu/effects/GrSimpleTextureEffect.cpp ('k') | src/gpu/effects/GrSingleTextureEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrSingleTextureEffect.h
===================================================================
--- src/gpu/effects/GrSingleTextureEffect.h (revision 8241)
+++ src/gpu/effects/GrSingleTextureEffect.h (working copy)
@@ -14,7 +14,8 @@
class GrTexture;
/**
- * A base class for effects that draw a single texture with a texture matrix.
+ * A base class for effects that draw a single texture with a texture matrix. This effect has no
+ * backend implementations. One must be provided by the subclass.
*/
class GrSingleTextureEffect : public GrEffect {
public:
@@ -22,20 +23,29 @@
const SkMatrix& getMatrix() const { return fMatrix; }
+ /** Indicates whether the matrix operates on local coords or positions */
+ CoordsType coordsType() const { return fCoordsType; }
+
protected:
- GrSingleTextureEffect(GrTexture*, const SkMatrix&); /* unfiltered, clamp mode */
- GrSingleTextureEffect(GrTexture*, const SkMatrix&, bool bilerp); /* clamp mode */
- GrSingleTextureEffect(GrTexture*, const SkMatrix&, const GrTextureParams&);
+ /** unfiltered, clamp mode */
+ GrSingleTextureEffect(GrTexture*, const SkMatrix&, CoordsType = kLocal_CoordsType);
+ /** clamp mode */
+ GrSingleTextureEffect(GrTexture*, const SkMatrix&, bool bilerp, CoordsType = kLocal_CoordsType);
+ GrSingleTextureEffect(GrTexture*,
+ const SkMatrix&,
+ const GrTextureParams&,
+ CoordsType = kLocal_CoordsType);
/**
* Helper for subclass onIsEqual() functions.
*/
- bool hasSameTextureParamsAndMatrix(const GrSingleTextureEffect& other) const {
+ bool hasSameTextureParamsMatrixAndCoordsType(const GrSingleTextureEffect& other) const {
const GrTextureAccess& otherAccess = other.fTextureAccess;
// We don't have to check the accesses' swizzles because they are inferred from the texture.
return fTextureAccess.getTexture() == otherAccess.getTexture() &&
fTextureAccess.getParams() == otherAccess.getParams() &&
- this->getMatrix().cheapEqualTo(other.getMatrix());
+ this->getMatrix().cheapEqualTo(other.getMatrix()) &&
+ fCoordsType == other.fCoordsType;
}
/**
@@ -55,6 +65,7 @@
private:
GrTextureAccess fTextureAccess;
SkMatrix fMatrix;
+ CoordsType fCoordsType;
typedef GrEffect INHERITED;
};
« no previous file with comments | « src/gpu/effects/GrSimpleTextureEffect.cpp ('k') | src/gpu/effects/GrSingleTextureEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698