wxHtmlWindow background drawing fixes for OS X and optimizations

1. Avoid crashes under OS X due to attempts to copy window contents to the
   backing store bitmap: this doesn't work under OS X so avoid it by always
   painting the background from OnPaint() itself, while still generating the
   erase background events for compatibility.

2. Don't double buffer wxHtmlWindow drawing if the window is already double
   buffered.

3. Don't allocate backing store bitmap on the heap, this is useless as bitmaps
   are already pointer-lile -- so just use invalid bitmap instead of NULL
   bitmap pointer.

4. Update the html/test sample to show the effects of custom erase background
   handler in wxHtmlWindow (it overrides the background bitmap painting).



git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61117 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-06-18 17:32:20 +00:00
parent 86ac84b8ce
commit 03a187ccae
3 changed files with 147 additions and 81 deletions

View File

@@ -400,7 +400,6 @@ protected:
// actual size of window. This method also setup scrollbars
void CreateLayout();
void OnEraseBackground(wxEraseEvent& event);
void OnPaint(wxPaintEvent& event);
void OnSize(wxSizeEvent& event);
void OnMouseMove(wxMouseEvent& event);
@@ -510,8 +509,13 @@ protected:
#endif // wxUSE_CLIPBOARD
private:
// window content for double buffered rendering:
wxBitmap *m_backBuffer;
// erase the window background using m_bmpBg or just solid colour if we
// don't have any background image
void DoEraseBackground(wxDC& dc);
// window content for double buffered rendering, may be invalid until it is
// really initialized in OnPaint()
wxBitmap m_backBuffer;
// background image, may be invalid
wxBitmap m_bmpBg;
@@ -539,10 +543,6 @@ private:
// if this FLAG is false, items are not added to history
bool m_HistoryOn;
// a flag set if we need to erase background in OnPaint() (otherwise this
// is supposed to have been done in OnEraseBackground())
bool m_eraseBgInOnPaint;
// standard mouse cursors
static wxCursor *ms_cursorLink;
static wxCursor *ms_cursorText;