summaryrefslogtreecommitdiff
path: root/plugingui/painter.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2017-02-12 11:07:22 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2017-02-12 11:07:22 +0100
commitcec1d9ea562e3d52c98f1219db5e186943f2f0d6 (patch)
tree3a66ff06ef16cce96e215644032e6c9fac2cbe8a /plugingui/painter.cc
parentdc33f15a6b968139779c2b7d2003d3ef6e7d5748 (diff)
Refactor/introduce widget and windiow redraw/dirty mechanism to eradicate unnecessary rendering passes during event handling.
Diffstat (limited to 'plugingui/painter.cc')
-rw-r--r--plugingui/painter.cc19
1 files changed, 7 insertions, 12 deletions
diff --git a/plugingui/painter.cc b/plugingui/painter.cc
index 3e6fa48..4e7e8ba 100644
--- a/plugingui/painter.cc
+++ b/plugingui/painter.cc
@@ -29,6 +29,12 @@
#include <cmath>
#include <cassert>
+#include "pixelbuffer.h"
+#include "font.h"
+#include "drawable.h"
+#include "image.h"
+#include "canvas.h"
+
namespace GUI
{
@@ -36,14 +42,11 @@ Painter::Painter(Canvas& canvas)
: canvas(canvas)
, pixbuf(canvas.GetPixelBuffer())
{
- canvas.beginPaint();
colour = Colour(0.0f, 0.0f, 0.0f, 0.5f);
}
Painter::~Painter()
{
- canvas.endPaint();
- flush();
}
void Painter::setColour(const Colour& colour)
@@ -161,7 +164,7 @@ void Painter::drawRectangle(int x1, int y1, int x2, int y2)
void Painter::drawFilledRectangle(int x1, int y1, int x2, int y2)
{
- for(int y = y1; y < y2; ++y)
+ for(int y = y1; y <= y2; ++y)
{
drawLine(x1, y, x2, y);
}
@@ -543,12 +546,4 @@ void Painter::drawBar(int x, int y, const Bar& bar, int width, int height)
bar.right->width(), height);
}
-void Painter::flush()
-{
-#ifdef X11
- // Send the "DrawLine" request to the server
- //XFlush(gctx->display);
-#endif/*X11*/
-}
-
} // GUI::