Skip to content
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

Add support for specific blend modes per batch. #508

Merged
merged 1 commit into from Nov 1, 2016

Conversation

@glennw
Copy link
Member

glennw commented Oct 31, 2016

Also track the previous blend mode while drawing batches
and only set it when changed.


This change is Reviewable

BlendMode::Alpha => {
self.device.set_blend(true);
}
}

This comment has been minimized.

@pcwalton

pcwalton Oct 31, 2016

Collaborator

nit: could just be self.device.set_blend(batch.key.blend_mode == BlendMode::Alpha)

This comment has been minimized.

@glennw

glennw Oct 31, 2016

Author Member

Fixed

@@ -862,11 +871,9 @@ pub struct AlphaBatchKeyFlags(u8);

impl AlphaBatchKeyFlags {

This comment has been minimized.

@pcwalton

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.

@glennw

glennw Oct 31, 2016

Author Member
Also track the previous blend mode while drawing batches
and only set it when changed.
@glennw glennw force-pushed the glennw:blend-mode-prep branch from 157fc08 to 878c6aa Oct 31, 2016
@glennw
Copy link
Member Author

glennw commented Nov 1, 2016

@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.

@kvark

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.

@pcwalton
Copy link
Collaborator

pcwalton commented Nov 1, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Nov 1, 2016

📌 Commit 878c6aa has been approved by pcwalton

@bors-servo
Copy link
Contributor

bors-servo commented Nov 1, 2016

Test exempted - status

@bors-servo bors-servo merged commit 878c6aa into servo:master Nov 1, 2016
1 of 2 checks passed
1 of 2 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
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 -->
@glennw glennw deleted the glennw:blend-mode-prep branch Dec 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.