Basic child obscuration test for backgrounds
https://bugs.webkit.org/show_bug.cgi?id=111701

Source/WebCore:

Reviewed by Simon Fraser.

Test: fast/repaint/obscured-background-no-repaint.html

We can easily detect some simple cases where a background image is fully obscured by an opaque child.

This avoids unncessary painting and image decoding. It is especially helpful for cases like about.com home
page where a fully obscured 'loading' spinner keeps triggering frequent complex repaints (gif animations
progress by getting painted and stop if they are not).

This could be made way more sophisticated. The checking could also be done per-layout rather per-paint.
Even this simple approach gets hit surprisingly often in real world sites.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::backgroundIsObscured):

    Before painting background test if any single child renderer fully obscures it.

(WebCore::RenderBox::backgroundIsOpaqueInRect):
* rendering/RenderBox.h:

LayoutTests:

Reviewed by Simon Fraser.

* fast/repaint/obscured-background-no-repaint-expected.txt: Added.
* fast/repaint/obscured-background-no-repaint.html: Added.
* fast/repaint/resources/animated.gif: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145680 268f45cc-cd09-0410-ab3c-d52691b4dbfc