mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 747274 - Add a pref (default to true on Android) to forcibly use nearest pixel filtering for background drawing. r=jrmuizel,ajuma a=blassey
This commit is contained in:
parent
65ffa9d016
commit
97e5839e99
@ -168,6 +168,20 @@ nsLayoutUtils::Are3DTransformsEnabled()
|
||||
return s3DTransformsEnabled;
|
||||
}
|
||||
|
||||
bool
|
||||
nsLayoutUtils::UseBackgroundNearestFiltering()
|
||||
{
|
||||
static bool sUseBackgroundNearestFilteringEnabled;
|
||||
static bool sUseBackgroundNearestFilteringPrefInitialised = false;
|
||||
|
||||
if (!sUseBackgroundNearestFilteringPrefInitialised) {
|
||||
sUseBackgroundNearestFilteringPrefInitialised = true;
|
||||
sUseBackgroundNearestFilteringEnabled = mozilla::Preferences::GetBool("gfx.filter.nearest.force-enabled", false);
|
||||
}
|
||||
|
||||
return sUseBackgroundNearestFilteringEnabled;
|
||||
}
|
||||
|
||||
void
|
||||
nsLayoutUtils::UnionChildOverflow(nsIFrame* aFrame,
|
||||
nsOverflowAreas& aOverflowAreas)
|
||||
@ -3734,6 +3748,11 @@ nsLayoutUtils::DrawBackgroundImage(nsRenderingContext* aRenderingContext,
|
||||
PRUint32 aImageFlags)
|
||||
{
|
||||
SAMPLE_LABEL("layout", "nsLayoutUtils::DrawBackgroundImage");
|
||||
|
||||
if (UseBackgroundNearestFiltering()) {
|
||||
aGraphicsFilter = gfxPattern::FILTER_NEAREST;
|
||||
}
|
||||
|
||||
return DrawImageInternal(aRenderingContext, aImage, aGraphicsFilter,
|
||||
aDest, aFill, aAnchor, aDirty,
|
||||
aImageSize, aImageFlags);
|
||||
|
@ -1496,6 +1496,12 @@ public:
|
||||
*/
|
||||
static bool Are3DTransformsEnabled();
|
||||
|
||||
/**
|
||||
* Checks if we should forcibly use nearest pixel filtering for the
|
||||
* background.
|
||||
*/
|
||||
static bool UseBackgroundNearestFiltering();
|
||||
|
||||
/**
|
||||
* Unions the overflow areas of all non-popup children of aFrame with
|
||||
* aOverflowAreas.
|
||||
|
@ -212,6 +212,12 @@ pref("gfx.downloadable_fonts.enabled", true);
|
||||
pref("gfx.downloadable_fonts.fallback_delay", 3000);
|
||||
pref("gfx.downloadable_fonts.sanitize", true);
|
||||
|
||||
#ifdef ANDROID
|
||||
pref("gfx.filter.nearest.force-enabled", true);
|
||||
#else
|
||||
pref("gfx.filter.nearest.force-enabled", false);
|
||||
#endif
|
||||
|
||||
// whether to always search all font cmaps during system font fallback
|
||||
pref("gfx.font_rendering.fallback.always_use_cmaps", false);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user