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

Sync changes from mozilla-central gfx/wr #3859

Merged
merged 4 commits into from Feb 14, 2020
Next

Bug 1579235 - Part 1 - Support prefer compositor flag in wrench. r=nical

Add support to the yaml reader and writer to be able to specify
that a primitive should set the PREFER_COMPOSITOR_SURFACE flag.

This flag is not currently used, but in future will signal the
picture caching code to promote a primitive to draw on a native
compositor surface where possible.

Differential Revision: https://phabricator.services.mozilla.com/D62693

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/1e1ffcbadfb2350ecda25b8752b3c07c2f2d0722
  • Loading branch information
gw3583 authored and moz-gfx committed Feb 13, 2020
commit 45d334bf3c7e2d207b4e131104924e7d14420c23
@@ -1732,6 +1732,13 @@ impl YamlFrameReader {
flags.remove(PrimitiveFlags::IS_SCROLLBAR_CONTAINER);
}
}
if let Some(prefer_compositor_surface) = item["prefer-compositor-surface"].as_bool() {
if prefer_compositor_surface {
flags.insert(PrimitiveFlags::PREFER_COMPOSITOR_SURFACE);
} else {
flags.remove(PrimitiveFlags::PREFER_COMPOSITOR_SURFACE);
}
}

let mut info = CommonItemProperties {
clip_rect,
@@ -205,6 +205,7 @@ fn common_node(v: &mut Table, clip_id_mapper: &mut ClipIdMapper, info: &CommonIt
rect_node(v, "clip-rect", &info.clip_rect);
bool_node(v, "backface-visible", info.flags.contains(PrimitiveFlags::IS_BACKFACE_VISIBLE));
bool_node(v, "scrollbar-container", info.flags.contains(PrimitiveFlags::IS_SCROLLBAR_CONTAINER));
bool_node(v, "prefer-compositor-surface", info.flags.contains(PrimitiveFlags::PREFER_COMPOSITOR_SURFACE));
bool_node(v, "scrollbar-thumb", info.flags.contains(PrimitiveFlags::IS_SCROLLBAR_THUMB));

clip_and_scroll_node(v, clip_id_mapper, info.clip_id, info.spatial_id);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.