optimalization of wxHtmlWindow painting (used to repaint areas invalidated when scrolling 3+ times)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12437 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -632,23 +632,18 @@ void wxHtmlWindow::OnCellMouseHover(wxHtmlCell * WXUNUSED(cell),
|
|||||||
|
|
||||||
void wxHtmlWindow::OnDraw(wxDC& dc)
|
void wxHtmlWindow::OnDraw(wxDC& dc)
|
||||||
{
|
{
|
||||||
int x, y;
|
if (m_tmpCanDrawLocks > 0 || m_Cell == NULL) return;
|
||||||
wxRegionIterator upd(GetUpdateRegion()); // get the update rect list
|
|
||||||
int v_y, v_h;
|
|
||||||
|
|
||||||
if (m_tmpCanDrawLocks > 0) return;
|
int x, y;
|
||||||
|
wxRect rect = GetUpdateRegion().GetBox();
|
||||||
|
|
||||||
dc.SetMapMode(wxMM_TEXT);
|
dc.SetMapMode(wxMM_TEXT);
|
||||||
dc.SetBackgroundMode(wxTRANSPARENT);
|
dc.SetBackgroundMode(wxTRANSPARENT);
|
||||||
GetViewStart(&x, &y);
|
GetViewStart(&x, &y);
|
||||||
|
|
||||||
while (upd)
|
m_Cell->Draw(dc, 0, 0,
|
||||||
{
|
y * wxHTML_SCROLL_STEP + rect.GetTop(),
|
||||||
v_y = upd.GetY();
|
y * wxHTML_SCROLL_STEP + rect.GetBottom());
|
||||||
v_h = upd.GetH();
|
|
||||||
if (m_Cell) m_Cell->Draw(dc, 0, 0, y * wxHTML_SCROLL_STEP + v_y, y * wxHTML_SCROLL_STEP + v_h + v_y);
|
|
||||||
upd++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -785,4 +780,4 @@ IMPLEMENT_DYNAMIC_CLASS(wxHtmlWinModule, wxModule)
|
|||||||
#include "wx/html/forcelnk.h"
|
#include "wx/html/forcelnk.h"
|
||||||
FORCE_WXHTML_MODULES()
|
FORCE_WXHTML_MODULES()
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user