Finally nailed a graphics bug I was looking for for quite some time. The only one I'm still seeing is with text. Sometimes the last line of text is not drawn.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12680 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2005-05-16 11:00:50 +00:00
parent c6b83b8027
commit 92acca78db
2 changed files with 44 additions and 44 deletions

View File

@ -493,22 +493,23 @@ DisplayDriverPainter::FillRect(const BRect& r, const RGBColor& color)
max_c(r.left, r.right),
max_c(r.top, r.bottom));
vr = fPainter->ClipRect(vr);
fGraphicsCard->HideSoftwareCursor(vr);
// try hardware optimized version first
if (fAvailableHWAccleration & HW_ACC_FILL_REGION) {
BRegion region(vr);
region.IntersectWith(fPainter->ClippingRegion());
fGraphicsCard->FillRegion(region, color);
} else {
fPainter->FillRect(vr, color.GetColor32());
if (vr.IsValid()) {
fGraphicsCard->HideSoftwareCursor(vr);
fGraphicsCard->Invalidate(vr);
// try hardware optimized version first
if (fAvailableHWAccleration & HW_ACC_FILL_REGION) {
BRegion region(vr);
region.IntersectWith(fPainter->ClippingRegion());
fGraphicsCard->FillRegion(region, color);
} else {
fPainter->FillRect(vr, color.GetColor32());
fGraphicsCard->Invalidate(vr);
}
fGraphicsCard->ShowSoftwareCursor();
}
fGraphicsCard->ShowSoftwareCursor();
Unlock();
}
}
@ -523,37 +524,38 @@ DisplayDriverPainter::FillRect(const BRect &r, const DrawData *d)
max_c(r.left, r.right),
max_c(r.top, r.bottom));
vr = fPainter->ClipRect(vr);
fGraphicsCard->HideSoftwareCursor(vr);
bool doInSoftware = true;
// try hardware optimized version first
if ((fAvailableHWAccleration & HW_ACC_FILL_REGION) &&
(d->GetDrawingMode() == B_OP_COPY ||
d->GetDrawingMode() == B_OP_OVER)) {
if (d->GetPattern() == B_SOLID_HIGH) {
BRegion region(vr);
region.IntersectWith(fPainter->ClippingRegion());
fGraphicsCard->FillRegion(region, d->HighColor());
doInSoftware = false;
} else if (d->GetPattern() == B_SOLID_LOW) {
BRegion region(vr);
region.IntersectWith(fPainter->ClippingRegion());
fGraphicsCard->FillRegion(region, d->LowColor());
doInSoftware = false;
}
}
if (doInSoftware) {
fPainter->SetDrawData(d);
BRect touched = fPainter->FillRect(vr);
if (vr.IsValid()) {
fGraphicsCard->HideSoftwareCursor(vr);
fGraphicsCard->Invalidate(touched);
bool doInSoftware = true;
// try hardware optimized version first
if ((fAvailableHWAccleration & HW_ACC_FILL_REGION) &&
(d->GetDrawingMode() == B_OP_COPY ||
d->GetDrawingMode() == B_OP_OVER)) {
if (d->GetPattern() == B_SOLID_HIGH) {
BRegion region(vr);
region.IntersectWith(fPainter->ClippingRegion());
fGraphicsCard->FillRegion(region, d->HighColor());
doInSoftware = false;
} else if (d->GetPattern() == B_SOLID_LOW) {
BRegion region(vr);
region.IntersectWith(fPainter->ClippingRegion());
fGraphicsCard->FillRegion(region, d->LowColor());
doInSoftware = false;
}
}
if (doInSoftware) {
fPainter->SetDrawData(d);
BRect touched = fPainter->FillRect(vr);
fGraphicsCard->Invalidate(touched);
}
fGraphicsCard->ShowSoftwareCursor();
}
fGraphicsCard->ShowSoftwareCursor();
Unlock();
}
}

View File

@ -40,7 +40,7 @@ roundf(float v)
return (int)floorf(v - 0.5);
}
#define CHECK_CLIPPING if (!fValidClipping) return BRect(0,0, -1, -1);
#define CHECK_CLIPPING if (!fValidClipping) return BRect(0, 0, -1, -1);
// constructor
Painter::Painter()
@ -634,8 +634,6 @@ void
Painter::FillRect(const BRect& r, const rgb_color& c) const
{
if (fBuffer && fValidClipping) {
//printf("Painter::FillRect(BRect(%.1f, %.1f, %.1f, %.1f))\n", r.left, r.top, r.right, r.bottom);
//printf(" rgb_color(%d, %d, %d, %d)\n", c.red, c.green, c.blue, c.alpha);
uint8* dst = fBuffer->row(0);
uint32 bpr = fBuffer->stride();
int32 left = (int32)r.left;