1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 19:57:45 +00:00

LibGUI: Add a GPainter class that inherits from Painter.

This gets rid of the last little piece of LibGUI knowledge in Painter.
This commit is contained in:
Andreas Kling 2019-03-28 17:19:56 +01:00
parent 326c6fd607
commit 9fa21fa585
27 changed files with 75 additions and 78 deletions

View file

@ -12,16 +12,8 @@ class GlyphBitmap;
class GraphicsBitmap;
class Font;
#ifdef USERLAND
class GWidget;
class GWindow;
#endif
class Painter {
public:
#ifdef USERLAND
explicit Painter(GWidget&);
#endif
explicit Painter(GraphicsBitmap&);
~Painter();
void fill_rect(const Rect&, Color);
@ -64,7 +56,7 @@ public:
void save() { m_state_stack.append(m_state_stack.last()); }
void restore() { ASSERT(m_state_stack.size() > 1); m_state_stack.take_last(); }
private:
protected:
void set_pixel_with_draw_op(dword& pixel, const Color&);
void fill_rect_with_draw_op(const Rect&, Color);
void blit_with_alpha(const Point&, const GraphicsBitmap&, const Rect& src_rect);
@ -80,7 +72,6 @@ private:
const State& state() const { return m_state_stack.last(); }
Rect m_clip_origin;
GWindow* m_window { nullptr };
Retained<GraphicsBitmap> m_target;
Vector<State> m_state_stack;
};