Skip to content

Commit

Permalink
[WPE] Build fix when WPE_PLATFORM disabled after 277537@main
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=272676

Reviewed by Carlos Garcia Campos.

Function 'primaryScreenDisplayID' is only availble is WPE_PLATFORM is defined.

* Source/WebCore/platform/wpe/PlatformScreenWPE.cpp:
(WebCore::fontDPI):
* Source/WebKit/UIProcess/API/glib/WebKitProtocolHandler.cpp:
(WebKit::WebKitProtocolHandler::handleGPU):

Canonical link: https://commits.webkit.org/277609@main
  • Loading branch information
dpino committed Apr 17, 2024
1 parent 53cfce0 commit 8965f9b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Source/WebCore/platform/wpe/PlatformScreenWPE.cpp
Expand Up @@ -107,8 +107,13 @@ double screenDPI(PlatformDisplayID screendisplayID)

double fontDPI()
{
#if ENABLE(WPE_PLATFORM)
// In WPE, there is no notion of font scaling separate from device DPI.
return screenDPI(primaryScreenDisplayID());
#else
notImplemented();
return 96.;
#endif
}

FloatRect screenRect(Widget* widget)
Expand Down
2 changes: 2 additions & 0 deletions Source/WebKit/UIProcess/API/glib/WebKitProtocolHandler.cpp
Expand Up @@ -414,7 +414,9 @@ void WebKitProtocolHandler::handleGPU(WebKitURISchemeRequest* request)
addTableRow(displayObject, "Depth"_s, String::number(screenDepth(nullptr)));
addTableRow(displayObject, "Bits per color component"_s, String::number(screenDepthPerComponent(nullptr)));
addTableRow(displayObject, "Font Scaling DPI"_s, String::number(fontDPI()));
#if PLATFORM(GTK) || (PLATFORM(WPE) && ENABLE(WPE_PLATFORM))
addTableRow(displayObject, "Screen DPI"_s, String::number(screenDPI(displayID.value_or(primaryScreenDisplayID()))));
#endif

if (displayID) {
if (auto* displayLink = page.process().processPool().displayLinks().existingDisplayLinkForDisplay(*displayID)) {
Expand Down

0 comments on commit 8965f9b

Please sign in to comment.