Bug 246822
Summary: | Add the class FilterTargetSwitcher | ||
---|---|---|---|
Product: | WebKit | Reporter: | Said Abou-Hallawa <sabouhallawa> |
Component: | Canvas | Assignee: | Said Abou-Hallawa <sabouhallawa> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | dino, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Bug Depends on: | |||
Bug Blocks: | 198416 |
Said Abou-Hallawa
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.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/101394417>
Said Abou-Hallawa
Pull request: https://github.com/WebKit/WebKit/pull/5596
EWS
Committed 255802@main (5a02a23fcd77): <https://commits.webkit.org/255802@main>
Reviewed commits have been landed. Closing PR #5596 and removing active labels.