commit ba2b76fef86befe525ae86dc9d8f48fd4ebeadb2
parent 1e163710b0012b1b79466b875f482c772ee9dfe9
Author: Sotaro Ikeda <sotaro.ikeda.g@gmail.com>
Date: Mon, 15 Dec 2025 03:05:53 +0000
Bug 2004696 - Disable compositor surface during negative scaling with WebRender layer compositor r=gfx-reviewers,gw
On Windows video overlay implementation does not support negative scaling for now.
Confirmed the problem is addressed.
Differential Revision: https://phabricator.services.mozilla.com/D276334
Diffstat:
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/gfx/wr/webrender/src/tile_cache/mod.rs b/gfx/wr/webrender/src/tile_cache/mod.rs
@@ -2128,13 +2128,20 @@ impl TileCacheInstance {
None
};
-
- if let CompositorKind::Native { capabilities, .. } = composite_state.compositor_kind {
- if external_image_id.is_some() &&
- !capabilities.supports_external_compositor_surface_negative_scaling &&
- (raster_to_device.scale.x < 0.0 || raster_to_device.scale.y < 0.0) {
- external_image_id = None;
+ match composite_state.compositor_kind {
+ CompositorKind::Native { capabilities, .. } => {
+ if external_image_id.is_some() &&
+ !capabilities.supports_external_compositor_surface_negative_scaling &&
+ (raster_to_device.scale.x < 0.0 || raster_to_device.scale.y < 0.0) {
+ external_image_id = None;
+ }
+ }
+ CompositorKind::Layer { .. } => {
+ if raster_to_device.scale.x < 0.0 || raster_to_device.scale.y < 0.0 {
+ return Err(NegativeScaling);
+ }
}
+ CompositorKind::Draw { .. } => {}
}
let compositor_transform_index = composite_state.register_transform(
@@ -3359,6 +3366,7 @@ enum SurfacePromotionFailure {
ComplexTransform,
SliceAtomic,
SizeTooLarge,
+ NegativeScaling,
}
impl Display for SurfacePromotionFailure {
@@ -3379,6 +3387,7 @@ impl Display for SurfacePromotionFailure {
SurfacePromotionFailure::ComplexTransform => "has a complex transform",
SurfacePromotionFailure::SliceAtomic => "slice is atomic",
SurfacePromotionFailure::SizeTooLarge => "surface is too large for compositor",
+ SurfacePromotionFailure::NegativeScaling => "negative scaling is not supported",
}.to_owned()
)
}