diff --git a/SharedGraphics/GraphicsBitmap.h b/SharedGraphics/GraphicsBitmap.h index 426dffa860..149338fe9d 100644 --- a/SharedGraphics/GraphicsBitmap.h +++ b/SharedGraphics/GraphicsBitmap.h @@ -5,8 +5,8 @@ #include "Size.h" #include #include -#include #include +#include #include #include @@ -39,6 +39,21 @@ public: size_t pitch() const { return m_pitch; } int shared_buffer_id() const { return m_shared_buffer ? m_shared_buffer->shared_buffer_id() : -1; } + unsigned bpp() const + { + switch (m_format) { + case Format::Indexed8: + return 8; + case Format::RGB32: + case Format::RGBA32: + return 32; + case Format::Invalid: + return 0; + default: + ASSERT_NOT_REACHED(); + } + } + void fill(Color); bool has_alpha_channel() const { return m_format == Format::RGBA32; }