haikuwebkit/Source/WebKit/UIProcess/cairo
Carlos Garcia Campos 4f893ad024 [Cairo] Simplify GraphicsContextCairo creation
https://bugs.webkit.org/show_bug.cgi?id=227575

Reviewed by Žan Doberšek.

Source/WebCore:

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.

No change in behavior, covered by existing tests.

* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContextCairo::GraphicsContextCairo):
(WebCore::GraphicsContextCairo::drawLine):
* platform/graphics/cairo/GraphicsContextCairo.h:
* platform/graphics/cairo/ImageBufferCairoSurfaceBackend.cpp:
(WebCore::ImageBufferCairoSurfaceBackend::ImageBufferCairoSurfaceBackend):
(WebCore::ImageBufferCairoSurfaceBackend::context const):
* platform/graphics/cairo/ImageBufferCairoSurfaceBackend.h:
* platform/graphics/cairo/NativeImageCairo.cpp:
* platform/graphics/cairo/PlatformContextCairo.cpp:
(WebCore::PlatformContextCairo::PlatformContextCairo):
* platform/graphics/cairo/PlatformContextCairo.h:
(WebCore::PlatformContextCairo::cr const):
(WebCore::PlatformContextCairo::cr): Deleted.
(WebCore::PlatformContextCairo::setCr): Deleted.
* platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.cpp:
(Nicosia::PaintingContextCairo::ForPainting::ForPainting):
(Nicosia::PaintingContextCairo::ForPainting::~ForPainting):
(Nicosia::PaintingContextCairo::ForPainting::replay):
* platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.h:
* platform/graphics/win/GraphicsContextCairoWin.cpp:
(WebCore::GraphicsContextCairo::GraphicsContextCairo):
* platform/graphics/win/ImageCairoWin.cpp:
(WebCore::BitmapImage::getHBITMAPOfSize):

Source/WebKit:

Use the new GraphicsContextCairo constructors.

* Shared/cairo/ShareableBitmapCairo.cpp:
(WebKit::ShareableBitmap::createGraphicsContext):
* UIProcess/cairo/BackingStoreCairo.cpp:
(WebKit::BackingStore::incorporateUpdate):

Canonical link: https://commits.webkit.org/239316@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279460 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-01 10:35:07 +00:00
..
BackingStoreCairo.cpp