summaryrefslogtreecommitdiffstats
path: root/gfx/wr/webrender/src/pattern.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
commita90a5cba08fdf6c0ceb95101c275108a152a3aed (patch)
tree532507288f3defd7f4dcf1af49698bcb76034855 /gfx/wr/webrender/src/pattern.rs
parentAdding debian version 126.0.1-1. (diff)
downloadfirefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz
firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/wr/webrender/src/pattern.rs')
-rw-r--r--gfx/wr/webrender/src/pattern.rs21
1 files changed, 18 insertions, 3 deletions
diff --git a/gfx/wr/webrender/src/pattern.rs b/gfx/wr/webrender/src/pattern.rs
index 36a06fa2b9..f4ddd51f9f 100644
--- a/gfx/wr/webrender/src/pattern.rs
+++ b/gfx/wr/webrender/src/pattern.rs
@@ -10,12 +10,14 @@ use api::{ColorF, PremultipliedColorF};
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
pub enum PatternKind {
ColorOrTexture = 0,
+ RadialGradient = 1,
+ ConicGradient = 2,
- Mask = 1,
+ Mask = 3,
// When adding patterns, don't forget to update the NUM_PATTERNS constant.
}
-pub const NUM_PATTERNS: u32 = 2;
+pub const NUM_PATTERNS: u32 = 4;
impl PatternKind {
pub fn from_u32(val: u32) -> Self {
@@ -61,8 +63,21 @@ impl Pattern {
Pattern {
kind: PatternKind::ColorOrTexture,
shader_input: PatternShaderInput::default(),
- base_color: PremultipliedColorF::BLACK,
+ base_color: PremultipliedColorF::WHITE,
is_opaque: false,
}
}
+
+ pub fn supports_segmented_rendering(&self) -> bool {
+ match self.kind {
+ PatternKind::ColorOrTexture | PatternKind::Mask => {
+ true
+ }
+ PatternKind::RadialGradient | PatternKind::ConicGradient => {
+ // TODO: We need to fix up the layout coords mismatch in pattern
+ // and quad rendering to allow these to be segmented.
+ false
+ }
+ }
+ }
}