| OLD | NEW | 
|---|
| 1 /* | 1 /* | 
| 2  * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2  * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 
| 3  * | 3  * | 
| 4  * Redistribution and use in source and binary forms, with or without | 4  * Redistribution and use in source and binary forms, with or without | 
| 5  * modification, are permitted provided that the following conditions | 5  * modification, are permitted provided that the following conditions | 
| 6  * are met: | 6  * are met: | 
| 7  * 1. Redistributions of source code must retain the above copyright | 7  * 1. Redistributions of source code must retain the above copyright | 
| 8  *    notice, this list of conditions and the following disclaimer. | 8  *    notice, this list of conditions and the following disclaimer. | 
| 9  * 2. Redistributions in binary form must reproduce the above copyright | 9  * 2. Redistributions in binary form must reproduce the above copyright | 
| 10  *    notice, this list of conditions and the following disclaimer in the | 10  *    notice, this list of conditions and the following disclaimer in the | 
| (...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 580     if (!hostWindow()) | 580     if (!hostWindow()) | 
| 581         return; | 581         return; | 
| 582 | 582 | 
| 583     // Since scrolling is double buffered, we will be blitting the scroll view's
       intersection | 583     // Since scrolling is double buffered, we will be blitting the scroll view's
       intersection | 
| 584     // with the clip rect every time to keep it smooth. | 584     // with the clip rect every time to keep it smooth. | 
| 585     IntRect clipRect = windowClipRect(); | 585     IntRect clipRect = windowClipRect(); | 
| 586     IntRect scrollViewRect = rectToCopyOnScroll(); | 586     IntRect scrollViewRect = rectToCopyOnScroll(); | 
| 587     IntRect updateRect = clipRect; | 587     IntRect updateRect = clipRect; | 
| 588     updateRect.intersect(scrollViewRect); | 588     updateRect.intersect(scrollViewRect); | 
| 589 | 589 | 
| 590     // Invalidate the root view (not the backing store). |  | 
| 591     hostWindow()->invalidateRootView(updateRect); |  | 
| 592 |  | 
| 593     if (m_drawPanScrollIcon) { | 590     if (m_drawPanScrollIcon) { | 
| 594         // FIXME: the pan icon is broken when accelerated compositing is on, sin
      ce it will draw under the compositing layers. | 591         // FIXME: the pan icon is broken when accelerated compositing is on, sin
      ce it will draw under the compositing layers. | 
| 595         // https://bugs.webkit.org/show_bug.cgi?id=47837 | 592         // https://bugs.webkit.org/show_bug.cgi?id=47837 | 
| 596         int panIconDirtySquareSizeLength = 2 * (panIconSizeLength + max(abs(scro
      llDelta.width()), abs(scrollDelta.height()))); // We only want to repaint what's
       necessary | 593         int panIconDirtySquareSizeLength = 2 * (panIconSizeLength + max(abs(scro
      llDelta.width()), abs(scrollDelta.height()))); // We only want to repaint what's
       necessary | 
| 597         IntPoint panIconDirtySquareLocation = IntPoint(m_panScrollIconPoint.x() 
      - (panIconDirtySquareSizeLength / 2), m_panScrollIconPoint.y() - (panIconDirtySq
      uareSizeLength / 2)); | 594         IntPoint panIconDirtySquareLocation = IntPoint(m_panScrollIconPoint.x() 
      - (panIconDirtySquareSizeLength / 2), m_panScrollIconPoint.y() - (panIconDirtySq
      uareSizeLength / 2)); | 
| 598         IntRect panScrollIconDirtyRect = IntRect(panIconDirtySquareLocation, Int
      Size(panIconDirtySquareSizeLength, panIconDirtySquareSizeLength)); | 595         IntRect panScrollIconDirtyRect = IntRect(panIconDirtySquareLocation, Int
      Size(panIconDirtySquareSizeLength, panIconDirtySquareSizeLength)); | 
| 599         panScrollIconDirtyRect.intersect(clipRect); | 596         panScrollIconDirtyRect.intersect(clipRect); | 
| 600         hostWindow()->invalidateContentsAndRootView(panScrollIconDirtyRect); | 597         hostWindow()->invalidateContentsAndRootView(panScrollIconDirtyRect); | 
| 601     } | 598     } | 
| 602 | 599 | 
| 603     if (canBlitOnScroll()) { // The main frame can just blit the WebView window | 600     if (canBlitOnScroll()) { // The main frame can just blit the WebView window | 
| 604         // FIXME: Find a way to scroll subframes with this faster path | 601         // FIXME: Find a way to scroll subframes with this faster path | 
| 605         if (!scrollContentsFastPath(-scrollDelta, scrollViewRect, clipRect)) | 602         if (!scrollContentsFastPath(-scrollDelta, scrollViewRect, clipRect)) | 
| 606             scrollContentsSlowPath(updateRect); | 603             scrollContentsSlowPath(updateRect); | 
| 607     } else { | 604     } else { | 
| 608        // We need to go ahead and repaint the entire backing store.  Do it now b
      efore moving the | 605        // We need to go ahead and repaint the entire backing store.  Do it now b
      efore moving the | 
| 609        // windowed plugins. | 606        // windowed plugins. | 
| 610        scrollContentsSlowPath(updateRect); | 607        scrollContentsSlowPath(updateRect); | 
| 611     } | 608     } | 
| 612 | 609 | 
| 613     // Invalidate the overhang areas if they are visible. | 610     // Invalidate the overhang areas if they are visible. | 
| 614     updateOverhangAreas(); | 611     updateOverhangAreas(); | 
| 615 | 612 | 
| 616     // This call will move children with native widgets (plugins) and invalidate
       them as well. | 613     // This call will move children with native widgets (plugins) and invalidate
       them as well. | 
| 617     frameRectsChanged(); | 614     frameRectsChanged(); | 
| 618 |  | 
| 619     // Now blit the backingstore into the window which should be very fast. |  | 
| 620     hostWindow()->invalidateRootView(IntRect()); |  | 
| 621 } | 615 } | 
| 622 | 616 | 
| 623 bool ScrollView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRec
      t& rectToScroll, const IntRect& clipRect) | 617 bool ScrollView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRec
      t& rectToScroll, const IntRect& clipRect) | 
| 624 { | 618 { | 
| 625     hostWindow()->scroll(scrollDelta, rectToScroll, clipRect); | 619     hostWindow()->scroll(scrollDelta, rectToScroll, clipRect); | 
| 626     return true; | 620     return true; | 
| 627 } | 621 } | 
| 628 | 622 | 
| 629 void ScrollView::scrollContentsSlowPath(const IntRect& updateRect) | 623 void ScrollView::scrollContentsSlowPath(const IntRect& updateRect) | 
| 630 { | 624 { | 
| (...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1269 { | 1263 { | 
| 1270 } | 1264 } | 
| 1271 | 1265 | 
| 1272 bool ScrollView::platformIsOffscreen() const | 1266 bool ScrollView::platformIsOffscreen() const | 
| 1273 { | 1267 { | 
| 1274     return false; | 1268     return false; | 
| 1275 } | 1269 } | 
| 1276 | 1270 | 
| 1277 | 1271 | 
| 1278 } | 1272 } | 
| OLD | NEW | 
|---|