зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1846293 - Improve flush handing in Canvas2D. r=dholbert
Don't keep weak pointers before flushing. Differential Revision: https://phabricator.services.mozilla.com/D184950
This commit is contained in:
Родитель
91eaf8a22f
Коммит
e6cea60db2
|
@ -4462,14 +4462,14 @@ TextMetrics* CanvasRenderingContext2D::DrawOrMeasureText(
|
|||
const nsAString& aRawText, float aX, float aY,
|
||||
const Optional<double>& aMaxWidth, TextDrawOperation aOp,
|
||||
ErrorResult& aError) {
|
||||
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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче