Bug 30143 - GraphicsContextSkia draws paths incorrectly
Summary: GraphicsContextSkia draws paths incorrectly
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-06 16:55 PDT by Andrew Scherkus
Modified: 2013-04-09 12:48 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Scherkus 2009-10-06 16:55:52 PDT
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.
Comment 1 Silvia Pfeiffer 2012-06-06 17:17:15 PDT
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?
Comment 2 Andrew Scherkus 2012-06-06 17:22:33 PDT
Oh my I filed this bug back waaaaaaay back when I initially was working on the original controls :P

Are you still hitting it?
Comment 3 Silvia Pfeiffer 2012-06-06 19:18:22 PDT
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. :-)
Comment 4 Silvia Pfeiffer 2012-06-07 21:18:05 PDT
I think we can close this - I have a patch for the video controls that works.