Title: [168551] trunk/Source/WebKit2
Revision
168551
Author
bfulg...@apple.com
Date
2014-05-09 13:57:57 -0700 (Fri, 09 May 2014)

Log Message

{TelephoneNumber, Selection}ControllerMac implementations dosn't handle tiled drawing properly.
https://bugs.webkit.org/show_bug.cgi?id=132746
<rdar://problem/16789588>

Reviewed by Tim Horton.

Don't try to draw the detector UI if no part of the selection bounds are inside
the current tile. Don't limit the detector UI to the bounds of this tile, or else
it will attempt to squeeze itself into the possibly small space available. Let it
draw as if it had the whole screen, and rely on the context clip region to
avoid overdrawing.

* WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm:
(WebKit::TelephoneNumberOverlayController::drawRect): Correct tiled drawing behavior.
* WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm:
(WebKit::SelectionOverlayController::drawRect): Ditto.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (168550 => 168551)


--- trunk/Source/WebKit2/ChangeLog	2014-05-09 20:48:21 UTC (rev 168550)
+++ trunk/Source/WebKit2/ChangeLog	2014-05-09 20:57:57 UTC (rev 168551)
@@ -1,3 +1,22 @@
+2014-05-09  Brent Fulgham  <bfulg...@apple.com>
+
+        {TelephoneNumber, Selection}ControllerMac implementations dosn't handle tiled drawing properly.
+        https://bugs.webkit.org/show_bug.cgi?id=132746
+        <rdar://problem/16789588>
+
+        Reviewed by Tim Horton.
+
+        Don't try to draw the detector UI if no part of the selection bounds are inside
+        the current tile. Don't limit the detector UI to the bounds of this tile, or else
+        it will attempt to squeeze itself into the possibly small space available. Let it
+        draw as if it had the whole screen, and rely on the context clip region to
+        avoid overdrawing.
+
+        * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm:
+        (WebKit::TelephoneNumberOverlayController::drawRect): Correct tiled drawing behavior.
+        * WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm:
+        (WebKit::SelectionOverlayController::drawRect): Ditto.
+
 2014-05-09  Anders Carlsson  <ander...@apple.com>
 
         Production build fix.

Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm (168550 => 168551)


--- trunk/Source/WebKit2/WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm	2014-05-09 20:48:21 UTC (rev 168550)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm	2014-05-09 20:57:57 UTC (rev 168551)
@@ -71,16 +71,25 @@
         Vector<CGRect> cgRects;
         cgRects.reserveCapacity(m_currentSelectionRects.size());
 
-        for (auto& rect : m_currentSelectionRects)
+        for (auto& rect : m_currentSelectionRects) {
+            IntRect selectionRect(rect.pixelSnappedLocation(), rect.pixelSnappedSize());
+
+            if (!selectionRect.intersects(dirtyRect))
+                continue;
+
             cgRects.append((CGRect)pixelSnappedIntRect(rect));
+        }
 
-        m_currentHighlight = adoptCF(DDHighlightCreateWithRectsInVisibleRect(nullptr, cgRects.begin(), cgRects.size(), (CGRect)dirtyRect, true));
-        m_currentHighlightIsDirty = false;
+        if (!cgRects.isEmpty()) {
+            CGRect bounds = m_webPage->corePage()->mainFrame().view()->boundsRect();
+            m_currentHighlight = adoptCF(DDHighlightCreateWithRectsInVisibleRect(nullptr, cgRects.begin(), cgRects.size(), bounds, true));
+            m_currentHighlightIsDirty = false;
 
-        Boolean onButton;
-        m_mouseIsOverHighlight = DDHighlightPointIsOnHighlight(m_currentHighlight.get(), (CGPoint)m_mousePosition, &onButton);
+            Boolean onButton;
+            m_mouseIsOverHighlight = DDHighlightPointIsOnHighlight(m_currentHighlight.get(), (CGPoint)m_mousePosition, &onButton);
 
-        mouseHoverStateChanged();
+            mouseHoverStateChanged();
+        }
     }
 
     // If the UI is not visibile or if the mouse is not over the DDHighlight we have no drawing to do.

Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm (168550 => 168551)


--- trunk/Source/WebKit2/WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm	2014-05-09 20:48:21 UTC (rev 168550)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm	2014-05-09 20:57:57 UTC (rev 168551)
@@ -91,9 +91,13 @@
         FrameView& mainFrameView = *m_webPage->corePage()->mainFrame().view();
         rect.setLocation(mainFrameView.windowToContents(viewForRange->contentsToWindow(rect.location())));
 
+        // If the selection rect is completely outside this drawing tile, don't process it further
+        if (!rect.intersects(dirtyRect))
+            continue;
+
         CGRect cgRects[] = { (CGRect)rect };
 
-        RetainPtr<DDHighlightRef> highlight = adoptCF(DDHighlightCreateWithRectsInVisibleRect(nullptr, cgRects, 1, (CGRect)dirtyRect, true));
+        RetainPtr<DDHighlightRef> highlight = adoptCF(DDHighlightCreateWithRectsInVisibleRect(nullptr, cgRects, 1, viewForRange->boundsRect(), true));
         RefPtr<TelephoneNumberData> telephoneNumberData = TelephoneNumberData::create(range.get(), highlight.get());
         m_telephoneNumberDatas.append(telephoneNumberData);
         
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to