Treat canvas invalidations as animation activity for JS heuristics, bug 753630. r=dmandelin

This commit is contained in:
Brian Hackett 2012-06-29 14:35:06 -07:00
Родитель 6359cf9f42
Коммит c30644f997
1 изменённых файлов: 13 добавлений и 0 удалений

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

@ -679,6 +679,19 @@ nsHTMLCanvasElement::InvalidateCanvasContent(const gfxRect* damageRect)
if (layer) {
static_cast<CanvasLayer*>(layer)->Updated();
}
/*
* Treat canvas invalidations as animation activity for JS. Frequently
* invalidating a canvas will feed into heuristics and cause JIT code to be
* kept around longer, for smoother animations.
*/
nsIScriptGlobalObject *scope = OwnerDoc()->GetScriptGlobalObject();
if (scope) {
JSObject *obj = scope->GetGlobalJSObject();
if (obj) {
js::NotifyAnimationActivity(obj);
}
}
}
void