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

Decompose repeated images and gradients into brush segments in most cases. #2572

Closed
wants to merge 7 commits into from
Prev

Only tighten the local clip if necessary to see if it fixes the mac r…

…eftests.
  • Loading branch information
nical committed Apr 4, 2018
commit d491421a1e1ffb841af6cfd83d86fe1f2dda9a97
@@ -1197,6 +1197,7 @@ impl PrimitiveStore {
frame_context: &FrameBuildingContext,
frame_state: &mut FrameBuildingState,
) {
let mut tight_local_clip = false;
let metadata = &mut self.cpu_metadata[prim_index.0];
match metadata.prim_kind {
PrimitiveKind::Border => {}
@@ -1369,6 +1370,7 @@ impl PrimitiveStore {

// TODO(review) should this always be true?
let may_need_clip_mask = true;
tight_local_clip = true;

let mut segments = brush.segment_desc.take().map_or(Vec::new(), |desc| desc.segments);
let previous_segment_count = segments.len();
@@ -1543,6 +1545,8 @@ impl PrimitiveStore {
};

if let Some((tile_spacing, stretch_size)) = repeat_params {
tight_local_clip = true;

let visible_rect = compute_conservatrive_visible_rect(
prim_run_context,
frame_context,
@@ -1595,7 +1599,11 @@ impl PrimitiveStore {
if let Some(mut request) = frame_state.gpu_cache.request(&mut metadata.gpu_location) {
// has to match VECS_PER_BRUSH_PRIM
request.push(metadata.local_rect);
request.push(metadata.local_clip_rect.intersection(&metadata.local_rect).unwrap());
if tight_local_clip {
request.push(metadata.local_clip_rect.intersection(&metadata.local_rect).unwrap());
} else {
request.push(metadata.local_clip_rect);
}

match metadata.prim_kind {
PrimitiveKind::Border => {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.