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

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

Issue 24853002: Make GPU coord transforms automatic (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 7 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 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
diff --git a/src/gpu/effects/GrSingleTextureEffect.h b/src/gpu/effects/GrSingleTextureEffect.h
index 27a7d7956d2ef34dae7a6460d4d3656c8fc9872d..a8f9a6d52142e60b1abdf075c100a303af5d384d 100644
--- a/src/gpu/effects/GrSingleTextureEffect.h
+++ b/src/gpu/effects/GrSingleTextureEffect.h
@@ -10,6 +10,7 @@
#include "GrEffect.h"
#include "SkMatrix.h"
+#include "GrCoordTransform.h"
class GrTexture;
@@ -21,30 +22,25 @@ class GrSingleTextureEffect : public GrEffect {
public:
virtual ~GrSingleTextureEffect();
- const SkMatrix& getMatrix() const { return fMatrix; }
-
- /** Indicates whether the matrix operates on local coords or positions */
- CoordsType coordsType() const { return fCoordsType; }
-
protected:
/** unfiltered, clamp mode */
- GrSingleTextureEffect(GrTexture*, const SkMatrix&, CoordsType = kLocal_CoordsType);
+ GrSingleTextureEffect(GrTexture*, const SkMatrix&, GrCoordSet = kLocal_GrCoordSet);
/** clamp mode */
GrSingleTextureEffect(GrTexture*, const SkMatrix&, GrTextureParams::FilterMode filterMode,
- CoordsType = kLocal_CoordsType);
+ GrCoordSet = kLocal_GrCoordSet);
GrSingleTextureEffect(GrTexture*,
const SkMatrix&,
const GrTextureParams&,
- CoordsType = kLocal_CoordsType);
+ GrCoordSet = kLocal_GrCoordSet);
/**
* Helper for subclass onIsEqual() functions.
*/
- bool hasSameTextureParamsMatrixAndCoordsType(const GrSingleTextureEffect& other) const {
+ bool hasSameTextureParamsMatrixAndSourceCoords(const GrSingleTextureEffect& other) const {
// We don't have to check the accesses' swizzles because they are inferred from the texture.
return fTextureAccess == other.fTextureAccess &&
- this->getMatrix().cheapEqualTo(other.getMatrix()) &&
- fCoordsType == other.fCoordsType;
+ fCoordTransform.getMatrix().cheapEqualTo(other.fCoordTransform.getMatrix()) &&
+ fCoordTransform.sourceCoords() == other.fCoordTransform.sourceCoords();
}
/**
@@ -62,9 +58,8 @@ protected:
}
private:
- GrTextureAccess fTextureAccess;
- SkMatrix fMatrix;
- CoordsType fCoordsType;
+ GrCoordTransform fCoordTransform;
+ GrTextureAccess fTextureAccess;
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