зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1248223 - verify that stroke widths are finite for Skia. r=jmuizelaar
This commit is contained in:
Родитель
5d028c4e25
Коммит
876e94a736
|
@ -142,7 +142,8 @@ StrokeOptionsToPaint(SkPaint& aPaint, const StrokeOptions &aOptions)
|
|||
{
|
||||
// Skia renders 0 width strokes with a width of 1 (and in black),
|
||||
// so we should just skip the draw call entirely.
|
||||
if (!aOptions.mLineWidth) {
|
||||
// Skia does not handle non-finite line widths.
|
||||
if (!aOptions.mLineWidth || !IsFinite(aOptions.mLineWidth)) {
|
||||
return false;
|
||||
}
|
||||
aPaint.setStrokeWidth(SkFloatToScalar(aOptions.mLineWidth));
|
||||
|
|
|
@ -190,7 +190,9 @@ PathSkia::StrokeContainsPoint(const StrokeOptions &aStrokeOptions,
|
|||
}
|
||||
|
||||
SkPaint paint;
|
||||
StrokeOptionsToPaint(paint, aStrokeOptions);
|
||||
if (!StrokeOptionsToPaint(paint, aStrokeOptions)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
SkPath strokePath;
|
||||
paint.getFillPath(mPath, &strokePath);
|
||||
|
@ -218,8 +220,10 @@ PathSkia::GetStrokedBounds(const StrokeOptions &aStrokeOptions,
|
|||
}
|
||||
|
||||
SkPaint paint;
|
||||
StrokeOptionsToPaint(paint, aStrokeOptions);
|
||||
|
||||
if (!StrokeOptionsToPaint(paint, aStrokeOptions)) {
|
||||
return Rect();
|
||||
}
|
||||
|
||||
SkPath result;
|
||||
paint.getFillPath(mPath, &result);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче