diff options
Diffstat (limited to 'include/gpu')
-rw-r--r-- | include/gpu/GrSamplerState.h | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/include/gpu/GrSamplerState.h b/include/gpu/GrSamplerState.h index a48150262a..618b0b165c 100644 --- a/include/gpu/GrSamplerState.h +++ b/include/gpu/GrSamplerState.h @@ -140,7 +140,28 @@ public: bool operator !=(const GrSamplerState& s) const { return !(*this == s); } GrSamplerState& operator =(const GrSamplerState s) { - memcpy(this, &s, sizeof(GrSamplerState)); + // memcpy() breaks refcounting + fWrapX = s.fWrapX; + fWrapY = s.fWrapY; + fFilterDirection = s.fFilterDirection; + fSampleMode = s.fSampleMode; + fFilter = s.fFilter; + fMatrix = s.fMatrix; + fSwapRAndB = s.fSwapRAndB; + fTextureDomain = s.fTextureDomain; + + fRadial2CenterX1 = s.fRadial2CenterX1; + fRadial2Radius0 = s.fRadial2Radius0; + fRadial2PosRoot = s.fRadial2PosRoot; + + fKernelWidth = s.fKernelWidth; + if (kConvolution_Filter == kFilter) { + memcpy(fKernel, s.fKernel, MAX_KERNEL_WIDTH * sizeof(float)); + } + + fCustomStage = s.fCustomStage; + SkSafeRef(fCustomStage); + return *this; } |