diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
commit | a90a5cba08fdf6c0ceb95101c275108a152a3aed (patch) | |
tree | 532507288f3defd7f4dcf1af49698bcb76034855 /gfx/wr/webrender/src/pattern.rs | |
parent | Adding debian version 126.0.1-1. (diff) | |
download | firefox-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.rs | 21 |
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 + } + } + } } |