summaryrefslogtreecommitdiffstats
path: root/gfx/thebes/gfxPlatform.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:42 +0000
commitda4c7e7ed675c3bf405668739c3012d140856109 (patch)
treecdd868dba063fecba609a1d819de271f0d51b23e /gfx/thebes/gfxPlatform.cpp
parentAdding upstream version 125.0.3. (diff)
downloadfirefox-da4c7e7ed675c3bf405668739c3012d140856109.tar.xz
firefox-da4c7e7ed675c3bf405668739c3012d140856109.zip
Adding upstream version 126.0.upstream/126.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/thebes/gfxPlatform.cpp')
-rw-r--r--gfx/thebes/gfxPlatform.cpp40
1 files changed, 25 insertions, 15 deletions
diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp
index c57564b054..ccc58213ef 100644
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -445,8 +445,7 @@ gfxPlatform::gfxPlatform()
mDisplayInfoCollector(this, &gfxPlatform::GetDisplayInfo),
mOverlayInfoCollector(this, &gfxPlatform::GetOverlayInfo),
mSwapChainInfoCollector(this, &gfxPlatform::GetSwapChainInfo),
- mCompositorBackend(layers::LayersBackend::LAYERS_NONE),
- mScreenDepth(0) {
+ mCompositorBackend(layers::LayersBackend::LAYERS_NONE) {
mAllowDownloadableFonts = UNINITIALIZED_VALUE;
InitBackendPrefs(GetBackendPrefs());
@@ -1064,6 +1063,13 @@ void gfxPlatform::ReportTelemetry() {
mozilla::glean::gfx_display::count.Set(screenCount);
mozilla::glean::gfx_display::primary_height.Set(rect.Height());
mozilla::glean::gfx_display::primary_width.Set(rect.Width());
+
+ // Check if any screen known by screenManager supports HDR.
+ bool supportsHDR = false;
+ for (const auto& screen : screenManager.CurrentScreenList()) {
+ supportsHDR |= screen->GetIsHDR();
+ }
+ Telemetry::ScalarSet(Telemetry::ScalarID::GFX_SUPPORTS_HDR, supportsHDR);
}
nsString adapterDesc;
@@ -1120,10 +1126,6 @@ void gfxPlatform::ReportTelemetry() {
NS_ConvertUTF16toUTF8(adapterDriverDate));
mozilla::glean::gfx_status::headless.Set(IsHeadless());
-
- MOZ_ASSERT(gPlatform, "Need gPlatform to generate some telemetry.");
- Telemetry::ScalarSet(Telemetry::ScalarID::GFX_SUPPORTS_HDR,
- gPlatform->SupportsHDR());
}
static bool IsFeatureSupported(long aFeature, bool aDefault) {
@@ -1607,6 +1609,12 @@ already_AddRefed<DataSourceSurface> gfxPlatform::GetWrappedDataSourceSurface(
}
void gfxPlatform::PopulateScreenInfo() {
+ // We're only going to set some gfxVars here, which is only possible from
+ // the parent process.
+ if (!XRE_IsParentProcess()) {
+ return;
+ }
+
nsCOMPtr<nsIScreenManager> manager =
do_GetService("@mozilla.org/gfx/screenmanager;1");
MOZ_ASSERT(manager, "failed to get nsIScreenManager");
@@ -1618,13 +1626,9 @@ void gfxPlatform::PopulateScreenInfo() {
return;
}
- screen->GetColorDepth(&mScreenDepth);
- if (XRE_IsParentProcess()) {
- gfxVars::SetScreenDepth(mScreenDepth);
- }
-
- int left, top;
- screen->GetRect(&left, &top, &mScreenSize.width, &mScreenSize.height);
+ int32_t screenDepth;
+ screen->GetColorDepth(&screenDepth);
+ gfxVars::SetPrimaryScreenDepth(screenDepth);
}
bool gfxPlatform::SupportsAzureContentForDrawTarget(DrawTarget* aTarget) {
@@ -3158,6 +3162,13 @@ void gfxPlatform::InitWebGPUConfig() {
#endif
gfxVars::SetAllowWebGPU(feature.IsEnabled());
+
+#if XP_WIN
+ if (IsWin10CreatorsUpdateOrLater() &&
+ StaticPrefs::dom_webgpu_allow_present_without_readback()) {
+ gfxVars::SetAllowWebGPUPresentWithoutReadback(true);
+ }
+#endif
}
#ifdef XP_WIN
@@ -3707,8 +3718,7 @@ uint32_t gfxPlatform::TargetFrameRate() {
/* static */
bool gfxPlatform::UseDesktopZoomingScrollbars() {
- return StaticPrefs::apz_allow_zooming() &&
- !StaticPrefs::apz_force_disable_desktop_zooming_scrollbars();
+ return StaticPrefs::apz_allow_zooming();
}
/*static*/