commit 185d0c4fb944795dfd97c8ceeb2f92e2f1c9af07
parent a32cef48493d96650f37cf8e2e623819efcbf97f
Author: Sotaro Ikeda <sotaro.ikeda.g@gmail.com>
Date: Wed, 24 Dec 2025 00:17:17 +0000
Bug 2007464 - Enable overlay with negative scaling with WebRender layer compositor r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D277398
Diffstat:
2 files changed, 2 insertions(+), 9 deletions(-)
diff --git a/gfx/webrender_bindings/DCLayerTree.cpp b/gfx/webrender_bindings/DCLayerTree.cpp
@@ -2230,7 +2230,7 @@ bool DCSurfaceVideo::CalculateSwapChainSize(gfx::Matrix& aTransform) {
// could be done by VideoProcessor
bool scaleVideoAtVideoProcessor = false;
if (StaticPrefs::gfx_webrender_dcomp_video_vp_scaling_win_AtStartup() &&
- aTransform.PreservesAxisAlignedRectangles()) {
+ aTransform.IsTranslation()) {
gfx::Size scaledSize = gfx::Size(mVideoSize) * aTransform.ScaleFactors();
gfx::IntSize size(int32_t(std::round(scaledSize.width)),
int32_t(std::round(scaledSize.height)));
diff --git a/gfx/wr/webrender/src/tile_cache/mod.rs b/gfx/wr/webrender/src/tile_cache/mod.rs
@@ -1852,12 +1852,7 @@ impl TileCacheInstance {
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 { .. } => {}
+ CompositorKind::Layer { .. } | CompositorKind::Draw { .. } => {}
}
let compositor_transform_index = composite_state.register_transform(
@@ -3146,7 +3141,6 @@ enum SurfacePromotionFailure {
ComplexTransform,
SliceAtomic,
SizeTooLarge,
- NegativeScaling,
}
impl Display for SurfacePromotionFailure {
@@ -3167,7 +3161,6 @@ 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()
)
}