зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
d4ed859ea5
Коммит
fc3ad7def1
|
@ -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));
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче