| Summary: | Unify the two ImageBuffer::create() functions, passing RenderingPurpose everywhere | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Simon Fraser (smfr) <simon.fraser> | ||||||||||
| Component: | Layout and Rendering | Assignee: | Simon Fraser (smfr) <simon.fraser> | ||||||||||
| Status: | RESOLVED FIXED | ||||||||||||
| Severity: | Normal | CC: | bfulgham, cdumez, changseok, cmarcelo, darin, dino, eric.carlson, esprehn+autocc, ews-watchlist, fmalita, glenn, gyuyoung.kim, hi, jer.noble, joepeck, kondapallykalyan, luiz, macpherson, menard, pangle, pdr, philipj, sabouhallawa, schenney, sergio, simon.fraser, webkit-bug-importer, zalan | ||||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||||
| Version: | WebKit Nightly Build | ||||||||||||
| Hardware: | Unspecified | ||||||||||||
| OS: | Unspecified | ||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Simon Fraser (smfr)
2022-04-05 16:40:56 PDT
Created attachment 456766 [details]
Patch
Created attachment 456768 [details]
Patch
Comment on attachment 456768 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=456768&action=review > Source/WebCore/platform/graphics/ImageBuffer.h:67 > + WEBCORE_EXPORT static RefPtr<ImageBuffer> create(const FloatSize&, OptionSet<ImageBufferOptions>, RenderingPurpose, float resolutionScale, const DestinationColorSpace&, PixelFormat, const CreationContext& = { }); I think ImageBufferOptions can be moved to the end just before CreationContext and it can have a default value { }. So many callers do not have to pass { } for it. > Source/WebCore/platform/graphics/RenderingMode.h:47 > +enum class ImageBufferOptions : uint8_t { Should this be moved to ImageBuffer.h since it is only used for ImageBuffer? > Source/WebCore/platform/graphics/filters/software/FETileSoftwareApplier.cpp:54 > + OptionSet<ImageBufferOptions> bufferOptions; > + if (filter.renderingMode() == RenderingMode::Accelerated) > + bufferOptions.add(ImageBufferOptions::Accelerated); This code is repeated many times in the patch. Can't we add an inline function in RenderingMode.h inline OptionSet<ImageBufferOptions> bufferOptions(RenderingMode renderringMode) { } Or something else. And use this inline directly in the call to ImageBuffer::create(tileRect.size(), bufferOptions(filter.renderingMode()), ...). Created attachment 456778 [details]
Patch
Created attachment 456779 [details]
Patch
Committed r292469 (249320@main): <https://commits.webkit.org/249320@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 456779 [details]. There’s a "RendingMode" typo in here. I suggest grepping for "endingMode". |