more correct implementation, but still exhibits problems, usage turned off in ViewHWInterface::Invalidate
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12088 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include <new>
|
#include <new>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "HWInterface.h"
|
#include "HWInterface.h"
|
||||||
|
|
||||||
@@ -51,6 +52,7 @@ void
|
|||||||
UpdateQueue::AddRect(const BRect& rect)
|
UpdateQueue::AddRect(const BRect& rect)
|
||||||
{
|
{
|
||||||
// Lock();
|
// Lock();
|
||||||
|
//printf("UpdateQueue::AddRect()\n");
|
||||||
fUpdateRegion.Include(rect);
|
fUpdateRegion.Include(rect);
|
||||||
_Reschedule();
|
_Reschedule();
|
||||||
// Unlock();
|
// Unlock();
|
||||||
@@ -71,17 +73,21 @@ UpdateQueue::_ExecuteUpdates()
|
|||||||
bool running = true;
|
bool running = true;
|
||||||
while (running) {
|
while (running) {
|
||||||
status_t err = acquire_sem_etc(fThreadControl, 1, B_RELATIVE_TIMEOUT,
|
status_t err = acquire_sem_etc(fThreadControl, 1, B_RELATIVE_TIMEOUT,
|
||||||
40000);
|
20000);
|
||||||
switch (err) {
|
switch (err) {
|
||||||
case B_OK:
|
case B_OK:
|
||||||
case B_TIMED_OUT:
|
case B_TIMED_OUT:
|
||||||
// execute updates
|
// execute updates
|
||||||
if (fInterface->LockWithTimeout(20000) >= B_OK) {
|
if (fInterface->LockWithTimeout(5000) >= B_OK) {
|
||||||
int32 count = fUpdateRegion.CountRects();
|
int32 count = fUpdateRegion.CountRects();
|
||||||
for (int32 i = 0; i < count; i++) {
|
//printf("%ld copy dirty region\n", find_thread(NULL));
|
||||||
fInterface->CopyBackToFront(fUpdateRegion.RectAt(i));
|
if (count > 0) {
|
||||||
|
printf("%ld rects\n", count);
|
||||||
|
for (int32 i = 0; i < count; i++) {
|
||||||
|
fInterface->CopyBackToFront(fUpdateRegion.RectAt(i));
|
||||||
|
}
|
||||||
|
fUpdateRegion.MakeEmpty();
|
||||||
}
|
}
|
||||||
fUpdateRegion.MakeEmpty();
|
|
||||||
fInterface->Unlock();
|
fInterface->Unlock();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -89,6 +95,9 @@ UpdateQueue::_ExecuteUpdates()
|
|||||||
running = false;
|
running = false;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
printf("other error: %s\n", strerror(err));
|
||||||
|
running = false;
|
||||||
|
snooze(20000);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -102,8 +111,7 @@ void
|
|||||||
UpdateQueue::_Reschedule()
|
UpdateQueue::_Reschedule()
|
||||||
{
|
{
|
||||||
if (fStatus == B_OK) {
|
if (fStatus == B_OK) {
|
||||||
if (fUpdateRegion.Frame().IsValid())
|
release_sem(fThreadControl);
|
||||||
release_sem(fThreadControl);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user