Title: [113987] trunk/Source/WebKit/blackberry
Revision
113987
Author
[email protected]
Date
2012-04-12 08:53:46 -0700 (Thu, 12 Apr 2012)

Log Message

[BlackBerry] Speed up processing of Selection region generation.
https://bugs.webkit.org/show_bug.cgi?id=82766

Reviewed by Rob Buis.

PR 136593.

Re-speed up text selection.  The previous patch had a merge
error causing text selection not to function.  The fix
implemented removed the optimization.  This fixes the error
in the original patch and removes the temporary fix.

Make style updated as suggested by Antonio Gomes.

Reviewed Internally by Gen Mak.

* WebKitSupport/SelectionHandler.cpp:
(BlackBerry::WebKit::SelectionHandler::regionForTextQuads):
(BlackBerry::WebKit::regionRectListContainsPoint):

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/ChangeLog (113986 => 113987)


--- trunk/Source/WebKit/blackberry/ChangeLog	2012-04-12 15:48:13 UTC (rev 113986)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2012-04-12 15:53:46 UTC (rev 113987)
@@ -1,5 +1,27 @@
 2012-04-12  Mike Fenton  <[email protected]>
 
+        [BlackBerry] Speed up processing of Selection region generation.
+        https://bugs.webkit.org/show_bug.cgi?id=82766
+
+        Reviewed by Rob Buis.
+
+        PR 136593.
+
+        Re-speed up text selection.  The previous patch had a merge
+        error causing text selection not to function.  The fix
+        implemented removed the optimization.  This fixes the error
+        in the original patch and removes the temporary fix.
+
+        Make style updated as suggested by Antonio Gomes.
+
+        Reviewed Internally by Gen Mak.
+
+        * WebKitSupport/SelectionHandler.cpp:
+        (BlackBerry::WebKit::SelectionHandler::regionForTextQuads):
+        (BlackBerry::WebKit::regionRectListContainsPoint):
+
+2012-04-12  Mike Fenton  <[email protected]>
+
         Pattern matching for hexadecimal should include * as an allowable count.
         https://bugs.webkit.org/show_bug.cgi?id=83779
 

Modified: trunk/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp (113986 => 113987)


--- trunk/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp	2012-04-12 15:48:13 UTC (rev 113986)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp	2012-04-12 15:53:46 UTC (rev 113987)
@@ -135,18 +135,20 @@
         // Convert the text quads into a more platform friendy
         // IntRectRegion and adjust for subframes.
         Platform::IntRect selectionBoundingBox;
+        std::vector<Platform::IntRect> adjustedIntRects;
         for (unsigned i = 0; i < quadList.size(); i++) {
             WebCore::IntRect enclosingRect = quadList[i].enclosingBoundingBox();
             enclosingRect.intersect(frameRect);
             enclosingRect.move(framePosition.x(), framePosition.y());
-            region = unionRegions(region, IntRectRegion(enclosingRect));
 
             // Clip to the visible content.
             if (clippingRect.location() != DOMSupport::InvalidPoint)
                 enclosingRect.intersect(clippingRect);
 
+            adjustedIntRects.push_back(enclosingRect);
             selectionBoundingBox = unionOfRects(enclosingRect, selectionBoundingBox);
         }
+        region = IntRectRegion(selectionBoundingBox, adjustedIntRects.size(), adjustedIntRects);
     }
 }
 
@@ -804,7 +806,7 @@
 
 // Check all rects in the region for a point match. The region is non-banded
 // and non-sorted so all must be checked.
-static bool regionRectListContainsPoint(IntRectRegion& region, WebCore::IntPoint point)
+static bool regionRectListContainsPoint(const IntRectRegion& region, const WebCore::IntPoint& point)
 {
     if (!region.extents().contains(point))
         return false;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to