Commit f8c754b9 authored by Nicolás Peña Moreno's avatar Nicolás Peña Moreno Committed by Commit Bot

[PaintTiming] Let videos trigger FCP

This CL adds a call to SetImagePainted() so that FCP fires when there we
paint a video.

Bug: 1071450
Change-Id: I9590517fd3355226096fd62079a3a4aa6eb50735
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2276244Reviewed-by: default avatarXianzhu Wang <wangxianzhu@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#784189}
parent 6b93be07
...@@ -42,6 +42,10 @@ void VideoPainter::PaintReplaced(const PaintInfo& paint_info, ...@@ -42,6 +42,10 @@ void VideoPainter::PaintReplaced(const PaintInfo& paint_info,
return; return;
GraphicsContext& context = paint_info.context; GraphicsContext& context = paint_info.context;
// Here we're not painting the video but rather preparing the layer for the
// compositor to submit video frames. But the compositor will do all the work
// related to the video moving forward. Therefore we mark the FCP here.
context.GetPaintController().SetImagePainted();
PhysicalRect content_box_rect = layout_video_.PhysicalContentBoxRect(); PhysicalRect content_box_rect = layout_video_.PhysicalContentBoxRect();
content_box_rect.Move(paint_offset); content_box_rect.Move(paint_offset);
......
...@@ -5672,7 +5672,6 @@ crbug.com/1062984 external/wpt/paint-timing/fcp-only/fcp-invisible-3d-rotate.htm ...@@ -5672,7 +5672,6 @@ crbug.com/1062984 external/wpt/paint-timing/fcp-only/fcp-invisible-3d-rotate.htm
crbug.com/1062984 external/wpt/paint-timing/fcp-only/fcp-out-of-bounds-translate.html [ Failure ] crbug.com/1062984 external/wpt/paint-timing/fcp-only/fcp-out-of-bounds-translate.html [ Failure ]
crbug.com/1062984 external/wpt/paint-timing/fcp-only/fcp-svg.html [ Failure ] crbug.com/1062984 external/wpt/paint-timing/fcp-only/fcp-svg.html [ Failure ]
crbug.com/1062984 external/wpt/paint-timing/fcp-only/fcp-text-input.html [ Failure ] crbug.com/1062984 external/wpt/paint-timing/fcp-only/fcp-text-input.html [ Failure ]
crbug.com/1062984 external/wpt/paint-timing/fcp-only/fcp-video-frame.html [ Failure Timeout ]
# Sheriff 2019-03-01 # Sheriff 2019-03-01
crbug.com/937416 http/tests/devtools/resource-tree/resource-tree-htmlimports.js [ Pass Failure ] crbug.com/937416 http/tests/devtools/resource-tree/resource-tree-htmlimports.js [ Pass Failure ]
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<script src="../resources/utils.js"></script> <script src="../resources/utils.js"></script>
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="/common/media.js"></script>
<video id="video" autoplay></video> <video id="video" autoplay></video>
<script> <script>
promise_test(async t => { promise_test(async t => {
...@@ -14,7 +15,7 @@ ...@@ -14,7 +15,7 @@
await assertNoFirstContentfulPaint(t); await assertNoFirstContentfulPaint(t);
// Set actual video content to trigger FCP. // Set actual video content to trigger FCP.
const video = document.getElementById('video'); const video = document.getElementById('video');
video.setAttribute('src', '/media/test.mp4'); video.src = getVideoURI('/media/test');
await new Promise(resolve => { await new Promise(resolve => {
video.oncanplay = resolve; video.oncanplay = resolve;
}); });
......
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