diff --git a/Libraries/LibGfx/PaintingSurface.cpp b/Libraries/LibGfx/PaintingSurface.cpp index bfdbe572426..f061299be94 100644 --- a/Libraries/LibGfx/PaintingSurface.cpp +++ b/Libraries/LibGfx/PaintingSurface.cpp @@ -27,14 +27,14 @@ struct PaintingSurface::Impl { RefPtr context; }; -NonnullRefPtr PaintingSurface::create_with_size(RefPtr context, Gfx::IntSize size, Gfx::BitmapFormat color_type, Gfx::AlphaType alpha_type) +NonnullRefPtr PaintingSurface::create_with_size(RefPtr context, IntSize size, BitmapFormat color_type, AlphaType alpha_type) { auto sk_color_type = to_skia_color_type(color_type); - auto sk_alpha_type = alpha_type == Gfx::AlphaType::Premultiplied ? kPremul_SkAlphaType : kUnpremul_SkAlphaType; + auto sk_alpha_type = alpha_type == AlphaType::Premultiplied ? kPremul_SkAlphaType : kUnpremul_SkAlphaType; auto image_info = SkImageInfo::Make(size.width(), size.height(), sk_color_type, sk_alpha_type, SkColorSpace::MakeSRGB()); if (!context) { - auto bitmap = Gfx::Bitmap::create(color_type, alpha_type, size).value(); + auto bitmap = Bitmap::create(color_type, alpha_type, size).value(); auto surface = SkSurfaces::WrapPixels(image_info, bitmap->begin(), bitmap->pitch()); VERIFY(surface); return adopt_ref(*new PaintingSurface(make(size, surface, bitmap, context))); @@ -48,7 +48,7 @@ NonnullRefPtr PaintingSurface::create_with_size(RefPtr PaintingSurface::wrap_bitmap(Bitmap& bitmap) { 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() == AlphaType::Premultiplied ? kPremul_SkAlphaType : kUnpremul_SkAlphaType; auto size = bitmap.size(); auto image_info = SkImageInfo::Make(bitmap.width(), bitmap.height(), color_type, alpha_type, SkColorSpace::MakeSRGB()); auto surface = SkSurfaces::WrapPixels(image_info, bitmap.begin(), bitmap.pitch()); @@ -87,19 +87,19 @@ PaintingSurface::PaintingSurface(NonnullOwnPtr&& impl) PaintingSurface::~PaintingSurface() = default; -void PaintingSurface::read_into_bitmap(Gfx::Bitmap& bitmap) +void PaintingSurface::read_into_bitmap(Bitmap& bitmap) { 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() == AlphaType::Premultiplied ? kPremul_SkAlphaType : kUnpremul_SkAlphaType; auto image_info = SkImageInfo::Make(bitmap.width(), bitmap.height(), color_type, alpha_type, SkColorSpace::MakeSRGB()); SkPixmap const pixmap(image_info, bitmap.begin(), bitmap.pitch()); m_impl->surface->readPixels(pixmap, 0, 0); } -void PaintingSurface::write_from_bitmap(Gfx::Bitmap const& bitmap) +void PaintingSurface::write_from_bitmap(Bitmap const& bitmap) { 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() == AlphaType::Premultiplied ? kPremul_SkAlphaType : kUnpremul_SkAlphaType; auto image_info = SkImageInfo::Make(bitmap.width(), bitmap.height(), color_type, alpha_type, SkColorSpace::MakeSRGB()); SkPixmap const pixmap(image_info, bitmap.begin(), bitmap.pitch()); m_impl->surface->writePixels(pixmap, 0, 0); diff --git a/Libraries/LibGfx/PaintingSurface.h b/Libraries/LibGfx/PaintingSurface.h index be204d8bf29..19778a3dbdc 100644 --- a/Libraries/LibGfx/PaintingSurface.h +++ b/Libraries/LibGfx/PaintingSurface.h @@ -29,7 +29,7 @@ public: BottomLeft, }; - static NonnullRefPtr create_with_size(RefPtr context, Gfx::IntSize size, Gfx::BitmapFormat color_type, Gfx::AlphaType alpha_type); + static NonnullRefPtr create_with_size(RefPtr context, IntSize size, BitmapFormat color_type, AlphaType alpha_type); static NonnullRefPtr wrap_bitmap(Bitmap&); #ifdef AK_OS_MACOS