The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Double Buffering Display Policy on OS X

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
Double Buffering Display Policy on OS X Posted: Sep 28, 2009 2:08 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Double Buffering Display Policy on OS X
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Cincom Smalltalk Blog - Smalltalk with Rants

Advertisement

Over the last few days I've been adjusting BottomFeeder (and related code) to deal with the performance issues associated with using DoubleBufferingWindowDisplayPolicy on OS X. First, I just got rid of all the usage in my code, period - which fixed the problems on OS X, but led to problems in X11. Then I looked at #damageRepairPoliicy: in ScheduledWindow, and thought about hacking that.

The trouble is, that's invasive, and affects the whole system. Interestingly, after trying that, I noticed a lot of flashing in the little publishing animation that's used. So instead, I hit on this: I created a new package, a WindowRepairPolicy namespace, and my own DoubleBufferingWindowDisplayPolicy class. Here's how buffering is normally turned on, in #postOpenWith:


builder window damageRepairPolicy: DoubleBufferingWindowDisplayPolicy new. 

To change my own apps without changing system code, I made #new in the new class look like this:


new
	"answer the right policy"

	| cls |
	cls := ('*MacOSX' match: ExternalInterface currentPlatform last)
		ifTrue: [UI.WindowDisplayPolicy]
		ifFalse: [UI.DoubleBufferingWindowDisplayPolicy].
	^cls new

And then changed my apps to use code like this:


builder window damageRepairPolicy: 
	WindowRepairPolicy.DoubleBufferingWindowDisplayPolicy new. 

No system level hacks, and all of my code works the way I want it to, on all platforms.

Technorati Tags: , ,

Read: Double Buffering Display Policy on OS X

Topic: Industry Misinterpretations 155: GWT Smalltalk Previous Topic   Next Topic Topic: Various Snow Leopard Annoyances

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use