Bug 30143
Summary: | GraphicsContextSkia draws paths incorrectly | ||
---|---|---|---|
Product: | WebKit | Reporter: | Andrew Scherkus <scherkus> |
Component: | WebCore Misc. | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED WONTFIX | ||
Severity: | Normal | CC: | schenney, silviapf |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | All | ||
OS: | All |
Andrew Scherkus
I experienced this when writing RenderMediaControlsChromium.
I would create a rounded rectangle path the add it via addPath() then fill it via fillPath() with alpha blending. It rendered correctly, but mousing over/using scroll wheel on the page would cause the re-fill the area, creating a different appearance.
I'm thinking context isn't being saved correctly or something.. I'll try and get a better repro steps.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Silvia Pfeiffer
This is happening in Skia because we only draw rounded borders when the rounding fits into the rectangle.
See this code in Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp :
Function: void GraphicsContext::fillRoundedRect()
if (topLeft.width() + topRight.width() > rect.width()
|| bottomLeft.width() + bottomRight.width() > rect.width()
|| topLeft.height() + bottomLeft.height() > rect.height()
|| topRight.height() + bottomRight.height() > rect.height()) {
// Not all the radii fit, return a rect. This matches the behavior of
// Path::createRoundedRectangle. Without this we attempt to draw a round
// shadow for a square box.
fillRect(rect, color, colorSpace);
return;
}
Thus, when the volume slider is too close to 0% or to 100%, the rectangle gets too small to be able to draw the arcs.
See bug https://bugs.webkit.org/show_bug.cgi?id=23882 .
I don't quite know how to implement the rounded fillers now. Any suggestions?
Andrew Scherkus
Oh my I filed this bug back waaaaaaay back when I initially was working on the original controls :P
Are you still hitting it?
Silvia Pfeiffer
I can actually get around this if I make the right side non-rounded underneath the slider thumbs. Also, I have to take the zoomFactor into account.
Given all this, it might make sense to re-write this code by introducing a div for the background color and a div for the highlighted buffered range.
I'll continue to try in C++ for now. :-)
Silvia Pfeiffer
I think we can close this - I have a patch for the video controls that works.