aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu/GrSamplerState.h
diff options
context:
space:
mode:
authorGravatar tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-04-30 20:19:07 +0000
committerGravatar tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-04-30 20:19:07 +0000
commit02b1ea24fd1152cb5a93e05b4d78700740140db6 (patch)
treeb689969715e36665d1e6e28b43e1d8305fc6fca5 /include/gpu/GrSamplerState.h
parent443e5a52b7e85070c26a068cd3b0aad126502395 (diff)
Add comparison and assignment operators to GrSamplerState.
Diffstat (limited to 'include/gpu/GrSamplerState.h')
-rw-r--r--include/gpu/GrSamplerState.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/include/gpu/GrSamplerState.h b/include/gpu/GrSamplerState.h
index d9957bd578..50fe240c8d 100644
--- a/include/gpu/GrSamplerState.h
+++ b/include/gpu/GrSamplerState.h
@@ -122,6 +122,16 @@ public:
GrSafeUnref(fCustomStage);
}
+ bool operator ==(const GrSamplerState& s) const {
+ return !memcmp(this, &s, sizeof(GrSamplerState));
+ }
+ bool operator !=(const GrSamplerState& s) const { return !(*this == s); }
+
+ GrSamplerState& operator =(const GrSamplerState s) {
+ memcpy(this, &s, sizeof(GrSamplerState));
+ return *this;
+ }
+
WrapMode getWrapX() const { return fWrapX; }
WrapMode getWrapY() const { return fWrapY; }
FilterDirection getFilterDirection() const { return fFilterDirection; }
@@ -258,12 +268,6 @@ private:
bool fSwapRAndB;
GrRect fTextureDomain;
- /// BUG! Ganesh only works correctly so long as fCustomStage is
- /// NULL; we need to have a complex ID system here so that we can
- /// have an equality-like comparison to determine whether two
- /// fCustomStages are equal.
- GrCustomStage* fCustomStage;
-
// these are undefined unless fSampleMode == kRadial2_SampleMode
GrScalar fRadial2CenterX1;
GrScalar fRadial2Radius0;
@@ -272,6 +276,12 @@ private:
// These are undefined unless fFilter == kConvolution_Filter
uint8_t fKernelWidth;
float fKernel[MAX_KERNEL_WIDTH];
+
+ /// BUG! Ganesh only works correctly so long as fCustomStage is
+ /// NULL; we need to have a complex ID system here so that we can
+ /// have an equality-like comparison to determine whether two
+ /// fCustomStages are equal.
+ GrCustomStage* fCustomStage;
};
#endif