external/webkit
Revision | b627d5bd0e9b9a4d02131ef694467bfb62b9fb7f (tree) |
---|---|
Time | 2012-01-11 08:22:35 |
Author | Chris Craik <ccraik@goog...> |
Commiter | Chris Craik |
Fully invalidate the pictureset when content size changes
bug:5759299
Webkit invals aren't correct when the content size changes (even simply growing
vertically), for now just repaint from scratch in that case.
Change-Id: I408b289bfee1139d6c8f3c7babd963d217cb5bc0
@@ -673,10 +673,20 @@ void WebViewCore::recordPictureSet(PictureSet* content) | ||
673 | 673 | content->clear(); |
674 | 674 | |
675 | 675 | #if USE(ACCELERATED_COMPOSITING) |
676 | - // Detects if the content size has changed | |
677 | - bool contentSizeChanged = false; | |
678 | - if (content->width() != width || content->height() != height) | |
679 | - contentSizeChanged = true; | |
676 | + // The invals are not always correct when the content size has changed. For | |
677 | + // now, let's just reset the inval so that it invalidates the entire content | |
678 | + // -- the pictureset will be fully repainted, tiles will be marked dirty and | |
679 | + // will have to be repainted. | |
680 | + | |
681 | + // FIXME: the webkit invals ought to have been enough... | |
682 | + if (content->width() != width || content->height() != height) { | |
683 | + SkIRect r; | |
684 | + r.fLeft = 0; | |
685 | + r.fTop = 0; | |
686 | + r.fRight = width; | |
687 | + r.fBottom = height; | |
688 | + m_addInval.setRect(r); | |
689 | + } | |
680 | 690 | #endif |
681 | 691 | |
682 | 692 | content->setDimensions(width, height, &m_addInval); |
@@ -700,23 +710,6 @@ void WebViewCore::recordPictureSet(PictureSet* content) | ||
700 | 710 | |
701 | 711 | // Rebuild the pictureset (webkit repaint) |
702 | 712 | rebuildPictureSet(content); |
703 | - | |
704 | -#if USE(ACCELERATED_COMPOSITING) | |
705 | - // We repainted the pictureset, but the invals are not always correct when | |
706 | - // the content size did change. For now, let's just reset the | |
707 | - // inval we will pass to the UI so that it invalidates the entire | |
708 | - // content -- tiles will be marked dirty and will have to be repainted. | |
709 | - // FIXME: the webkit invals ought to have been enough... | |
710 | - if (contentSizeChanged) { | |
711 | - SkIRect r; | |
712 | - r.fLeft = 0; | |
713 | - r.fTop = 0; | |
714 | - r.fRight = width; | |
715 | - r.fBottom = height; | |
716 | - m_addInval.setRect(r); | |
717 | - } | |
718 | -#endif | |
719 | - | |
720 | 713 | } // WebViewCoreRecordTimeCounter |
721 | 714 | |
722 | 715 | WebCore::Node* oldFocusNode = currentFocus(); |