--- a/DisplaySurface.st Fri Feb 27 11:48:02 2004 +0100
+++ b/DisplaySurface.st Fri Feb 27 12:14:11 2004 +0100
@@ -102,6 +102,9 @@
!DisplaySurface methodsFor:'accessing'!
addUpdateRectangle:newRectangle
+ "return true, if the newRectangle is not already contained in the updateRegion
+ (i.e. if it added any pixels to the region"
+
|closure|
updateRegion isNil ifTrue:[
@@ -111,6 +114,7 @@
(updateRegion contains:[:oldRectangle | (newRectangle isContainedIn:oldRectangle)]) ifTrue:[
^ false.
].
+
updateRegion size > 10 ifTrue:[
closure := updateRegion
inject:newRectangle
@@ -120,6 +124,7 @@
updateRegion := OrderedCollection with:closure.
^ true
].
+
updateRegion add:newRectangle.
^ true
!
@@ -2396,7 +2401,7 @@
!DisplaySurface class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/DisplaySurface.st,v 1.107 2004-02-26 15:49:42 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/DisplaySurface.st,v 1.108 2004-02-27 11:14:11 cg Exp $'
! !
DisplaySurface initialize!
--- a/WindowSensor.st Fri Feb 27 11:48:02 2004 +0100
+++ b/WindowSensor.st Fri Feb 27 12:14:11 2004 +0100
@@ -1943,23 +1943,19 @@
basicAddDamage:newRectangle view:aView
"{ Pragma: +optSpeed }"
- "Add newRectangle to the damage list.
- Try to merge incoming rectangles with the existing damage rectangles.
- Incoming rectangles which are completely contained in any existing damage rect are ignored,
- any existing damage rectangle which is completely contained in the incoming rectangle
- is replaced.
- Returns true, if a new event has been added to the queue, false if it
- was optimized away."
-
- |newEvent r fullRedraw aDamageEvent
- nDamagesForView bounds areaOfIndividualRects thisRectangle
- mergedLeft mergedRight mergedTop mergedBottom
- sz "{ Class: SmallInteger }"
- updateRegion oldDamageEvent oldDamageEventIndex anyOtherEventPending|
+ "Add newRectangle to the views update region.
+ Must be careful, if the damage queue contains an event pattern such as:
+ damage map
+ in this case, a new damage event is required to be added AFTER the map event,
+ otherwise, the newRectangle will be processed in a state where the map has not yet been
+ processed and the view thinks it can be ignored.
+ In this case, the damage event is re-added at the end of the queue."
+
+ |sz "{ Class: SmallInteger }"
+ aDamageEvent oldDamageEvent oldDamageEventIndex anyOtherEventPending|
"/ NEWDAMAGE handling - experimental;
"/ comment these lines if you encounter trouble.
- (aView addUpdateRectangle:newRectangle) ifFalse:[^ false].
sz := damage size.
oldDamageEventIndex := nil.
@@ -1986,16 +1982,30 @@
"/ Therefore, we clear the old damage event and add a new one at the end,
"/ so that the damages will be processed AFTER the mapEvent has been processed.
anyOtherEventPending ifFalse:[
- ^ true
+ ^ aView addUpdateRectangle:newRectangle.
].
damage at:oldDamageEventIndex put:nil.
damage add:oldDamageEvent.
+ aView addUpdateRectangle:newRectangle.
^ true
].
damage add:(WindowEvent newDamageFor:aView).
+ aView addUpdateRectangle:newRectangle.
^ true.
+"/ |newEvent r fullRedraw aDamageEvent
+"/ nDamagesForView bounds areaOfIndividualRects thisRectangle
+"/ mergedLeft mergedRight mergedTop mergedBottom
+"/ sz "{ Class: SmallInteger }"
+"/ updateRegion oldDamageEvent oldDamageEventIndex anyOtherEventPending|
+"/
+"/ "Add newRectangle to the damage list.
+"/ Try to merge incoming rectangles with the existing damage rectangles.
+"/ Incoming rectangles which are completely contained in any existing damage rect are ignored,
+"/ any existing damage rectangle which is completely contained in the incoming rectangle is replaced.
+"/ Returns true, if a new event has been added to the queue, false if it was optimized away."
+"/
"/ "/ OLDDAMAGE handling
"/ r := newRectangle.
"/ ((fullRedraw := aView redrawsFull)
@@ -3121,7 +3131,7 @@
!WindowSensor class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/WindowSensor.st,v 1.219 2004-02-27 10:48:02 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/WindowSensor.st,v 1.220 2004-02-27 11:13:47 cg Exp $'
! !
WindowSensor initialize!