Bug 774728 - Do a null pointer check before using any gradient shaders in DrawTargetSkia r=mattwoodrow

--HG--
extra : rebase_source : 7db2d28692a3cd9cccbd542ca752950f5df90511
This commit is contained in:
George Wright 2012-07-25 20:11:17 -04:00
Родитель d4ed859ea5
Коммит fc3ad7def1
1 изменённых файлов: 15 добавлений и 8 удалений

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

@ -206,10 +206,14 @@ void SetPaintPattern(SkPaint& aPaint, const Pattern& aPattern, Float aAlpha = 1.
&stops->mPositions.front(),
stops->mCount,
mode);
SkMatrix mat;
GfxMatrixToSkiaMatrix(pat.mMatrix, mat);
shader->setLocalMatrix(mat);
SkSafeUnref(aPaint.setShader(shader));
if (shader) {
SkMatrix mat;
GfxMatrixToSkiaMatrix(pat.mMatrix, mat);
shader->setLocalMatrix(mat);
SkSafeUnref(aPaint.setShader(shader));
}
} else {
aPaint.setColor(SkColorSetARGB(0, 0, 0, 0));
}
@ -233,10 +237,13 @@ void SetPaintPattern(SkPaint& aPaint, const Pattern& aPattern, Float aAlpha = 1.
&stops->mPositions.front(),
stops->mCount,
mode);
SkMatrix mat;
GfxMatrixToSkiaMatrix(pat.mMatrix, mat);
shader->setLocalMatrix(mat);
SkSafeUnref(aPaint.setShader(shader));
if (shader) {
SkMatrix mat;
GfxMatrixToSkiaMatrix(pat.mMatrix, mat);
shader->setLocalMatrix(mat);
SkSafeUnref(aPaint.setShader(shader));
}
} else {
aPaint.setColor(SkColorSetARGB(0, 0, 0, 0));
}