Page MenuHomePhabricator

Bug 1571974: Make prim_store::get_line_decoration_sizes return an oriented LayoutSize. r?kvark
ClosedPublic

Authored by jimb on Jan 24 2020, 12:58 AM.

Details

Summary

Without this change, get_line_decoration_sizes returns an (inline_size,
block_size) pair, where inline_size is parallel to the line being decorated, and
block_size perpendicular. However, these values are generally used as the
dimensions of an axis-aligned bounding box for the line, not as specific
parameters to the rendering process, so it makes sense to arrange them into a
LayoutSize value in this function, since it is already taking the orientation
into account anyway.

The caller, SceneBuilder::add_line, then doesn't need to swap the components,
and the adjustment of the clipping rectangle to avoid partial dots looks a bit
more natural: widths with widths, heights with heights.

Diff Detail

Repository
rMOZILLACENTRAL mozilla-central
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jimb created this revision.Jan 24 2020, 12:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 24 2020, 12:58 AM
phab-bot requested review of this revision.Jan 24 2020, 12:58 AM
phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: Restricted Project.
jimb updated this revision to Diff 221956.Jan 24 2020, 6:10 AM
jimb edited the summary of this revision. (Show Details)
jrmuizel edited reviewers, added: kvark; removed: jrmuizel.Jan 24 2020, 3:42 PM

Moving to kvark

kvark accepted this revision.Jan 28 2020, 2:35 PM
kvark added inline comments.
gfx/wr/webrender/src/prim_store/mod.rs
4131–4132

I think the part about "determines" need to be more descriptive, it's not clear what the logic is for determining this

4132–4152

should rename the method to avoid plural sizes now

This revision is now accepted and ready to land.Jan 28 2020, 2:35 PM
jimb updated this revision to Diff 223636.Jan 31 2020, 12:21 PM
jimb retitled this revision from Bug 1571974: Make prim_store::get_line_decoration_sizes return an oriented LayoutSize. r?jrmuizel to Bug 1571974: Make prim_store::get_line_decoration_sizes return an oriented LayoutSize. r?kvark.
jimb marked 2 inline comments as done.Feb 3 2020, 9:30 AM
jimb updated this revision to Diff 223911.Feb 3 2020, 9:31 AM
opoprus reopened this revision.Feb 3 2020, 8:04 PM
This revision is now accepted and ready to land.Feb 3 2020, 8:04 PM