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 upImplement support for multiple text runs per shadow. #1469
Merged
+398
−131
Conversation
|
r? @kvark |
…erface. This allows multiple text runs to be combined in to one shadow, and fixes a few existing bugs encountered along the way. It doesn't (yet) support other items in the text shadow, but the structures are in place to make this easy to add.
|
r+ on the api/wrench changes |
|
Looks reasonable to me! |
| PendingTextShadow { | ||
| shadow: shadow, | ||
| text_primitives: Vec::new(), | ||
| clip_and_scroll: clip_and_scroll, |
This comment has been minimized.
This comment has been minimized.
| shadow: text_shadow.shadow, | ||
| }; | ||
|
|
||
| text_shadow.local_rect = text_shadow.local_rect |
This comment has been minimized.
This comment has been minimized.
kvark
Jul 12, 2017
Member
no need to actually modify the local_rect here as opposed to just declaring a new variable (thus lifting mut on text_shadow)
| if self.glyph_instances.is_empty() { | ||
| let src_glyphs = display_list.get(self.glyph_range); | ||
| for src in src_glyphs { | ||
| self.glyph_instances.push(GlyphInstance { |
This comment has been minimized.
This comment has been minimized.
| // which will be blitted to the framebuffer. | ||
| let cache_width = (metadata.local_rect.size.width * device_pixel_ratio).ceil() as i32; | ||
| let cache_height = (metadata.local_rect.size.height * device_pixel_ratio).ceil() as i32; | ||
| let cache_size = DeviceIntSize::new(cache_width, cache_height); |
This comment has been minimized.
This comment has been minimized.
kvark
Jul 12, 2017
Member
could probably write via (metadata.local_rect.size * device_pixel_ratio).ceil().to_i32()
|
@bors-servo r+ |
|
|
bors-servo
added a commit
that referenced
this pull request
Jul 12, 2017
Implement support for multiple text runs per shadow. <!-- 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/1469) <!-- Reviewable:end -->
|
|
This was referenced Jul 12, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
glennw commentedJul 12, 2017
•
edited by larsbergstrom
This change is