mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Implement support for the drop-shadow
filter (#30439)
* Implement support for `drop-shadow` * Clean up remnant from early attempts * Fix misleading comments on GenericSimpleShadow If Servo-specific `style` changes will need to be upstreamed anyway, I might as well fix a thing that had thrown me off! * Revert "Fix misleading comments on GenericSimpleShadow" This reverts commit cdc810b826ac082041adc212c24649ee3b86ca0a. * Clean up an import * Update test expectations * Fix missing expectation on Layout 2013
This commit is contained in:
parent
8436002383
commit
f7c340f881
23 changed files with 51 additions and 355 deletions
|
@ -62,7 +62,7 @@ use crate::display_list::items::{
|
|||
PushTextShadowDisplayItem, StackingContext, StackingContextType, StickyFrameData,
|
||||
TextOrientation, WebRenderImageInfo,
|
||||
};
|
||||
use crate::display_list::{border, gradient, ToLayout};
|
||||
use crate::display_list::{border, gradient, FilterToLayout, ToLayout};
|
||||
use crate::flow::{BaseFlow, Flow, FlowFlags};
|
||||
use crate::flow_ref::FlowRef;
|
||||
use crate::fragment::{
|
||||
|
@ -1975,8 +1975,14 @@ impl Fragment {
|
|||
.translate(-border_box_offset.to_vector());
|
||||
|
||||
// Create the filter pipeline.
|
||||
let current_color = self.style().clone_color();
|
||||
let effects = self.style().get_effects();
|
||||
let mut filters: Vec<FilterOp> = effects.filter.0.iter().map(ToLayout::to_layout).collect();
|
||||
let mut filters: Vec<FilterOp> = effects
|
||||
.filter
|
||||
.0
|
||||
.iter()
|
||||
.map(|filter| FilterToLayout::to_layout(filter, ¤t_color))
|
||||
.collect();
|
||||
if effects.opacity != 1.0 {
|
||||
filters.push(FilterOp::Opacity(effects.opacity.into(), effects.opacity));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue