Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly support tiling clip mask images. #3220

Merged
merged 11 commits into from Oct 23, 2018

clip: Use a smaller tile representation for mask images.

  • Loading branch information
emilio committed Oct 23, 2018
commit 8b62794752bbef20bf4dc2c2c3ccc833c087c442
@@ -17,7 +17,7 @@ use gpu_types::{BoxShadowStretchMode};
use image::{self, Repetition};
use intern;
use internal_types::FastHashSet;
use prim_store::{ClipData, ImageMaskData, SpaceMapper, VisibleImageTile};
use prim_store::{ClipData, ImageMaskData, SpaceMapper, VisibleMaskImageTile};
use render_task::to_cache_size;
use resource_cache::{ImageRequest, ResourceCache};
use std::{cmp, u32};
@@ -316,12 +316,9 @@ impl ClipNode {
data.write_gpu_blocks(request);
}

mask_tiles.push(VisibleImageTile {
mask_tiles.push(VisibleMaskImageTile {
tile_offset: tile.offset,
handle,
edge_flags: tile.edge_flags,
local_rect: tile.rect,
local_clip_rect: visible_rect,
});
}
}
@@ -821,7 +818,7 @@ impl ClipItemKey {
pub enum ClipItem {
Rectangle(LayoutRect, ClipMode),
RoundedRectangle(LayoutRect, BorderRadius, ClipMode),
Image { mask: ImageMask, visible_tiles: Option<Vec<VisibleImageTile>> },
Image { mask: ImageMask, visible_tiles: Option<Vec<VisibleMaskImageTile>> },
BoxShadow(BoxShadowClipSource),
}

@@ -369,6 +369,14 @@ pub struct VisibleImageTile {
pub local_clip_rect: LayoutRect,
}

#[derive(Debug)]
#[cfg_attr(feature = "capture", derive(Serialize))]
#[cfg_attr(feature = "replay", derive(Deserialize))]
pub struct VisibleMaskImageTile {
pub tile_offset: TileOffset,
pub handle: GpuCacheHandle,
}

#[derive(Debug)]
pub struct VisibleGradientTile {
pub handle: GpuCacheHandle,
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.