+// ============================================================================
+// implementation
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// wxSharedDCBufferManager: helper class maintaining backing store bitmap
+// ----------------------------------------------------------------------------
+
+class wxSharedDCBufferManager : public wxModule
+{
+public:
+ wxSharedDCBufferManager() { }
+
+ virtual bool OnInit() { return true; }
+ virtual void OnExit() { wxDELETE(ms_buffer); }
+
+ static wxBitmap* GetBuffer(int w, int h)
+ {
+ if ( ms_usingSharedBuffer )
+ return new wxBitmap(w, h);
+
+ if ( !ms_buffer ||
+ w > ms_buffer->GetWidth() ||
+ h > ms_buffer->GetHeight() )
+ {
+ delete ms_buffer;
+ ms_buffer = new wxBitmap(w, h);
+ }