diff options
author | tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-04-30 20:19:07 +0000 |
---|---|---|
committer | tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-04-30 20:19:07 +0000 |
commit | 02b1ea24fd1152cb5a93e05b4d78700740140db6 (patch) | |
tree | b689969715e36665d1e6e28b43e1d8305fc6fca5 /include/gpu/GrSamplerState.h | |
parent | 443e5a52b7e85070c26a068cd3b0aad126502395 (diff) |
Add comparison and assignment operators to GrSamplerState.
http://codereview.appspot.com/6137058/
git-svn-id: http://skia.googlecode.com/svn/trunk@3803 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/gpu/GrSamplerState.h')
-rw-r--r-- | include/gpu/GrSamplerState.h | 22 |
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 |