mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 971942: 2. layout.frame_rate, layers.offmainthreadcomposition.frame-rate, layers.orientation.sync.timeout moved to gfxPrefs. The layers.offmainthreadcomposition.frame-rate is also changed to be a live preference so it does not need a restart. r=bgirard
This commit is contained in:
parent
130b7127d6
commit
6e2f6474ed
@ -12,7 +12,7 @@
|
||||
#include "gfxASurface.h"
|
||||
#include "gfxImageSurface.h"
|
||||
#include "gfxQuartzSurface.h"
|
||||
#include "gfxPlatform.h"
|
||||
#include "gfxPrefs.h"
|
||||
#include "gfxFailure.h"
|
||||
#include "prenv.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
@ -139,7 +139,7 @@ GLContextCGL::MakeCurrentImpl(bool aForce)
|
||||
// If swapInt is 1, then glSwapBuffers will block and wait for a vblank signal.
|
||||
// When we're iterating as fast as possible, however, we want a non-blocking
|
||||
// glSwapBuffers, which will happen when swapInt==0.
|
||||
GLint swapInt = gfxPlatform::GetPrefLayoutFrameRate() == 0 ? 0 : 1;
|
||||
GLint swapInt = gfxPrefs::LayoutFrameRate() == 0 ? 0 : 1;
|
||||
[mContext setValues:&swapInt forParameter:NSOpenGLCPSwapInterval];
|
||||
}
|
||||
return true;
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "base/tracked.h" // for FROM_HERE
|
||||
#include "gfxContext.h" // for gfxContext
|
||||
#include "gfxPlatform.h" // for gfxPlatform
|
||||
#include "gfxPrefs.h" // for gfxPrefs
|
||||
#include "ipc/ShadowLayersManager.h" // for ShadowLayersManager
|
||||
#include "mozilla/AutoRestore.h" // for AutoRestore
|
||||
#include "mozilla/DebugOnly.h" // for DebugOnly
|
||||
@ -552,10 +553,10 @@ static const int32_t kDefaultFrameRate = 60;
|
||||
static int32_t
|
||||
CalculateCompositionFrameRate()
|
||||
{
|
||||
int32_t compositionFrameRatePref = gfxPlatform::GetPrefLayersCompositionFrameRate();
|
||||
int32_t compositionFrameRatePref = gfxPrefs::LayersCompositionFrameRate();
|
||||
if (compositionFrameRatePref < 0) {
|
||||
// Use the same frame rate for composition as for layout.
|
||||
int32_t layoutFrameRatePref = gfxPlatform::GetPrefLayoutFrameRate();
|
||||
int32_t layoutFrameRatePref = gfxPrefs::LayoutFrameRate();
|
||||
if (layoutFrameRatePref < 0) {
|
||||
// TODO: The main thread frame scheduling code consults the actual
|
||||
// monitor refresh rate in this case. We should do the same.
|
||||
@ -671,7 +672,7 @@ CompositorParent::CompositeToTarget(DrawTarget* aTarget)
|
||||
#endif
|
||||
|
||||
// 0 -> Full-tilt composite
|
||||
if (gfxPlatform::GetPrefLayersCompositionFrameRate() == 0) {
|
||||
if (gfxPrefs::LayersCompositionFrameRate() == 0) {
|
||||
// Special full-tilt composite mode for performance testing
|
||||
ScheduleComposition();
|
||||
}
|
||||
@ -728,7 +729,7 @@ CompositorParent::ShadowLayersUpdated(LayerTransactionParent* aLayerTree,
|
||||
mForceCompositionTask->Cancel();
|
||||
}
|
||||
mForceCompositionTask = NewRunnableMethod(this, &CompositorParent::ForceComposition);
|
||||
ScheduleTask(mForceCompositionTask, gfxPlatform::GetPlatform()->GetOrientationSyncMillis());
|
||||
ScheduleTask(mForceCompositionTask, gfxPrefs::OrientationSyncMillis());
|
||||
}
|
||||
|
||||
// Instruct the LayerManager to update its render bounds now. Since all the orientation
|
||||
|
@ -191,30 +191,6 @@ FontPrefsObserver::Observe(nsISupports *aSubject,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
class OrientationSyncPrefsObserver MOZ_FINAL : public nsIObserver
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIOBSERVER
|
||||
};
|
||||
|
||||
NS_IMPL_ISUPPORTS1(OrientationSyncPrefsObserver, nsIObserver)
|
||||
|
||||
NS_IMETHODIMP
|
||||
OrientationSyncPrefsObserver::Observe(nsISupports *aSubject,
|
||||
const char *aTopic,
|
||||
const char16_t *someData)
|
||||
{
|
||||
if (!someData) {
|
||||
NS_ERROR("orientation sync pref observer broken");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
NS_ASSERTION(gfxPlatform::GetPlatform(), "the singleton instance has gone");
|
||||
gfxPlatform::GetPlatform()->OrientationSyncPrefsObserverChanged();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
class MemoryPressureObserver MOZ_FINAL : public nsIObserver
|
||||
{
|
||||
public:
|
||||
@ -452,9 +428,6 @@ gfxPlatform::Init()
|
||||
gPlatform->mFontPrefsObserver = new FontPrefsObserver();
|
||||
Preferences::AddStrongObservers(gPlatform->mFontPrefsObserver, kObservedPrefs);
|
||||
|
||||
gPlatform->mOrientationSyncPrefsObserver = new OrientationSyncPrefsObserver();
|
||||
Preferences::AddStrongObserver(gPlatform->mOrientationSyncPrefsObserver, "layers.orientation.sync.timeout");
|
||||
|
||||
mozilla::Preferences::AddBoolVarCache(&gPlatform->mWidgetUpdateFlashing,
|
||||
"nglayout.debug.widget_update_flashing");
|
||||
|
||||
@ -472,8 +445,6 @@ gfxPlatform::Init()
|
||||
|
||||
Preferences::RegisterCallbackAndCall(RecordingPrefChanged, "gfx.2d.recording", nullptr);
|
||||
|
||||
gPlatform->mOrientationSyncMillis = Preferences::GetUint("layers.orientation.sync.timeout", (uint32_t)0);
|
||||
|
||||
mozilla::Preferences::AddBoolVarCache(&sDrawFrameCounter,
|
||||
"layers.frame-counter",
|
||||
false);
|
||||
@ -2044,18 +2015,6 @@ gfxPlatform::OptimalFormatForContent(gfxContentType aContent)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gfxPlatform::OrientationSyncPrefsObserverChanged()
|
||||
{
|
||||
mOrientationSyncMillis = Preferences::GetUint("layers.orientation.sync.timeout", (uint32_t)0);
|
||||
}
|
||||
|
||||
uint32_t
|
||||
gfxPlatform::GetOrientationSyncMillis() const
|
||||
{
|
||||
return mOrientationSyncMillis;
|
||||
}
|
||||
|
||||
/**
|
||||
* There are a number of layers acceleration (or layers in general) preferences
|
||||
* that should be consistent for the lifetime of the application (bug 840967).
|
||||
@ -2075,8 +2034,6 @@ static bool sPrefLayersDump = false;
|
||||
static bool sPrefLayersScrollGraph = false;
|
||||
static bool sPrefLayersEnableTiles = false;
|
||||
static bool sLayersSupportsD3D9 = false;
|
||||
static int sPrefLayoutFrameRate = -1;
|
||||
static int sPrefLayersCompositionFrameRate = -1;
|
||||
static bool sBufferRotationEnabled = false;
|
||||
static bool sComponentAlphaEnabled = true;
|
||||
static bool sPrefBrowserTabsRemoteAutostart = false;
|
||||
@ -2104,8 +2061,6 @@ InitLayersAccelerationPrefs()
|
||||
sPrefLayersDump = Preferences::GetBool("layers.dump", false);
|
||||
sPrefLayersScrollGraph = Preferences::GetBool("layers.scroll-graph", false);
|
||||
sPrefLayersEnableTiles = Preferences::GetBool("layers.enable-tiles", false);
|
||||
sPrefLayoutFrameRate = Preferences::GetInt("layout.frame_rate", -1);
|
||||
sPrefLayersCompositionFrameRate = Preferences::GetInt("layers.offmainthreadcomposition.frame-rate", -1);
|
||||
sBufferRotationEnabled = Preferences::GetBool("layers.bufferrotation.enabled", true);
|
||||
sComponentAlphaEnabled = Preferences::GetBool("layers.componentalpha.enabled", true);
|
||||
sPrefBrowserTabsRemoteAutostart = Preferences::GetBool("browser.tabs.remote.autostart", false);
|
||||
@ -2204,13 +2159,6 @@ gfxPlatform::CanUseDirect3D9()
|
||||
return sLayersSupportsD3D9;
|
||||
}
|
||||
|
||||
int
|
||||
gfxPlatform::GetPrefLayoutFrameRate()
|
||||
{
|
||||
InitLayersAccelerationPrefs();
|
||||
return sPrefLayoutFrameRate;
|
||||
}
|
||||
|
||||
bool
|
||||
gfxPlatform::GetPrefLayersDump()
|
||||
{
|
||||
@ -2234,13 +2182,6 @@ gfxPlatform::GetPrefLayersEnableTiles()
|
||||
return sPrefLayersEnableTiles;
|
||||
}
|
||||
|
||||
int
|
||||
gfxPlatform::GetPrefLayersCompositionFrameRate()
|
||||
{
|
||||
InitLayersAccelerationPrefs();
|
||||
return sPrefLayersCompositionFrameRate;
|
||||
}
|
||||
|
||||
bool
|
||||
gfxPlatform::BufferRotationEnabled()
|
||||
{
|
||||
|
@ -508,8 +508,6 @@ public:
|
||||
static bool GetPrefLayersPreferOpenGL();
|
||||
static bool GetPrefLayersPreferD3D9();
|
||||
static bool CanUseDirect3D9();
|
||||
static int GetPrefLayoutFrameRate();
|
||||
static int GetPrefLayersCompositionFrameRate();
|
||||
static bool GetPrefLayersDump();
|
||||
static bool GetPrefLayersScrollGraph();
|
||||
static bool GetPrefLayersEnableTiles();
|
||||
@ -576,8 +574,6 @@ public:
|
||||
|
||||
virtual void FontsPrefsChanged(const char *aPref);
|
||||
|
||||
void OrientationSyncPrefsObserverChanged();
|
||||
|
||||
int32_t GetBidiNumeralOption();
|
||||
|
||||
/**
|
||||
@ -603,8 +599,6 @@ public:
|
||||
|
||||
bool WidgetUpdateFlashing() const { return mWidgetUpdateFlashing; }
|
||||
|
||||
uint32_t GetOrientationSyncMillis() const;
|
||||
|
||||
/**
|
||||
* Return the layer debugging options to use browser-wide.
|
||||
*/
|
||||
@ -723,7 +717,6 @@ private:
|
||||
nsTArray<uint32_t> mCJKPrefLangs;
|
||||
nsCOMPtr<nsIObserver> mSRGBOverrideObserver;
|
||||
nsCOMPtr<nsIObserver> mFontPrefsObserver;
|
||||
nsCOMPtr<nsIObserver> mOrientationSyncPrefsObserver;
|
||||
nsCOMPtr<nsIObserver> mMemoryPressureObserver;
|
||||
|
||||
// The preferred draw target backend to use for canvas
|
||||
@ -739,7 +732,6 @@ private:
|
||||
|
||||
mozilla::RefPtr<mozilla::gfx::DrawEventRecorder> mRecorder;
|
||||
bool mWidgetUpdateFlashing;
|
||||
uint32_t mOrientationSyncMillis;
|
||||
bool mLayersPreferMemoryOverShmem;
|
||||
bool mLayersUseDeprecated;
|
||||
bool mDrawLayerBorders;
|
||||
|
@ -113,6 +113,10 @@ public:
|
||||
#else
|
||||
DECL_GFX_PREF(Once, "layers.async-video.enabled", AsyncVideoEnabled, bool, false);
|
||||
#endif
|
||||
DECL_GFX_PREF(Live, "layers.offmainthreadcomposition.frame-rate", LayersCompositionFrameRate, int32_t,-1);
|
||||
DECL_GFX_PREF(Live, "layers.orientation.sync.timeout", OrientationSyncMillis, uint32_t, (uint32_t)0);
|
||||
|
||||
DECL_GFX_PREF(Once, "layout.frame_rate", LayoutFrameRate, int32_t, -1);
|
||||
|
||||
public:
|
||||
// Manage the singleton:
|
||||
|
Loading…
Reference in New Issue
Block a user