Skip to content

Commit

Permalink
Bug 1846293 - Improve flush handing in Canvas2D. r=dholbert a=pascalc
Browse files Browse the repository at this point in the history
Don't keep weak pointers before flushing.

Differential Revision: https://phabricator.services.mozilla.com/D184950
  • Loading branch information
emilio committed Sep 8, 2023
1 parent fc4a087 commit 6b19f62
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dom/canvas/CanvasRenderingContext2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4372,14 +4372,14 @@ TextMetrics* CanvasRenderingContext2D::DrawOrMeasureText(
const double kHangingBaselineDefault = 0.8; // fraction of ascent
const double kIdeographicBaselineDefault = 0.5; // fraction of descent

gfxFontGroup* currentFontStyle = GetCurrentFontStyle();
RefPtr<gfxFontGroup> currentFontStyle = GetCurrentFontStyle();
if (NS_WARN_IF(!currentFontStyle)) {
aError = NS_ERROR_FAILURE;
return nullptr;
}

RefPtr<PresShell> presShell = GetPresShell();
Document* document = presShell ? presShell->GetDocument() : nullptr;
RefPtr<Document> document = presShell ? presShell->GetDocument() : nullptr;

// replace all the whitespace characters with U+0020 SPACE
nsAutoString textToDraw(aRawText);
Expand Down

0 comments on commit 6b19f62

Please sign in to comment.