Auto merge of #25622 - pylbrecht:composite.op.clear, r=jdm

Add missing CanvasRenderingContext2D global composition operation "clear"

<!-- Please describe your changes on the following line: -->

<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix part of #25331

<!-- Either: -->
- [x] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
bors-servo 2020-01-27 19:40:42 -05:00 committed by GitHub
commit 1b7223a284
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 4 additions and 13 deletions

View file

@ -1002,6 +1002,7 @@ impl ToRaqoteStyle for CompositionStyle {
CompositionStyle::Copy => raqote::BlendMode::Src,
CompositionStyle::Lighter => raqote::BlendMode::Add,
CompositionStyle::Xor => raqote::BlendMode::Xor,
CompositionStyle::Clear => raqote::BlendMode::Clear,
}
}
}

View file

@ -254,6 +254,7 @@ pub enum CompositionStyle {
Copy,
Lighter,
Xor,
Clear,
}
impl FromStr for CompositionStyle {
@ -272,6 +273,7 @@ impl FromStr for CompositionStyle {
"copy" => Ok(CompositionStyle::Copy),
"lighter" => Ok(CompositionStyle::Lighter),
"xor" => Ok(CompositionStyle::Xor),
"clear" => Ok(CompositionStyle::Clear),
_ => Err(()),
}
}
@ -291,6 +293,7 @@ impl CompositionStyle {
CompositionStyle::Copy => "copy",
CompositionStyle::Lighter => "lighter",
CompositionStyle::Xor => "xor",
CompositionStyle::Clear => "clear",
}
}
}

View file

@ -1,5 +0,0 @@
[2d.composite.operation.clear.html]
type: testharness
[Canvas test: 2d.composite.operation.clear]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.operation.clear.html]
[OffscreenCanvas test: 2d.composite.operation.clear]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.operation.clear.worker.html]
[2d]
expected: FAIL