* GetMouse() now survives being called with NULL parameters for location or
buttons. * Automatic whitespace cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28116 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+72
-58
@@ -1375,8 +1375,11 @@ BView::DragMessage(BMessage *message, BBitmap *image,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BView::GetMouse(BPoint *location, uint32 *buttons, bool checkMessageQueue)
|
BView::GetMouse(BPoint *_location, uint32 *_buttons, bool checkMessageQueue)
|
||||||
{
|
{
|
||||||
|
if (_location == NULL && _buttons == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
_CheckOwnerLockAndSwitchCurrent();
|
_CheckOwnerLockAndSwitchCurrent();
|
||||||
|
|
||||||
uint32 eventOptions = fEventOptions | fMouseEventOptions;
|
uint32 eventOptions = fEventOptions | fMouseEventOptions;
|
||||||
@@ -1424,13 +1427,14 @@ BView::GetMouse(BPoint *location, uint32 *buttons, bool checkMessageQueue)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
message->FindPoint("screen_where", location);
|
message->FindPoint("screen_where", _location);
|
||||||
message->FindInt32("buttons", (int32 *)buttons);
|
message->FindInt32("buttons", (int32 *)_buttons);
|
||||||
queue->Unlock();
|
queue->Unlock();
|
||||||
// we need to hold the queue lock until here, because
|
// we need to hold the queue lock until here, because
|
||||||
// the message might still be used for something else
|
// the message might still be used for something else
|
||||||
|
|
||||||
ConvertFromScreen(location);
|
if (_location != NULL)
|
||||||
|
ConvertFromScreen(_location);
|
||||||
|
|
||||||
if (deleteMessage)
|
if (deleteMessage)
|
||||||
delete message;
|
delete message;
|
||||||
@@ -1449,8 +1453,10 @@ BView::GetMouse(BPoint *location, uint32 *buttons, bool checkMessageQueue)
|
|||||||
int32 code;
|
int32 code;
|
||||||
if (fOwner->fLink->FlushWithReply(code) == B_OK
|
if (fOwner->fLink->FlushWithReply(code) == B_OK
|
||||||
&& code == B_OK) {
|
&& code == B_OK) {
|
||||||
fOwner->fLink->Read<BPoint>(location);
|
BPoint location;
|
||||||
fOwner->fLink->Read<uint32>(buttons);
|
uint32 buttons;
|
||||||
|
fOwner->fLink->Read<BPoint>(&location);
|
||||||
|
fOwner->fLink->Read<uint32>(&buttons);
|
||||||
// TODO: ServerWindow replies with an int32 here
|
// TODO: ServerWindow replies with an int32 here
|
||||||
|
|
||||||
ConvertFromScreen(location);
|
ConvertFromScreen(location);
|
||||||
@@ -1464,8 +1470,16 @@ BView::GetMouse(BPoint *location, uint32 *buttons, bool checkMessageQueue)
|
|||||||
// to scrolling. An app reading these messages would have to know
|
// to scrolling. An app reading these messages would have to know
|
||||||
// the locations of the window and view for each message...
|
// the locations of the window and view for each message...
|
||||||
// otherwise it is potentially broken anyways.
|
// otherwise it is potentially broken anyways.
|
||||||
} else
|
if (_location != NULL)
|
||||||
*buttons = 0;
|
*_location = location;
|
||||||
|
if (_buttons != NULL)
|
||||||
|
*_buttons = buttons;
|
||||||
|
} else {
|
||||||
|
if (_location != NULL)
|
||||||
|
_location->Set(0, 0);
|
||||||
|
if (_buttons != NULL)
|
||||||
|
*_buttons = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2609,14 +2623,14 @@ BView::FillEllipse(BRect rect, const BGradient& gradient)
|
|||||||
{
|
{
|
||||||
if (fOwner == NULL)
|
if (fOwner == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_CheckLockAndSwitchCurrent();
|
_CheckLockAndSwitchCurrent();
|
||||||
|
|
||||||
fOwner->fLink->StartMessage(AS_FILL_ELLIPSE_GRADIENT);
|
fOwner->fLink->StartMessage(AS_FILL_ELLIPSE_GRADIENT);
|
||||||
fOwner->fLink->Attach<BRect>(rect);
|
fOwner->fLink->Attach<BRect>(rect);
|
||||||
fOwner->fLink->Attach<gradient_type>(gradient.Type());
|
fOwner->fLink->Attach<gradient_type>(gradient.Type());
|
||||||
fOwner->fLink->AttachGradient(gradient);
|
fOwner->fLink->AttachGradient(gradient);
|
||||||
|
|
||||||
_FlushIfNotInTransaction();
|
_FlushIfNotInTransaction();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2692,16 +2706,16 @@ BView::FillArc(BRect rect, float startAngle, float arcAngle,
|
|||||||
{
|
{
|
||||||
if (fOwner == NULL)
|
if (fOwner == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_CheckLockAndSwitchCurrent();
|
_CheckLockAndSwitchCurrent();
|
||||||
|
|
||||||
fOwner->fLink->StartMessage(AS_FILL_ARC_GRADIENT);
|
fOwner->fLink->StartMessage(AS_FILL_ARC_GRADIENT);
|
||||||
fOwner->fLink->Attach<BRect>(rect);
|
fOwner->fLink->Attach<BRect>(rect);
|
||||||
fOwner->fLink->Attach<float>(startAngle);
|
fOwner->fLink->Attach<float>(startAngle);
|
||||||
fOwner->fLink->Attach<float>(arcAngle);
|
fOwner->fLink->Attach<float>(arcAngle);
|
||||||
fOwner->fLink->Attach<gradient_type>(gradient.Type());
|
fOwner->fLink->Attach<gradient_type>(gradient.Type());
|
||||||
fOwner->fLink->AttachGradient(gradient);
|
fOwner->fLink->AttachGradient(gradient);
|
||||||
|
|
||||||
_FlushIfNotInTransaction();
|
_FlushIfNotInTransaction();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2749,9 +2763,9 @@ BView::FillBezier(BPoint *controlPoints, const BGradient& gradient)
|
|||||||
{
|
{
|
||||||
if (fOwner == NULL)
|
if (fOwner == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_CheckLockAndSwitchCurrent();
|
_CheckLockAndSwitchCurrent();
|
||||||
|
|
||||||
fOwner->fLink->StartMessage(AS_FILL_BEZIER_GRADIENT);
|
fOwner->fLink->StartMessage(AS_FILL_BEZIER_GRADIENT);
|
||||||
fOwner->fLink->Attach<BPoint>(controlPoints[0]);
|
fOwner->fLink->Attach<BPoint>(controlPoints[0]);
|
||||||
fOwner->fLink->Attach<BPoint>(controlPoints[1]);
|
fOwner->fLink->Attach<BPoint>(controlPoints[1]);
|
||||||
@@ -2759,7 +2773,7 @@ BView::FillBezier(BPoint *controlPoints, const BGradient& gradient)
|
|||||||
fOwner->fLink->Attach<BPoint>(controlPoints[3]);
|
fOwner->fLink->Attach<BPoint>(controlPoints[3]);
|
||||||
fOwner->fLink->Attach<gradient_type>(gradient.Type());
|
fOwner->fLink->Attach<gradient_type>(gradient.Type());
|
||||||
fOwner->fLink->AttachGradient(gradient);
|
fOwner->fLink->AttachGradient(gradient);
|
||||||
|
|
||||||
_FlushIfNotInTransaction();
|
_FlushIfNotInTransaction();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2849,9 +2863,9 @@ BView::FillPolygon(const BPolygon *polygon, const BGradient& gradient)
|
|||||||
|| polygon->fCount <= 2
|
|| polygon->fCount <= 2
|
||||||
|| fOwner == NULL)
|
|| fOwner == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_CheckLockAndSwitchCurrent();
|
_CheckLockAndSwitchCurrent();
|
||||||
|
|
||||||
if (fOwner->fLink->StartMessage(AS_FILL_POLYGON_GRADIENT,
|
if (fOwner->fLink->StartMessage(AS_FILL_POLYGON_GRADIENT,
|
||||||
polygon->fCount * sizeof(BPoint)
|
polygon->fCount * sizeof(BPoint)
|
||||||
+ sizeof(BRect) + sizeof(int32)) == B_OK) {
|
+ sizeof(BRect) + sizeof(int32)) == B_OK) {
|
||||||
@@ -2861,7 +2875,7 @@ BView::FillPolygon(const BPolygon *polygon, const BGradient& gradient)
|
|||||||
polygon->fCount * sizeof(BPoint));
|
polygon->fCount * sizeof(BPoint));
|
||||||
fOwner->fLink->Attach<gradient_type>(gradient.Type());
|
fOwner->fLink->Attach<gradient_type>(gradient.Type());
|
||||||
fOwner->fLink->AttachGradient(gradient);
|
fOwner->fLink->AttachGradient(gradient);
|
||||||
|
|
||||||
_FlushIfNotInTransaction();
|
_FlushIfNotInTransaction();
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "ERROR: Can't send polygon to app_server!\n");
|
fprintf(stderr, "ERROR: Can't send polygon to app_server!\n");
|
||||||
@@ -2886,7 +2900,7 @@ BView::FillPolygon(const BPoint *ptArray, int32 numPts,
|
|||||||
{
|
{
|
||||||
if (!ptArray)
|
if (!ptArray)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
BPolygon polygon(ptArray, numPts);
|
BPolygon polygon(ptArray, numPts);
|
||||||
FillPolygon(&polygon, gradient);
|
FillPolygon(&polygon, gradient);
|
||||||
}
|
}
|
||||||
@@ -2912,9 +2926,9 @@ BView::FillPolygon(const BPoint *ptArray, int32 numPts, BRect bounds,
|
|||||||
{
|
{
|
||||||
if (!ptArray)
|
if (!ptArray)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
BPolygon polygon(ptArray, numPts);
|
BPolygon polygon(ptArray, numPts);
|
||||||
|
|
||||||
polygon.MapTo(polygon.Frame(), bounds);
|
polygon.MapTo(polygon.Frame(), bounds);
|
||||||
FillPolygon(&polygon, gradient);
|
FillPolygon(&polygon, gradient);
|
||||||
}
|
}
|
||||||
@@ -2962,19 +2976,19 @@ BView::FillRect(BRect rect, const BGradient& gradient)
|
|||||||
{
|
{
|
||||||
if (fOwner == NULL)
|
if (fOwner == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// NOTE: ensuring compatibility with R5,
|
// NOTE: ensuring compatibility with R5,
|
||||||
// invalid rects are not filled, they are stroked though!
|
// invalid rects are not filled, they are stroked though!
|
||||||
if (!rect.IsValid())
|
if (!rect.IsValid())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_CheckLockAndSwitchCurrent();
|
_CheckLockAndSwitchCurrent();
|
||||||
|
|
||||||
fOwner->fLink->StartMessage(AS_FILL_RECT_GRADIENT);
|
fOwner->fLink->StartMessage(AS_FILL_RECT_GRADIENT);
|
||||||
fOwner->fLink->Attach<BRect>(rect);
|
fOwner->fLink->Attach<BRect>(rect);
|
||||||
fOwner->fLink->Attach<gradient_type>(gradient.Type());
|
fOwner->fLink->Attach<gradient_type>(gradient.Type());
|
||||||
fOwner->fLink->AttachGradient(gradient);
|
fOwner->fLink->AttachGradient(gradient);
|
||||||
|
|
||||||
_FlushIfNotInTransaction();
|
_FlushIfNotInTransaction();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3024,16 +3038,16 @@ BView::FillRoundRect(BRect rect, float xRadius, float yRadius,
|
|||||||
{
|
{
|
||||||
if (fOwner == NULL)
|
if (fOwner == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_CheckLockAndSwitchCurrent();
|
_CheckLockAndSwitchCurrent();
|
||||||
|
|
||||||
fOwner->fLink->StartMessage(AS_FILL_ROUNDRECT_GRADIENT);
|
fOwner->fLink->StartMessage(AS_FILL_ROUNDRECT_GRADIENT);
|
||||||
fOwner->fLink->Attach<BRect>(rect);
|
fOwner->fLink->Attach<BRect>(rect);
|
||||||
fOwner->fLink->Attach<float>(xRadius);
|
fOwner->fLink->Attach<float>(xRadius);
|
||||||
fOwner->fLink->Attach<float>(yRadius);
|
fOwner->fLink->Attach<float>(yRadius);
|
||||||
fOwner->fLink->Attach<gradient_type>(gradient.Type());
|
fOwner->fLink->Attach<gradient_type>(gradient.Type());
|
||||||
fOwner->fLink->AttachGradient(gradient);
|
fOwner->fLink->AttachGradient(gradient);
|
||||||
|
|
||||||
_FlushIfNotInTransaction();
|
_FlushIfNotInTransaction();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3060,14 +3074,14 @@ BView::FillRegion(BRegion *region, const BGradient& gradient)
|
|||||||
{
|
{
|
||||||
if (region == NULL || fOwner == NULL)
|
if (region == NULL || fOwner == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_CheckLockAndSwitchCurrent();
|
_CheckLockAndSwitchCurrent();
|
||||||
|
|
||||||
fOwner->fLink->StartMessage(AS_FILL_REGION_GRADIENT);
|
fOwner->fLink->StartMessage(AS_FILL_REGION_GRADIENT);
|
||||||
fOwner->fLink->AttachRegion(*region);
|
fOwner->fLink->AttachRegion(*region);
|
||||||
fOwner->fLink->Attach<gradient_type>(gradient.Type());
|
fOwner->fLink->Attach<gradient_type>(gradient.Type());
|
||||||
fOwner->fLink->AttachGradient(gradient);
|
fOwner->fLink->AttachGradient(gradient);
|
||||||
|
|
||||||
_FlushIfNotInTransaction();
|
_FlushIfNotInTransaction();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3179,33 +3193,33 @@ BView::FillTriangle(BPoint pt1, BPoint pt2, BPoint pt3,
|
|||||||
// we construct the smallest rectangle that contains the 3 points
|
// we construct the smallest rectangle that contains the 3 points
|
||||||
// for the 1st point
|
// for the 1st point
|
||||||
BRect bounds(pt1, pt1);
|
BRect bounds(pt1, pt1);
|
||||||
|
|
||||||
// for the 2nd point
|
// for the 2nd point
|
||||||
if (pt2.x < bounds.left)
|
if (pt2.x < bounds.left)
|
||||||
bounds.left = pt2.x;
|
bounds.left = pt2.x;
|
||||||
|
|
||||||
if (pt2.y < bounds.top)
|
if (pt2.y < bounds.top)
|
||||||
bounds.top = pt2.y;
|
bounds.top = pt2.y;
|
||||||
|
|
||||||
if (pt2.x > bounds.right)
|
if (pt2.x > bounds.right)
|
||||||
bounds.right = pt2.x;
|
bounds.right = pt2.x;
|
||||||
|
|
||||||
if (pt2.y > bounds.bottom)
|
if (pt2.y > bounds.bottom)
|
||||||
bounds.bottom = pt2.y;
|
bounds.bottom = pt2.y;
|
||||||
|
|
||||||
// for the 3rd point
|
// for the 3rd point
|
||||||
if (pt3.x < bounds.left)
|
if (pt3.x < bounds.left)
|
||||||
bounds.left = pt3.x;
|
bounds.left = pt3.x;
|
||||||
|
|
||||||
if (pt3.y < bounds.top)
|
if (pt3.y < bounds.top)
|
||||||
bounds.top = pt3.y;
|
bounds.top = pt3.y;
|
||||||
|
|
||||||
if (pt3.x > bounds.right)
|
if (pt3.x > bounds.right)
|
||||||
bounds.right = pt3.x;
|
bounds.right = pt3.x;
|
||||||
|
|
||||||
if (pt3.y > bounds.bottom)
|
if (pt3.y > bounds.bottom)
|
||||||
bounds.bottom = pt3.y;
|
bounds.bottom = pt3.y;
|
||||||
|
|
||||||
FillTriangle(pt1, pt2, pt3, bounds, gradient);
|
FillTriangle(pt1, pt2, pt3, bounds, gradient);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3237,7 +3251,7 @@ BView::FillTriangle(BPoint pt1, BPoint pt2, BPoint pt3,
|
|||||||
{
|
{
|
||||||
if (fOwner == NULL)
|
if (fOwner == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_CheckLockAndSwitchCurrent();
|
_CheckLockAndSwitchCurrent();
|
||||||
fOwner->fLink->StartMessage(AS_FILL_TRIANGLE_GRADIENT);
|
fOwner->fLink->StartMessage(AS_FILL_TRIANGLE_GRADIENT);
|
||||||
fOwner->fLink->Attach<BPoint>(pt1);
|
fOwner->fLink->Attach<BPoint>(pt1);
|
||||||
@@ -3246,7 +3260,7 @@ BView::FillTriangle(BPoint pt1, BPoint pt2, BPoint pt3,
|
|||||||
fOwner->fLink->Attach<BRect>(bounds);
|
fOwner->fLink->Attach<BRect>(bounds);
|
||||||
fOwner->fLink->Attach<gradient_type>(gradient.Type());
|
fOwner->fLink->Attach<gradient_type>(gradient.Type());
|
||||||
fOwner->fLink->AttachGradient(gradient);
|
fOwner->fLink->AttachGradient(gradient);
|
||||||
|
|
||||||
_FlushIfNotInTransaction();
|
_FlushIfNotInTransaction();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3331,13 +3345,13 @@ BView::FillShape(BShape *shape, const BGradient& gradient)
|
|||||||
{
|
{
|
||||||
if (shape == NULL || fOwner == NULL)
|
if (shape == NULL || fOwner == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
shape_data *sd = (shape_data *)(shape->fPrivateData);
|
shape_data *sd = (shape_data *)(shape->fPrivateData);
|
||||||
if (sd->opCount == 0 || sd->ptCount == 0)
|
if (sd->opCount == 0 || sd->ptCount == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_CheckLockAndSwitchCurrent();
|
_CheckLockAndSwitchCurrent();
|
||||||
|
|
||||||
fOwner->fLink->StartMessage(AS_FILL_SHAPE_GRADIENT);
|
fOwner->fLink->StartMessage(AS_FILL_SHAPE_GRADIENT);
|
||||||
fOwner->fLink->Attach<BRect>(shape->Bounds());
|
fOwner->fLink->Attach<BRect>(shape->Bounds());
|
||||||
fOwner->fLink->Attach<int32>(sd->opCount);
|
fOwner->fLink->Attach<int32>(sd->opCount);
|
||||||
@@ -3346,7 +3360,7 @@ BView::FillShape(BShape *shape, const BGradient& gradient)
|
|||||||
fOwner->fLink->Attach(sd->ptList, sd->ptCount * sizeof(BPoint));
|
fOwner->fLink->Attach(sd->ptList, sd->ptCount * sizeof(BPoint));
|
||||||
fOwner->fLink->Attach<gradient_type>(gradient.Type());
|
fOwner->fLink->Attach<gradient_type>(gradient.Type());
|
||||||
fOwner->fLink->AttachGradient(gradient);
|
fOwner->fLink->AttachGradient(gradient);
|
||||||
|
|
||||||
_FlushIfNotInTransaction();
|
_FlushIfNotInTransaction();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4679,7 +4693,7 @@ BView::_ClipToPicture(BPicture *picture, BPoint where,
|
|||||||
// This implementation is pretty slow, since just creating an offscreen bitmap
|
// This implementation is pretty slow, since just creating an offscreen bitmap
|
||||||
// takes a lot of time. That's the main reason why it should be moved
|
// takes a lot of time. That's the main reason why it should be moved
|
||||||
// to the server.
|
// to the server.
|
||||||
|
|
||||||
// Here the idea is to get rid of the padding bytes in the bitmap,
|
// Here the idea is to get rid of the padding bytes in the bitmap,
|
||||||
// as padding complicates and slows down the iteration.
|
// as padding complicates and slows down the iteration.
|
||||||
// TODO: Maybe it's not so nice as it assumes BBitmaps to be aligned
|
// TODO: Maybe it's not so nice as it assumes BBitmaps to be aligned
|
||||||
@@ -4688,7 +4702,7 @@ BView::_ClipToPicture(BPicture *picture, BPoint where,
|
|||||||
if ((bounds.IntegerWidth() + 1) % 32)
|
if ((bounds.IntegerWidth() + 1) % 32)
|
||||||
bounds.right = bounds.left + ((bounds.IntegerWidth() + 1) / 32 + 1) * 32 - 1;
|
bounds.right = bounds.left + ((bounds.IntegerWidth() + 1) / 32 + 1) * 32 - 1;
|
||||||
|
|
||||||
// TODO: I used a RGBA32 bitmap because drawing on a GRAY8 doesn't work.
|
// TODO: I used a RGBA32 bitmap because drawing on a GRAY8 doesn't work.
|
||||||
BBitmap *bitmap = new BBitmap(bounds, B_RGBA32, true);
|
BBitmap *bitmap = new BBitmap(bounds, B_RGBA32, true);
|
||||||
if (bitmap && bitmap->InitCheck() == B_OK && bitmap->Lock()) {
|
if (bitmap && bitmap->InitCheck() == B_OK && bitmap->Lock()) {
|
||||||
BView *view = new BView(bounds, "drawing view", B_FOLLOW_NONE, 0);
|
BView *view = new BView(bounds, "drawing view", B_FOLLOW_NONE, 0);
|
||||||
@@ -4696,8 +4710,8 @@ BView::_ClipToPicture(BPicture *picture, BPoint where,
|
|||||||
view->DrawPicture(picture, where);
|
view->DrawPicture(picture, where);
|
||||||
view->Sync();
|
view->Sync();
|
||||||
bitmap->Unlock();
|
bitmap->Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
BRegion region;
|
BRegion region;
|
||||||
int32 width = bounds.IntegerWidth() + 1;
|
int32 width = bounds.IntegerWidth() + 1;
|
||||||
int32 height = bounds.IntegerHeight() + 1;
|
int32 height = bounds.IntegerHeight() + 1;
|
||||||
@@ -4705,13 +4719,13 @@ BView::_ClipToPicture(BPicture *picture, BPoint where,
|
|||||||
uint32 bit = 0;
|
uint32 bit = 0;
|
||||||
uint32 *bits = (uint32 *)bitmap->Bits();
|
uint32 *bits = (uint32 *)bitmap->Bits();
|
||||||
clipping_rect rect;
|
clipping_rect rect;
|
||||||
|
|
||||||
// TODO: A possible optimization would be adding "spans" instead
|
// TODO: A possible optimization would be adding "spans" instead
|
||||||
// of 1x1 rects. That would probably help with very complex
|
// of 1x1 rects. That would probably help with very complex
|
||||||
// BPictures
|
// BPictures
|
||||||
for (int32 y = 0; y < height; y++) {
|
for (int32 y = 0; y < height; y++) {
|
||||||
for (int32 x = 0; x < width; x++) {
|
for (int32 x = 0; x < width; x++) {
|
||||||
bit = *bits++;
|
bit = *bits++;
|
||||||
if (bit != 0xFFFFFFFF) {
|
if (bit != 0xFFFFFFFF) {
|
||||||
rect.left = x;
|
rect.left = x;
|
||||||
rect.right = rect.left;
|
rect.right = rect.left;
|
||||||
@@ -4723,15 +4737,15 @@ BView::_ClipToPicture(BPicture *picture, BPoint where,
|
|||||||
bitmap->UnlockBits();
|
bitmap->UnlockBits();
|
||||||
}
|
}
|
||||||
delete bitmap;
|
delete bitmap;
|
||||||
|
|
||||||
if (invert) {
|
if (invert) {
|
||||||
BRegion inverseRegion;
|
BRegion inverseRegion;
|
||||||
inverseRegion.Include(Bounds());
|
inverseRegion.Include(Bounds());
|
||||||
inverseRegion.Exclude(®ion);
|
inverseRegion.Exclude(®ion);
|
||||||
ConstrainClippingRegion(&inverseRegion);
|
ConstrainClippingRegion(&inverseRegion);
|
||||||
} else
|
} else
|
||||||
ConstrainClippingRegion(®ion);
|
ConstrainClippingRegion(®ion);
|
||||||
#else
|
#else
|
||||||
if (_CheckOwnerLockAndSwitchCurrent()) {
|
if (_CheckOwnerLockAndSwitchCurrent()) {
|
||||||
fOwner->fLink->StartMessage(AS_VIEW_CLIP_TO_PICTURE);
|
fOwner->fLink->StartMessage(AS_VIEW_CLIP_TO_PICTURE);
|
||||||
fOwner->fLink->Attach<int32>(picture->Token());
|
fOwner->fLink->Attach<int32>(picture->Token());
|
||||||
|
|||||||
Reference in New Issue
Block a user