Made the new clipping code to use a single message to update client frame/bounds. ACTIVATED new clipping code! If someone notices problems please write to any list
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14558 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+40
-16
@@ -1935,7 +1935,8 @@ Layer::do_CopyBits(BRect& src, BRect& dst, int32 xOffset, int32 yOffset) {
|
|||||||
// the region at the destination that needs invalidation
|
// the region at the destination that needs invalidation
|
||||||
GetRootLayer()->fRedrawReg.Set(dst);
|
GetRootLayer()->fRedrawReg.Set(dst);
|
||||||
// exclude the region drawn by the copy operation
|
// exclude the region drawn by the copy operation
|
||||||
GetRootLayer()->fRedrawReg.Exclude(©Region);
|
// TODO: quick fix for our scrolling problem. FIX THIS!
|
||||||
|
// GetRootLayer()->fRedrawReg.Exclude(©Region);
|
||||||
// apply the current clipping as well
|
// apply the current clipping as well
|
||||||
GetRootLayer()->fRedrawReg.IntersectWith(&fVisible2);
|
GetRootLayer()->fRedrawReg.IntersectWith(&fVisible2);
|
||||||
|
|
||||||
@@ -1955,25 +1956,15 @@ Layer::do_CopyBits(BRect& src, BRect& dst, int32 xOffset, int32 yOffset) {
|
|||||||
void
|
void
|
||||||
Layer::MovedByHook(float dx, float dy)
|
Layer::MovedByHook(float dx, float dy)
|
||||||
{
|
{
|
||||||
if (Window() && Flags() & B_FRAME_EVENTS && !IsTopLayer()) {
|
if (Window() && !IsTopLayer())
|
||||||
BMessage msg(B_VIEW_MOVED);
|
AddToViewsWithInvalidCoords();
|
||||||
msg.AddInt64("when", system_time());
|
|
||||||
msg.AddPoint("where", Frame().LeftTop());
|
|
||||||
Window()->SendMessageToClient(&msg, fViewToken, false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Layer::ResizedByHook(float dx, float dy, bool automatic)
|
Layer::ResizedByHook(float dx, float dy, bool automatic)
|
||||||
{
|
{
|
||||||
if (Window() && Flags() & B_FRAME_EVENTS && !IsTopLayer()) {
|
if (Window() && !IsTopLayer())
|
||||||
BMessage msg(B_VIEW_RESIZED);
|
AddToViewsWithInvalidCoords();
|
||||||
msg.AddInt64("when", system_time());
|
|
||||||
msg.AddFloat("width", Frame().Width());
|
|
||||||
msg.AddFloat("height", Frame().Height());
|
|
||||||
msg.AddPoint("where", Frame().LeftTop());
|
|
||||||
Window()->SendMessageToClient(&msg, fViewToken, false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -2242,7 +2233,33 @@ Layer::resize_layer_frame_by(float x, float y)
|
|||||||
newFrame.bottom += y;
|
newFrame.bottom += y;
|
||||||
else if ((rm & 0x00F0U) == _VIEW_CENTER_ << 4)
|
else if ((rm & 0x00F0U) == _VIEW_CENTER_ << 4)
|
||||||
newFrame.bottom += y/2;
|
newFrame.bottom += y/2;
|
||||||
|
/*
|
||||||
|
if (newFrame != fFrame) {
|
||||||
|
float offsetX, offsetY;
|
||||||
|
float dx, dy;
|
||||||
|
|
||||||
|
dx = newFrame.Width() - fFrame.Width();
|
||||||
|
dy = newFrame.Height() - fFrame.Height();
|
||||||
|
offsetX = newFrame.left - fFrame.left;
|
||||||
|
offsetY = newFrame.top - fFrame.top;
|
||||||
|
|
||||||
|
fFrame = newFrame;
|
||||||
|
|
||||||
|
if (offsetX != 0.0f || offsetY != 0.0f) {
|
||||||
|
MovedByHook(offsetX, offsetY);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dx != 0.0f || dy != 0.0f) {
|
||||||
|
// call hook function
|
||||||
|
ResizedByHook(dx, dy, true); // automatic
|
||||||
|
|
||||||
|
for (Layer *lay = LastChild(); lay; lay = PreviousChild())
|
||||||
|
lay->resize_layer_frame_by(dx, dy);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
// TODO: the above code is CORRECT!!!
|
||||||
|
// It's commented because BView::FrameResized()/Moved() be called twice a given view. FIX THIS!
|
||||||
if (newFrame != fFrame) {
|
if (newFrame != fFrame) {
|
||||||
float dx, dy;
|
float dx, dy;
|
||||||
|
|
||||||
@@ -2397,6 +2414,8 @@ Layer::do_ResizeBy(float dx, float dy)
|
|||||||
GetRootLayer()->RequestDraw(GetRootLayer()->fRedrawReg, NULL);
|
GetRootLayer()->RequestDraw(GetRootLayer()->fRedrawReg, NULL);
|
||||||
// GetRootLayer()->RequestRedraw(); // TODO: what if we pass (fParent, startFromTHIS, &redrawReg)?
|
// GetRootLayer()->RequestRedraw(); // TODO: what if we pass (fParent, startFromTHIS, &redrawReg)?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SendViewCoordUpdateMsg();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Layer::do_MoveBy(float dx, float dy)
|
void Layer::do_MoveBy(float dx, float dy)
|
||||||
@@ -2448,6 +2467,8 @@ void Layer::do_MoveBy(float dx, float dy)
|
|||||||
GetRootLayer()->RequestDraw(GetRootLayer()->fRedrawReg, NULL);
|
GetRootLayer()->RequestDraw(GetRootLayer()->fRedrawReg, NULL);
|
||||||
// GetRootLayer()->RequestRedraw(); // TODO: what if we pass (fParent, startFromTHIS, &redrawReg)?
|
// GetRootLayer()->RequestRedraw(); // TODO: what if we pass (fParent, startFromTHIS, &redrawReg)?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SendViewCoordUpdateMsg();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -2477,7 +2498,8 @@ Layer::do_ScrollBy(float dx, float dy)
|
|||||||
// common region goes back to its original location. then, by excluding
|
// common region goes back to its original location. then, by excluding
|
||||||
// it from curent fullVisible we'll obtain the region that needs to be redrawn.
|
// it from curent fullVisible we'll obtain the region that needs to be redrawn.
|
||||||
invalid.OffsetBy(-dx, -dy);
|
invalid.OffsetBy(-dx, -dy);
|
||||||
redrawReg.Exclude(&invalid);
|
// TODO: a quick fix for the scrolling problem!!! FIX THIS!
|
||||||
|
// redrawReg.Exclude(&invalid);
|
||||||
|
|
||||||
// GetRootLayer()->fRedrawReg.Include(&redrawReg);
|
// GetRootLayer()->fRedrawReg.Include(&redrawReg);
|
||||||
GetRootLayer()->fRedrawReg = redrawReg;
|
GetRootLayer()->fRedrawReg = redrawReg;
|
||||||
@@ -2487,6 +2509,8 @@ Layer::do_ScrollBy(float dx, float dy)
|
|||||||
|
|
||||||
if (dx != 0.0f || dy != 0.0f)
|
if (dx != 0.0f || dy != 0.0f)
|
||||||
ScrolledByHook(dx, dy);
|
ScrolledByHook(dx, dy);
|
||||||
|
|
||||||
|
SendViewCoordUpdateMsg();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
#include "RGBColor.h"
|
#include "RGBColor.h"
|
||||||
#include "ServerWindow.h"
|
#include "ServerWindow.h"
|
||||||
|
|
||||||
//#define NEW_CLIPPING 1
|
#define NEW_CLIPPING 1
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
B_LAYER_NONE = 1,
|
B_LAYER_NONE = 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user