mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 23:59:49 +00:00
LibGfx: Make PaintingSurface::write_from_bitmap take a Bitmap const&
It makes it a little bit easier to distinguish which one of read_into_bitmap and write_from_bitmap actually modify the Bitmap that was passed to the method. NFC.
This commit is contained in:
parent
4d7b7178f9
commit
407aa629a0
Notes:
github-actions[bot]
2024-12-05 16:17:53 +00:00
Author: https://github.com/LucasChollet
Commit: 407aa629a0
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1764
Reviewed-by: https://github.com/trflynn89
2 changed files with 2 additions and 2 deletions
|
@ -85,7 +85,7 @@ void PaintingSurface::read_into_bitmap(Gfx::Bitmap& bitmap)
|
||||||
m_impl->surface->readPixels(pixmap, 0, 0);
|
m_impl->surface->readPixels(pixmap, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PaintingSurface::write_from_bitmap(Gfx::Bitmap& bitmap)
|
void PaintingSurface::write_from_bitmap(Gfx::Bitmap const& bitmap)
|
||||||
{
|
{
|
||||||
auto color_type = to_skia_color_type(bitmap.format());
|
auto color_type = to_skia_color_type(bitmap.format());
|
||||||
auto alpha_type = bitmap.alpha_type() == Gfx::AlphaType::Premultiplied ? kPremul_SkAlphaType : kUnpremul_SkAlphaType;
|
auto alpha_type = bitmap.alpha_type() == Gfx::AlphaType::Premultiplied ? kPremul_SkAlphaType : kUnpremul_SkAlphaType;
|
||||||
|
|
|
@ -32,7 +32,7 @@ public:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void read_into_bitmap(Bitmap&);
|
void read_into_bitmap(Bitmap&);
|
||||||
void write_from_bitmap(Bitmap&);
|
void write_from_bitmap(Bitmap const&);
|
||||||
|
|
||||||
void notify_content_will_change();
|
void notify_content_will_change();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue