Commit 556b103a authored by Sunny Sachanandani's avatar Sunny Sachanandani Committed by Commit Bot

viz: Remove support for non-root direct composition overlays

DCLayerOverlayProcessor supports non-root with a disabled by default
finch flag. This hasn't shipped in the last 3+ years and it's unlikely
it would ever ship in the current form. Meanwhile, any refactoring of
the overlay processor for implementing real performance optimizations
like partial quad aggregation becomes a lot more complicated due to
handling the corner case of non-root render passes.

Also remove support for non axis-aligned transforms since those rely on
non-root render pass support as well.  Remove the misleading unit tests
for non axis-aligned transforms since those only test video quads in
root render pass which doesn't occur in practice since non axis-aligned
video surfaces don't get merged to the root render pass.

Bug: 1100690, 1077210
Change-Id: Idc012d29d9e4effd3b3e4194ad0cfcdf9083d71f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2277321Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Reviewed-by: default avatarMaggie Chen <magchen@chromium.org>
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
Cr-Commit-Position: refs/heads/master@{#785906}
parent c777abf5
......@@ -98,23 +98,10 @@ class VIZ_SERVICE_EXPORT DCLayerOverlayProcessor
void UpdateHasHwOverlaySupport();
private:
// Returns an iterator to the element after |it|.
QuadList::Iterator ProcessRenderPassDrawQuad(RenderPass* render_pass,
gfx::Rect* damage_rect,
QuadList::Iterator it);
void ProcessRenderPass(DisplayResourceProvider* resource_provider,
const gfx::RectF& display_rect,
RenderPass* render_pass,
bool is_root,
gfx::Rect* damage_rect,
DCLayerOverlayList* dc_layer_overlays);
// UpdateDCLayerOverlays() adds the quad at |it| to the overlay list
// |dc_layer_overlays|.
void UpdateDCLayerOverlays(const gfx::RectF& display_rect,
RenderPass* render_pass,
bool is_root,
const QuadList::Iterator& it,
const gfx::Rect& quad_rectangle_in_target_space,
const gfx::Rect& occluding_damage_rect,
......@@ -135,15 +122,15 @@ class VIZ_SERVICE_EXPORT DCLayerOverlayProcessor
RenderPass* render_pass,
const gfx::Rect& quad_rectangle,
const QuadList::Iterator& it,
bool is_root,
gfx::Rect* damage_rect,
gfx::Rect* this_frame_underlay_rect,
DCLayerOverlay* dc_layer);
void InsertDebugBorderDrawQuads(const gfx::RectF& display_rect,
const gfx::Rect& overlay_rect,
RenderPass* root_render_pass,
gfx::Rect* damage_rect);
void InsertDebugBorderDrawQuad(const gfx::RectF& display_rect,
const gfx::Rect& overlay_rect,
SkColor border_color,
RenderPass* render_pass,
gfx::Rect* damage_rect);
bool has_overlay_support_;
const bool show_debug_borders_;
......@@ -156,26 +143,6 @@ class VIZ_SERVICE_EXPORT DCLayerOverlayProcessor
int previous_frame_processed_overlay_count_ = 0;
int current_frame_processed_overlay_count_ = 0;
struct RenderPassData {
RenderPassData();
RenderPassData(const RenderPassData& other);
~RenderPassData();
// Store information about clipped punch-through rects in target space for
// non-root render passes. These rects are used to clear the corresponding
// areas in parent render passes.
std::vector<gfx::Rect> punch_through_rects;
// Output rects of child render passes that have backdrop filters in target
// space. These rects are used to determine if the overlay rect could be
// read by backdrop filters.
std::vector<gfx::Rect> backdrop_filter_rects;
// Whether this render pass has backdrop filters.
bool has_backdrop_filters = false;
};
base::flat_map<RenderPassId, RenderPassData> render_pass_data_;
scoped_refptr<base::SingleThreadTaskRunner> viz_task_runner_;
DISALLOW_COPY_AND_ASSIGN(DCLayerOverlayProcessor);
......
<!DOCTYPE HTML>
<!-- This HTML plays a video with complex overlay transformation.
To improve test stability, this test sends out SUCCESS for screen capture after
the video playback starts (video.currentTime > 0).
-->
<html>
<head>
<title>Complex Overlay Video test</title>
<style type="text/css">
.nomargin {
margin: 0px auto;
}
.transformed {
transform: scaleX(1.5);
transform: scaleY(1.5);
transform: rotate(20deg);
}
</style>
<script src="pixel_video_test.js"></script>
</head>
<body onload="main()">
<div id="container" style="position:absolute; top:0px; left:0px;">
<video class="nomargin transformed" id="video" width="240" height="136">
<source src="/media/test/data/four-colors.mp4" type="video/mp4">
</video>
</div>
<div id="container" class="nomargin" style="position:absolute; top:0px; left:0px; width:30px; height:30px; background-color:black;">
</div>
</body>
</html>
......@@ -674,14 +674,6 @@ class PixelTestPages(object):
# test with the code path that's enabled with battery power.
'--disable_vp_scaling=1'
]
browser_args_Nonroot = browser_args + [
'--enable-features=DirectCompositionNonrootOverlays,' +
'DirectCompositionUnderlays'
]
browser_args_Complex = browser_args + [
'--enable-features=DirectCompositionComplexOverlays,' +
'DirectCompositionNonrootOverlays,' + 'DirectCompositionUnderlays'
]
browser_args_YUY2 = browser_args + [
'--disable-features=DirectCompositionPreferNV12Overlays'
]
......@@ -809,17 +801,6 @@ class PixelTestPages(object):
browser_args=browser_args,
other_args={'zero_copy': True},
matching_algorithm=strict_dc_sobel_algorithm),
# Surprisingly stable, does not need inexact matching at this time.
PixelTestPage('pixel_video_nonroot.html',
base_name + '_DirectComposition_Nonroot',
test_rect=[0, 0, 240, 136],
browser_args=browser_args_Nonroot),
PixelTestPage('pixel_video_complex_overlays.html',
base_name + '_DirectComposition_ComplexOverlays',
test_rect=[0, 0, 240, 136],
browser_args=browser_args_Complex,
other_args={'video_is_rotated': True},
matching_algorithm=strict_dc_sobel_algorithm),
PixelTestPage('pixel_video_mp4_rounded_corner.html',
base_name + '_DirectComposition_Video_MP4_Rounded_Corner',
test_rect=[0, 0, 240, 135],
......
......@@ -157,10 +157,6 @@ crbug.com/927901 [ android ] Pixel_Video_VP9_DXVA [ Skip ]
crbug.com/927901 [ mac ] Pixel_Video_VP9_DXVA [ Skip ]
crbug.com/927901 [ chromeos ] Pixel_Video_VP9_DXVA [ Skip ]
# Complex overlays test is flaky on Nvidia probably due to its small size.
# TODO(cblume): Commented out until a more broad suppression can be reverted / fixed.
# crbug.com/929425 [ win nvidia no-use-skia-dawn ] Pixel_DirectComposition_ComplexOverlays [ RetryOnFailure ]
# Mark all webview tests as RetryOnFailure due to Nexus 5x driver bug.
crbug.com/950932 [ android-webview-instrumentation qualcomm-adreno-(tm)-418 ] * [ RetryOnFailure ]
......@@ -275,8 +271,6 @@ crbug.com/1021566 [ use-skia-dawn ] Pixel_2DCanvasWebGL [ Skip ]
crbug.com/1021566 [ use-skia-dawn ] Pixel_Canvas2DRedBox [ Skip ]
crbug.com/1021566 [ use-skia-dawn ] Pixel_Canvas2DRedBoxScrgbLinear [ Skip ]
crbug.com/1021566 [ use-skia-dawn ] Pixel_Canvas2DUntagged [ Skip ]
crbug.com/1021566 [ use-skia-dawn ] Pixel_DirectComposition_ComplexOverlays [ Skip ]
crbug.com/1021566 [ use-skia-dawn ] Pixel_DirectComposition_Nonroot [ Skip ]
crbug.com/1021566 [ use-skia-dawn ] Pixel_DirectComposition_Underlay [ Skip ]
crbug.com/1021566 [ use-skia-dawn ] Pixel_DirectComposition_Underlay_DXVA [ Skip ]
crbug.com/1021566 [ use-skia-dawn ] Pixel_DirectComposition_Underlay_Fullsize [ Skip ]
......@@ -339,7 +333,6 @@ crbug.com/1086690 [ chromeos ] Pixel_WebGLSadCanvas [ Skip ]
crbug.com/1097735 [ use-skia-dawn ] Pixel_PaintWorkletTransform [ Failure ]
# TODO(cblume): temporarily suppress these test until reverted / fixed.
crbug.com/1102086 [ win nvidia no-use-skia-dawn ] Pixel_DirectComposition_ComplexOverlays [ Skip ]
crbug.com/1102086 [ win7 amd no-use-skia-dawn no-skia-renderer ] Pixel_Video_MP4_FourColors_Aspect_4x3 [ Skip ]
crbug.com/1102086 [ mac intel ] Pixel_Video_Context_Loss_MP4 [ Skip ]
crbug.com/1102086 [ mac intel no-use-skia-dawn no-skia-renderer ] Pixel_Video_MP4 [ Skip ]
......
......@@ -67,11 +67,6 @@ crbug.com/1009860 [ win10 ] SwapChainTraceTest_CanvasUnacceleratedLowLatency2D [
# VP9 videos fail to trigger zero copy video presentation path.
crbug.com/930343 [ win intel ] VideoPathTraceTest_DirectComposition_Video_VP9_Fullsize [ Failure ]
# Complex overlays test is flaky on Nvidia probably due to its small size.
crbug.com/937545 [ win10 nvidia ] VideoPathTraceTest_DirectComposition_ComplexOverlays [ RetryOnFailure ]
# Flaky for unknown reason.
crbug.com/960007 [ win10 nvidia ] OverlayModeTraceTest_DirectComposition_Nonroot [ RetryOnFailure ]
# TODO(crbug.com/1079393): Compress down to just "intel" instead of specific
# GPUs once UHD 630 failures are fixed.
crbug.com/969117 [ win10 intel-0xa2e ] OverlayModeTraceTest_DirectComposition_Video_MP4_FourColors_Aspect_4x3 [ RetryOnFailure ]
......@@ -80,7 +75,6 @@ crbug.com/969117 [ win10 intel-0xd26 ] OverlayModeTraceTest_DirectComposition_Vi
crbug.com/978181 [ win10 nvidia ] OverlayModeTraceTest_DirectComposition_Underlay [ RetryOnFailure ]
# Incorrectly reporting SCALING instead of DIRECT on Windows 10 UHD 630 GPUs.
crbug.com/1079393 [ win10 intel-0x3e92 ] OverlayModeTraceTest_DirectComposition_Nonroot [ Failure ]
crbug.com/1079393 [ win10 intel-0x3e92 ] OverlayModeTraceTest_DirectComposition_Underlay [ Failure ]
crbug.com/1079393 [ win10 intel-0x3e92 ] OverlayModeTraceTest_DirectComposition_Underlay_DXVA [ Failure ]
crbug.com/1079393 [ win10 intel-0x3e92 ] OverlayModeTraceTest_DirectComposition_Underlay_Fullsize [ Failure ]
......@@ -99,8 +93,6 @@ crbug.com/1079393 [ win10 intel-0x3e92 ] VideoPathTraceTest_DirectComposition_Vi
# Using YUY2 instead of NV12 on Windows 10 HD 630 GPUs due to NV12 support
# showing up as SOFTWARE.
crbug.com/1079393 [ win10 intel-0x5912 ] VideoPathTraceTest_DirectComposition_ComplexOverlays [ Failure ]
crbug.com/1079393 [ win10 intel-0x5912 ] VideoPathTraceTest_DirectComposition_Nonroot [ Failure ]
crbug.com/1079393 [ win10 intel-0x5912 ] VideoPathTraceTest_DirectComposition_Underlay [ Failure ]
crbug.com/1079393 [ win10 intel-0x5912 ] VideoPathTraceTest_DirectComposition_Underlay_DXVA [ Failure ]
crbug.com/1079393 [ win10 intel-0x5912 ] VideoPathTraceTest_DirectComposition_Underlay_Fullsize [ Failure ]
......
......@@ -173,11 +173,6 @@ const int kGLSwitchesCopiedFromGpuProcessHostNumSwitches =
namespace features {
// Allow putting content with complex transforms (e.g. rotations) into an
// overlay.
const base::Feature kDirectCompositionComplexOverlays{
"DirectCompositionComplexOverlays", base::FEATURE_DISABLED_BY_DEFAULT};
// Use IDXGIOutput::WaitForVBlank() to drive begin frames.
const base::Feature kDirectCompositionGpuVSync{
"DirectCompositionGpuVSync", base::FEATURE_ENABLED_BY_DEFAULT};
......@@ -187,10 +182,6 @@ const base::Feature kDirectCompositionLowLatencyPresentation{
"DirectCompositionLowLatencyPresentation",
base::FEATURE_DISABLED_BY_DEFAULT};
// Allow using overlays for non-root render passes.
const base::Feature kDirectCompositionNonrootOverlays{
"DirectCompositionNonrootOverlays", base::FEATURE_DISABLED_BY_DEFAULT};
// Overrides preferred overlay format to NV12 instead of YUY2.
const base::Feature kDirectCompositionPreferNV12Overlays{
"DirectCompositionPreferNV12Overlays", base::FEATURE_ENABLED_BY_DEFAULT};
......
......@@ -81,10 +81,8 @@ GL_EXPORT extern const int kGLSwitchesCopiedFromGpuProcessHostNumSwitches;
} // namespace switches
namespace features {
GL_EXPORT extern const base::Feature kDirectCompositionComplexOverlays;
GL_EXPORT extern const base::Feature kDirectCompositionGpuVSync;
GL_EXPORT extern const base::Feature kDirectCompositionLowLatencyPresentation;
GL_EXPORT extern const base::Feature kDirectCompositionNonrootOverlays;
GL_EXPORT extern const base::Feature kDirectCompositionPreferNV12Overlays;
GL_EXPORT extern const base::Feature kDirectCompositionPresentationFeedback;
GL_EXPORT extern const base::Feature kDirectCompositionSoftwareOverlays;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment