Closed
Bug 1299164
Opened 8 years ago
Closed 8 years ago
Add BufferSizeFromDimensions in addition to BufferSizeFromStrideAndHeight
Categories
(Core :: Graphics, defect)
Core
Graphics
Tracking
()
RESOLVED
FIXED
mozilla51
Tracking | Status | |
---|---|---|
firefox51 | --- | fixed |
People
(Reporter: milan, Assigned: milan)
References
Details
(Whiteboard: [gfx-noted])
Attachments
(2 files)
We have a convenient BufferSizeFromStrideAndHeight utility function that takes stride (usually width * byte count) and height. Add a utility function to take all three.
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → milan
Whiteboard: [gfx-noted]
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 3•8 years ago
|
||
mozreview-review |
Comment on attachment 8786455 [details]
Bug 1299164: Part 1. Add BufferSizeFromDimensions method to complement BufferSizeFromStrideAndHeight.
https://reviewboard.mozilla.org/r/75406/#review73564
::: gfx/2d/DataSurfaceHelpers.cpp:268
(Diff revision 1)
> size_t
> BufferSizeFromStrideAndHeight(int32_t aStride,
> int32_t aHeight,
> int32_t aExtraBytes)
> {
> - if (MOZ_UNLIKELY(aHeight <= 0)) {
> + return BufferSizeFromDimensions(aStride, aHeight, 1, aExtraBytes);
Not a huge fan of passing stride to height. Maybe we should name it stride in BufferSizeFromDimension as well? I'll leave this up to you to decide.
Attachment #8786455 -
Flags: review?(bas) → review+
Comment 4•8 years ago
|
||
mozreview-review |
Comment on attachment 8786456 [details]
Bug 1299164: Part 2. Use BufferSizeFromDimensions method, as well as some of the others that check for valid size.
https://reviewboard.mozilla.org/r/75408/#review73566
Attachment #8786456 -
Flags: review?(bas) → review+
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Comment 7•8 years ago
|
||
mozreview-review-reply |
Comment on attachment 8786455 [details]
Bug 1299164: Part 1. Add BufferSizeFromDimensions method to complement BufferSizeFromStrideAndHeight.
https://reviewboard.mozilla.org/r/75406/#review73564
> Not a huge fan of passing stride to height. Maybe we should name it stride in BufferSizeFromDimension as well? I'll leave this up to you to decide.
I agree, the readability is important. Given that it was suffering with trying to save a few lines of "duplicated" code, and it led to an extra function call, I separated the two functions - BufferSizeFromStrideAndHeight does not call BufferSizeFromDimensions anymore. The problem above goes away and things are a bit cleaner. I don't anticipate big changes to these functions, but if we make them to one, we should make them to both.
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 12•8 years ago
|
||
Pushed by msreckovic@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c39ec15e7e21
Part 1. Add BufferSizeFromDimensions method to complement BufferSizeFromStrideAndHeight. r=bas
https://hg.mozilla.org/integration/autoland/rev/53dc795121e1
Part 2. Use BufferSizeFromDimensions method, as well as some of the others that check for valid size. r=bas
I had to back this out because it appears to have caused failures like https://treeherder.mozilla.org/logviewer.html#?job_id=2981925&repo=autoland
https://hg.mozilla.org/integration/autoland/rev/aefced02ac1e
Flags: needinfo?(milan)
Assignee | ||
Comment 14•8 years ago
|
||
Thanks for catching this and backing it out. I imagine it's for disallowing negative stride, but I'll double check before try/inbounding this again.
Assignee | ||
Comment 15•8 years ago
|
||
It's for Factory::CreateDrawTargetForCairoSurface returning nullptr when AllowedSurfaceSize fails (on 45680x65360 size.) I guess we were allowing that to succeed before.
Assignee | ||
Comment 16•8 years ago
|
||
In the context of print
Assignee | ||
Comment 17•8 years ago
|
||
Flags: needinfo?(milan)
Assignee | ||
Comment 18•8 years ago
|
||
mozreview-review |
Comment on attachment 8786456 [details]
Bug 1299164: Part 2. Use BufferSizeFromDimensions method, as well as some of the others that check for valid size.
https://reviewboard.mozilla.org/r/75408/#review77416
Comment 19•8 years ago
|
||
Pushed by msreckovic@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/e2d722f565d3
Part 1. Add BufferSizeFromDimensions method to complement BufferSizeFromStrideAndHeight. r=bas
https://hg.mozilla.org/integration/mozilla-inbound/rev/1aecdb3b9974
Part 2. Use BufferSizeFromDimensions method, as well as some of the others that check for valid size. r=bas
Comment 20•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/e2d722f565d3
https://hg.mozilla.org/mozilla-central/rev/1aecdb3b9974
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
You need to log in
before you can comment on or make changes to this bug.
Description
•