Debugging Border-Radius Rendering for Video Elements in Chromium v94

74 views
Skip to first unread message

Bharani Tharan

unread,
Aug 28, 2024, 8:22:51 AM8/28/24
to skia-discuss
Hi All,

I’m encountering an issue with border-radius in our customized Chromium v94 build.

The video is not conforming to the border-radius container and is displaying as a rectangle instead.

After investigating the SkiaRenderer::PrepareCanvas method, I found that the following condition is not being met:

if (rounded_corner_bounds.has_value()) {
    current_canvas_->clipRRect(SkRRect(*rounded_corner_bounds), true /* AA */);
}

In this case, rounded_corner_bounds.has_value() returned 0.

As I understand it, clipRRect is used to create rounded corners. However, there might be other methods for achieving rounded corners and blending effects.

Could someone provide the exact API or method in the skia_renderer.cc file that DrawQuad uses for rendering rounded corners (excluding clipRRect), especially for video elements and their blending?

Your assistance in resolving this issue would be greatly appreciated.

Here’s the HTML code I'm working with:

html
Copy code
<!DOCTYPE html>
<html>
<head>
  <style>
    body {
      background: #ffffff;
    }
   
    #example6 {
      border: 2px solid red;
      padding: 10px;
      border-radius: 50%;
    }
   
    video {
      width: 40vw;
      height: 70vh;
      object-fit: fill;
      overflow: hidden;
      background-color: rgba(255,255,255,0.5);
      z-index: 1;
    }
  </style>
</head>
<body>
  <h1>border-radius: 50%;</h1>
  <video src="3.webm" id="example6" texture loop autoplay muted></video>
</body>
</html>

Thank you in advance for your help!

Bharani Tharan

unread,
Aug 29, 2024, 8:21:31 AM8/29/24
to skia-discuss
Hi all,
Any feedback on this please suggest.

Bharani Tharan

unread,
Sep 3, 2024, 7:50:40 AM9/3/24
to skia-discuss
Hi all,

I have a working case in Chromium v108 where I discovered the fillQuadWithEdgeAA API in the Device_drawTexture.cpp file. 

If I avoid using this method, the video border radius does not apply in Chromium v108. Ultimately, all methods lead to the addDrawOp method in the SurfaceDrawContext.cpp file.

Could you advise on which specific method is responsible for applying rounded corners and transparency ?

Brian Osman

unread,
Sep 3, 2024, 9:47:46 AM9/3/24
to skia-d...@googlegroups.com
I'm not sure anyone is going to be able to answer that - v108 is almost two years old, and quite a bit has changed since then. Regardless, for these kinds of debugging issues, I usually rely on "differential debugging". Is there some other (similar) content where the rounded corners DO work? Can you figure out which code path that takes, vs. the video content that's not being rounded? Answering those questions will hopefully point at where things diverge (and how you might fix this in your branch).

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/e52ee4fb-ce60-4c95-81fc-1fc9f28898adn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages