[Webkit-unassigned] [Bug 246822] New: Add the class FilterTargetSwitcher

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Oct 20 12:22:08 PDT 2022


https://bugs.webkit.org/show_bug.cgi?id=246822

            Bug ID: 246822
           Summary: Add the class FilterTargetSwitcher
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Canvas
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: sabouhallawa at apple.com
                CC: dino at apple.com

This will manage applying a filter to a certain area of drawings with the minimum changes in the existing code. All it needs is a set of callbacks in the existing caller class. And the caller can either add this line of code to the drawing function:

FilterTargetSwitcher targetSwitcher(*this, bounds);

Or a line like this one if calculating the bounds is expensive:

FilterTargetSwitcher targetSwitcher(*this, []() {
    return path.fastBoundingRect();
});

The constructor of FilterTargetSwitcher will ask the client if there a filter to apply or not. If there is a filter, it will switch the drawing to a temporary ImageBuffer. The client has to make sure all the drawing code from now on will use the context of this ImageBuffer. The destructor will apply the filter to the temporary ImageBuffer and then composite filtered ImageBuffer to the client drawing context.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20221020/ba1aa8ed/attachment.htm>


More information about the webkit-unassigned mailing list