Open Bug 2089966 Opened 13 days ago Updated 7 days ago

Simplify the redundant layers check in gfxFont::RenderColorGlyph

Categories

(Core :: Graphics, task)

task

Tracking

()

ASSIGNED

People

(Reporter: Sylvestre, Assigned: mirko, Mentored)

References

(Blocks 1 open bug)

Details

(Keywords: good-first-bug, Whiteboard: [lang=c++])

Attachments

(1 external file)

Filing as a good first bug to learn workflows.

In gfxFont::RenderColorGlyph, an earlier if (!paintGraph && !layers) return false; means that when we reach if (layers) { ... } after handling paintGraph, layers is always non-null and the trailing return false; is unreachable. Drop the if (layers) test and the dead return false;.

Current code:


  if (layers) {
    auto face(GetFontEntry()->GetHBFace());

Link to the code:
https://searchfox.org/firefox-main/source/gfx/thebes/gfxFont.cpp

To verify the fix:

./mach build

This was reported by Coverity Scan (CID 1609708). The analyzer will stop reporting it once the change lands.

Tutorial to contribute:
https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
https://firefox-source-docs.mozilla.org/contributing/stack_quickref.html

Please don't ask for the bug to be assigned. It will be automatically assigned to the first patch.

Assignee: nobody → mirko
Status: NEW → ASSIGNED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: