// for debugging use:
-#define SYNC_PAINT
+ #define SYNC_PAINT
#include <unistd.h>
#ifndef SYNC_PAINT
#include <pthread.h>
void *gRC::thread()
{
+ int need_notify = 0;
#ifndef SYNC_PAINT
while (1)
#else
if (o.opcode==gOpcode::shutdown)
break;
if (o.opcode==gOpcode::notify)
- {
- m_notify_pump.send(1);
- } else
+ need_notify = 1;
+ else
o.dc->exec(&o);
o.dc->Release();
queue.dequeue();
+
+ if ((!queue.size()) && need_notify)
+ {
+ need_notify = 0;
+ m_notify_pump.send(1);
+ }
}
#ifndef SYNC_PAINT
pthread_exit(0);
{
gOpcode o;
+ ASSERT(pixmap);
+
o.opcode=gOpcode::blit;
o.dc = m_dc.grabRef();
pixmap->AddRef();
if (o->parm.renderText->flags & gPainter::RT_VALIGN_CENTER)
{
eRect bbox = para->getBoundBox();
- offset += ePoint(0, (o->parm.renderText->area.height() - bbox.height()) / 2);
+ int vcentered_top = (o->parm.renderText->area.height() - bbox.height()) / 2;
+ int correction = vcentered_top - bbox.top();
+ offset += ePoint(0, correction);
}
para->blit(*this, offset, getRGB(m_background_color), getRGB(m_foreground_color));
delete o->parm.renderText;