Remove the constructors taking a PlatformContextCairo and add two that receive a RefPtr<cairo_t>&& and cairo_surface_t*. In both cases the PlatformContextCairo is created, so it's now always owned and callers don't need to create it.
Created attachment 432670 [details] Patch
Created attachment 432672 [details] Patch
Created attachment 432673 [details] Patch
Committed r279460 (239316@main): <https://commits.webkit.org/239316@main>
<rdar://problem/80015368>
Comment on attachment 432673 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=432673&action=review Very nice refactoring. We no longer need PlatformContextCairo. We can merge PlatformContextCairo into GraphicsContextCairo. > Source/WebCore/platform/graphics/win/GraphicsContextCairoWin.cpp:76 > + : GraphicsContextCairo(platformContext->cr()) Umm, this is not same with the original code. But, I think no problem.
(In reply to Fujii Hironori from comment #6) > Very nice refactoring. We no longer need PlatformContextCairo. We can merge > PlatformContextCairo into GraphicsContextCairo. Filed: Bug 227721 – [Cairo] Merge PlatformContextCairo into GraphicsContextCairo