Bug 1839614 - patch 2 - Move the browser.display.auto_quality_min_font_size pref into StaticPrefs. r=gfx-reviewers,lsalzman

No change in behavior here; this is to prepare for offscreen-canvas workers
to be able to access the pref (following patch).

Depends on D181636

Differential Revision: https://phabricator.services.mozilla.com/D181637
This commit is contained in:
Jonathan Kew 2023-06-23 15:12:19 +00:00
parent 0add7b24b0
commit 7d0978de1e
5 changed files with 11 additions and 13 deletions

View File

@ -83,6 +83,7 @@
#include "mozilla/ServoStyleSet.h"
#include "mozilla/ServoStyleSetInlines.h"
#include "mozilla/StaticPrefs_apz.h"
#include "mozilla/StaticPrefs_browser.h"
#include "mozilla/StaticPrefs_dom.h"
#include "mozilla/StaticPrefs_font.h"
#include "mozilla/StaticPrefs_general.h"
@ -7007,8 +7008,10 @@ nsIFrame* nsLayoutUtils::GetReferenceFrame(nsIFrame* aFrame) {
result |= gfx::ShapedTextFlags::TEXT_OPTIMIZE_SPEED;
break;
case StyleTextRendering::Auto:
if (aPresContext && aStyleFont->mFont.size.ToCSSPixels() <
aPresContext->GetAutoQualityMinFontSize()) {
if (aPresContext &&
aStyleFont->mFont.size.ToCSSPixels() <
aPresContext->DevPixelsToFloatCSSPixels(
StaticPrefs::browser_display_auto_quality_min_font_size())) {
result |= gfx::ShapedTextFlags::TEXT_OPTIMIZE_SPEED;
}
break;

View File

@ -237,7 +237,6 @@ nsPresContext::nsPresContext(dom::Document* aDocument, nsPresContextType aType)
mFullZoom(1.0),
mLastFontInflationScreenSize(gfxSize(-1.0, -1.0)),
mCurAppUnitsPerDevPixel(0),
mAutoQualityMinFontSizePixelsPref(0),
mDynamicToolbarMaxHeight(0),
mDynamicToolbarHeight(0),
mPageSize(-1, -1),
@ -424,9 +423,6 @@ void nsPresContext::GetUserPreferences() {
return;
}
mAutoQualityMinFontSizePixelsPref =
Preferences::GetInt("browser.display.auto_quality_min_font_size");
PreferenceSheet::EnsureInitialized();
mSendAfterPaintToContent = Preferences::GetBool(

View File

@ -566,10 +566,6 @@ class nsPresContext : public nsISupports, public mozilla::SupportsWeakPtr {
*/
void SetColorSchemeOverride(mozilla::dom::PrefersColorSchemeOverride);
mozilla::CSSCoord GetAutoQualityMinFontSize() const {
return DevPixelsToFloatCSSPixels(mAutoQualityMinFontSizePixelsPref);
}
/**
* Return the device's screen size in inches, for font size
* inflation.

View File

@ -1133,6 +1133,12 @@
value: 32
mirror: always
# Min font device pixel size at which to turn on high quality.
- name: browser.display.auto_quality_min_font_size
type: RelaxedAtomicUint32
value: 20
mirror: always
- name: browser.display.background_color
type: String
value: "#FFFFFF"

View File

@ -168,9 +168,6 @@ pref("dom.text-recognition.enabled", true);
// of content viewers to cache based on the amount of available memory.
pref("browser.sessionhistory.max_total_viewers", -1);
// min font device pixel size at which to turn on high quality
pref("browser.display.auto_quality_min_font_size", 20);
// See http://whatwg.org/specs/web-apps/current-work/#ping
pref("browser.send_pings", false);
pref("browser.send_pings.max_per_link", 1); // limit the number of pings that are sent per link click