[squeak-dev] Re: Drawing speed (was: The Trunk: Graphics-tfel.326.mcz)

timfelgentreff timfelgentreff at gmail.com
Fri Feb 19 22:08:20 UTC 2016


Is that so? I didn't find any code in VMMaker that forces the screen flip...
Where does that happen? In the interrupt check?

I was under the impression (from the method comment in forceDisplayUpdate)
that platforms are allowed to buffer screen updates and only need to flip
the buffers when that primitive is called.


Bert Freudenberg wrote
> This is a bad idea, it makes dragging feel sluggish. Before, I got 17
> ms/iteration. Now, 100 ms/iteration on a moderately-sized display. Even if
> I replace it with “Display forceToScreen: (rect merge: newRect)” I only
> get back to 34 ms / iteration, because it invalidates way more pixels than
> needed (just the border vs the whole rectangle area).
> 
> This should not be needed anyway: the VM must show draw requests to the
> user immediately (or say within about 10 ms) unless the
> primitiveDeferUpdates: flag is set (which is managed by Morphic for screen
> updates).
> 
> - Bert -
> 
>> On 19.02.2016, at 13:17, 

> commits at .squeak

>  wrote:
>> 
>> Tim Felgentreff uploaded a new version of Graphics to project The Trunk:
>> http://source.squeak.org/trunk/Graphics-tfel.326.mcz
>> 
>> ==================== Summary ====================
>> 
>> Name: Graphics-tfel.326
>> Author: tfel
>> Time: 19 February 2016, 2:17:46.541729 pm
>> UUID: 934ee205-38fd-4dcc-a877-b238d9e47a3a
>> Ancestors: Graphics-tfel.325
>> 
>> use VM primitive to flip screen buffers when drawing rectangles to the
>> screen
>> 
>> =============== Diff against Graphics-tfel.325 ===============
>> 
>> Item was changed:
>>  ----- Method: Rectangle>>newRectButtonPressedDo: (in category
>> 'transforming') -----
>>  newRectButtonPressedDo: newRectBlock 
>>  	"Track the outline of a new rectangle until mouse button 
>>  	changes. newFrameBlock produces each new rectangle from the 
>>  	previous. Only tracks while mouse is down."
>>  	| rect newRect buttonNow delay |
>>  	delay := Delay forMilliseconds: 10.
>>  	buttonNow := Sensor anyButtonPressed.
>>  	rect := self.
>>  	Display
>>  		border: rect
>>  		width: 2
>>  		rule: Form reverse
>>  		fillColor: Color gray.
>>  	[buttonNow]
>>  		whileTrue: [delay wait.
>>  			buttonNow := Sensor anyButtonPressed.
>>  			newRect := newRectBlock value: rect.
>>  			newRect = rect
>>  				ifFalse: [Display
>>  						border: rect
>>  						width: 2
>>  						rule: Form reverse
>>  						fillColor: Color gray.
>>  					Display
>>  						border: newRect
>>  						width: 2
>>  						rule: Form reverse
>>  						fillColor: Color gray.
>> + 					Display forceToScreen.
>>  					rect := newRect]].
>>  	Display
>>  		border: rect
>>  		width: 2
>>  		rule: Form reverse
>>  		fillColor: Color gray.
>>  	Project current pointerMoved. 
>>  	Sensor processEvent: Sensor createMouseEvent.
>>  	^ rect!
>> 
>> Item was changed:
>>  ----- Method: Rectangle>>newRectFrom: (in category 'transforming') -----
>>  newRectFrom: newRectBlock
>>  	"Track the outline of a new rectangle until mouse button changes.
>>  	newFrameBlock produces each new rectangle from the previous"
>>  	| rect newRect buttonStart buttonNow delay |
>>  	delay := Delay forMilliseconds: 10.
>>  	buttonStart := buttonNow := Sensor anyButtonPressed.
>>  	rect := self.
>>  	Display border: rect width: 2 rule: Form reverse fillColor: Color gray.
>>  	[buttonNow == buttonStart] whileTrue: 
>>  		[delay wait.
>>  		buttonNow := Sensor anyButtonPressed.
>>  		newRect := newRectBlock value: rect.
>>  		newRect = rect ifFalse:
>>  			[Display border: rect width: 2 rule: Form reverse fillColor: Color
>> gray.
>>  			Display border: newRect width: 2 rule: Form reverse fillColor: Color
>> gray.
>> + 			Display forceToScreen.
>>  			rect := newRect]].
>>  	Display border: rect width: 2 rule: Form reverse fillColor: Color gray.
>>  	Project current pointerMoved. 
>>  	Sensor processEvent: Sensor createMouseEvent.
>>  	^ rect!
>> 
>> 
> 
> 
> 
> 
> 
> 
> 
> smime.p7s (5K)
> <http://forum.world.st/attachment/4879060/0/smime.p7s>





--
View this message in context: http://forum.world.st/Drawing-speed-was-The-Trunk-Graphics-tfel-326-mcz-tp4879060p4879112.html
Sent from the Squeak - Dev mailing list archive at Nabble.com.


More information about the Squeak-dev mailing list