mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Bug 1309200 - Add gfx::Factory::GetDefaultSoftwareBackend. r=Bas
This commit is contained in:
parent
73df3d530d
commit
9af48bd777
@ -1296,11 +1296,13 @@ struct Config {
|
||||
LogForwarder* mLogForwarder;
|
||||
int32_t mMaxTextureSize;
|
||||
int32_t mMaxAllocSize;
|
||||
BackendType mDefaultSoftwareBackend;
|
||||
|
||||
Config()
|
||||
: mLogForwarder(nullptr)
|
||||
, mMaxTextureSize(8192)
|
||||
, mMaxAllocSize(52000000)
|
||||
, mDefaultSoftwareBackend(BackendType::CAIRO)
|
||||
{}
|
||||
};
|
||||
|
||||
@ -1438,6 +1440,8 @@ public:
|
||||
|
||||
static uint32_t GetMaxSurfaceSize(BackendType aType);
|
||||
|
||||
static BackendType GetDefaultSoftwareBackend();
|
||||
|
||||
static LogForwarder* GetLogForwarder() { return sConfig ? sConfig->mLogForwarder : nullptr; }
|
||||
|
||||
private:
|
||||
|
@ -217,6 +217,12 @@ Factory::HasSSE2()
|
||||
#endif
|
||||
}
|
||||
|
||||
BackendType
|
||||
Factory::GetDefaultSoftwareBackend()
|
||||
{
|
||||
return sConfig ? sConfig->mDefaultSoftwareBackend : BackendType::CAIRO;
|
||||
}
|
||||
|
||||
// If the size is "reasonable", we want gfxCriticalError to assert, so
|
||||
// this is the option set up for it.
|
||||
inline int LoggerOptionsBasedOnSize(const IntSize& aSize)
|
||||
|
@ -92,7 +92,7 @@ GPUParent::Init(base::ProcessId aParentPid,
|
||||
gfxVars::Initialize();
|
||||
gfxPlatform::InitNullMetadata();
|
||||
// Ensure our Factory is initialised, mainly for gfx logging to work.
|
||||
gfxPlatform::InitMoz2DLogging();
|
||||
gfxPlatform::InitMoz2D();
|
||||
#if defined(XP_WIN)
|
||||
DeviceManagerDx::Init();
|
||||
DeviceManagerD3D9::Init();
|
||||
|
@ -653,7 +653,7 @@ gfxPlatform::Init()
|
||||
ScopedGfxFeatureReporter::AppNote(forcedPrefs);
|
||||
}
|
||||
|
||||
InitMoz2DLogging();
|
||||
InitMoz2D();
|
||||
|
||||
gGfxPlatformPrefsLock = new Mutex("gfxPlatform::gGfxPlatformPrefsLock");
|
||||
|
||||
@ -793,7 +793,7 @@ gfxPlatform::Init()
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
gfxPlatform::InitMoz2DLogging()
|
||||
gfxPlatform::InitMoz2D()
|
||||
{
|
||||
auto fwd = new CrashStatsLogForwarder("GraphicsCriticalError");
|
||||
fwd->SetCircularBufferSize(gfxPrefs::GfxLoggingCrashLength());
|
||||
@ -802,6 +802,7 @@ gfxPlatform::InitMoz2DLogging()
|
||||
cfg.mLogForwarder = fwd;
|
||||
cfg.mMaxTextureSize = gfxPrefs::MaxTextureSize();
|
||||
cfg.mMaxAllocSize = gfxPrefs::MaxAllocSize();
|
||||
cfg.mDefaultSoftwareBackend = gPlatform->GetSoftwareBackend();
|
||||
|
||||
gfx::Factory::Init(cfg);
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ public:
|
||||
*/
|
||||
static void InitNullMetadata();
|
||||
|
||||
static void InitMoz2DLogging();
|
||||
static void InitMoz2D();
|
||||
|
||||
/**
|
||||
* Create an offscreen surface of the given dimensions
|
||||
|
Loading…
Reference in New Issue
Block a user