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 #3840

Merged
merged 6 commits into from Jan 23, 2020
@@ -218,14 +218,17 @@ extern "C" {
UINT window_height = static_cast<UINT>(ceil(float(window_rect.bottom - window_rect.top) * dpiY / 96.f));

LPCWSTR name;
DWORD style;
if (enable_compositor) {
name = L"example-compositor (DirectComposition)";
style = WS_EX_NOREDIRECTIONBITMAP;
} else {
name = L"example-compositor (Simple)";
style = 0;
}

window->hWnd = CreateWindowEx(
WS_EX_NOREDIRECTIONBITMAP,
style,
CLASS_NAME,
name,
WS_OVERLAPPEDWINDOW,
@@ -2985,6 +2985,10 @@ bitflags! {
const SCROLLBAR_CONTAINER = 64;
/// If set, this cluster contains clear rectangle primitives.
const IS_CLEAR_PRIMITIVE = 128;
/// This is used as a performance hint - this primitive may be promoted to a native
/// compositor surface under certain (implementation specific) conditions. This
/// is typically used for large videos, and canvas elements.
const PREFER_COMPOSITOR_SURFACE = 256;
}
}

@@ -3112,6 +3116,10 @@ impl PrimitiveList {
flags.insert(ClusterFlags::SCROLLBAR_CONTAINER);
}

if prim_flags.contains(PrimitiveFlags::PREFER_COMPOSITOR_SURFACE) {
flags.insert(ClusterFlags::PREFER_COMPOSITOR_SURFACE);
}

// Insert the primitive into the first or last cluster as required
match insert_position {
PrimitiveListPosition::Begin => {
@@ -43,6 +43,10 @@ bitflags! {
const IS_SCROLLBAR_CONTAINER = 1 << 1;
/// If set, this primitive represents a scroll bar thumb
const IS_SCROLLBAR_THUMB = 1 << 2;
/// This is used as a performance hint - this primitive may be promoted to a native
/// compositor surface under certain (implementation specific) conditions. This
/// is typically used for large videos, and canvas elements.
const PREFER_COMPOSITOR_SURFACE = 1 << 3;
}
}

@@ -251,10 +251,6 @@ bitflags! {
///
/// See https://github.com/servo/webrender/pull/2555/
const ALLOW_MIPMAPS = 2;
/// This is used as a performance hint - this image may be promoted to a native
/// compositor surface under certain (implementation specific) conditions. This
/// is typically used for large videos, and canvas elements.
const PREFER_COMPOSITOR_SURFACE = 4;
}
}

@@ -325,12 +321,6 @@ impl ImageDescriptor {
pub fn allow_mipmaps(&self) -> bool {
self.flags.contains(ImageDescriptorFlags::ALLOW_MIPMAPS)
}

/// Returns true if this descriptor wants to be drawn as a native
/// compositor surface.
pub fn prefer_compositor_surface(&self) -> bool {
self.flags.contains(ImageDescriptorFlags::PREFER_COMPOSITOR_SURFACE)
}
}

/// Represents the backing store of an arbitrary series of pixels for display by
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.