Title: [199038] trunk/Source/WebCore
Revision
199038
Author
[email protected]
Date
2016-04-04 21:04:35 -0700 (Mon, 04 Apr 2016)

Log Message

Make FrameView's exposedRect an Optional<>
https://bugs.webkit.org/show_bug.cgi?id=156189

Reviewed by Tim Horton.

Instead of testing against isInfinite(), make FrameView::exposedRect() and the
member variable an Optional<FloatRect>.

* page/FrameView.cpp:
(WebCore::FrameView::setExposedRect):
* page/FrameView.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::computeTileCoverage):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (199037 => 199038)


--- trunk/Source/WebCore/ChangeLog	2016-04-05 03:56:46 UTC (rev 199037)
+++ trunk/Source/WebCore/ChangeLog	2016-04-05 04:04:35 UTC (rev 199038)
@@ -1,5 +1,23 @@
 2016-04-04  Simon Fraser  <[email protected]>
 
+        Make FrameView's exposedRect an Optional<>
+        https://bugs.webkit.org/show_bug.cgi?id=156189
+
+        Reviewed by Tim Horton.
+
+        Instead of testing against isInfinite(), make FrameView::exposedRect() and the
+        member variable an Optional<FloatRect>.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::setExposedRect):
+        * page/FrameView.h:
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::computeTileCoverage):
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
+
+2016-04-04  Simon Fraser  <[email protected]>
+
         Don't crash when rendering form controls with Display List Drawing enabled
         https://bugs.webkit.org/show_bug.cgi?id=156122
 

Modified: trunk/Source/WebCore/page/FrameView.cpp (199037 => 199038)


--- trunk/Source/WebCore/page/FrameView.cpp	2016-04-05 03:56:46 UTC (rev 199037)
+++ trunk/Source/WebCore/page/FrameView.cpp	2016-04-05 04:04:35 UTC (rev 199038)
@@ -207,7 +207,6 @@
     , m_delayedScrollEventTimer(*this, &FrameView::sendScrollEvent)
     , m_isTrackingRepaints(false)
     , m_shouldUpdateWhileOffscreen(true)
-    , m_exposedRect(FloatRect::infiniteRect())
     , m_deferSetNeedsLayoutCount(0)
     , m_setNeedsLayoutWasDeferred(false)
     , m_speculativeTilingEnabled(false)
@@ -4910,8 +4909,9 @@
 
 void FrameView::setExposedRect(FloatRect exposedRect)
 {
-    if (m_exposedRect == exposedRect)
+    if (m_exposedRect && m_exposedRect.value() == exposedRect)
         return;
+
     m_exposedRect = exposedRect;
 
     // FIXME: We should support clipping to the exposed rect for subframes as well.

Modified: trunk/Source/WebCore/page/FrameView.h (199037 => 199038)


--- trunk/Source/WebCore/page/FrameView.h	2016-04-05 03:56:46 UTC (rev 199037)
+++ trunk/Source/WebCore/page/FrameView.h	2016-04-05 04:04:35 UTC (rev 199038)
@@ -543,7 +543,7 @@
     // clipping by other UI elements), whereas visibleContentRect is
     // internal to WebCore and doesn't respect those things.
     WEBCORE_EXPORT void setExposedRect(FloatRect);
-    FloatRect exposedRect() const { return m_exposedRect; }
+    Optional<FloatRect> exposedRect() const { return m_exposedRect; }
 
 #if ENABLE(CSS_SCROLL_SNAP)
     void updateSnapOffsets() override;
@@ -754,7 +754,7 @@
 
     bool m_shouldUpdateWhileOffscreen;
 
-    FloatRect m_exposedRect;
+    Optional<FloatRect> m_exposedRect;
 
     unsigned m_deferSetNeedsLayoutCount;
     bool m_setNeedsLayoutWasDeferred;

Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (199037 => 199038)


--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2016-04-05 03:56:46 UTC (rev 199037)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2016-04-05 04:04:35 UTC (rev 199038)
@@ -226,7 +226,7 @@
     TiledBacking::TileCoverage tileCoverage = TiledBacking::CoverageForVisibleArea;
     bool useMinimalTilesDuringLiveResize = frameView.inLiveResize();
     if (frameView.speculativeTilingEnabled() && !useMinimalTilesDuringLiveResize) {
-        bool clipsToExposedRect = !frameView.exposedRect().isInfinite();
+        bool clipsToExposedRect = static_cast<bool>(frameView.exposedRect());
         if (frameView.horizontalScrollbarMode() != ScrollbarAlwaysOff || clipsToExposedRect)
             tileCoverage |= TiledBacking::CoverageForHorizontalScrolling;
 

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (199037 => 199038)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2016-04-05 03:56:46 UTC (rev 199037)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2016-04-05 04:04:35 UTC (rev 199038)
@@ -59,6 +59,7 @@
 #include "ScrollingConstraints.h"
 #include "ScrollingCoordinator.h"
 #include "Settings.h"
+#include "TextStream.h"
 #include "TiledBacking.h"
 #include "TransformState.h"
 #include <wtf/CurrentTime.h>
@@ -458,12 +459,12 @@
         rootLayer->flushCompositingState(exposedRect, frameView.viewportIsStable());
 #else
         // Having a m_clipLayer indicates that we're doing scrolling via GraphicsLayers.
-        IntRect visibleRect = m_clipLayer ? IntRect(IntPoint(), frameView.unscaledVisibleContentSizeIncludingObscuredArea()) : frameView.visibleContentRect();
-        if (!frameView.exposedRect().isInfinite())
-            visibleRect.intersect(IntRect(frameView.exposedRect()));
+        FloatRect visibleRect = m_clipLayer ? FloatRect({ 0, 0 }, frameView.unscaledVisibleContentSizeIncludingObscuredArea()) : frameView.visibleContentRect();
 
-        LOG(Compositing, "RenderLayerCompositor %p flushPendingLayerChanges(%d) %d, %d, %dx%d (stable viewport %d)", this, isFlushRoot,
-            visibleRect.x(), visibleRect.y(), visibleRect.width(), visibleRect.height(), frameView.viewportIsStable());
+        if (frameView.exposedRect())
+            visibleRect.intersect(frameView.exposedRect().value());
+
+        LOG_WITH_STREAM(Compositing,  stream << "RenderLayerCompositor " << this << " flushPendingLayerChanges(" << isFlushRoot << ") " << visibleRect << " (stable viewport " << frameView.viewportIsStable() << ")");
         rootLayer->flushCompositingState(visibleRect, frameView.viewportIsStable());
 #endif
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to