mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 614732 - Add prefs for enabling/disabling display-list hit-testing/painting. r=roc.
This commit is contained in:
parent
6aaa7e645b
commit
396b0f9473
@ -270,6 +270,8 @@ nsLayoutStatics::Initialize()
|
||||
|
||||
nsWindowMemoryReporter::Init();
|
||||
|
||||
nsSVGUtils::Init();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -160,31 +160,26 @@ static const PRUint8 gsRGBToLinearRGBMap[256] = {
|
||||
239, 242, 244, 246, 248, 250, 253, 255
|
||||
};
|
||||
|
||||
static bool gSMILEnabled;
|
||||
static const char SMIL_PREF_STR[] = "svg.smil.enabled";
|
||||
|
||||
static int
|
||||
SMILPrefChanged(const char *aPref, void *aClosure)
|
||||
{
|
||||
bool prefVal = Preferences::GetBool(SMIL_PREF_STR);
|
||||
gSMILEnabled = prefVal;
|
||||
return 0;
|
||||
}
|
||||
static bool sSMILEnabled;
|
||||
static bool sSVGDisplayListHitTestingEnabled;
|
||||
static bool sSVGDisplayListPaintingEnabled;
|
||||
|
||||
bool
|
||||
NS_SMILEnabled()
|
||||
{
|
||||
static bool sInitialized = false;
|
||||
|
||||
if (!sInitialized) {
|
||||
/* check and register ourselves with the pref */
|
||||
gSMILEnabled = Preferences::GetBool(SMIL_PREF_STR);
|
||||
Preferences::RegisterCallback(SMILPrefChanged, SMIL_PREF_STR);
|
||||
return sSMILEnabled;
|
||||
}
|
||||
|
||||
sInitialized = true;
|
||||
}
|
||||
bool
|
||||
NS_SVGDisplayListHitTestingEnabled()
|
||||
{
|
||||
return sSVGDisplayListHitTestingEnabled;
|
||||
}
|
||||
|
||||
return gSMILEnabled;
|
||||
bool
|
||||
NS_SVGDisplayListPaintingEnabled()
|
||||
{
|
||||
return sSVGDisplayListPaintingEnabled;
|
||||
}
|
||||
|
||||
// we only take the address of this:
|
||||
@ -237,6 +232,20 @@ SVGAutoRenderState::IsPaintingToWindow(nsRenderingContext *aContext)
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGUtils::Init()
|
||||
{
|
||||
Preferences::AddBoolVarCache(&sSMILEnabled,
|
||||
"svg.smil.enabled",
|
||||
true);
|
||||
|
||||
Preferences::AddBoolVarCache(&sSVGDisplayListHitTestingEnabled,
|
||||
"svg.display-lists.hit-testing.enabled");
|
||||
|
||||
Preferences::AddBoolVarCache(&sSVGDisplayListPaintingEnabled,
|
||||
"svg.display-lists.painting.enabled");
|
||||
}
|
||||
|
||||
nsSVGSVGElement*
|
||||
nsSVGUtils::GetOuterSVGElement(nsSVGElement *aSVGElement)
|
||||
{
|
||||
|
@ -143,6 +143,9 @@ IsSVGWhitespace(PRUnichar aChar)
|
||||
*/
|
||||
bool NS_SMILEnabled();
|
||||
|
||||
bool NS_SVGDisplayListHitTestingEnabled();
|
||||
bool NS_SVGDisplayListPaintingEnabled();
|
||||
|
||||
/**
|
||||
* Sometimes we need to distinguish between an empty box and a box
|
||||
* that contains an element that has no size e.g. a point at the origin.
|
||||
@ -225,6 +228,8 @@ public:
|
||||
typedef mozilla::SVGAnimatedPreserveAspectRatio SVGAnimatedPreserveAspectRatio;
|
||||
typedef mozilla::SVGPreserveAspectRatio SVGPreserveAspectRatio;
|
||||
|
||||
static void Init();
|
||||
|
||||
/*
|
||||
* Get the parent element of an nsIContent
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user