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 upAdd support for specific blend modes per batch. #508
Merged
Conversation
webrender/src/renderer.rs
Outdated
| BlendMode::Alpha => { | ||
| self.device.set_blend(true); | ||
| } | ||
| } |
This comment has been minimized.
This comment has been minimized.
pcwalton
Oct 31, 2016
Collaborator
nit: could just be self.device.set_blend(batch.key.blend_mode == BlendMode::Alpha)
This comment has been minimized.
This comment has been minimized.
| @@ -862,11 +871,9 @@ pub struct AlphaBatchKeyFlags(u8); | |||
|
|
|||
| impl AlphaBatchKeyFlags { | |||
This comment has been minimized.
This comment has been minimized.
pcwalton
Oct 31, 2016
Collaborator
Should we use bitflags! for this at some point? (Doesn't have to be now)
This comment has been minimized.
This comment has been minimized.
Also track the previous blend mode while drawing batches and only set it when changed.
|
@pcwalton Addressed review comments |
| @@ -88,6 +88,12 @@ const GPU_TAG_PRIM_BOX_SHADOW: GpuProfileTag = GpuProfileTag { label: "BoxShadow | |||
| // Orange | |||
| const GPU_TAG_PRIM_BORDER: GpuProfileTag = GpuProfileTag { label: "Border", color: ColorF { r: 1.0, g: 0.5, b: 0.0, a: 1.0 } }; | |||
|
|
|||
| #[derive(Debug, Copy, Clone, PartialEq)] | |||
| pub enum BlendMode { | |||
| None, | |||
This comment has been minimized.
This comment has been minimized.
kvark
Nov 1, 2016
Member
Isn't this non-idiomatic? I'd think an Option<BlendMode> would be appropriate, where the actual BlendMode variants are all blend-enabled, even if the equation is trivial.
|
@bors-servo: r+ |
|
|
|
|
bors-servo
added a commit
that referenced
this pull request
Nov 1, 2016
Add support for specific blend modes per batch. Also track the previous blend mode while drawing batches and only set it when changed. <!-- 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/508) <!-- Reviewable:end -->
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 commentedOct 31, 2016
•
edited by larsbergstrom
Also track the previous blend mode while drawing batches
and only set it when changed.
This change is