Bug 191632 - Align Mac WK2 layer flush throttling with iOS
Summary: Align Mac WK2 layer flush throttling with iOS
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on: 191642
Blocks:
  Show dependency treegraph
 
Reported: 2018-11-14 06:18 PST by Antti Koivisto
Modified: 2018-11-14 11:54 PST (History)
8 users (show)

See Also:


Attachments
patch (10.31 KB, patch)
2018-11-14 07:22 PST, Antti Koivisto
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 2018-11-14 06:18:28 PST
Currently Mac WK2 uses WebCore side throttling implementation in RenderLayerCompositor. This code has throttling timer per-frame while the actual decision making and layer flushes itself are per page. These timers generate way more flushes than expected in presence of multiple frames. There are also bugs in how flushing state is updated when frames are created dynamically.

On iOS WK2 throttling is implemented on WebKit side and controlled by a per-page timer. Recent fixes also make this implementation visually fast. We should align the Mac implementation and eventually unify them.
Comment 1 Antti Koivisto 2018-11-14 07:22:25 PST
Created attachment 354807 [details]
patch
Comment 2 WebKit Commit Bot 2018-11-14 08:53:32 PST
Comment on attachment 354807 [details]
patch

Clearing flags on attachment: 354807

Committed r238178: <https://trac.webkit.org/changeset/238178>
Comment 3 WebKit Commit Bot 2018-11-14 08:53:34 PST
All reviewed patches have been landed.  Closing bug.
Comment 4 Radar WebKit Bug Importer 2018-11-14 08:54:21 PST
<rdar://problem/46064211>
Comment 5 Truitt Savell 2018-11-14 11:02:06 PST
The changes in https://trac.webkit.org/changeset/238178/webkit

has caused these two tests to begin timing out on MacOS Release WK2:
fast/forms/access-key-mutated.html 
fast/forms/access-key-case-insensitive.html

Repro Command:
run-webkit-tests --root testbuild-238178 fast/forms/access-key-mutated.html fast/forms/access-key-case-insensitive.html --iterations 5 -f

These tests pass instantly on 238177.
Comment 6 Antti Koivisto 2018-11-14 11:11:58 PST
Filed https://bugs.webkit.org/show_bug.cgi?id=191642 for those, will skip meanwhile
Comment 7 Antti Koivisto 2018-11-14 11:19:29 PST
Skipped in https://trac.webkit.org/r238187
Comment 8 Simon Fraser (smfr) 2018-11-14 11:37:21 PST
Comment on attachment 354807 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=354807&action=review

> Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:221
> +    m_hasPendingFlush = true;
> +
> +    if (m_layerTreeStateIsFrozen) {
> +        m_isLayerFlushThrottlingTemporarilyDisabledForInteraction = false;
>          return;
> +    }
> +
> +    if (m_isLayerFlushThrottlingTemporarilyDisabledForInteraction) {
> +        m_isLayerFlushThrottlingTemporarilyDisabledForInteraction = false;
> +        scheduleLayerFlushRunLoopObserver();
> +        m_layerFlushThrottlingTimer.stop();
> +        return;
> +    }
> +
> +    if (m_layerFlushThrottlingTimer.isActive()) {
> +        ASSERT(m_isThrottlingLayerFlushes);
> +        return;
> +    }
> +
> +    if (m_isThrottlingLayerFlushes) {
> +        startLayerFlushThrottlingTimer();
> +        return;
> +    }

So now this code exists in both TiledCoreAnimationDrawingArea and RemoteLayerTreeDrawingArea. Can we share code?
Comment 9 Antti Koivisto 2018-11-14 11:54:34 PST
> So now this code exists in both TiledCoreAnimationDrawingArea and
> RemoteLayerTreeDrawingArea. Can we share code?

Like the ChangeLog mentions, sharing is the next step.