mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
31 lines
695 B
C++
31 lines
695 B
C++
/*
|
|
* Copyright (c) 2024, Pavel Shliak <shlyakpavel@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Assertions.h>
|
|
#include <LibGfx/Bitmap.h>
|
|
#include <core/SkColorType.h>
|
|
|
|
namespace Gfx {
|
|
|
|
static SkColorType to_skia_color_type(Gfx::BitmapFormat format)
|
|
{
|
|
switch (format) {
|
|
case Gfx::BitmapFormat::Invalid:
|
|
return kUnknown_SkColorType;
|
|
case Gfx::BitmapFormat::BGRA8888:
|
|
case Gfx::BitmapFormat::BGRx8888:
|
|
return kBGRA_8888_SkColorType;
|
|
case Gfx::BitmapFormat::RGBA8888:
|
|
return kRGBA_8888_SkColorType;
|
|
case Gfx::BitmapFormat::RGBx8888:
|
|
return kRGB_888x_SkColorType;
|
|
}
|
|
VERIFY_NOT_REACHED();
|
|
}
|
|
|
|
}
|