mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Auto merge of #19716 - pyfisch:conversions, r=emilio
Use a ToLayout trait for converting from style to webrender types <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19716) <!-- Reviewable:end -->
This commit is contained in:
commit
1a4df8f876
7 changed files with 250 additions and 315 deletions
|
@ -69,7 +69,7 @@ use layout::context::LayoutContext;
|
|||
use layout::context::RegisteredPainter;
|
||||
use layout::context::RegisteredPainters;
|
||||
use layout::context::malloc_size_of_persistent_local_context;
|
||||
use layout::display_list::{ToGfxColor, WebRenderDisplayListConverter};
|
||||
use layout::display_list::WebRenderDisplayListConverter;
|
||||
use layout::flow::{Flow, GetBaseFlow, ImmutableFlowUtils, MutableOwnedFlowUtils};
|
||||
use layout::flow_ref::FlowRef;
|
||||
use layout::incremental::{LayoutDamageComputation, RelayoutMode, SpecialRestyleDamage};
|
||||
|
@ -1688,10 +1688,15 @@ fn get_root_flow_background_color(flow: &mut Flow) -> webrender_api::ColorF {
|
|||
}
|
||||
|
||||
let kid_block_flow = kid.as_block();
|
||||
kid_block_flow.fragment
|
||||
let color = kid_block_flow.fragment
|
||||
.style
|
||||
.resolve_color(kid_block_flow.fragment.style.get_background().background_color)
|
||||
.to_gfx_color()
|
||||
.resolve_color(kid_block_flow.fragment.style.get_background().background_color);
|
||||
webrender_api::ColorF::new(
|
||||
color.red_f32(),
|
||||
color.green_f32(),
|
||||
color.blue_f32(),
|
||||
color.alpha_f32(),
|
||||
)
|
||||
}
|
||||
|
||||
fn get_ua_stylesheets() -> Result<UserAgentStylesheets, &'static str> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue