Bug 50417
| Summary: | Avoid repainting compositing layers unnecessarily when layout changes | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Simon Fraser (smfr) <simon.fraser> |
| Component: | Layout and Rendering | Assignee: | Simon Fraser (smfr) <simon.fraser> |
| Status: | NEW | ||
| Severity: | Normal | CC: | dino, ed_dvd, igor.oliveira, jchaffraix, simon.fraser, webkit-bug-importer, zalan |
| Priority: | P2 | Keywords: | InRadar |
| Version: | 528+ (Nightly build) | ||
| Hardware: | PC | ||
| OS: | OS X 10.5 | ||
| Bug Depends on: | 74370 | ||
| Bug Blocks: | |||
Simon Fraser (smfr)
RenderBoxModelObject::styleWillChange() has this code:
if (diff == StyleDifferenceLayout) {
// When a layout hint happens, we go ahead and do a repaint of the layer, since the layer could
// end up being destroyed.
if (hasLayer()) {
if (style()->position() != newStyle->position() ||
style()->zIndex() != newStyle->zIndex() ||
style()->hasAutoZIndex() != newStyle->hasAutoZIndex() ||
!(style()->clip() == newStyle->clip()) ||
style()->hasClip() != newStyle->hasClip() ||
style()->opacity() != newStyle->opacity() ||
style()->transform() != newStyle->transform())
layer()->repaintIncludingDescendants();
This can cause extra repainting of compositing layers when they don't need to be repainted.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Simon Fraser (smfr)
<rdar://problem/8863549>
Simon Fraser (smfr)
There's also this:
inline void RenderObject::setNeedsLayout(bool b, bool markParents)
{
bool alreadyNeededLayout = m_needsLayout;
m_needsLayout = b;
if (b) {
ASSERT(!isSetNeedsLayoutForbidden());
if (!alreadyNeededLayout) {
...
if (hasLayer())
setLayerNeedsFullRepaint();
Simon Fraser (smfr)
One specific example we should optimize is to avoid repaints when doing a "positioned movement only" layout.