Removed a couple of deadlocks caused by missing DisplayDriver unlocks
remove possible NULL pointer crash in LayerData Added low-level clipping to ViewDriver Some minor UI tweaks to WinBorder git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10216 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -146,6 +146,7 @@ void DisplayDriver::DrawBitmap(BRegion *region, ServerBitmap *bitmap, const BRec
|
||||
if(!AcquireBuffer(&frameBuffer))
|
||||
{
|
||||
debugger("ERROR: Couldn't acquire framebuffer in DrawBitmap()\n");
|
||||
Unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -306,6 +307,7 @@ void DisplayDriver::CopyRegionList(BList* list, BList* pList, int32 rCount, BReg
|
||||
if(!AcquireBuffer(&frameBuffer))
|
||||
{
|
||||
debugger("ERROR: Couldn't acquire framebuffer in CopyRegionList()\n");
|
||||
Unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2382,6 +2384,7 @@ void DisplayDriver::FillTriangle(BPoint *pts, const BRect &bounds, const RGBColo
|
||||
end.x=MAX(first.x,MAX(second.x,third.x));
|
||||
StrokeSolidLine(ROUND(start.x), ROUND(start.y), ROUND(end.x), ROUND(start.y), color);
|
||||
fCursorHandler.DriverShow();
|
||||
Unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2397,6 +2400,7 @@ void DisplayDriver::FillTriangle(BPoint *pts, const BRect &bounds, const RGBColo
|
||||
for(i=(int32)first.y+1; i<=third.y; i++)
|
||||
StrokeSolidLine(ROUND(lineA.GetX(i)), i, ROUND(lineB.GetX(i)), i, color);
|
||||
fCursorHandler.DriverShow();
|
||||
Unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2410,6 +2414,7 @@ void DisplayDriver::FillTriangle(BPoint *pts, const BRect &bounds, const RGBColo
|
||||
for(i=(int32)first.y; i<third.y; i++)
|
||||
StrokeSolidLine(ROUND(lineA.GetX(i)), i, ROUND(lineB.GetX(i)), i, color);
|
||||
fCursorHandler.DriverShow();
|
||||
Unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2500,6 +2505,7 @@ void DisplayDriver::FillTriangle(BPoint *pts, const BRect &bounds, const DrawDat
|
||||
end.x=MAX(first.x,MAX(second.x,third.x));
|
||||
StrokePatternLine(ROUND(start.x), ROUND(start.y), ROUND(end.x), ROUND(start.y), d);
|
||||
fCursorHandler.DriverShow();
|
||||
Unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2515,6 +2521,7 @@ void DisplayDriver::FillTriangle(BPoint *pts, const BRect &bounds, const DrawDat
|
||||
for(i=(int32)first.y+1; i<=third.y; i++)
|
||||
StrokePatternLine(ROUND(lineA.GetX(i)), i, ROUND(lineB.GetX(i)), i, d);
|
||||
fCursorHandler.DriverShow();
|
||||
Unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2528,6 +2535,7 @@ void DisplayDriver::FillTriangle(BPoint *pts, const BRect &bounds, const DrawDat
|
||||
for(i=(int32)first.y; i<third.y; i++)
|
||||
StrokePatternLine(ROUND(lineA.GetX(i)), i, ROUND(lineB.GetX(i)), i, d);
|
||||
fCursorHandler.DriverShow();
|
||||
Unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2697,6 +2705,7 @@ void DisplayDriver::StrokeArc(const BRect &r, const float &angle, const float &s
|
||||
{
|
||||
StrokeEllipse(r,color);
|
||||
fCursorHandler.DriverShow();
|
||||
Unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2865,6 +2874,7 @@ void DisplayDriver::StrokeArc(const BRect &r, const float &angle, const float &s
|
||||
{
|
||||
StrokeEllipse(r,d);
|
||||
fCursorHandler.DriverShow();
|
||||
Unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3733,8 +3743,11 @@ float DisplayDriver::StringWidth(const char *string, int32 length, const DrawDat
|
||||
FontStyle *style=font->Style();
|
||||
|
||||
if(!style)
|
||||
{
|
||||
Unlock();
|
||||
return 0.0;
|
||||
|
||||
}
|
||||
|
||||
FT_Face face;
|
||||
FT_GlyphSlot slot;
|
||||
FT_UInt glyph_index=0, previous=0;
|
||||
|
||||
@@ -49,7 +49,7 @@ DrawData::DrawData(void)
|
||||
scale=1.0;
|
||||
fontAliasing=true;
|
||||
|
||||
if(fontserver)
|
||||
if(fontserver && fontserver->GetSystemPlain())
|
||||
font=*(fontserver->GetSystemPlain());
|
||||
|
||||
clipReg=NULL;
|
||||
|
||||
@@ -753,6 +753,7 @@ void ViewDriver::SetDrawData(const DrawData *d, bool set_font_data)
|
||||
unlock=true;
|
||||
}
|
||||
|
||||
drawview->ConstrainClippingRegion(d->clipReg);
|
||||
drawview->SetPenSize(d->pensize);
|
||||
drawview->SetDrawingMode(d->draw_mode);
|
||||
drawview->SetHighColor(d->highcolor.GetColor32());
|
||||
|
||||
@@ -304,30 +304,40 @@ void WinBorder::MouseUp(PointerEvent& evt)
|
||||
if (!(Window()->IsLocked()))
|
||||
debugger("you must lock the attached ServerWindow object\n\t before calling WinBorder::MouseUp()\n");
|
||||
|
||||
if (fIsMoving)
|
||||
click_type action;
|
||||
|
||||
// find out where user clicked in Decorator
|
||||
action = fDecorator->Clicked(evt.where, evt.buttons, evt.modifiers);
|
||||
|
||||
if(fIsMoving)
|
||||
{
|
||||
fIsMoving = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (fIsResizing)
|
||||
{
|
||||
fIsResizing = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (fIsZooming)
|
||||
{
|
||||
fIsZooming = false;
|
||||
fDecorator->SetZoom(false);
|
||||
fDecorator->DrawZoom();
|
||||
Window()->Zoom();
|
||||
|
||||
if(action==DEC_ZOOM)
|
||||
Window()->Zoom();
|
||||
return;
|
||||
}
|
||||
if (fIsClosing)
|
||||
if(fIsClosing)
|
||||
{
|
||||
fIsClosing = false;
|
||||
fDecorator->SetClose(false);
|
||||
fDecorator->DrawClose();
|
||||
Window()->Quit();
|
||||
if(action==DEC_CLOSE)
|
||||
Window()->Quit();
|
||||
return;
|
||||
}
|
||||
if(fIsMinimizing)
|
||||
@@ -335,7 +345,8 @@ void WinBorder::MouseUp(PointerEvent& evt)
|
||||
fIsMinimizing = false;
|
||||
fDecorator->SetMinimize(false);
|
||||
fDecorator->DrawMinimize();
|
||||
Window()->Minimize(true);
|
||||
if(action==DEC_MINIMIZE)
|
||||
Window()->Minimize(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user