diff options
author | Anthony Ramine <nox@nox.paris> | 2019-11-29 09:28:44 +0100 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2019-12-01 10:56:33 +0100 |
commit | 5a360ac63d374023884289ca86b7c2390394c533 (patch) | |
tree | ddd0f62d6628b36f44d857be64bfa14e8ea1564d /components/layout_2020/fragments.rs | |
parent | f24e8d0557c6cb51fac0a5e8ff4046ec6a1717d3 (diff) | |
download | servo-5a360ac63d374023884289ca86b7c2390394c533.tar.gz servo-5a360ac63d374023884289ca86b7c2390394c533.zip |
Start supporting images in layout 2020
Diffstat (limited to 'components/layout_2020/fragments.rs')
-rw-r--r-- | components/layout_2020/fragments.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/components/layout_2020/fragments.rs b/components/layout_2020/fragments.rs index a0ea097abb6..e0c335eb3c9 100644 --- a/components/layout_2020/fragments.rs +++ b/components/layout_2020/fragments.rs @@ -10,12 +10,13 @@ use std::sync::Arc; use style::properties::ComputedValues; use style::values::computed::Length; use style::Zero; -use webrender_api::FontInstanceKey; +use webrender_api::{FontInstanceKey, ImageKey}; pub(crate) enum Fragment { Box(BoxFragment), Anonymous(AnonymousFragment), Text(TextFragment), + Image(ImageFragment), } pub(crate) struct BoxFragment { @@ -61,6 +62,12 @@ pub(crate) struct TextFragment { pub glyphs: Vec<Arc<GlyphStore>>, } +pub(crate) struct ImageFragment { + pub style: ServoArc<ComputedValues>, + pub content_rect: Rect<Length>, + pub image_key: ImageKey, +} + impl AnonymousFragment { pub fn no_op(mode: (WritingMode, Direction)) -> Self { Self { |