Skip to content

Commit

Permalink
[m115] Crash in SkiaRenderer::DrawTextureQuad w/ MF Clear DComp
Browse files Browse the repository at this point in the history
When using Media Foundation Renderer w/ Direct Composition on Windows composited Stream Video Textures are supported. The CHECK added in SkiaRenderer::DrawTextureQuad could result in GPU process crashes and black video as a result. This change avoids the check on Windows.

Note: I do not believe there's any Windows scenarios which combine Stream Video Textures with use_real_color_space_for_stream_video_, so no replacement has been added here.

(cherry picked from commit 94dfdfb)

Change-Id: I2b128791f49196c524cae247327c628c0bb31432
Bug: 1448978
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4568516
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Commit-Queue: William Carr <wicarr@microsoft.com>
Cr-Original-Commit-Position: refs/heads/main@{#1152646}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4599233
Cr-Commit-Position: refs/branch-heads/5790@{#494}
Cr-Branched-From: 1d71a33-refs/heads/main@{#1148114}
  • Loading branch information
WiCarr authored and Chromium LUCI CQ committed Jun 8, 2023
1 parent b650f4c commit 48bba4b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions components/viz/service/display/direct_renderer.cc
Expand Up @@ -43,6 +43,10 @@
#include "ui/gfx/geometry/transform.h"
#include "ui/gfx/geometry/transform_util.h"

#if BUILDFLAG(IS_WIN)
#include "components/viz/common/quads/texture_draw_quad.h"
#endif // BUILDFLAG(IS_WIN)

namespace {

// Returns the bounding box that contains the specified rounded corner.
Expand Down Expand Up @@ -339,6 +343,25 @@ void DirectRenderer::DrawFrame(
&(current_frame()->output_surface_plane));
}

#if BUILDFLAG(IS_WIN)
// On Windows stream video texture quads are currently only supported in
// overlays. There are scenarios where promotion may fail today, (e.g.
// if the quad is in a non-root render pass or video capture is enabled)
// so we do an extra pass to ensure these quads aren't processed by setting
// their visible rect to empty.
for (const auto& pass : *render_passes_in_draw_order) {
QuadList* ql = &pass->quad_list;
for (auto it = ql->begin(); it != ql->end(); ++it) {
if (it->material == DrawQuad::Material::kTextureContent) {
const TextureDrawQuad* tex_quad = TextureDrawQuad::MaterialCast(*it);
if (tex_quad->is_stream_video) {
it->visible_rect = gfx::Rect();
}
}
}
}
#endif // BUILDFLAG(IS_WIN)

// Only reshape when we know we are going to draw. Otherwise, the reshape
// can leave the window at the wrong size if we never draw and the proper
// viewport size is never set.
Expand Down

0 comments on commit 48bba4b

Please sign in to comment.