Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upBasic implementation of line decoration display items. #1504
Conversation
| * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
|
||
| float det(vec2 a, vec2 b) { |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
glennw
Jul 20, 2017
Author
Member
It's a 2d cross product, I guess. It's just using the same name as the paper the algorithm was taken from.
| impl ToGpuBlocks for LinePrimitive { | ||
| fn write_gpu_blocks(&self, mut request: GpuDataRequest) { | ||
| request.push(self.color); | ||
| request.push([pack_as_float(self.style as u32), |
This comment has been minimized.
This comment has been minimized.
kvark
Jul 20, 2017
Member
what's the reason to call pack_as_float here as opposed to just casting to f32?
This comment has been minimized.
This comment has been minimized.
glennw
Jul 20, 2017
Author
Member
pack_as_float adds 0.5 to ensure that casting back to an int definitely gets the correct value. It's more a defensive measure than anything - perhaps it's not necessary?
| @@ -1878,6 +1904,22 @@ impl Renderer { | |||
| &target.text_run_textures, | |||
| &projection); | |||
| } | |||
| if !target.line_cache_prims.is_empty() { | |||
| // TODO(gw): Technically, we don't need blend for solid | |||
| // lines. We could check that here? | |||
This comment has been minimized.
This comment has been minimized.
kvark
Jul 20, 2017
Member
if that becomes a performance concern, we'd need to split those into opaque/non-opaque
This comment has been minimized.
This comment has been minimized.
|
Seems good! I kinda lost track of what you really wanted with the line-dimension specifying stuff. From servo's perspective, boxes + orientation would be easier to send (because of how their logical->real conversion works). Gecko would probably be fine either way? |
|
@bors-servo r=kvark |
|
|
Basic implementation of line decoration display items. Includes the commits in #1491 from @gankro. This provides a basic implementation of the line decoration styles in CSS. I haven't specifically tried to make the styles (e.g. wavy, dotted) match other browsers, yet. I think it's reasonable to get this reviewed and merged, and then tweak the visuals as a follow up. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/1504) <!-- Reviewable:end -->
|
|
|
|
|
@bors-servo retry |
Basic implementation of line decoration display items. Includes the commits in #1491 from @gankro. This provides a basic implementation of the line decoration styles in CSS. I haven't specifically tried to make the styles (e.g. wavy, dotted) match other browsers, yet. I think it's reasonable to get this reviewed and merged, and then tweak the visuals as a follow up. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/1504) <!-- Reviewable:end -->
|
|


glennw commentedJul 20, 2017
•
edited by larsbergstrom
Includes the commits in #1491 from @gankro.
This provides a basic implementation of the line decoration styles in CSS.
I haven't specifically tried to make the styles (e.g. wavy, dotted) match other browsers, yet. I think it's reasonable to get this reviewed and merged, and then tweak the visuals as a follow up.
This change is