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))
|
if(!AcquireBuffer(&frameBuffer))
|
||||||
{
|
{
|
||||||
debugger("ERROR: Couldn't acquire framebuffer in DrawBitmap()\n");
|
debugger("ERROR: Couldn't acquire framebuffer in DrawBitmap()\n");
|
||||||
|
Unlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -306,6 +307,7 @@ void DisplayDriver::CopyRegionList(BList* list, BList* pList, int32 rCount, BReg
|
|||||||
if(!AcquireBuffer(&frameBuffer))
|
if(!AcquireBuffer(&frameBuffer))
|
||||||
{
|
{
|
||||||
debugger("ERROR: Couldn't acquire framebuffer in CopyRegionList()\n");
|
debugger("ERROR: Couldn't acquire framebuffer in CopyRegionList()\n");
|
||||||
|
Unlock();
|
||||||
return;
|
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));
|
end.x=MAX(first.x,MAX(second.x,third.x));
|
||||||
StrokeSolidLine(ROUND(start.x), ROUND(start.y), ROUND(end.x), ROUND(start.y), color);
|
StrokeSolidLine(ROUND(start.x), ROUND(start.y), ROUND(end.x), ROUND(start.y), color);
|
||||||
fCursorHandler.DriverShow();
|
fCursorHandler.DriverShow();
|
||||||
|
Unlock();
|
||||||
return;
|
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++)
|
for(i=(int32)first.y+1; i<=third.y; i++)
|
||||||
StrokeSolidLine(ROUND(lineA.GetX(i)), i, ROUND(lineB.GetX(i)), i, color);
|
StrokeSolidLine(ROUND(lineA.GetX(i)), i, ROUND(lineB.GetX(i)), i, color);
|
||||||
fCursorHandler.DriverShow();
|
fCursorHandler.DriverShow();
|
||||||
|
Unlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2410,6 +2414,7 @@ void DisplayDriver::FillTriangle(BPoint *pts, const BRect &bounds, const RGBColo
|
|||||||
for(i=(int32)first.y; i<third.y; i++)
|
for(i=(int32)first.y; i<third.y; i++)
|
||||||
StrokeSolidLine(ROUND(lineA.GetX(i)), i, ROUND(lineB.GetX(i)), i, color);
|
StrokeSolidLine(ROUND(lineA.GetX(i)), i, ROUND(lineB.GetX(i)), i, color);
|
||||||
fCursorHandler.DriverShow();
|
fCursorHandler.DriverShow();
|
||||||
|
Unlock();
|
||||||
return;
|
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));
|
end.x=MAX(first.x,MAX(second.x,third.x));
|
||||||
StrokePatternLine(ROUND(start.x), ROUND(start.y), ROUND(end.x), ROUND(start.y), d);
|
StrokePatternLine(ROUND(start.x), ROUND(start.y), ROUND(end.x), ROUND(start.y), d);
|
||||||
fCursorHandler.DriverShow();
|
fCursorHandler.DriverShow();
|
||||||
|
Unlock();
|
||||||
return;
|
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++)
|
for(i=(int32)first.y+1; i<=third.y; i++)
|
||||||
StrokePatternLine(ROUND(lineA.GetX(i)), i, ROUND(lineB.GetX(i)), i, d);
|
StrokePatternLine(ROUND(lineA.GetX(i)), i, ROUND(lineB.GetX(i)), i, d);
|
||||||
fCursorHandler.DriverShow();
|
fCursorHandler.DriverShow();
|
||||||
|
Unlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2528,6 +2535,7 @@ void DisplayDriver::FillTriangle(BPoint *pts, const BRect &bounds, const DrawDat
|
|||||||
for(i=(int32)first.y; i<third.y; i++)
|
for(i=(int32)first.y; i<third.y; i++)
|
||||||
StrokePatternLine(ROUND(lineA.GetX(i)), i, ROUND(lineB.GetX(i)), i, d);
|
StrokePatternLine(ROUND(lineA.GetX(i)), i, ROUND(lineB.GetX(i)), i, d);
|
||||||
fCursorHandler.DriverShow();
|
fCursorHandler.DriverShow();
|
||||||
|
Unlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2697,6 +2705,7 @@ void DisplayDriver::StrokeArc(const BRect &r, const float &angle, const float &s
|
|||||||
{
|
{
|
||||||
StrokeEllipse(r,color);
|
StrokeEllipse(r,color);
|
||||||
fCursorHandler.DriverShow();
|
fCursorHandler.DriverShow();
|
||||||
|
Unlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2865,6 +2874,7 @@ void DisplayDriver::StrokeArc(const BRect &r, const float &angle, const float &s
|
|||||||
{
|
{
|
||||||
StrokeEllipse(r,d);
|
StrokeEllipse(r,d);
|
||||||
fCursorHandler.DriverShow();
|
fCursorHandler.DriverShow();
|
||||||
|
Unlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3733,8 +3743,11 @@ float DisplayDriver::StringWidth(const char *string, int32 length, const DrawDat
|
|||||||
FontStyle *style=font->Style();
|
FontStyle *style=font->Style();
|
||||||
|
|
||||||
if(!style)
|
if(!style)
|
||||||
|
{
|
||||||
|
Unlock();
|
||||||
return 0.0;
|
return 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
FT_Face face;
|
FT_Face face;
|
||||||
FT_GlyphSlot slot;
|
FT_GlyphSlot slot;
|
||||||
FT_UInt glyph_index=0, previous=0;
|
FT_UInt glyph_index=0, previous=0;
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ DrawData::DrawData(void)
|
|||||||
scale=1.0;
|
scale=1.0;
|
||||||
fontAliasing=true;
|
fontAliasing=true;
|
||||||
|
|
||||||
if(fontserver)
|
if(fontserver && fontserver->GetSystemPlain())
|
||||||
font=*(fontserver->GetSystemPlain());
|
font=*(fontserver->GetSystemPlain());
|
||||||
|
|
||||||
clipReg=NULL;
|
clipReg=NULL;
|
||||||
|
|||||||
@@ -753,6 +753,7 @@ void ViewDriver::SetDrawData(const DrawData *d, bool set_font_data)
|
|||||||
unlock=true;
|
unlock=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
drawview->ConstrainClippingRegion(d->clipReg);
|
||||||
drawview->SetPenSize(d->pensize);
|
drawview->SetPenSize(d->pensize);
|
||||||
drawview->SetDrawingMode(d->draw_mode);
|
drawview->SetDrawingMode(d->draw_mode);
|
||||||
drawview->SetHighColor(d->highcolor.GetColor32());
|
drawview->SetHighColor(d->highcolor.GetColor32());
|
||||||
|
|||||||
@@ -304,30 +304,40 @@ void WinBorder::MouseUp(PointerEvent& evt)
|
|||||||
if (!(Window()->IsLocked()))
|
if (!(Window()->IsLocked()))
|
||||||
debugger("you must lock the attached ServerWindow object\n\t before calling WinBorder::MouseUp()\n");
|
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;
|
fIsMoving = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fIsResizing)
|
if (fIsResizing)
|
||||||
{
|
{
|
||||||
fIsResizing = false;
|
fIsResizing = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fIsZooming)
|
if (fIsZooming)
|
||||||
{
|
{
|
||||||
fIsZooming = false;
|
fIsZooming = false;
|
||||||
fDecorator->SetZoom(false);
|
fDecorator->SetZoom(false);
|
||||||
fDecorator->DrawZoom();
|
fDecorator->DrawZoom();
|
||||||
Window()->Zoom();
|
|
||||||
|
if(action==DEC_ZOOM)
|
||||||
|
Window()->Zoom();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (fIsClosing)
|
if(fIsClosing)
|
||||||
{
|
{
|
||||||
fIsClosing = false;
|
fIsClosing = false;
|
||||||
fDecorator->SetClose(false);
|
fDecorator->SetClose(false);
|
||||||
fDecorator->DrawClose();
|
fDecorator->DrawClose();
|
||||||
Window()->Quit();
|
if(action==DEC_CLOSE)
|
||||||
|
Window()->Quit();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(fIsMinimizing)
|
if(fIsMinimizing)
|
||||||
@@ -335,7 +345,8 @@ void WinBorder::MouseUp(PointerEvent& evt)
|
|||||||
fIsMinimizing = false;
|
fIsMinimizing = false;
|
||||||
fDecorator->SetMinimize(false);
|
fDecorator->SetMinimize(false);
|
||||||
fDecorator->DrawMinimize();
|
fDecorator->DrawMinimize();
|
||||||
Window()->Minimize(true);
|
if(action==DEC_MINIMIZE)
|
||||||
|
Window()->Minimize(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user