Commit 39d843dc authored by Chris Harrelson's avatar Chris Harrelson Committed by Commit Bot

Reland: Composite fullscreen videos with composited descendants.

This one fixes
fullscreen/compositor-touch-hit-rects-fullscreen-video-controls.html.

It also modifies the test to actually verify that the video is
composited.

Bug: 1112884,1108972

Change-Id: Ia4357a540a3b8ac530331810824591af2210a5f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2337544
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#795093}
parent 7380858c
......@@ -27,6 +27,7 @@
#include "third_party/blink/renderer/core/paint/compositing/compositing_requirements_updater.h"
#include "base/macros.h"
#include "third_party/blink/renderer/core/html/media/html_media_element.h"
#include "third_party/blink/renderer/core/layout/layout_embedded_content.h"
#include "third_party/blink/renderer/core/layout/layout_view.h"
#include "third_party/blink/renderer/core/paint/compositing/paint_layer_compositor.h"
......@@ -183,6 +184,13 @@ static CompositingReasons SubtreeReasonsForCompositing(
subtree_reasons |= CompositingReason::kIsolateCompositedDescendants;
}
if (layer->GetLayoutObject().IsVideo() &&
To<HTMLMediaElement>(layer->GetLayoutObject().GetNode())
->IsFullscreen()) {
subtree_reasons |=
CompositingReason::kFullscreenVideoWithCompositedDescendants;
}
// A layer with preserve-3d or perspective only needs to be composited if
// there are descendant layers that will be affected by the preserve-3d or
// perspective.
......
......@@ -104,6 +104,9 @@ constexpr CompositingReasonStringMap kCompositingReasonsStringMap[] = {
{CompositingReason::kIsolateCompositedDescendants,
"isolateCompositedDescendants",
"Should isolate descendants to apply a blend effect"},
{CompositingReason::kFullscreenVideoWithCompositedDescendants,
"fullscreenVideoWithCompositedDescendants",
"Is a fullscreen video element with composited descendants"},
{CompositingReason::kRoot, "root", "Is the root layer"},
{CompositingReason::kLayerForHorizontalScrollbar,
"layerForHorizontalScrollbar",
......
......@@ -64,6 +64,7 @@ using CompositingReasons = uint64_t;
V(PerspectiveWith3DDescendants) \
V(Preserve3DWith3DDescendants) \
V(IsolateCompositedDescendants) \
V(FullscreenVideoWithCompositedDescendants) \
\
/* The root layer is a special case. It may be forced to be a layer, but it \
also needs to be a layer if anything else in the subtree is composited. */ \
......
......@@ -65,3 +65,7 @@ http/tests/images/image-decode-in-frame.html [ Pass Failure ]
# CompositeAfterPaint positions and scales root scrollbars incorrectly when
# a page scale factor is applied.
crbug.com/1106550 virtual/threaded-prefer-compositing/fast/scrolling/scrollbars/mouse-scrolling-on-div-scrollbar-thumb-scaled.html [ Failure ]
# Need to force the video to be composited in this case, or change pre-CAP
# to match CAP behavior.
crbug.com/1108972 fullscreen/compositor-touch-hit-rects-fullscreen-video-controls.html [ Failure ]
......@@ -11,6 +11,8 @@ handler: layer(800x600) has hit test rect (0,0 800x600)
handler: layer(800x600) has hit test rect (0,0 800x600)
handler: layer(800x600) has hit test rect (0,0 800x600)
handler: layer(800x600) has hit test rect (0,0 800x600)
handler: layer(800x600) has hit test rect (0,0 800x600)
Found composited video layer, as expected
END OF TEST
......@@ -29,6 +29,11 @@ window.onload = function () {
else
consoleWrite("Should keep rect on document");
logRects('handler');
if (JSON.parse(internals.layerTreeAsText(document)).layers.find(
layer => layer.name.includes("LayoutVideo")))
log('Found composited video layer, as expected')
else
log('ERROR: Failed to find composited video composited layer')
endTest();
});
......
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