Use element-by-element assignment in GrSamplerState::operator= instead of memcpy
so that we can handle refcounting correctly. http://codereview.appspot.com/6262049/ git-svn-id: http://skia.googlecode.com/svn/trunk@4092 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
9aabfc789e
commit
111755936d
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user