WebKit Bugzilla
Attachment 361155 Details for
Bug 194073
: Hit testing functions optimizations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194073-20190204210629.patch (text/plain), 4.22 KB, created by
Benjamin Poulain
on 2019-02-04 21:06:30 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Benjamin Poulain
Created:
2019-02-04 21:06:30 PST
Size:
4.22 KB
patch
obsolete
>Subversion Revision: 240962 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 9701fe3f94625af78a7e6c942d93dd1ea4c97ac4..37dc910ed73cf0a220599ccf0b36ad819e74e41a 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,39 @@ >+2019-02-04 Benjamin Poulain <benjamin@webkit.org> >+ >+ Hit testing functions optimizations >+ https://bugs.webkit.org/show_bug.cgi?id=194073 >+ <rdar://problem/47692312> >+ >+ Reviewed by Zalan Bujtas. >+ >+ This patch implements some easy optimizations that speed up >+ hit testing without changing the algorithms. >+ >+ * page/FrameViewLayoutContext.h: >+ The code for: >+ view().frameView().layoutContext().isPaintOffsetCacheEnabled() >+ followed by: >+ view().frameView().layoutContext().layoutState() >+ was loading all the intermediate values twice and calling layoutState() >+ twice. >+ >+ By marking the function as pure, Clang can CSE the whole thing and >+ remove the duplicated code. >+ >+ * platform/graphics/LayoutRect.h: >+ (WebCore::LayoutRect::isInfinite const): >+ That one is pretty funny. >+ >+ Since LayoutRect::isInfinite() was implemented before operator==() is >+ declared, the compiler was falling back to the implicit convertion to FloatRect() >+ before doing any comparison. >+ >+ This explains a bunch of the convertions to float when using LayoutRect. >+ >+ * rendering/RenderBox.cpp: >+ (WebCore::RenderBox::mapLocalToContainer const): >+ Just reoder to make the register nice and clean for the optimization described above. >+ > 2019-02-04 Ms2ger <Ms2ger@igalia.com> > > [GTK][WPE] Need a function to convert internal URI to display ("pretty") URI >diff --git a/Source/WebCore/page/FrameViewLayoutContext.h b/Source/WebCore/page/FrameViewLayoutContext.h >index 04662d0d2238db415ec20d58782493f47cfbb46b..d16f6c35cf96860c10842e6822321aeb31391ed4 100644 >--- a/Source/WebCore/page/FrameViewLayoutContext.h >+++ b/Source/WebCore/page/FrameViewLayoutContext.h >@@ -95,7 +95,7 @@ public: > > void flushAsynchronousTasks(); > >- RenderLayoutState* layoutState() const; >+ RenderLayoutState* layoutState() const PURE_FUNCTION; > // Returns true if layoutState should be used for its cached offset and clip. > bool isPaintOffsetCacheEnabled() const { return !m_paintOffsetCacheDisableCount && layoutState(); } > #ifndef NDEBUG >diff --git a/Source/WebCore/platform/graphics/LayoutRect.h b/Source/WebCore/platform/graphics/LayoutRect.h >index a2a22cb3e0dfa7e22dcc50342b464d5cb9e8a99f..609181ea6f1cdb339d9614387f65d4bace4077c9 100644 >--- a/Source/WebCore/platform/graphics/LayoutRect.h >+++ b/Source/WebCore/platform/graphics/LayoutRect.h >@@ -166,7 +166,7 @@ public: > void scale(float xScale, float yScale); > > LayoutRect transposedRect() const { return LayoutRect(m_location.transposedPoint(), m_size.transposedSize()); } >- bool isInfinite() const { return *this == LayoutRect::infiniteRect(); } >+ bool isInfinite() const; > > static LayoutRect infiniteRect() > { >@@ -207,6 +207,11 @@ inline bool operator!=(const LayoutRect& a, const LayoutRect& b) > return a.location() != b.location() || a.size() != b.size(); > } > >+inline bool LayoutRect::isInfinite() const >+{ >+ return *this == LayoutRect::infiniteRect(); >+} >+ > // Integral snapping functions. > inline IntRect snappedIntRect(const LayoutRect& rect) > { >diff --git a/Source/WebCore/rendering/RenderBox.cpp b/Source/WebCore/rendering/RenderBox.cpp >index d38720c9159f0be34ee6d2eac6aafe8a25ecbf53..7bd279b06dd0d46e8a2ff91dee68fca3b938cfc4 100644 >--- a/Source/WebCore/rendering/RenderBox.cpp >+++ b/Source/WebCore/rendering/RenderBox.cpp >@@ -1988,7 +1988,7 @@ void RenderBox::mapLocalToContainer(const RenderLayerModelObject* repaintContain > if (repaintContainer == this) > return; > >- if (view().frameView().layoutContext().isPaintOffsetCacheEnabled() && !repaintContainer) { >+ if (!repaintContainer && view().frameView().layoutContext().isPaintOffsetCacheEnabled()) { > auto* layoutState = view().frameView().layoutContext().layoutState(); > LayoutSize offset = layoutState->paintOffset() + locationOffset(); > if (style().hasInFlowPosition() && layer())
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194073
:
360684
|
360823
|
360945
| 361155