8 #ifndef GrCoordTransform_DEFINED
9 #define GrCoordTransform_DEFINED
11 #include "GrProcessor.h"
13 #include "GrTexture.h"
15 #include "GrShaderVar.h"
45 GrCoordTransform() : fSourceCoords(kLocal_GrCoordSet) { SkDEBUGCODE(fInProcessor =
false); }
54 GrTextureParams::FilterMode filter) {
56 SkDEBUGCODE(fInProcessor =
false);
57 this->reset(sourceCoords, texture, filter);
65 const GrTexture* texture, GrTextureParams::FilterMode filter) {
66 SkDEBUGCODE(fInProcessor =
false);
68 this->reset(sourceCoords, m, texture, filter);
75 GrSLPrecision precision = kDefault_GrSLPrecision) {
76 SkDEBUGCODE(fInProcessor =
false);
77 this->reset(sourceCoords, m, precision);
80 void reset(GrCoordSet sourceCoords,
const GrTexture* texture,
81 GrTextureParams::FilterMode filter) {
82 SkASSERT(!fInProcessor);
87 void reset(GrCoordSet,
const SkMatrix&,
const GrTexture*, GrTextureParams::FilterMode filter);
88 void reset(GrCoordSet sourceCoords,
const SkMatrix& m,
89 GrSLPrecision precision = kDefault_GrSLPrecision);
92 SkASSERT(!fInProcessor);
93 fSourceCoords = that.fSourceCoords;
94 fMatrix = that.fMatrix;
95 fReverseY = that.fReverseY;
96 fPrecision = that.fPrecision;
105 SkASSERT(!fInProcessor);
110 return fSourceCoords == that.fSourceCoords &&
112 fReverseY == that.fReverseY &&
113 fPrecision == that.fPrecision;
116 bool operator!=(
const GrCoordTransform& that)
const {
return !(*
this == that); }
118 GrCoordSet sourceCoords()
const {
return fSourceCoords; }
119 const SkMatrix& getMatrix()
const {
return fMatrix; }
120 bool reverseY()
const {
return fReverseY; }
121 GrSLPrecision precision()
const {
return fPrecision; }
133 GrCoordSet fSourceCoords;
136 GrSLPrecision fPrecision;
137 typedef SkNoncopyable INHERITED;
141 void setInProcessor()
const { fInProcessor =
true; }
143 mutable bool fInProcessor;
bool setIDiv(int divx, int divy)
Set the matrix to scale by 1/divx and 1/divy.
The SkMatrix class holds a 3x3 matrix for transforming coordinates.
Definition: SkMatrix.h:26
int width() const
Retrieves the width of the surface.
Definition: GrSurface.h:26
int height() const
Retrieves the height of the surface.
Definition: GrSurface.h:31
bool cheapEqualTo(const SkMatrix &m) const
Efficient comparison of two matrices.
Definition: SkMatrix.h:619
Definition: GrTexture.h:19