Review URL: http://codereview.appspot.com/4997045/



git-svn-id: http://skia.googlecode.com/svn/trunk@2248 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
bsalomon@google.com 2011-09-12 14:30:27 +00:00
Родитель 4f83be8f86
Коммит 27c9b6d276
1 изменённых файлов: 13 добавлений и 0 удалений

Просмотреть файл

@ -108,6 +108,16 @@ public:
}
GrPaint(const GrPaint& paint) {
for (int i = 0; i < kMaxTextures; ++i) {
fTextures[i] = NULL;
}
for (int i = 0; i < kMaxMasks; ++i) {
fMaskTextures[i] = NULL;
}
*this = paint;
}
GrPaint& operator=(const GrPaint& paint) {
fSrcBlendCoeff = paint.fSrcBlendCoeff;
fDstBlendCoeff = paint.fDstBlendCoeff;
fAntiAlias = paint.fAntiAlias;
@ -119,15 +129,18 @@ public:
fColorFilterXfermode = paint.fColorFilterXfermode;
for (int i = 0; i < kMaxTextures; ++i) {
GrSafeUnref(fTextures[i]);
fTextureSamplers[i] = paint.fTextureSamplers[i];
fTextures[i] = paint.fTextures[i];
GrSafeRef(fTextures[i]);
}
for (int i = 0; i < kMaxMasks; ++i) {
GrSafeUnref(fMaskTextures[i]);
fMaskSamplers[i] = paint.fMaskSamplers[i];
fMaskTextures[i] = paint.fMaskTextures[i];
GrSafeRef(fMaskTextures[i]);
}
return *this;
}
~GrPaint() {