Skip to content

[Skia] Port on-screen FPS counter drawing to Skia compositor - #65093

Merged
webkit-commit-queue merged 1 commit into
WebKit:mainfrom
nikolaszimmermann:eng/Skia-Port-on-screen-FPS-counter-drawing-to-Skia-compositor
May 18, 2026
Merged

webkit-commit-queue merged 1 commit into
WebKit:mainfrom
nikolaszimmermann:eng/Skia-Port-on-screen-FPS-counter-drawing-to-Skia-compositor

Conversation

@nikolaszimmermann

@nikolaszimmermann nikolaszimmermann commented May 18, 2026 •

Copy link
Copy Markdown
Contributor

f077817

[Skia] Port on-screen FPS counter drawing to Skia compositor
https://bugs.webkit.org/show_bug.cgi?id=315003

Reviewed by Carlos Garcia Campos.

The on-screen FPS overlay was specific to the TextureMapper path
(TextureMapperFPSCounter). Draw a Skia counterpart directly from
ThreadedCompositor so an on-screen FPS overlay is also available when
the Skia compositor is enabled.

The existing WEBKIT_SHOW_FPS envvar keeps its behavior (logging the
FPS to the console, with its value setting the calculation interval in
seconds). A new WEBKIT_DRAW_FPS=1 envvar additionally renders the
on-screen overlay, reusing that calculation interval.
WEBKIT_DRAW_FPS_FONT_SIZE configures the overlay font size (defaults to 14).

* Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::paintToSkiaCanvas):
(WebKit::ThreadedCompositor::initializeFPSCounter):
(WebKit::ThreadedCompositor::updateFPSCounter):
(WebKit::ThreadedCompositor::drawFPSCounter):
* Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCompositor.h:

Canonical link: https://commits.webkit.org/313409@main

cb175e6

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
  🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ✅ 🧪 win-tests
✅ 🧪 webkitperl   🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
  🧪 ios-wk2-wpt ✅ 🧪 api-mac-debug ✅ 🛠 gtk3-libwebrtc
  🧪 api-ios ✅ 🛠 gtk
  🛠 ios-safer-cpp ✅ 🧪 mac-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🛠 playstation
  🧪 vision-wk2 ✅ 🧪 mac-intel-wk2
✅ 🛠 tv ✅ 🛠 mac-safer-cpp
✅ 🛠 tv-sim ✅ 🧪 mac-site-isolation
✅ 🛠 watch
✅ 🛠 watch-sim

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label May 18, 2026
@nikolaszimmermann nikolaszimmermann removed the merging-blocked Applied to prevent a change from being merged label May 18, 2026
@nikolaszimmermann
nikolaszimmermann force-pushed the eng/Skia-Port-on-screen-FPS-counter-drawing-to-Skia-compositor branch from 2a1171c to cb175e6 Compare May 18, 2026 11:37
@nikolaszimmermann nikolaszimmermann added the merge-queue Applied to send a pull request to merge-queue label May 18, 2026
webkit-commit-queue pushed a commit to nikolaszimmermann/WebKit that referenced this pull request May 18, 2026
https://bugs.webkit.org/show_bug.cgi?id=315016

Reviewed by Carlos Garcia Campos.

The debug repaint counter recomputed its string and re-measured its
text geometry on every composite of the layer, even though the count
only changes when the layer actually repaints its content. Cache the
shaped string and geometry, recomputing only when the count changes,
matching the on-screen FPS counter in ThreadedCompositor (PR WebKit#65093).

* Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.cpp:
(WebCore::SkiaCompositingLayer::paintSelf):
* Source/WebCore/platform/graphics/skia/SkiaCompositingLayer.h:

Canonical link: https://commits.webkit.org/313408@main
https://bugs.webkit.org/show_bug.cgi?id=315003

Reviewed by Carlos Garcia Campos.

The on-screen FPS overlay was specific to the TextureMapper path
(TextureMapperFPSCounter). Draw a Skia counterpart directly from
ThreadedCompositor so an on-screen FPS overlay is also available when
the Skia compositor is enabled.

The existing WEBKIT_SHOW_FPS envvar keeps its behavior (logging the
FPS to the console, with its value setting the calculation interval in
seconds). A new WEBKIT_DRAW_FPS=1 envvar additionally renders the
on-screen overlay, reusing that calculation interval.
WEBKIT_DRAW_FPS_FONT_SIZE configures the overlay font size (defaults to 14).

* Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::paintToSkiaCanvas):
(WebKit::ThreadedCompositor::initializeFPSCounter):
(WebKit::ThreadedCompositor::updateFPSCounter):
(WebKit::ThreadedCompositor::drawFPSCounter):
* Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCompositor.h:

Canonical link: https://commits.webkit.org/313409@main
@webkit-commit-queue
webkit-commit-queue force-pushed the eng/Skia-Port-on-screen-FPS-counter-drawing-to-Skia-compositor branch from cb175e6 to f077817 Compare May 18, 2026 12:48
@webkit-commit-queue

Copy link
Copy Markdown
Collaborator

Committed 313409@main (f077817): https://commits.webkit.org/313409@main

Reviewed commits have been landed. Closing PR #65093 and removing active labels.

@webkit-commit-queue
webkit-commit-queue merged commit f077817 into WebKit:main May 18, 2026
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label May 18, 2026
@nikolaszimmermann
nikolaszimmermann deleted the eng/Skia-Port-on-screen-FPS-counter-drawing-to-Skia-compositor branch May 27, 2026 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WPE WebKit WebKit WPE component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants