Open
Bug 1429792
Opened 8 years ago
Updated 3 years ago
Expose const pointer to BaseRect internal data for special and limited use
Categories
(Core :: Graphics, enhancement, P3)
Core
Graphics
Tracking
()
NEW
People
(Reporter: milan, Unassigned)
References
Details
(Whiteboard: [gfx-noted])
Attachments
(1 file)
Example is a Hash() method https://dxr.mozilla.org/mozilla-central/source/layout/painting/MaskLayerImageCache.h#112 that wants a pointer to data in order to hash, but doesn't try to interpret the data in any particular way.
Comment hidden (mozreview-request) |
Comment 2•8 years ago
|
||
This didn't occur to me yesterday, but now I'm wondering -- can't we just directly use the Rect pointer itself for hashing etc, rather than needing a pointer to its member data?
e.g. in MaskLayerImageCache.h's hash function, couldn't we replace this...
PLDHashNumber hash = HashBytes(&mRect.x, 4*sizeof(gfxFloat));
...with this:
HashBytes(&mRect, sizeof(mRect));
?
I can imagine this general approach being problematic if we expected arbitrarily-filled packing space between the member-variables or stuff like that, but I don't think that should happen here...
Comment 3•8 years ago
|
||
(Sorry, I was of course missing a "PLDHashNumber hash =" in my possible-replacement code -- but you get the idea.)
Reporter | ||
Comment 4•8 years ago
|
||
I don't have a preference.
Comment 5•8 years ago
|
||
mozreview-review |
Comment on attachment 8941844 [details]
Bug 1429792: Allow const pointer access to underlying BaseRect data, for special and limited use. .schouten
https://reviewboard.mozilla.org/r/212072/#review217980
If that's the only usecase, for the sake of simplicity I agree with Daniel.
Attachment #8941844 -
Flags: review?(bas) → review-
Reporter | ||
Comment 6•8 years ago
|
||
So far, the only use case. I'm going to keep this open with bug 1390110 in mind.
See Also: → 1390110
Updated•8 years ago
|
Priority: -- → P3
Whiteboard: [gfx-noted]
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•