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

Invalidate drop-shadow data when local rect is animating. #2799

Merged
merged 1 commit into from Jun 5, 2018
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -83,13 +83,15 @@ pub struct PictureContext<'a> {
pub struct PictureState {
pub tasks: Vec<RenderTaskId>,
pub has_non_root_coord_system: bool,
pub local_rect_changed: bool,
}

impl PictureState {
pub fn new() -> PictureState {
PictureState {
tasks: Vec::new(),
has_non_root_coord_system: false,
local_rect_changed: false,
}
}
}
@@ -467,6 +467,14 @@ impl PicturePrimitive {
pic_state.tasks.push(render_task_id);
self.surface = Some(PictureSurface::RenderTask(render_task_id));

// If the local rect of the contents changed, force the cache handle
// to be invalidated so that the primitive data below will get
// uploaded to the GPU this frame. This can occur during property
// animation.
if pic_state.local_rect_changed {

This comment has been minimized.

@kvark

kvark Jun 4, 2018

Member

when is it ever reset to false?

This comment has been minimized.

@gw3583

gw3583 Jun 4, 2018

Author Collaborator

The PictureState struct is constructed every frame, during the recursive traversal.

This comment has been minimized.

@gw3583

gw3583 Jun 4, 2018

Author Collaborator

(It's just a stack allocated helper struct passed down to child pictures).

frame_state.gpu_cache.invalidate(&mut self.extra_gpu_data_handle);
}

if let Some(mut request) = frame_state.gpu_cache.request(&mut self.extra_gpu_data_handle) {
// TODO(gw): This is very hacky code below! It stores an extra
// brush primitive below for the special case of a
@@ -2473,6 +2473,7 @@ impl PrimitiveStore {
if new_local_rect != metadata.local_rect {
metadata.local_rect = new_local_rect;
frame_state.gpu_cache.invalidate(&mut metadata.gpu_location);
pic_state.local_rect_changed = true;

This comment has been minimized.

@kvark

kvark Jun 4, 2018

Member

any reason we can't just invalidate pic_state.extra_gpu_data_handle right here?

This comment has been minimized.

@gw3583

gw3583 Jun 4, 2018

Author Collaborator

extra_gpu_data_handle exists on the Picture struct, not in PictureState. We do have access to the picture here, and could invalidate it here - however, the way that extra_gpu_data_handle is used depends on the type of Picture, and so it seems tidier to have that done in the code that deals with specific picture types, rather than adding a new match here on the picture type.

}
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.