2012-04-12 Mike Fenton <mifenton@rim.com>
+ [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 <mifenton@rim.com>
+
Pattern matching for hexadecimal should include * as an allowable count.
https://bugs.webkit.org/show_bug.cgi?id=83779
// 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);
}
}
// 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;