mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 916704 - Always initialize SVGTextContentPaint::Paint and check SetupCairoState return value in nsSVGTextFrame2::PaintSVG. r=longsonr
This commit is contained in:
parent
46581519af
commit
e740c96c5b
@ -1143,6 +1143,7 @@ mozilla::SVGTextContextPaint::Paint::GetPattern(float aOpacity,
|
||||
// cache it, we'll have to compute mPatternMatrix, which is annoying.
|
||||
return pattern.forget();
|
||||
default:
|
||||
MOZ_ASSERT(false, "invalid paint type");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ struct SVGTextContextPaint : public gfxTextContextPaint {
|
||||
float GetStrokeOpacity() MOZ_OVERRIDE { return mStrokeOpacity; }
|
||||
|
||||
struct Paint {
|
||||
Paint() {}
|
||||
Paint() : mPaintType(eStyleSVGPaintType_None) {}
|
||||
|
||||
void SetPaintServer(nsIFrame *aFrame, const gfxMatrix& aContextMatrix,
|
||||
nsSVGPaintServerFrame *aPaintServerFrame) {
|
||||
|
@ -3531,7 +3531,9 @@ nsSVGTextFrame2::PaintSVG(nsRenderingContext* aContext,
|
||||
(gfxTextContextPaint*)aContext->GetUserData(&gfxTextContextPaint::sUserDataKey);
|
||||
|
||||
nsAutoPtr<gfxTextContextPaint> contextPaint;
|
||||
SetupCairoState(gfx, frame, outerContextPaint, getter_Transfers(contextPaint));
|
||||
gfxFont::DrawMode drawMode =
|
||||
SetupCairoState(gfx, frame, outerContextPaint,
|
||||
getter_Transfers(contextPaint));
|
||||
|
||||
// Set up the transform for painting the text frame for the substring
|
||||
// indicated by the run.
|
||||
@ -3540,16 +3542,19 @@ nsSVGTextFrame2::PaintSVG(nsRenderingContext* aContext,
|
||||
runTransform.Multiply(currentMatrix);
|
||||
gfx->SetMatrix(runTransform);
|
||||
|
||||
nsRect frameRect = frame->GetVisualOverflowRect();
|
||||
bool paintSVGGlyphs;
|
||||
if (ShouldRenderAsPath(aContext, frame, paintSVGGlyphs)) {
|
||||
SVGTextDrawPathCallbacks callbacks(aContext, frame, matrixForPaintServers,
|
||||
paintSVGGlyphs);
|
||||
frame->PaintText(aContext, nsPoint(), frameRect, item,
|
||||
contextPaint, &callbacks);
|
||||
} else {
|
||||
frame->PaintText(aContext, nsPoint(), frameRect, item,
|
||||
contextPaint, nullptr);
|
||||
if (drawMode != gfxFont::DrawMode(0)) {
|
||||
nsRect frameRect = frame->GetVisualOverflowRect();
|
||||
bool paintSVGGlyphs;
|
||||
if (ShouldRenderAsPath(aContext, frame, paintSVGGlyphs)) {
|
||||
SVGTextDrawPathCallbacks callbacks(aContext, frame,
|
||||
matrixForPaintServers,
|
||||
paintSVGGlyphs);
|
||||
frame->PaintText(aContext, nsPoint(), frameRect, item,
|
||||
contextPaint, &callbacks);
|
||||
} else {
|
||||
frame->PaintText(aContext, nsPoint(), frameRect, item,
|
||||
contextPaint, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
if (frame == caretFrame && ShouldPaintCaret(run, caret)) {
|
||||
|
Loading…
Reference in New Issue
Block a user