1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:37:45 +00:00

Convert more RetainPtr use to Retained.

This commit is contained in:
Andreas Kling 2019-02-25 16:04:08 +01:00
parent 2cfcbdc735
commit 15fb917f28
16 changed files with 41 additions and 56 deletions

View file

@ -10,7 +10,7 @@ CharacterBitmap::~CharacterBitmap()
{
}
RetainPtr<CharacterBitmap> CharacterBitmap::create_from_ascii(const char* asciiData, unsigned width, unsigned height)
Retained<CharacterBitmap> CharacterBitmap::create_from_ascii(const char* asciiData, unsigned width, unsigned height)
{
return adopt(*new CharacterBitmap(asciiData, width, height));
}

View file

@ -6,7 +6,7 @@
class CharacterBitmap : public Retainable<CharacterBitmap> {
public:
static RetainPtr<CharacterBitmap> create_from_ascii(const char* asciiData, unsigned width, unsigned height);
static Retained<CharacterBitmap> create_from_ascii(const char* asciiData, unsigned width, unsigned height);
~CharacterBitmap();
bool bit_at(unsigned x, unsigned y) const { return m_bits[y * width() + x] == '#'; }

View file

@ -15,19 +15,18 @@
#endif
Painter::Painter(GraphicsBitmap& bitmap)
: m_target(bitmap)
{
m_font = &Font::default_font();
m_target = &bitmap;
m_clip_rect = { { 0, 0 }, bitmap.size() };
}
#ifdef LIBGUI
Painter::Painter(GWidget& widget)
: m_font(&widget.font())
, m_window(widget.window())
, m_target(*m_window->backing())
{
m_window = widget.window();
m_target = m_window->backing();
ASSERT(m_target);
m_translation.move_by(widget.window_relative_rect().location());
// NOTE: m_clip_rect is in Window coordinates since we are painting into its backing store.
m_clip_rect = widget.window_relative_rect();
@ -37,7 +36,6 @@ Painter::Painter(GWidget& widget)
Painter::~Painter()
{
m_target = nullptr;
}
void Painter::fill_rect_with_draw_op(const Rect& a_rect, Color color)

View file

@ -63,9 +63,7 @@ private:
const Font* m_font;
Point m_translation;
Rect m_clip_rect;
RetainPtr<GraphicsBitmap> m_target;
#ifdef USERLAND
GWindow* m_window { nullptr };
#endif
Retained<GraphicsBitmap> m_target;
DrawOp m_draw_op { DrawOp::Copy };
};