Bug 1366956 part 2 - Replace IsFramesTimingEnabled FFI function with direct pref cache access. r?heycam
MozReview-Commit-ID: 3pVCEmuxf9D
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -49,17 +49,16 @@
#include "mozilla/DeclarationBlockInlines.h"
#include "mozilla/EffectCompositor.h"
#include "mozilla/EffectSet.h"
#include "mozilla/EventStates.h"
#include "mozilla/GeckoStyleContext.h"
#include "mozilla/Keyframe.h"
#include "mozilla/Mutex.h"
-#include "mozilla/Preferences.h"
#include "mozilla/ServoElementSnapshot.h"
#include "mozilla/ServoRestyleManager.h"
#include "mozilla/StyleAnimationValue.h"
#include "mozilla/SystemGroup.h"
#include "mozilla/ServoMediaList.h"
#include "mozilla/RWLock.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/ElementInlines.h"
@@ -85,18 +84,16 @@ using namespace mozilla::dom;
}
#include "mozilla/ServoArcTypeList.h"
SERVO_ARC_TYPE(StyleContext, ServoStyleContext)
#undef SERVO_ARC_TYPE
static Mutex* sServoFontMetricsLock = nullptr;
static RWLock* sServoLangFontPrefsLock = nullptr;
-static bool sFramesTimingFunctionEnabled;
-
static
const nsFont*
ThreadSafeGetDefaultFontHelper(const nsPresContext* aPresContext,
nsIAtom* aLanguage, uint8_t aGenericId)
{
bool needsCache = false;
const nsFont* retval;
@@ -825,21 +822,16 @@ Gecko_GetPositionInSegment(RawGeckoAnima
double positionInSegment =
(aProgress - aSegment->mFromKey) / (aSegment->mToKey - aSegment->mFromKey);
return ComputedTimingFunction::GetPortion(aSegment->mTimingFunction,
positionInSegment,
aBeforeFlag);
}
-bool
-Gecko_IsFramesTimingEnabled() {
- return sFramesTimingFunctionEnabled;
-}
-
RawServoAnimationValueBorrowedOrNull
Gecko_AnimationGetBaseStyle(void* aBaseStyles, nsCSSPropertyID aProperty)
{
auto base =
static_cast<nsRefPtrHashtable<nsUint32HashKey, RawServoAnimationValue>*>
(aBaseStyles);
return base->GetWeak(aProperty);
}
@@ -2413,19 +2405,16 @@ Gecko_XBLBinding_InheritsStyle(RawGeckoX
void
InitializeServo()
{
URLExtraData::InitDummy();
Servo_Initialize(URLExtraData::Dummy());
sServoFontMetricsLock = new Mutex("Gecko_GetFontMetrics");
sServoLangFontPrefsLock = new RWLock("nsPresContext::GetDefaultFont");
-
- Preferences::AddBoolVarCache(&sFramesTimingFunctionEnabled,
- "layout.css.frames-timing.enabled");
}
void
ShutdownServo()
{
delete sServoFontMetricsLock;
delete sServoLangFontPrefsLock;
Servo_Shutdown();
--- a/layout/style/ServoBindings.h
+++ b/layout/style/ServoBindings.h
@@ -259,17 +259,16 @@ nsCSSPropertyID Gecko_ElementTransitions
RawServoAnimationValueBorrowedOrNull Gecko_ElementTransitions_EndValueAt(
RawGeckoElementBorrowed aElementOrPseudo,
size_t aIndex);
double Gecko_GetProgressFromComputedTiming(RawGeckoComputedTimingBorrowed aComputedTiming);
double Gecko_GetPositionInSegment(
RawGeckoAnimationPropertySegmentBorrowed aSegment,
double aProgress,
mozilla::ComputedTimingFunction::BeforeFlag aBeforeFlag);
-bool Gecko_IsFramesTimingEnabled();
// Get servo's AnimationValue for |aProperty| from the cached base style
// |aBaseStyles|.
// |aBaseStyles| is nsRefPtrHashtable<nsUint32HashKey, RawServoAnimationValue>.
// We use void* to avoid exposing nsRefPtrHashtable in FFI.
RawServoAnimationValueBorrowedOrNull Gecko_AnimationGetBaseStyle(
void* aBaseStyles,
nsCSSPropertyID aProperty);
void Gecko_StyleTransition_SetUnsupportedProperty(