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

Picture caching support, part 1 (of 2). #3332

Merged
merged 10 commits into from Nov 23, 2018

Address some more review comments

  • Loading branch information
gw3583 committed Nov 22, 2018
commit ea5f781fac77754953cbf5d511f6ca5b7914bd3b
@@ -33,7 +33,7 @@ use util::{TransformedRectKind};
// a dummy task that doesn't mask out anything.
const OPAQUE_TASK_ADDRESS: RenderTaskAddress = RenderTaskAddress(0x7fff);

// Used to signal there are no segments provided with this primitive.
/// Used to signal there are no segments provided with this primitive.
const INVALID_SEGMENT_INDEX: i32 = 0xffff;

#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
@@ -325,10 +325,8 @@ impl TileCache {
let tile = if tx >= 0 && ty >= 0 && tx < self.tile_rect.size.width && ty < self.tile_rect.size.height {
let index = (ty * self.tile_rect.size.width + tx) as usize;
mem::replace(&mut self.tiles[index], Tile::new())
} else if let Some(tile) = self.old_tiles.remove(&TileOffset::new(x + x0, y + y0)) {
tile
} else {
Tile::new()
self.old_tiles.remove(&TileOffset::new(x + x0, y + y0)).unwrap_or_else(Tile::new)
};
new_tiles.push(tile);
}
@@ -449,8 +447,10 @@ impl TileCache {
}
}

for (key, value) in &mut opacity_bindings {
*value = scene_properties.get_float_value(*key).unwrap_or(*value);
for (key, current) in &mut opacity_bindings {
if let Some(value) = scene_properties.get_float_value(*key) {
*current = value;
}
}

// The transforms of any clips that are relative to the picture may affect
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.