gfxContext should support stack allocation, it shouldn't be refcounted

NEW
Unassigned

Status

()

Core
Graphics
6 years ago
4 years ago

People

(Reporter: BenWa, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

6 years ago
Most use cases of gfxContext is a temporary stack objects to draw to an image. Because the object is refcounted it must be allocated on the stack because as soon as you pass it to somethings that tries to ref count it, it will Release() your object later and BOOM 'delete gfxContext' gets called. This mean gfxContext shouldn't be recounted. 

We've removed instances before in bug 383166 but as soon as you need to pass a gfxContext* to something (layout) then you can't guarantee that it wont try to AddRef/Release.
Considering we want to phase out gfxContext longer term and gfxContext creations should not be in performance critical loops or anything of the likes, I have my doubts whether this is worth it.
Blocks: 991398
You need to log in before you can comment on or make changes to this bug.