ViewLayers screen clipping is clipped to the parent bounds, but that is only a partial fix and should be done more elegantly. When moving a window, the part that we could blit is certainly not dirty, the pending dirty region that we drag along is clipped to the new visible region of the moved window
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15170 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -388,14 +388,14 @@ Desktop::MoveWindowBy(WindowLayer* window, int32 x, int32 y)
|
||||
// could move by blitting
|
||||
copyRegion.OffsetBy(x, y);
|
||||
newDirtyRegion.Exclude(©Region);
|
||||
MarkClean(©Region);
|
||||
fDrawingEngine->MarkDirty(©Region);
|
||||
|
||||
fDrawingEngine->Unlock();
|
||||
}
|
||||
// include the moved peviously dirty region
|
||||
// TODO: redesign dirty regions to be located in
|
||||
// each window -> less intersecting
|
||||
alreadyDirtyRegion.OffsetBy(x, y);
|
||||
alreadyDirtyRegion.IntersectWith(&window->VisibleRegion());
|
||||
newDirtyRegion.Include(&alreadyDirtyRegion);
|
||||
|
||||
MarkDirty(&newDirtyRegion);
|
||||
|
||||
@@ -266,6 +266,33 @@ ViewLayer::ConvertToParent(BRegion* region) const
|
||||
fFrame.top - fScrollingOffset.y);
|
||||
}
|
||||
|
||||
// ConvertFromParent
|
||||
void
|
||||
ViewLayer::ConvertFromParent(BPoint* point) const
|
||||
{
|
||||
// remove scrolling offset and convert to parent coordinate space
|
||||
point->x += fScrollingOffset.x - fFrame.left;
|
||||
point->y += fScrollingOffset.y - fFrame.top;
|
||||
}
|
||||
|
||||
// ConvertFromParent
|
||||
void
|
||||
ViewLayer::ConvertFromParent(BRect* rect) const
|
||||
{
|
||||
// remove scrolling offset and convert to parent coordinate space
|
||||
rect->OffsetBy(fScrollingOffset.x - fFrame.left,
|
||||
fScrollingOffset.y - fFrame.top);
|
||||
}
|
||||
|
||||
// ConvertFromParent
|
||||
void
|
||||
ViewLayer::ConvertFromParent(BRegion* region) const
|
||||
{
|
||||
// remove scrolling offset and convert to parent coordinate space
|
||||
region->OffsetBy(fScrollingOffset.x - fFrame.left,
|
||||
fScrollingOffset.y - fFrame.top);
|
||||
}
|
||||
|
||||
// ConvertToTop
|
||||
void
|
||||
ViewLayer::ConvertToTop(BPoint* point) const
|
||||
@@ -637,6 +664,12 @@ ViewLayer::ScreenClipping(BRegion* windowContentClipping, bool force) const
|
||||
{
|
||||
if (!fScreenClippingValid || force) {
|
||||
fScreenClipping = fLocalClipping;
|
||||
if (fParent) {
|
||||
BRect parentWindow = fParent->Bounds();
|
||||
ConvertFromParent(&parentWindow);
|
||||
BRegion visibleInParent(parentWindow);
|
||||
fScreenClipping.IntersectWith(&visibleInParent);
|
||||
}
|
||||
ConvertToTop(&fScreenClipping);
|
||||
fScreenClipping.IntersectWith(windowContentClipping);
|
||||
fScreenClippingValid = true;
|
||||
|
||||
@@ -53,6 +53,10 @@ class ViewLayer {
|
||||
void ConvertToParent(BRect* rect) const;
|
||||
void ConvertToParent(BRegion* region) const;
|
||||
|
||||
void ConvertFromParent(BPoint* point) const;
|
||||
void ConvertFromParent(BRect* rect) const;
|
||||
void ConvertFromParent(BRegion* region) const;
|
||||
|
||||
void ConvertToTop(BPoint* point) const;
|
||||
void ConvertToTop(BRect* rect) const;
|
||||
void ConvertToTop(BRegion* region) const;
|
||||
|
||||
Reference in New Issue
Block a user