Diff
Modified: branches/safari-600.1.4.16-branch/LayoutTests/ChangeLog (183036 => 183037)
--- branches/safari-600.1.4.16-branch/LayoutTests/ChangeLog 2015-04-20 23:38:42 UTC (rev 183036)
+++ branches/safari-600.1.4.16-branch/LayoutTests/ChangeLog 2015-04-21 00:17:23 UTC (rev 183037)
@@ -1,3 +1,34 @@
+2015-04-20 Lucas Forschler <lforsch...@apple.com>
+
+ Merge 181656 & 182985.
+
+ 2015-04-18 Simon Fraser <simon.fra...@apple.com>
+
+ REGRESSION (r181656): Animated tiled layers are missing content
+ https://bugs.webkit.org/show_bug.cgi?id=143911
+ rdar://problem/20596328
+
+ Reviewed by Darin Adler.
+
+ Test that animates a tiled layer, and checks that layer flushes occur while the
+ animation is running.
+
+ * compositing/animation/animation-backing-expected.txt: Added.
+ * compositing/animation/animation-backing.html: Added.
+
+ 2015-03-17 Timothy Horton <timothy_hor...@apple.com>
+
+ Reproducible null deref under ScriptedAnimationController::createDisplayRefreshMonitor
+ https://bugs.webkit.org/show_bug.cgi?id=142776
+ <rdar://problem/18921338>
+
+ Reviewed by Alexey Proskuryakov.
+
+ * fast/animation/request-animation-frame-unparented-iframe-crash-expected.txt: Added.
+ * fast/animation/request-animation-frame-unparented-iframe-crash.html: Added.
+ Add a test that ensures that calling requestAnimationFrame on a recently-unparented
+ frame doesn't crash.
+
2015-03-11 Babak Shafiei <bshaf...@apple.com>
Merge r181351.
Copied: branches/safari-600.1.4.16-branch/LayoutTests/compositing/animation/animation-backing-expected.txt (from rev 182985, trunk/LayoutTests/compositing/animation/animation-backing-expected.txt) (0 => 183037)
--- branches/safari-600.1.4.16-branch/LayoutTests/compositing/animation/animation-backing-expected.txt (rev 0)
+++ branches/safari-600.1.4.16-branch/LayoutTests/compositing/animation/animation-backing-expected.txt 2015-04-21 00:17:23 UTC (rev 183037)
@@ -0,0 +1 @@
+Saw layer flushes during animation: PASS
Copied: branches/safari-600.1.4.16-branch/LayoutTests/compositing/animation/animation-backing.html (from rev 182985, trunk/LayoutTests/compositing/animation/animation-backing.html) (0 => 183037)
--- branches/safari-600.1.4.16-branch/LayoutTests/compositing/animation/animation-backing.html (rev 0)
+++ branches/safari-600.1.4.16-branch/LayoutTests/compositing/animation/animation-backing.html 2015-04-21 00:17:23 UTC (rev 183037)
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <style>
+ .mover {
+ height: 100px;
+ width: 3000px;
+ background-color: gray;
+ border: 1px solid black;
+ }
+
+ .mover.animating {
+ animation: move 0.25s forwards linear;
+ }
+
+ @keyframes move {
+ from { transform: translateX(1000px); }
+ to { transform: translateX(-2000px); }
+ }
+ </style>
+ <script>
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+ function doTest()
+ {
+ window.setTimeout(function() {
+ var mover = document.getElementById('mover');
+ mover.addEventListener('animationstart', function() {
+ if (window.internals)
+ internals.startTrackingLayerFlushes();
+ });
+
+ mover.addEventListener('animationend', function() {
+ if (window.internals) {
+ var flushCount = internals.layerFlushCount();
+ document.getElementById('result').textContent = flushCount ? "Saw layer flushes during animation: PASS" : "No layer flushes during animation: FAIL";
+ }
+ if (window.testRunner)
+ testRunner.notifyDone();
+ });
+ mover.classList.add('animating');
+ }, 0);
+ }
+ window.addEventListener('load', doTest, false);
+ </script>
+</head>
+<body>
+<div id="mover" class="mover"></div>
+<div id="result">This test must be run in the test harness.</div>
+</body>
+</html>
Copied: branches/safari-600.1.4.16-branch/LayoutTests/fast/animation/request-animation-frame-unparented-iframe-crash-expected.txt (from rev 181656, trunk/LayoutTests/fast/animation/request-animation-frame-unparented-iframe-crash-expected.txt) (0 => 183037)
--- branches/safari-600.1.4.16-branch/LayoutTests/fast/animation/request-animation-frame-unparented-iframe-crash-expected.txt (rev 0)
+++ branches/safari-600.1.4.16-branch/LayoutTests/fast/animation/request-animation-frame-unparented-iframe-crash-expected.txt 2015-04-21 00:17:23 UTC (rev 183037)
@@ -0,0 +1 @@
+This test passes if it does not crash.
Copied: branches/safari-600.1.4.16-branch/LayoutTests/fast/animation/request-animation-frame-unparented-iframe-crash.html (from rev 181656, trunk/LayoutTests/fast/animation/request-animation-frame-unparented-iframe-crash.html) (0 => 183037)
--- branches/safari-600.1.4.16-branch/LayoutTests/fast/animation/request-animation-frame-unparented-iframe-crash.html (rev 0)
+++ branches/safari-600.1.4.16-branch/LayoutTests/fast/animation/request-animation-frame-unparented-iframe-crash.html 2015-04-21 00:17:23 UTC (rev 183037)
@@ -0,0 +1,22 @@
+<script>
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+}
+
+window._onload_ = function () {
+ var frame = document.getElementById("frame");
+ var frameWindow = frame.contentWindow;
+ var rAF = frameWindow.requestAnimationFrame;
+
+ frame.parentElement.removeChild(frame);
+ rAF.call(frameWindow, function () { });
+
+ if (window.testRunner)
+ testRunner.notifyDone();
+};
+</script>
+<body>
+<iframe id="frame"></iframe>
+This test passes if it does not crash.
+</body>
Modified: branches/safari-600.1.4.16-branch/Source/WebCore/ChangeLog (183036 => 183037)
--- branches/safari-600.1.4.16-branch/Source/WebCore/ChangeLog 2015-04-20 23:38:42 UTC (rev 183036)
+++ branches/safari-600.1.4.16-branch/Source/WebCore/ChangeLog 2015-04-21 00:17:23 UTC (rev 183037)
@@ -1,5 +1,185 @@
2015-04-20 Lucas Forschler <lforsch...@apple.com>
+ Merge 181656 and 182985.
+
+ 2015-04-18 Simon Fraser <simon.fra...@apple.com>
+
+ REGRESSION (r181656): Animated tiled layers are missing content
+ https://bugs.webkit.org/show_bug.cgi?id=143911
+ rdar://problem/20596328
+
+ Reviewed by Darin Adler.
+
+ After r181656, all requestAnimationFrame was falling back to timers, and not
+ using the platform's DisplayRefreshMonitor, because of a Nullopt vs nullptr
+ fumble. As a result, GraphicsLayerUpdater (which updates tiled layers during
+ animations) was failing to do any updates.
+
+ Replace this confusing Optional<> code with simpler code that just forces the
+ clients to make a DisplayRefreshMonitor if they can, first asking
+ ChromeClient, and then falling back to createDefaultDisplayRefreshMonitor().
+
+ Make lots of things into references, and use C++11 initialization in some places.
+
+ Add Internals API to allow a test to get the number of layer flushes that have
+ occurred.
+
+ * dom/ScriptedAnimationController.cpp:
+ (WebCore::ScriptedAnimationController::ScriptedAnimationController):
+ (WebCore::ScriptedAnimationController::windowScreenDidChange):
+ (WebCore::ScriptedAnimationController::scheduleAnimation):
+ (WebCore::ScriptedAnimationController::createDisplayRefreshMonitor):
+ * dom/ScriptedAnimationController.h:
+ * page/ChromeClient.h:
+ * platform/graphics/DisplayRefreshMonitor.cpp:
+ (WebCore::DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor):
+ (WebCore::DisplayRefreshMonitor::create):
+ (WebCore::DisplayRefreshMonitor::addClient):
+ (WebCore::DisplayRefreshMonitor::removeClient):
+ (WebCore::DisplayRefreshMonitor::displayDidRefresh):
+ * platform/graphics/DisplayRefreshMonitor.h:
+ * platform/graphics/DisplayRefreshMonitorClient.cpp:
+ (WebCore::DisplayRefreshMonitorClient::~DisplayRefreshMonitorClient):
+ * platform/graphics/DisplayRefreshMonitorClient.h:
+ * platform/graphics/DisplayRefreshMonitorManager.cpp:
+ (WebCore::DisplayRefreshMonitorManager::createMonitorForClient):
+ (WebCore::DisplayRefreshMonitorManager::registerClient):
+ (WebCore::DisplayRefreshMonitorManager::unregisterClient):
+ (WebCore::DisplayRefreshMonitorManager::scheduleAnimation):
+ (WebCore::DisplayRefreshMonitorManager::displayDidRefresh):
+ (WebCore::DisplayRefreshMonitorManager::windowScreenDidChange):
+ * platform/graphics/DisplayRefreshMonitorManager.h:
+ * platform/graphics/GraphicsLayerUpdater.cpp:
+ (WebCore::GraphicsLayerUpdater::GraphicsLayerUpdater):
+ (WebCore::GraphicsLayerUpdater::scheduleUpdate):
+ (WebCore::GraphicsLayerUpdater::screenDidChange):
+ (WebCore::GraphicsLayerUpdater::displayRefreshFired):
+ (WebCore::GraphicsLayerUpdater::createDisplayRefreshMonitor):
+ * platform/graphics/GraphicsLayerUpdater.h:
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::RenderLayerCompositor):
+ (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
+ (WebCore::RenderLayerCompositor::notifyFlushBeforeDisplayRefresh):
+ (WebCore::RenderLayerCompositor::flushLayersSoon):
+ (WebCore::RenderLayerCompositor::createDisplayRefreshMonitor):
+ (WebCore::RenderLayerCompositor::startTrackingLayerFlushes):
+ (WebCore::RenderLayerCompositor::layerFlushCount):
+ * rendering/RenderLayerCompositor.h:
+ * testing/Internals.cpp:
+ (WebCore::Internals::startTrackingLayerFlushes):
+ (WebCore::Internals::layerFlushCount):
+ * testing/Internals.h:
+ * testing/Internals.idl:
+
+ 2015-03-17 Timothy Horton <timothy_hor...@apple.com>
+
+ Reproducible null deref under ScriptedAnimationController::createDisplayRefreshMonitor
+ https://bugs.webkit.org/show_bug.cgi?id=142776
+ <rdar://problem/18921338>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Test: fast/animation/request-animation-frame-unparented-iframe-crash.html
+
+ In some cases (like the new test), we can end up trying to start
+ requestAnimationFrame on a Document that has no Page. Most paths null-checked
+ the Page and did the right thing, but one failed to do so. In addition,
+ the current fallback (when Page is null) can result in us constructing
+ the wrong kind of DisplayRefreshMonitor, which could lead to trouble
+ down the road when it's reused. Instead, just completely avoid making a
+ DisplayRefreshMonitor in the null-page case.
+
+ * dom/ScriptedAnimationController.cpp:
+ (WebCore::ScriptedAnimationController::createDisplayRefreshMonitor):
+ If the page is null, bail.
+
+ * dom/ScriptedAnimationController.h:
+ * platform/graphics/DisplayRefreshMonitor.cpp:
+ (WebCore::DisplayRefreshMonitor::create):
+ Use Optional<> to make it easy to distinguish between ChromeClient
+ being unreachable (because we don't have a Page for some reason) and
+ ChromeClient declaring that it doesn't want to override the type of
+ DisplayRefreshMonitor that is created.
+
+ If ChromeClient was unreachable for some reason, we'll get back an engaged
+ nullptr and return it (instead of creating a DisplayRefreshMonitor based
+ on the platform). This avoids creating the wrong type of DisplayRefreshMonitor
+ in the rare case where we can't reach the ChromeClient (e.g. a freshly unparented
+ IFrame).
+
+ If instead the client returns a disengaged Nullopt, we'll interpret that as
+ "construct the default type", which falls back on the platform #ifdefs to
+ decide what to make.2015-04-18 Simon Fraser <simon.fra...@apple.com>
+
+ REGRESSION (r181656): Animated tiled layers are missing content
+ https://bugs.webkit.org/show_bug.cgi?id=143911
+ rdar://problem/20596328
+
+ Reviewed by Darin Adler.
+
+ After r181656, all requestAnimationFrame was falling back to timers, and not
+ using the platform's DisplayRefreshMonitor, because of a Nullopt vs nullptr
+ fumble. As a result, GraphicsLayerUpdater (which updates tiled layers during
+ animations) was failing to do any updates.
+
+ Replace this confusing Optional<> code with simpler code that just forces the
+ clients to make a DisplayRefreshMonitor if they can, first asking
+ ChromeClient, and then falling back to createDefaultDisplayRefreshMonitor().
+
+ Make lots of things into references, and use C++11 initialization in some places.
+
+ Add Internals API to allow a test to get the number of layer flushes that have
+ occurred.
+
+ * dom/ScriptedAnimationController.cpp:
+ (WebCore::ScriptedAnimationController::ScriptedAnimationController):
+ (WebCore::ScriptedAnimationController::windowScreenDidChange):
+ (WebCore::ScriptedAnimationController::scheduleAnimation):
+ (WebCore::ScriptedAnimationController::createDisplayRefreshMonitor):
+ * dom/ScriptedAnimationController.h:
+ * page/ChromeClient.h:
+ * platform/graphics/DisplayRefreshMonitor.cpp:
+ (WebCore::DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor):
+ (WebCore::DisplayRefreshMonitor::create):
+ (WebCore::DisplayRefreshMonitor::addClient):
+ (WebCore::DisplayRefreshMonitor::removeClient):
+ (WebCore::DisplayRefreshMonitor::displayDidRefresh):
+ * platform/graphics/DisplayRefreshMonitor.h:
+ * platform/graphics/DisplayRefreshMonitorClient.cpp:
+ (WebCore::DisplayRefreshMonitorClient::~DisplayRefreshMonitorClient):
+ * platform/graphics/DisplayRefreshMonitorClient.h:
+ * platform/graphics/DisplayRefreshMonitorManager.cpp:
+ (WebCore::DisplayRefreshMonitorManager::createMonitorForClient):
+ (WebCore::DisplayRefreshMonitorManager::registerClient):
+ (WebCore::DisplayRefreshMonitorManager::unregisterClient):
+ (WebCore::DisplayRefreshMonitorManager::scheduleAnimation):
+ (WebCore::DisplayRefreshMonitorManager::displayDidRefresh):
+ (WebCore::DisplayRefreshMonitorManager::windowScreenDidChange):
+ * platform/graphics/DisplayRefreshMonitorManager.h:
+ * platform/graphics/GraphicsLayerUpdater.cpp:
+ (WebCore::GraphicsLayerUpdater::GraphicsLayerUpdater):
+ (WebCore::GraphicsLayerUpdater::scheduleUpdate):
+ (WebCore::GraphicsLayerUpdater::screenDidChange):
+ (WebCore::GraphicsLayerUpdater::displayRefreshFired):
+ (WebCore::GraphicsLayerUpdater::createDisplayRefreshMonitor):
+ * platform/graphics/GraphicsLayerUpdater.h:
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::RenderLayerCompositor):
+ (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
+ (WebCore::RenderLayerCompositor::notifyFlushBeforeDisplayRefresh):
+ (WebCore::RenderLayerCompositor::flushLayersSoon):
+ (WebCore::RenderLayerCompositor::createDisplayRefreshMonitor):
+ (WebCore::RenderLayerCompositor::startTrackingLayerFlushes):
+ (WebCore::RenderLayerCompositor::layerFlushCount):
+ * rendering/RenderLayerCompositor.h:
+ * testing/Internals.cpp:
+ (WebCore::Internals::startTrackingLayerFlushes):
+ (WebCore::Internals::layerFlushCount):
+ * testing/Internals.h:
+ * testing/Internals.idl:
+
+2015-04-20 Lucas Forschler <lforsch...@apple.com>
+
Merge r180520
2015-02-22 Dean Jackson <d...@apple.com>
Modified: branches/safari-600.1.4.16-branch/Source/WebCore/WebCore.exp.in (183036 => 183037)
--- branches/safari-600.1.4.16-branch/Source/WebCore/WebCore.exp.in 2015-04-20 23:38:42 UTC (rev 183036)
+++ branches/safari-600.1.4.16-branch/Source/WebCore/WebCore.exp.in 2015-04-21 00:17:23 UTC (rev 183037)
@@ -912,6 +912,7 @@
__ZN7WebCore21NetworkStorageSession28createPrivateBrowsingSessionERKN3WTF6StringE
__ZN7WebCore21PlatformKeyboardEvent24disambiguateKeyDownEventENS_13PlatformEvent4TypeEb
__ZN7WebCore21RemoteCommandListener6createERNS_27RemoteCommandListenerClientE
+__ZN7WebCore21RenderLayerCompositor25startTrackingLayerFlushesEv
__ZN7WebCore21ResourceLoadScheduler20servePendingRequestsENS_20ResourceLoadPriorityE
__ZN7WebCore21ResourceLoadScheduler20servePendingRequestsEPNS0_15HostInformationENS_20ResourceLoadPriorityE
__ZN7WebCore21ResourceLoadScheduler21resumePendingRequestsEv
@@ -1843,6 +1844,7 @@
__ZNK7WebCore21HTMLFrameOwnerElement15contentDocumentEv
__ZNK7WebCore21NetworkStorageSession13cookieStorageEv
__ZNK7WebCore21RenderLayerCompositor11scrollLayerEv
+__ZNK7WebCore21RenderLayerCompositor15layerFlushCountEv
__ZNK7WebCore21RenderLayerCompositor15rootRenderLayerEv
__ZNK7WebCore21UserContentURLPattern7matchesERKNS_3URLE
__ZNK7WebCore21ViewportConfiguration10layoutSizeEv
@@ -2641,8 +2643,8 @@
__ZN7WebCore19applicationIsWebAppEv
__ZN7WebCore19asciiLineBreakTableE
__ZN7WebCore20PlatformEventFactory27createPlatformKeyboardEventEP8WebEvent
+__ZN7WebCore20ResourceHandleClient22willCacheResponseAsyncEPNS_14ResourceHandleEPK20_CFCachedURLResponse
__ZN7WebCore20WebArchivePboardTypeE
-__ZN7WebCore20ResourceHandleClient22willCacheResponseAsyncEPNS_14ResourceHandleEPK20_CFCachedURLResponse
__ZN7WebCore20applicationIsOkCupidEv
__ZN7WebCore20endOfEditableContentERKNS_15VisiblePositionE
__ZN7WebCore20lastOffsetForEditingEPKNS_4NodeE
@@ -2974,6 +2976,17 @@
__ZN7WebCore14ResourceHandle25continueWillCacheResponseEP19NSCachedURLResponse
#endif
+#if USE(CONTENT_FILTERING)
+__ZN7WebCore13ContentFilter6decodeEP17NSKeyedUnarchiverRS0_
+__ZN7WebCore13ContentFilterC1Ev
+__ZN7WebCore13ContentFilterD1Ev
+__ZNK7WebCore13ContentFilter6encodeEP15NSKeyedArchiver
+#endif
+
+#if USE(CONTENT_FILTERING) && PLATFORM(IOS)
+__ZN7WebCore13ContentFilter43handleUnblockRequestAndDispatchIfSuccessfulERKNS_15ResourceRequestENSt3__18functionIFvvEEE
+#endif
+
#if ENABLE(CONTEXT_MENUS)
__ZN7WebCore11ContextMenu22setPlatformDescriptionEP14NSMutableArray
__ZN7WebCore12EventHandler20sendContextMenuEventERKNS_18PlatformMouseEventE
@@ -3445,8 +3458,8 @@
__ZN7WebCore32WebVideoFullscreenInterfaceAVKit14exitFullscreenENS_7IntRectE
__ZN7WebCore32WebVideoFullscreenInterfaceAVKit14setCurrentTimeEdd
__ZN7WebCore32WebVideoFullscreenInterfaceAVKit15enterFullscreenEv
+__ZN7WebCore32WebVideoFullscreenInterfaceAVKit15resetMediaStateEv
__ZN7WebCore32WebVideoFullscreenInterfaceAVKit15setupFullscreenER7CALayerNS_7IntRectEP6UIView
-__ZN7WebCore32WebVideoFullscreenInterfaceAVKit15resetMediaStateEv
__ZN7WebCore32WebVideoFullscreenInterfaceAVKit17cleanupFullscreenEv
__ZN7WebCore32WebVideoFullscreenInterfaceAVKit17setSeekableRangesERKNS_10TimeRangesE
__ZN7WebCore32WebVideoFullscreenInterfaceAVKit18setVideoDimensionsEbff
@@ -3469,13 +3482,3 @@
#if ENABLE(VIEW_MODE_CSS_MEDIA)
__ZN7WebCore4Page11setViewModeENS0_8ViewModeE
#endif
-
-#if USE(CONTENT_FILTERING)
-#if PLATFORM(IOS)
-__ZN7WebCore13ContentFilter43handleUnblockRequestAndDispatchIfSuccessfulERKNS_15ResourceRequestENSt3__18functionIFvvEEE
-#endif
-__ZN7WebCore13ContentFilter6decodeEP17NSKeyedUnarchiverRS0_
-__ZN7WebCore13ContentFilterC1Ev
-__ZN7WebCore13ContentFilterD1Ev
-__ZNK7WebCore13ContentFilter6encodeEP15NSKeyedArchiver
-#endif
Modified: branches/safari-600.1.4.16-branch/Source/WebCore/dom/ScriptedAnimationController.cpp (183036 => 183037)
--- branches/safari-600.1.4.16-branch/Source/WebCore/dom/ScriptedAnimationController.cpp 2015-04-20 23:38:42 UTC (rev 183036)
+++ branches/safari-600.1.4.16-branch/Source/WebCore/dom/ScriptedAnimationController.cpp 2015-04-21 00:17:23 UTC (rev 183037)
@@ -51,16 +51,9 @@
ScriptedAnimationController::ScriptedAnimationController(Document* document, PlatformDisplayID displayID)
: m_document(document)
- , m_nextCallbackId(0)
- , m_suspendCount(0)
#if USE(REQUEST_ANIMATION_FRAME_TIMER)
, m_animationTimer(this, &ScriptedAnimationController::animationTimerFired)
- , m_lastAnimationFrameTimeMonotonic(0)
-#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
- , m_isUsingTimer(false)
- , m_isThrottled(false)
#endif
-#endif
{
windowScreenDidChange(displayID);
}
@@ -173,7 +166,7 @@
if (m_document->settings() && !m_document->settings()->requestAnimationFrameEnabled())
return;
#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
- DisplayRefreshMonitorManager::sharedManager().windowScreenDidChange(displayID, this);
+ DisplayRefreshMonitorManager::sharedManager().windowScreenDidChange(displayID, *this);
#else
UNUSED_PARAM(displayID);
#endif
@@ -187,7 +180,7 @@
#if USE(REQUEST_ANIMATION_FRAME_TIMER)
#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
if (!m_isUsingTimer && !m_isThrottled) {
- if (DisplayRefreshMonitorManager::sharedManager().scheduleAnimation(this))
+ if (DisplayRefreshMonitorManager::sharedManager().scheduleAnimation(*this))
return;
m_isUsingTimer = true;
@@ -226,9 +219,15 @@
#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
-PassRefPtr<DisplayRefreshMonitor> ScriptedAnimationController::createDisplayRefreshMonitor(PlatformDisplayID displayID) const
+RefPtr<DisplayRefreshMonitor> ScriptedAnimationController::createDisplayRefreshMonitor(PlatformDisplayID displayID) const
{
- return m_document->page()->chrome().client().createDisplayRefreshMonitor(displayID);
+ if (!m_document->page())
+ return nullptr;
+
+ if (auto monitor = m_document->page()->chrome().client().createDisplayRefreshMonitor(displayID))
+ return monitor;
+
+ return DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor(displayID);
}
#endif
Modified: branches/safari-600.1.4.16-branch/Source/WebCore/dom/ScriptedAnimationController.h (183036 => 183037)
--- branches/safari-600.1.4.16-branch/Source/WebCore/dom/ScriptedAnimationController.h 2015-04-20 23:38:42 UTC (rev 183036)
+++ branches/safari-600.1.4.16-branch/Source/WebCore/dom/ScriptedAnimationController.h 2015-04-21 00:17:23 UTC (rev 183037)
@@ -78,23 +78,23 @@
CallbackList m_callbacks;
Document* m_document;
- CallbackId m_nextCallbackId;
- int m_suspendCount;
+ CallbackId m_nextCallbackId { 0 };
+ int m_suspendCount { 0 };
void scheduleAnimation();
#if USE(REQUEST_ANIMATION_FRAME_TIMER)
void animationTimerFired(Timer<ScriptedAnimationController>&);
Timer<ScriptedAnimationController> m_animationTimer;
- double m_lastAnimationFrameTimeMonotonic;
+ double m_lastAnimationFrameTimeMonotonic { 0 };
#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
// Override for DisplayRefreshMonitorClient
virtual void displayRefreshFired(double timestamp) override;
- virtual PassRefPtr<DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) const override;
+ virtual RefPtr<DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) const override;
- bool m_isUsingTimer;
- bool m_isThrottled;
+ bool m_isUsingTimer { false };
+ bool m_isThrottled { false };
#endif
#endif
};
Modified: branches/safari-600.1.4.16-branch/Source/WebCore/page/ChromeClient.h (183036 => 183037)
--- branches/safari-600.1.4.16-branch/Source/WebCore/page/ChromeClient.h 2015-04-20 23:38:42 UTC (rev 183036)
+++ branches/safari-600.1.4.16-branch/Source/WebCore/page/ChromeClient.h 2015-04-21 00:17:23 UTC (rev 183037)
@@ -295,7 +295,7 @@
virtual GraphicsLayerFactory* graphicsLayerFactory() const { return nullptr; }
#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
- virtual PassRefPtr<DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) const { return nullptr; }
+ virtual RefPtr<DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) const { return nullptr; }
#endif
// Pass 0 as the GraphicsLayer to detatch the root layer.
Modified: branches/safari-600.1.4.16-branch/Source/WebCore/platform/graphics/DisplayRefreshMonitor.cpp (183036 => 183037)
--- branches/safari-600.1.4.16-branch/Source/WebCore/platform/graphics/DisplayRefreshMonitor.cpp 2015-04-20 23:38:42 UTC (rev 183036)
+++ branches/safari-600.1.4.16-branch/Source/WebCore/platform/graphics/DisplayRefreshMonitor.cpp 2015-04-21 00:17:23 UTC (rev 183037)
@@ -35,21 +35,22 @@
namespace WebCore {
-PassRefPtr<DisplayRefreshMonitor> DisplayRefreshMonitor::create(DisplayRefreshMonitorClient* client)
+RefPtr<DisplayRefreshMonitor> DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor(PlatformDisplayID displayID)
{
- PlatformDisplayID displayID = client->displayID();
-
- if (RefPtr<DisplayRefreshMonitor> monitor = client->createDisplayRefreshMonitor(displayID))
- return monitor.release();
-
#if PLATFORM(MAC)
return DisplayRefreshMonitorMac::create(displayID);
#endif
#if PLATFORM(IOS)
return DisplayRefreshMonitorIOS::create(displayID);
#endif
+ return nullptr;
}
+RefPtr<DisplayRefreshMonitor> DisplayRefreshMonitor::create(DisplayRefreshMonitorClient& client)
+{
+ return client.createDisplayRefreshMonitor(client.displayID());
+}
+
DisplayRefreshMonitor::DisplayRefreshMonitor(PlatformDisplayID displayID)
: m_monotonicAnimationStartTime(0)
, m_active(true)
@@ -71,16 +72,16 @@
monitor->displayDidRefresh();
}
-void DisplayRefreshMonitor::addClient(DisplayRefreshMonitorClient* client)
+void DisplayRefreshMonitor::addClient(DisplayRefreshMonitorClient& client)
{
- m_clients.add(client);
+ m_clients.add(&client);
}
-bool DisplayRefreshMonitor::removeClient(DisplayRefreshMonitorClient* client)
+bool DisplayRefreshMonitor::removeClient(DisplayRefreshMonitorClient& client)
{
if (m_clientsToBeNotified)
- m_clientsToBeNotified->remove(client);
- return m_clients.remove(client);
+ m_clientsToBeNotified->remove(&client);
+ return m_clients.remove(&client);
}
void DisplayRefreshMonitor::displayDidRefresh()
@@ -124,7 +125,7 @@
m_previousFrameDone = true;
}
- DisplayRefreshMonitorManager::sharedManager().displayDidRefresh(this);
+ DisplayRefreshMonitorManager::sharedManager().displayDidRefresh(*this);
}
}
Modified: branches/safari-600.1.4.16-branch/Source/WebCore/platform/graphics/DisplayRefreshMonitor.h (183036 => 183037)
--- branches/safari-600.1.4.16-branch/Source/WebCore/platform/graphics/DisplayRefreshMonitor.h 2015-04-20 23:38:42 UTC (rev 183036)
+++ branches/safari-600.1.4.16-branch/Source/WebCore/platform/graphics/DisplayRefreshMonitor.h 2015-04-21 00:17:23 UTC (rev 183037)
@@ -41,7 +41,7 @@
class DisplayRefreshMonitor : public RefCounted<DisplayRefreshMonitor> {
public:
- static PassRefPtr<DisplayRefreshMonitor> create(DisplayRefreshMonitorClient*);
+ static RefPtr<DisplayRefreshMonitor> create(DisplayRefreshMonitorClient&);
virtual ~DisplayRefreshMonitor();
// Return true if callback request was scheduled, false if it couldn't be
@@ -50,8 +50,8 @@
void windowScreenDidChange(PlatformDisplayID);
bool hasClients() const { return m_clients.size(); }
- void addClient(DisplayRefreshMonitorClient*);
- bool removeClient(DisplayRefreshMonitorClient*);
+ void addClient(DisplayRefreshMonitorClient&);
+ bool removeClient(DisplayRefreshMonitorClient&);
PlatformDisplayID displayID() const { return m_displayID; }
@@ -74,6 +74,8 @@
Mutex& mutex() { return m_mutex; }
+ static RefPtr<DisplayRefreshMonitor> createDefaultDisplayRefreshMonitor(PlatformDisplayID);
+
protected:
explicit DisplayRefreshMonitor(PlatformDisplayID);
static void handleDisplayRefreshedNotificationOnMainThread(void* data);
Modified: branches/safari-600.1.4.16-branch/Source/WebCore/platform/graphics/DisplayRefreshMonitorClient.cpp (183036 => 183037)
--- branches/safari-600.1.4.16-branch/Source/WebCore/platform/graphics/DisplayRefreshMonitorClient.cpp 2015-04-20 23:38:42 UTC (rev 183036)
+++ branches/safari-600.1.4.16-branch/Source/WebCore/platform/graphics/DisplayRefreshMonitorClient.cpp 2015-04-21 00:17:23 UTC (rev 183037)
@@ -41,7 +41,7 @@
DisplayRefreshMonitorClient::~DisplayRefreshMonitorClient()
{
- DisplayRefreshMonitorManager::sharedManager().unregisterClient(this);
+ DisplayRefreshMonitorManager::sharedManager().unregisterClient(*this);
}
void DisplayRefreshMonitorClient::fireDisplayRefreshIfNeeded(double timestamp)
Modified: branches/safari-600.1.4.16-branch/Source/WebCore/platform/graphics/DisplayRefreshMonitorClient.h (183036 => 183037)
--- branches/safari-600.1.4.16-branch/Source/WebCore/platform/graphics/DisplayRefreshMonitorClient.h 2015-04-20 23:38:42 UTC (rev 183036)
+++ branches/safari-600.1.4.16-branch/Source/WebCore/platform/graphics/DisplayRefreshMonitorClient.h 2015-04-21 00:17:23 UTC (rev 183037)
@@ -43,7 +43,7 @@
// Always called on the main thread.
virtual void displayRefreshFired(double timestamp) = 0;
- virtual PassRefPtr<DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) const = 0;
+ virtual RefPtr<DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) const = 0;
PlatformDisplayID displayID() const { return m_displayID; }
bool hasDisplayID() const { return m_displayIDIsSet; }
Modified: branches/safari-600.1.4.16-branch/Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.cpp (183036 => 183037)
--- branches/safari-600.1.4.16-branch/Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.cpp 2015-04-20 23:38:42 UTC (rev 183036)
+++ branches/safari-600.1.4.16-branch/Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.cpp 2015-04-21 00:17:23 UTC (rev 183037)
@@ -44,9 +44,9 @@
return manager.get();
}
-DisplayRefreshMonitor* DisplayRefreshMonitorManager::ensureMonitorForClient(DisplayRefreshMonitorClient* client)
+DisplayRefreshMonitor* DisplayRefreshMonitorManager::createMonitorForClient(DisplayRefreshMonitorClient& client)
{
- PlatformDisplayID clientDisplayID = client->displayID();
+ PlatformDisplayID clientDisplayID = client.displayID();
for (const RefPtr<DisplayRefreshMonitor>& monitor : m_monitors) {
if (monitor->displayID() != clientDisplayID)
continue;
@@ -55,26 +55,29 @@
}
RefPtr<DisplayRefreshMonitor> monitor = DisplayRefreshMonitor::create(client);
+ if (!monitor)
+ return nullptr;
+
monitor->addClient(client);
DisplayRefreshMonitor* result = monitor.get();
m_monitors.append(monitor.release());
return result;
}
-void DisplayRefreshMonitorManager::registerClient(DisplayRefreshMonitorClient* client)
+void DisplayRefreshMonitorManager::registerClient(DisplayRefreshMonitorClient& client)
{
- if (!client->hasDisplayID())
+ if (!client.hasDisplayID())
return;
- ensureMonitorForClient(client);
+ createMonitorForClient(client);
}
-void DisplayRefreshMonitorManager::unregisterClient(DisplayRefreshMonitorClient* client)
+void DisplayRefreshMonitorManager::unregisterClient(DisplayRefreshMonitorClient& client)
{
- if (!client->hasDisplayID())
+ if (!client.hasDisplayID())
return;
- PlatformDisplayID clientDisplayID = client->displayID();
+ PlatformDisplayID clientDisplayID = client.displayID();
for (size_t i = 0; i < m_monitors.size(); ++i) {
RefPtr<DisplayRefreshMonitor> monitor = m_monitors[i];
if (monitor->displayID() != clientDisplayID)
@@ -87,36 +90,38 @@
}
}
-bool DisplayRefreshMonitorManager::scheduleAnimation(DisplayRefreshMonitorClient* client)
+bool DisplayRefreshMonitorManager::scheduleAnimation(DisplayRefreshMonitorClient& client)
{
- if (!client->hasDisplayID())
+ if (!client.hasDisplayID())
return false;
- DisplayRefreshMonitor* monitor = ensureMonitorForClient(client);
+ DisplayRefreshMonitor* monitor = createMonitorForClient(client);
+ if (!monitor)
+ return false;
- client->setIsScheduled(true);
+ client.setIsScheduled(true);
return monitor->requestRefreshCallback();
}
-void DisplayRefreshMonitorManager::displayDidRefresh(DisplayRefreshMonitor* monitor)
+void DisplayRefreshMonitorManager::displayDidRefresh(DisplayRefreshMonitor& monitor)
{
- if (!monitor->shouldBeTerminated())
+ if (!monitor.shouldBeTerminated())
return;
- size_t monitorIndex = m_monitors.find(monitor);
+ size_t monitorIndex = m_monitors.find(&monitor);
ASSERT(monitorIndex != notFound);
m_monitors.remove(monitorIndex);
}
-void DisplayRefreshMonitorManager::windowScreenDidChange(PlatformDisplayID displayID, DisplayRefreshMonitorClient* client)
+void DisplayRefreshMonitorManager::windowScreenDidChange(PlatformDisplayID displayID, DisplayRefreshMonitorClient& client)
{
- if (client->hasDisplayID() && client->displayID() == displayID)
+ if (client.hasDisplayID() && client.displayID() == displayID)
return;
unregisterClient(client);
- client->setDisplayID(displayID);
+ client.setDisplayID(displayID);
registerClient(client);
- if (client->isScheduled())
+ if (client.isScheduled())
scheduleAnimation(client);
}
Modified: branches/safari-600.1.4.16-branch/Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.h (183036 => 183037)
--- branches/safari-600.1.4.16-branch/Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.h 2015-04-20 23:38:42 UTC (rev 183036)
+++ branches/safari-600.1.4.16-branch/Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.h 2015-04-21 00:17:23 UTC (rev 183037)
@@ -41,20 +41,20 @@
public:
static DisplayRefreshMonitorManager& sharedManager();
- void registerClient(DisplayRefreshMonitorClient*);
- void unregisterClient(DisplayRefreshMonitorClient*);
+ void registerClient(DisplayRefreshMonitorClient&);
+ void unregisterClient(DisplayRefreshMonitorClient&);
- bool scheduleAnimation(DisplayRefreshMonitorClient*);
- void windowScreenDidChange(PlatformDisplayID, DisplayRefreshMonitorClient*);
+ bool scheduleAnimation(DisplayRefreshMonitorClient&);
+ void windowScreenDidChange(PlatformDisplayID, DisplayRefreshMonitorClient&);
private:
friend class DisplayRefreshMonitor;
- void displayDidRefresh(DisplayRefreshMonitor*);
+ void displayDidRefresh(DisplayRefreshMonitor&);
DisplayRefreshMonitorManager() { }
virtual ~DisplayRefreshMonitorManager();
- DisplayRefreshMonitor* ensureMonitorForClient(DisplayRefreshMonitorClient*);
+ DisplayRefreshMonitor* createMonitorForClient(DisplayRefreshMonitorClient&);
Vector<RefPtr<DisplayRefreshMonitor>> m_monitors;
};
Modified: branches/safari-600.1.4.16-branch/Source/WebCore/platform/graphics/GraphicsLayerUpdater.cpp (183036 => 183037)
--- branches/safari-600.1.4.16-branch/Source/WebCore/platform/graphics/GraphicsLayerUpdater.cpp 2015-04-20 23:38:42 UTC (rev 183036)
+++ branches/safari-600.1.4.16-branch/Source/WebCore/platform/graphics/GraphicsLayerUpdater.cpp 2015-04-21 00:17:23 UTC (rev 183037)
@@ -31,14 +31,13 @@
namespace WebCore {
-GraphicsLayerUpdater::GraphicsLayerUpdater(GraphicsLayerUpdaterClient* client, PlatformDisplayID displayID)
+GraphicsLayerUpdater::GraphicsLayerUpdater(GraphicsLayerUpdaterClient& client, PlatformDisplayID displayID)
: m_client(client)
- , m_scheduled(false)
{
#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
- DisplayRefreshMonitorManager::sharedManager().registerClient(this);
- DisplayRefreshMonitorManager::sharedManager().windowScreenDidChange(displayID, this);
- DisplayRefreshMonitorManager::sharedManager().scheduleAnimation(this);
+ DisplayRefreshMonitorManager::sharedManager().registerClient(*this);
+ DisplayRefreshMonitorManager::sharedManager().windowScreenDidChange(displayID, *this);
+ DisplayRefreshMonitorManager::sharedManager().scheduleAnimation(*this);
#else
UNUSED_PARAM(displayID);
#endif
@@ -55,7 +54,7 @@
return;
#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
- DisplayRefreshMonitorManager::sharedManager().scheduleAnimation(this);
+ DisplayRefreshMonitorManager::sharedManager().scheduleAnimation(*this);
#endif
m_scheduled = true;
}
@@ -63,7 +62,7 @@
void GraphicsLayerUpdater::screenDidChange(PlatformDisplayID displayID)
{
#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
- DisplayRefreshMonitorManager::sharedManager().windowScreenDidChange(displayID, this);
+ DisplayRefreshMonitorManager::sharedManager().windowScreenDidChange(displayID, *this);
#else
UNUSED_PARAM(displayID);
#endif
@@ -74,14 +73,13 @@
UNUSED_PARAM(timestamp);
m_scheduled = false;
- if (m_client)
- m_client->flushLayersSoon(this);
+ m_client.flushLayersSoon(*this);
}
#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
-PassRefPtr<DisplayRefreshMonitor> GraphicsLayerUpdater::createDisplayRefreshMonitor(PlatformDisplayID displayID) const
+RefPtr<DisplayRefreshMonitor> GraphicsLayerUpdater::createDisplayRefreshMonitor(PlatformDisplayID displayID) const
{
- return m_client ? m_client->createDisplayRefreshMonitor(displayID) : nullptr;
+ return m_client.createDisplayRefreshMonitor(displayID);
}
#endif
Modified: branches/safari-600.1.4.16-branch/Source/WebCore/platform/graphics/GraphicsLayerUpdater.h (183036 => 183037)
--- branches/safari-600.1.4.16-branch/Source/WebCore/platform/graphics/GraphicsLayerUpdater.h 2015-04-20 23:38:42 UTC (rev 183036)
+++ branches/safari-600.1.4.16-branch/Source/WebCore/platform/graphics/GraphicsLayerUpdater.h 2015-04-21 00:17:23 UTC (rev 183037)
@@ -36,9 +36,9 @@
class GraphicsLayerUpdaterClient {
public:
virtual ~GraphicsLayerUpdaterClient() { }
- virtual void flushLayersSoon(GraphicsLayerUpdater*) = 0;
+ virtual void flushLayersSoon(GraphicsLayerUpdater&) = 0;
#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
- virtual PassRefPtr<DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) const = 0;
+ virtual RefPtr<DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) const = 0;
#endif
};
@@ -48,21 +48,21 @@
#endif
{
public:
- GraphicsLayerUpdater(GraphicsLayerUpdaterClient*, PlatformDisplayID);
+ GraphicsLayerUpdater(GraphicsLayerUpdaterClient&, PlatformDisplayID);
virtual ~GraphicsLayerUpdater();
void scheduleUpdate();
void screenDidChange(PlatformDisplayID);
#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
- virtual PassRefPtr<DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) const override;
+ virtual RefPtr<DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) const override;
#endif
private:
virtual void displayRefreshFired(double timestamp);
- GraphicsLayerUpdaterClient* m_client;
- bool m_scheduled;
+ GraphicsLayerUpdaterClient& m_client;
+ bool m_scheduled { false };
};
} // namespace WebCore
Modified: branches/safari-600.1.4.16-branch/Source/WebCore/rendering/RenderLayerCompositor.cpp (183036 => 183037)
--- branches/safari-600.1.4.16-branch/Source/WebCore/rendering/RenderLayerCompositor.cpp 2015-04-20 23:38:42 UTC (rev 183036)
+++ branches/safari-600.1.4.16-branch/Source/WebCore/rendering/RenderLayerCompositor.cpp 2015-04-21 00:17:23 UTC (rev 183037)
@@ -265,7 +265,6 @@
, m_updateCompositingLayersTimer(this, &RenderLayerCompositor::updateCompositingLayersTimerFired)
, m_hasAcceleratedCompositing(true)
, m_compositingTriggers(static_cast<ChromeClient::CompositingTriggerFlags>(ChromeClient::AllTriggers))
- , m_compositedLayerCount(0)
, m_showDebugBorders(false)
, m_showRepaintCounter(false)
, m_acceleratedDrawingEnabled(false)
@@ -278,20 +277,12 @@
, m_inPostLayoutUpdate(false)
, m_subframeScrollLayersNeedReattach(false)
, m_isTrackingRepaints(false)
- , m_layersWithTiledBackingCount(0)
, m_rootLayerAttachment(RootLayerUnattached)
, m_layerFlushTimer(this, &RenderLayerCompositor::layerFlushTimerFired)
, m_layerFlushThrottlingEnabled(false)
, m_layerFlushThrottlingTemporarilyDisabledForInteraction(false)
, m_hasPendingLayerFlush(false)
, m_paintRelatedMilestonesTimer(this, &RenderLayerCompositor::paintRelatedMilestonesTimerFired)
-#if !LOG_DISABLED
- , m_rootLayerUpdateCount(0)
- , m_obligateCompositedLayerCount(0)
- , m_secondaryCompositedLayerCount(0)
- , m_obligatoryBackingStoreBytes(0)
- , m_secondaryBackingStoreBytes(0)
-#endif
{
}
@@ -476,6 +467,7 @@
client->didFlushCompositingLayers();
#endif
+ ++m_layerFlushCount;
startLayerFlushTimerIfNeeded();
}
@@ -593,13 +585,13 @@
if (Page* page = this->page())
displayID = page->chrome().displayID();
- m_layerUpdater = std::make_unique<GraphicsLayerUpdater>(this, displayID);
+ m_layerUpdater = std::make_unique<GraphicsLayerUpdater>(*this, displayID);
}
m_layerUpdater->scheduleUpdate();
}
-void RenderLayerCompositor::flushLayersSoon(GraphicsLayerUpdater*)
+void RenderLayerCompositor::flushLayersSoon(GraphicsLayerUpdater&)
{
scheduleLayerFlush(true);
}
@@ -4073,15 +4065,28 @@
}
#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
-PassRefPtr<DisplayRefreshMonitor> RenderLayerCompositor::createDisplayRefreshMonitor(PlatformDisplayID displayID) const
+RefPtr<DisplayRefreshMonitor> RenderLayerCompositor::createDisplayRefreshMonitor(PlatformDisplayID displayID) const
{
Frame& frame = m_renderView.frameView().frame();
Page* page = frame.page();
if (!page)
return nullptr;
- return page->chrome().client().createDisplayRefreshMonitor(displayID);
+ if (auto monitor = page->chrome().client().createDisplayRefreshMonitor(displayID))
+ return monitor;
+
+ return DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor(displayID);
}
#endif
+void RenderLayerCompositor::startTrackingLayerFlushes()
+{
+ m_layerFlushCount = 0;
+}
+
+unsigned RenderLayerCompositor::layerFlushCount() const
+{
+ return m_layerFlushCount;
+}
+
} // namespace WebCore
Modified: branches/safari-600.1.4.16-branch/Source/WebCore/rendering/RenderLayerCompositor.h (183036 => 183037)
--- branches/safari-600.1.4.16-branch/Source/WebCore/rendering/RenderLayerCompositor.h 2015-04-20 23:38:42 UTC (rev 183036)
+++ branches/safari-600.1.4.16-branch/Source/WebCore/rendering/RenderLayerCompositor.h 2015-04-21 00:17:23 UTC (rev 183037)
@@ -303,6 +303,10 @@
void setRootExtendedBackgroundColor(const Color&);
Color rootExtendedBackgroundColor() const { return m_rootExtendedBackgroundColor; }
+ // For testing.
+ void startTrackingLayerFlushes();
+ unsigned layerFlushCount() const;
+
private:
class OverlapMap;
@@ -314,7 +318,7 @@
virtual bool isTrackingRepaints() const override;
// GraphicsLayerUpdaterClient implementation
- virtual void flushLayersSoon(GraphicsLayerUpdater*) override;
+ virtual void flushLayersSoon(GraphicsLayerUpdater&) override;
// Whether the given RL needs a compositing layer.
bool needsToBeComposited(const RenderLayer&, RenderLayer::ViewportConstrainedNotCompositedReason* = 0) const;
@@ -392,7 +396,7 @@
ScrollingCoordinator* scrollingCoordinator() const;
#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
- PassRefPtr<DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) const;
+ RefPtr<DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) const override;
#endif
bool requiresCompositingForAnimation(RenderLayerModelObject&) const;
@@ -472,7 +476,6 @@
bool m_hasAcceleratedCompositing;
ChromeClient::CompositingTriggerFlags m_compositingTriggers;
- int m_compositedLayerCount;
bool m_showDebugBorders;
bool m_showRepaintCounter;
bool m_acceleratedDrawingEnabled;
@@ -491,7 +494,9 @@
bool m_isTrackingRepaints; // Used for testing.
- unsigned m_layersWithTiledBackingCount;
+ int m_compositedLayerCount { 0 };
+ unsigned m_layersWithTiledBackingCount { 0 };
+ unsigned m_layerFlushCount { 0 };
RootLayerAttachment m_rootLayerAttachment;
@@ -532,11 +537,11 @@
Timer<RenderLayerCompositor> m_paintRelatedMilestonesTimer;
#if !LOG_DISABLED
- int m_rootLayerUpdateCount;
- int m_obligateCompositedLayerCount; // count of layer that have to be composited.
- int m_secondaryCompositedLayerCount; // count of layers that have to be composited because of stacking or overlap.
- double m_obligatoryBackingStoreBytes;
- double m_secondaryBackingStoreBytes;
+ int m_rootLayerUpdateCount { 0 };
+ int m_obligateCompositedLayerCount { 0 }; // count of layer that have to be composited.
+ int m_secondaryCompositedLayerCount { 0 }; // count of layers that have to be composited because of stacking or overlap.
+ double m_obligatoryBackingStoreBytes { 0 };
+ double m_secondaryBackingStoreBytes { 0 };
#endif
Color m_rootExtendedBackgroundColor;
Modified: branches/safari-600.1.4.16-branch/Source/WebCore/testing/Internals.cpp (183036 => 183037)
--- branches/safari-600.1.4.16-branch/Source/WebCore/testing/Internals.cpp 2015-04-20 23:38:42 UTC (rev 183036)
+++ branches/safari-600.1.4.16-branch/Source/WebCore/testing/Internals.cpp 2015-04-21 00:17:23 UTC (rev 183037)
@@ -81,6 +81,7 @@
#include "PseudoElement.h"
#include "Range.h"
#include "RenderEmbeddedObject.h"
+#include "RenderLayerCompositor.h"
#include "RenderMenuList.h"
#include "RenderTreeAsText.h"
#include "RenderView.h"
@@ -1944,6 +1945,28 @@
frameView->setTracksRepaints(false);
}
+void Internals::startTrackingLayerFlushes(ExceptionCode& ec)
+{
+ Document* document = contextDocument();
+ if (!document || !document->renderView()) {
+ ec = INVALID_ACCESS_ERR;
+ return;
+ }
+
+ document->renderView()->compositor().startTrackingLayerFlushes();
+}
+
+unsigned long Internals::layerFlushCount(ExceptionCode& ec)
+{
+ Document* document = contextDocument();
+ if (!document || !document->renderView()) {
+ ec = INVALID_ACCESS_ERR;
+ return 0;
+ }
+
+ return document->renderView()->compositor().layerFlushCount();
+}
+
void Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(ExceptionCode& ec)
{
updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(nullptr, ec);
Modified: branches/safari-600.1.4.16-branch/Source/WebCore/testing/Internals.h (183036 => 183037)
--- branches/safari-600.1.4.16-branch/Source/WebCore/testing/Internals.h 2015-04-20 23:38:42 UTC (rev 183036)
+++ branches/safari-600.1.4.16-branch/Source/WebCore/testing/Internals.h 2015-04-21 00:17:23 UTC (rev 183037)
@@ -279,6 +279,10 @@
void startTrackingRepaints(ExceptionCode&);
void stopTrackingRepaints(ExceptionCode&);
+
+ void startTrackingLayerFlushes(ExceptionCode&);
+ unsigned long layerFlushCount(ExceptionCode&);
+
void updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(ExceptionCode&);
void updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(Node*, ExceptionCode&);
Modified: branches/safari-600.1.4.16-branch/Source/WebCore/testing/Internals.idl (183036 => 183037)
--- branches/safari-600.1.4.16-branch/Source/WebCore/testing/Internals.idl 2015-04-20 23:38:42 UTC (rev 183036)
+++ branches/safari-600.1.4.16-branch/Source/WebCore/testing/Internals.idl 2015-04-21 00:17:23 UTC (rev 183037)
@@ -241,6 +241,9 @@
[RaisesException] void startTrackingRepaints();
[RaisesException] void stopTrackingRepaints();
+ [RaisesException] void startTrackingLayerFlushes();
+ [RaisesException] unsigned long layerFlushCount();
+
// |node| should be Document, HTMLIFrameElement, or unspecified.
// If |node| is an HTMLIFrameElement, it assumes node.contentDocument is
// specified without security checks. Unspecified means this document.
Modified: branches/safari-600.1.4.16-branch/Source/WebKit2/ChangeLog (183036 => 183037)
--- branches/safari-600.1.4.16-branch/Source/WebKit2/ChangeLog 2015-04-20 23:38:42 UTC (rev 183036)
+++ branches/safari-600.1.4.16-branch/Source/WebKit2/ChangeLog 2015-04-21 00:17:23 UTC (rev 183037)
@@ -1,19 +1,54 @@
-2015-03-16 Babak Shafiei <bshaf...@apple.com>
+2015-04-20 Lucas Forschler <lforsch...@apple.com>
- Merge patch for rdar://problem/20155503.
+ Merge r181656 & r182985.
- 2015-03-13 Enrica Casucci <enr...@apple.com>
+ 2015-04-18 Simon Fraser <simon.fra...@apple.com>
- Webkit crash in WebKit::nextFocusableElement() when typing TAB on external keyboard
- rdar://problem/20155503
+ REGRESSION (r181656): Animated tiled layers are missing content
+ https://bugs.webkit.org/show_bug.cgi?id=143911
+ rdar://problem/20596328
- Reviewed by David Kilzer.
+ Reviewed by Darin Adler.
+
+ After r181656, all requestAnimationFrame was falling back to timers, and not
+ using the platform's DisplayRefreshMonitor, because of a Nullopt vs nullptr
+ fumble.
+
+ Replace this confusing Optional<> code with simpler code that just forces the
+ clients to make a DisplayRefreshMonitor if they can, first asking
+ ChromeClient, and then falling back to createDefaultDisplayRefreshMonitor().
+
+ Make lots of things into references, and use C++11 initialization in some places.
- Adding null check!
+ * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+ (WebKit::WebChromeClient::createDisplayRefreshMonitor):
+ * WebProcess/WebCoreSupport/WebChromeClient.h:
- * WebProcess/WebPage/ios/WebPageIOS.mm:
- (WebKit::nextFocusableElement):
+ 2015-03-17 Timothy Horton <timothy_hor...@apple.com>
+ Reproducible null deref under ScriptedAnimationController::createDisplayRefreshMonitor
+ https://bugs.webkit.org/show_bug.cgi?id=142776
+ <rdar://problem/18921338>
+
+ Reviewed by Alexey Proskuryakov.
+
+ * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+ (WebKit::WebChromeClient::createDisplayRefreshMonitor):
+ * WebProcess/WebCoreSupport/WebChromeClient.h:
+ Adjust to the new signature.
+
+2015-03-13 Enrica Casucci <enr...@apple.com>
+
+ Webkit crash in WebKit::nextFocusableElement() when typing TAB on external keyboard
+ rdar://problem/20155503
+
+ Reviewed by David Kilzer.
+
+ Adding null check!
+
+ * WebProcess/WebPage/ios/WebPageIOS.mm:
+ (WebKit::nextFocusableElement):
+
2015-03-12 Babak Shafiei <bshaf...@apple.com>
Merge r181448.
Modified: branches/safari-600.1.4.16-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (183036 => 183037)
--- branches/safari-600.1.4.16-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp 2015-04-20 23:38:42 UTC (rev 183036)
+++ branches/safari-600.1.4.16-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp 2015-04-21 00:17:23 UTC (rev 183037)
@@ -810,7 +810,7 @@
}
#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
-PassRefPtr<WebCore::DisplayRefreshMonitor> WebChromeClient::createDisplayRefreshMonitor(PlatformDisplayID displayID) const
+RefPtr<WebCore::DisplayRefreshMonitor> WebChromeClient::createDisplayRefreshMonitor(PlatformDisplayID displayID) const
{
return m_page->drawingArea()->createDisplayRefreshMonitor(displayID);
}
Modified: branches/safari-600.1.4.16-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h (183036 => 183037)
--- branches/safari-600.1.4.16-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h 2015-04-20 23:38:42 UTC (rev 183036)
+++ branches/safari-600.1.4.16-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h 2015-04-21 00:17:23 UTC (rev 183037)
@@ -217,7 +217,7 @@
virtual WebCore::GraphicsLayer* documentOverlayLayerForFrame(WebCore::Frame&) override;
#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
- virtual PassRefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) const override;
+ virtual RefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) const override;
#endif
virtual CompositingTriggerFlags allowedCompositingTriggers() const
Modified: branches/safari-600.1.4.16-branch/Source/WebKit2/WebProcess/WebPage/DrawingArea.cpp (183036 => 183037)
--- branches/safari-600.1.4.16-branch/Source/WebKit2/WebProcess/WebPage/DrawingArea.cpp 2015-04-20 23:38:42 UTC (rev 183036)
+++ branches/safari-600.1.4.16-branch/Source/WebKit2/WebProcess/WebPage/DrawingArea.cpp 2015-04-21 00:17:23 UTC (rev 183037)
@@ -93,7 +93,7 @@
}
#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
-PassRefPtr<WebCore::DisplayRefreshMonitor> DrawingArea::createDisplayRefreshMonitor(PlatformDisplayID)
+RefPtr<WebCore::DisplayRefreshMonitor> DrawingArea::createDisplayRefreshMonitor(PlatformDisplayID)
{
return nullptr;
}
Modified: branches/safari-600.1.4.16-branch/Source/WebKit2/WebProcess/WebPage/DrawingArea.h (183036 => 183037)
--- branches/safari-600.1.4.16-branch/Source/WebKit2/WebProcess/WebPage/DrawingArea.h 2015-04-20 23:38:42 UTC (rev 183036)
+++ branches/safari-600.1.4.16-branch/Source/WebKit2/WebProcess/WebPage/DrawingArea.h 2015-04-21 00:17:23 UTC (rev 183037)
@@ -104,7 +104,7 @@
virtual void scheduleCompositingLayerFlushImmediately() = 0;
#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
- virtual PassRefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID);
+ virtual RefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID);
#endif
virtual WebCore::TransformationMatrix rootLayerTransform() const;
Modified: branches/safari-600.1.4.16-branch/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h (183036 => 183037)
--- branches/safari-600.1.4.16-branch/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h 2015-04-20 23:38:42 UTC (rev 183036)
+++ branches/safari-600.1.4.16-branch/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h 2015-04-21 00:17:23 UTC (rev 183037)
@@ -70,7 +70,7 @@
virtual void addTransactionCallbackID(uint64_t callbackID) override;
- virtual PassRefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) override;
+ virtual RefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) override;
void willDestroyDisplayRefreshMonitor(WebCore::DisplayRefreshMonitor*);
virtual bool shouldUseTiledBackingForFrameView(const WebCore::FrameView*) override;
Modified: branches/safari-600.1.4.16-branch/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm (183036 => 183037)
--- branches/safari-600.1.4.16-branch/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm 2015-04-20 23:38:42 UTC (rev 183036)
+++ branches/safari-600.1.4.16-branch/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm 2015-04-21 00:17:23 UTC (rev 183037)
@@ -104,7 +104,7 @@
return m_remoteLayerTreeContext.get();
}
-PassRefPtr<DisplayRefreshMonitor> RemoteLayerTreeDrawingArea::createDisplayRefreshMonitor(PlatformDisplayID displayID)
+RefPtr<DisplayRefreshMonitor> RemoteLayerTreeDrawingArea::createDisplayRefreshMonitor(PlatformDisplayID displayID)
{
RefPtr<RemoteLayerTreeDisplayRefreshMonitor> monitor = RemoteLayerTreeDisplayRefreshMonitor::create(displayID, *this);
m_displayRefreshMonitors.add(monitor.get());