Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(694)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutInline.cpp

Issue 2616483002: Reduce rectangle merges when doing region-based hit test on text boxes (Closed)
Patch Set: Created 3 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutInline.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutInline.cpp b/third_party/WebKit/Source/core/layout/LayoutInline.cpp
index d8abdb06ea2e634593a42aa87e078561dcbcca34..19c4700cc9fb14f4411be3bbe2c604bb5de9e07f 100644
--- a/third_party/WebKit/Source/core/layout/LayoutInline.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutInline.cpp
@@ -876,12 +876,16 @@ class HitTestCulledInlinesGeneratorContext {
const HitTestLocation& location)
: m_intersected(false), m_region(region), m_location(location) {}
void operator()(const FloatRect& rect) {
- m_intersected = m_intersected || m_location.intersects(rect);
- m_region.unite(enclosingIntRect(rect));
+ bool intersects = m_location.intersects(rect);
+ m_intersected = m_intersected || intersects;
wkorman 2017/01/04 00:36:35 nit: could use |= here and below.
+ if (intersects)
+ m_region.unite(enclosingIntRect(rect));
}
void operator()(const LayoutRect& rect) {
- m_intersected = m_intersected || m_location.intersects(rect);
- m_region.unite(enclosingIntRect(rect));
+ bool intersects = m_location.intersects(rect);
+ m_intersected = m_intersected || intersects;
+ if (intersects)
+ m_region.unite(enclosingIntRect(rect));
}
bool intersected() const { return m_intersected; }
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698