Closed
Bug 1259513
Opened 9 years ago
Closed 9 years ago
Don't use the gfxContext constructor directly
Categories
(Core :: Graphics, defect)
Tracking
()
RESOLVED
FIXED
mozilla48
Tracking | Status | |
---|---|---|
firefox48 | --- | fixed |
People
(Reporter: milan, Assigned: milan)
References
Details
(Whiteboard: [gfx-noted])
Attachments
(1 file)
gfxContext needs to have a valid draw target to be constructed. Don't attempt to make one of those if the target is invalid, and make it obvious to the callers they will not get a gfxContext if the draw target is invalid, by removing direct access to the constructor, and instead having a utility function that can return failure.
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → milan
Whiteboard: [gfx-noted]
Assignee | ||
Comment 1•9 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/42243/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/42243/
Attachment #8734451 -
Flags: review?(lsalzman)
Assignee | ||
Updated•9 years ago
|
Attachment #8734451 -
Flags: feedback?(jmuizelaar)
Attachment #8734451 -
Flags: feedback?(bas)
Comment 2•9 years ago
|
||
Would it make more sense to just have the constructor crash and make the users check the drawtarget before constructing the gfxContext?
Flags: needinfo?(milan)
Assignee | ||
Comment 3•9 years ago
|
||
That's what we do today, and it hasn't worked. I'm hoping that having an explicit method that looks like it can fail, instead of a constructor, which people assume does not, would help this.
Flags: needinfo?(milan)
Assignee | ||
Comment 4•9 years ago
|
||
Comment on attachment 8734451 [details]
MozReview Request: Bug 1259513: Make gfxContext constructor private, use a utility function that can return nullptr. r?lsalzman
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/42243/diff/1-2/
Attachment #8734451 -
Flags: feedback?(jmuizelaar)
Attachment #8734451 -
Flags: feedback?(bas)
Assignee | ||
Comment 5•9 years ago
|
||
Comment on attachment 8734451 [details]
MozReview Request: Bug 1259513: Make gfxContext constructor private, use a utility function that can return nullptr. r?lsalzman
Critical note if the arguments aren't checked, just to make some more noise and a few places where the calling code wasn't consistent.
Attachment #8734451 -
Flags: feedback?(jmuizelaar)
Attachment #8734451 -
Flags: feedback?(bas)
Assignee | ||
Updated•9 years ago
|
Comment 6•9 years ago
|
||
Comment on attachment 8734451 [details]
MozReview Request: Bug 1259513: Make gfxContext constructor private, use a utility function that can return nullptr. r?lsalzman
https://reviewboard.mozilla.org/r/42243/#review38841
With the caveat that we must now make sure that we check the result of gfxContext::ForDrawTarget when we use it, r+.
Attachment #8734451 -
Flags: review?(lsalzman) → review+
Updated•9 years ago
|
Attachment #8734451 -
Flags: feedback?(bas) → feedback+
Comment 7•9 years ago
|
||
Comment on attachment 8734451 [details]
MozReview Request: Bug 1259513: Make gfxContext constructor private, use a utility function that can return nullptr. r?lsalzman
https://reviewboard.mozilla.org/r/42243/#review39213
Attachment #8734451 -
Flags: review+
Assignee | ||
Comment 8•9 years ago
|
||
Comment on attachment 8734451 [details]
MozReview Request: Bug 1259513: Make gfxContext constructor private, use a utility function that can return nullptr. r?lsalzman
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/42243/diff/2-3/
Attachment #8734451 -
Flags: feedback?(jmuizelaar)
Attachment #8734451 -
Flags: feedback+
Assignee | ||
Comment 9•9 years ago
|
||
(In reply to Milan Sreckovic [:milan] from comment #8)
> Comment on attachment 8734451 [details]
> MozReview Request: Bug 1259513: Make gfxContext constructor private, use a
> utility function that can return nullptr. r?lsalzman
>
> Review request updated; see interdiff:
> https://reviewboard.mozilla.org/r/42243/diff/2-3/
This is just a rebase.
Assignee | ||
Comment 10•9 years ago
|
||
Comment on attachment 8734451 [details]
MozReview Request: Bug 1259513: Make gfxContext constructor private, use a utility function that can return nullptr. r?lsalzman
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/42243/diff/3-4/
Assignee | ||
Comment 11•9 years ago
|
||
Comment on attachment 8734451 [details]
MozReview Request: Bug 1259513: Make gfxContext constructor private, use a utility function that can return nullptr. r?lsalzman
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/42243/diff/4-5/
Comment 12•9 years ago
|
||
Comment 13•9 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
You need to log in
before you can comment on or make changes to this bug.
Description
•