Bug 475343. If the region to paint is too complex, just use its bounding box. GTK changes. r=roc

--HG--
extra : rebase_source : a3f7af16b372ab6f9675071d591edbe37a71b2d5
This commit is contained in:
Karl Tomlinson 2009-02-16 14:10:24 +13:00
Родитель 87619079d3
Коммит 10ebdc9141
1 изменённых файлов: 10 добавлений и 0 удалений

Просмотреть файл

@ -135,6 +135,10 @@ D_DEBUG_DOMAIN( ns_Window, "nsWindow", "nsWindow" );
#define D_DEBUG_AT(x,y...) do {} while (0)
#endif
// Don't put more than this many rects in the dirty region, just fluff
// out to the bounding-box if there are more
#define MAX_RECTS_IN_REGION 100
/* For PrepareNativeWidget */
static NS_DEFINE_IID(kDeviceContextCID, NS_DEVICE_CONTEXT_CID);
@ -2127,6 +2131,12 @@ nsWindow::OnExposeEvent(GtkWidget *aWidget, GdkEventExpose *aEvent)
if (NS_UNLIKELY(!rects)) // OOM
return FALSE;
if (nrects > MAX_RECTS_IN_REGION) {
// Just use the bounding box
rects[0] = aEvent->area;
nrects = 1;
}
LOGDRAW(("sending expose event [%p] %p 0x%lx (rects follow):\n",
(void *)this, (void *)aEvent->window,
GDK_WINDOW_XWINDOW(aEvent->window)));