New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Render solid line decorations in the opaque pass #3232
Merged
+27
−8
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.
| @@ -1907,7 +1907,8 @@ impl PrimitiveStore { | ||
| prim_instance.clipped_world_rect = Some(pic_state.map_pic_to_world.bounds); | ||
| } else { | ||
| if prim.local_rect.size.width <= 0.0 || | ||
| prim.local_rect.size.height <= 0.0 { | ||
| prim.local_rect.size.height <= 0.0 | ||
| { | ||
| if cfg!(debug_assertions) && is_chased { | ||
| println!("\tculled for zero local rectangle"); | ||
| } | ||
| @@ -1954,6 +1955,9 @@ impl PrimitiveStore { | ||
| let clip_chain = match clip_chain { | ||
| Some(clip_chain) => clip_chain, | ||
| None => { | ||
| if cfg!(debug_assertions) && is_chased { | ||
| println!("\tunable to build the clip chain, skipping"); | ||
| } | ||
| prim_instance.clipped_world_rect = None; | ||
| return false; | ||
| } | ||
| @@ -2060,8 +2064,8 @@ impl PrimitiveStore { | ||
| let prim_index = prim_instance.prim_index; | ||
| let is_chased = Some(prim_index) == self.chase_id; | ||
|
|
||
| if is_chased { | ||
| println!("\tpreparing prim {:?} in pipeline {:?}", | ||
| if cfg!(debug_assertions) && is_chased { | ||
| println!("\tpreparing {:?} in {:?}", | ||
| prim_instance.prim_index, pic_context.pipeline_id); | ||
| } | ||
|
|
||
| @@ -2784,16 +2788,28 @@ impl PrimitiveInstance { | ||
| } | ||
| } | ||
| } | ||
| BrushKind::LineDecoration { ref mut handle, style, orientation, wavy_line_thickness, .. } => { | ||
| // Work out the device pixel size to be used to cache this line decoration. | ||
| BrushKind::LineDecoration { color, ref mut handle, style, orientation, wavy_line_thickness } => { | ||
| // Update opacity for this primitive to ensure the correct | ||
|
||
| // batching parameters are used. | ||
| self.opacity.is_opaque = match style { | ||
| LineStyle::Solid => color.a == 1.0, | ||
| LineStyle::Dotted | | ||
| LineStyle::Dashed | | ||
| LineStyle::Wavy => false, | ||
| }; | ||
|
|
||
| // Work out the device pixel size to be used to cache this line decoration. | ||
| let size = get_line_decoration_sizes( | ||
| &prim_local_rect.size, | ||
| orientation, | ||
| style, | ||
| wavy_line_thickness, | ||
| ); | ||
|
|
||
| if is_chased { | ||
lqd
|
||
| println!("\tline decoration opaque={}, sizes={:?}", self.opacity.is_opaque, size); | ||
| } | ||
|
|
||
| if let Some((inline_size, block_size)) = size { | ||
| let size = match orientation { | ||
| LineOrientation::Horizontal => LayoutSize::new(inline_size, block_size), | ||
ProTip!
Use n and p to navigate between commits in a pull request.
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.
Nice👍