StrokeLine alters the pen location, DrawData needs to be non-const. I didn't make this change in the DisplayDriverImpl stuff, and it is left out of the build for now.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12333 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -188,14 +188,14 @@ class DisplayDriverImpl : public DisplayDriver {
|
|||||||
|
|
||||||
virtual void StrokeLine( const BPoint &start,
|
virtual void StrokeLine( const BPoint &start,
|
||||||
const BPoint &end,
|
const BPoint &end,
|
||||||
const DrawData *d);
|
DrawData *d);
|
||||||
|
|
||||||
// this version used by Decorator
|
// this version used by Decorator
|
||||||
virtual void StrokePoint( const BPoint &pt,
|
virtual void StrokePoint( const BPoint &pt,
|
||||||
const RGBColor &color);
|
const RGBColor &color);
|
||||||
|
|
||||||
virtual void StrokePoint( const BPoint &pt,
|
virtual void StrokePoint( const BPoint &pt,
|
||||||
const DrawData *d);
|
DrawData *d);
|
||||||
|
|
||||||
virtual void StrokePolygon( BPoint *ptlist,
|
virtual void StrokePolygon( BPoint *ptlist,
|
||||||
int32 numpts,
|
int32 numpts,
|
||||||
|
|||||||
@@ -702,15 +702,18 @@ DisplayDriverPainter::StrokeEllipse(const BRect &r, const DrawData *d)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// StrokeLine
|
// StrokeLine
|
||||||
|
//
|
||||||
|
// * this function is only used by Decorators
|
||||||
|
// * it assumes a one pixel wide line
|
||||||
void
|
void
|
||||||
DisplayDriverPainter::StrokeLine(const BPoint &start, const BPoint &end, const RGBColor &color)
|
DisplayDriverPainter::StrokeLine(const BPoint &start, const BPoint &end, const RGBColor &color)
|
||||||
{
|
{
|
||||||
if (Lock()) {
|
if (Lock()) {
|
||||||
if (!fPainter->StraightLine(start, end, color.GetColor32())) {
|
if (!fPainter->StraightLine(start, end, color.GetColor32())) {
|
||||||
DrawData d;
|
DrawData context;
|
||||||
d.highcolor = color;
|
context.highcolor = color;
|
||||||
d.draw_mode = B_OP_COPY;
|
context.draw_mode = B_OP_COPY;
|
||||||
StrokeLine(start, end, &d);
|
StrokeLine(start, end, &context);
|
||||||
} else {
|
} else {
|
||||||
fGraphicsCard->Invalidate(fPainter->ClipRect(BRect(start, end)));
|
fGraphicsCard->Invalidate(fPainter->ClipRect(BRect(start, end)));
|
||||||
}
|
}
|
||||||
@@ -720,22 +723,18 @@ DisplayDriverPainter::StrokeLine(const BPoint &start, const BPoint &end, const R
|
|||||||
|
|
||||||
// StrokeLine
|
// StrokeLine
|
||||||
void
|
void
|
||||||
DisplayDriverPainter::StrokeLine(const BPoint &start, const BPoint &end, const DrawData *d)
|
DisplayDriverPainter::StrokeLine(const BPoint &start, const BPoint &end, DrawData* context)
|
||||||
{
|
{
|
||||||
if (Lock()) {
|
if (Lock()) {
|
||||||
|
BRect touched = fPainter->StrokeLine(start, end, context);
|
||||||
fPainter->SetDrawData(d);
|
|
||||||
BRect touched = fPainter->StrokeLine(start, end);
|
|
||||||
|
|
||||||
fGraphicsCard->Invalidate(touched);
|
fGraphicsCard->Invalidate(touched);
|
||||||
|
|
||||||
Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// used by decorator
|
|
||||||
//
|
|
||||||
// StrokePoint
|
// StrokePoint
|
||||||
|
//
|
||||||
|
// * this function is only used by Decorators
|
||||||
void
|
void
|
||||||
DisplayDriverPainter::StrokePoint(const BPoint& pt, const RGBColor &color)
|
DisplayDriverPainter::StrokePoint(const BPoint& pt, const RGBColor &color)
|
||||||
{
|
{
|
||||||
@@ -744,9 +743,9 @@ DisplayDriverPainter::StrokePoint(const BPoint& pt, const RGBColor &color)
|
|||||||
|
|
||||||
// StrokePoint
|
// StrokePoint
|
||||||
void
|
void
|
||||||
DisplayDriverPainter::StrokePoint(const BPoint& pt, const DrawData *d)
|
DisplayDriverPainter::StrokePoint(const BPoint& pt, DrawData *context)
|
||||||
{
|
{
|
||||||
StrokeLine(pt, pt, d);
|
StrokeLine(pt, pt, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
// StrokePolygon
|
// StrokePolygon
|
||||||
@@ -1129,20 +1128,18 @@ DisplayDriverPainter::StrokeLineArray(const int32 &numlines,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (Lock()) {
|
if (Lock()) {
|
||||||
DrawData d;
|
DrawData context;
|
||||||
d.draw_mode = B_OP_COPY;
|
context.draw_mode = B_OP_COPY;
|
||||||
const LineArrayData *data;
|
const LineArrayData *data;
|
||||||
|
|
||||||
data = (const LineArrayData *)&(linedata[0]);
|
data = (const LineArrayData *)&(linedata[0]);
|
||||||
d.highcolor = data->color;
|
context.highcolor = data->color;
|
||||||
fPainter->SetDrawData(&d);
|
BRect touched = fPainter->StrokeLine(data->pt1, data->pt2, &context);
|
||||||
BRect touched = fPainter->StrokeLine(data->pt1, data->pt2);
|
|
||||||
|
|
||||||
for (int32 i = 1; i < numlines; i++) {
|
for (int32 i = 1; i < numlines; i++) {
|
||||||
data = (const LineArrayData *)&(linedata[i]);
|
data = (const LineArrayData *)&(linedata[i]);
|
||||||
d.highcolor = data->color;
|
context.highcolor = data->color;
|
||||||
fPainter->SetDrawData(&d);
|
touched = touched | fPainter->StrokeLine(data->pt1, data->pt2, &context);
|
||||||
touched = touched | fPainter->StrokeLine(data->pt1, data->pt2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fGraphicsCard->Invalidate(touched);
|
fGraphicsCard->Invalidate(touched);
|
||||||
|
|||||||
Reference in New Issue
Block a user