Skip to content

Commit 9e804de

Browse files
authored
Remove CEF GPU compositing (#3821)
1 parent 8e66bdd commit 9e804de

File tree

8 files changed

+9
-52
lines changed

8 files changed

+9
-52
lines changed

Client/cefweb/CWebApp.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,10 @@ void CWebApp::OnBeforeCommandLineProcessing(const CefString& process_type, CefRe
2323
{
2424
CWebCore* pWebCore = static_cast<CWebCore*>(g_pCore->GetWebCore());
2525

26-
if (!pWebCore->GetGPUEnabled()) // if GPU is disabled...
27-
{
28-
command_line->AppendSwitch("disable-gpu-compositing");
26+
if (!pWebCore->GetGPUEnabled())
2927
command_line->AppendSwitch("disable-gpu");
30-
}
31-
else if (!pWebCore->GetGPUCompositingEnabled()) // if GPU is enabled, but compositing is disabled...
32-
command_line->AppendSwitch("disable-gpu-compositing");
28+
29+
command_line->AppendSwitch("disable-gpu-compositing"); // always disable this, causes issues with official builds
3330

3431
// command_line->AppendSwitch("disable-d3d11");
3532
command_line->AppendSwitch("enable-begin-frame-scheduling");

Client/cefweb/CWebCore.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,12 @@ CWebCore::~CWebCore()
4949
delete m_pXmlConfig;
5050
}
5151

52-
bool CWebCore::Initialise(bool gpuEnabled, bool gpuCompositingEnabled)
52+
bool CWebCore::Initialise(bool gpuEnabled)
5353
{
5454
CefMainArgs mainArgs;
5555
void* sandboxInfo = nullptr;
5656

5757
m_bGPUEnabled = gpuEnabled;
58-
m_bGPUCompositingEnabled = gpuCompositingEnabled;
5958

6059
CefRefPtr<CWebApp> app(new CWebApp);
6160

@@ -878,8 +877,3 @@ bool CWebCore::GetGPUEnabled() const noexcept
878877
{
879878
return m_bGPUEnabled;
880879
}
881-
882-
bool CWebCore::GetGPUCompositingEnabled() const noexcept
883-
{
884-
return m_bGPUCompositingEnabled;
885-
}

Client/cefweb/CWebCore.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class CWebCore : public CWebCoreInterface
5454
public:
5555
CWebCore();
5656
~CWebCore();
57-
bool Initialise(bool gpuEnabled, bool gpuCompositingEnabled) override;
57+
bool Initialise(bool gpuEnabled) override;
5858

5959
CWebViewInterface* CreateWebView(unsigned int uiWidth, unsigned int uiHeight, bool bIsLocal, CWebBrowserItem* pWebBrowserRenderItem, bool bTransparent);
6060
void DestroyWebView(CWebViewInterface* pWebViewInterface);
@@ -109,7 +109,6 @@ class CWebCore : public CWebCoreInterface
109109
static void StaticFetchBlacklistFinished(const SHttpDownloadResult& result);
110110

111111
bool GetGPUEnabled() const noexcept;
112-
bool GetGPUCompositingEnabled() const noexcept;
113112

114113
private:
115114
typedef std::pair<bool, eWebFilterType> WebFilterPair;
@@ -135,5 +134,4 @@ class CWebCore : public CWebCoreInterface
135134

136135
// Shouldn't be changed after init
137136
bool m_bGPUEnabled;
138-
bool m_bGPUCompositingEnabled;
139137
};

Client/core/CClientVariables.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,6 @@ void CClientVariables::LoadDefaults()
359359
DEFAULT("discord_rpc_share_data_firsttime", false); // Display the user data sharing consent dialog box - for the first time
360360
DEFAULT("_beta_qc_rightclick_command", _S("reconnect")); // Command to run when right clicking quick connect (beta - can be removed at any time)
361361
DEFAULT("browser_enable_gpu", true); // Enable GPU in CEF? (allows stuff like WebGL to function)
362-
DEFAULT("browser_enable_gpu_compositing", true); // Enable GPU compositing in CEF? (required GPU enabled)
363362

364363
if (!Exists("locale"))
365364
{

Client/core/CCore.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,13 +1156,11 @@ CWebCoreInterface* CCore::GetWebCore()
11561156
if (m_pWebCore == nullptr)
11571157
{
11581158
bool gpuEnabled;
1159-
bool gpuCompositingEnabled;
11601159
auto cvars = g_pCore->GetCVars();
11611160
cvars->Get("browser_enable_gpu", gpuEnabled);
1162-
cvars->Get("browser_enable_gpu_compositing", gpuCompositingEnabled);
11631161

11641162
m_pWebCore = CreateModule<CWebCoreInterface>(m_WebCoreModule, "CefWeb", "cefweb", "InitWebCoreInterface", this);
1165-
m_pWebCore->Initialise(gpuEnabled, gpuCompositingEnabled);
1163+
m_pWebCore->Initialise(gpuEnabled);
11661164
}
11671165
return m_pWebCore;
11681166
}

Client/core/CSettings.cpp

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -918,14 +918,8 @@ void CSettings::CreateGUI()
918918
m_pCheckBoxRemoteJavascript->AutoSize(NULL, 20.0f);
919919

920920
m_pCheckBoxBrowserGPUEnabled = reinterpret_cast<CGUICheckBox*>(pManager->CreateCheckBox(m_pTabBrowser, _("Enable GPU rendering"), true));
921-
m_pCheckBoxBrowserGPUEnabled->SetPosition(CVector2D(vecTemp.fX + 300.0f, vecTemp.fY - 20.0f));
921+
m_pCheckBoxBrowserGPUEnabled->SetPosition(CVector2D(vecTemp.fX + 300.0f, vecTemp.fY - 25.0f));
922922
m_pCheckBoxBrowserGPUEnabled->AutoSize(NULL, 20.0f);
923-
m_pCheckBoxBrowserGPUEnabled->SetClickHandler(GUI_CALLBACK(&CSettings::OnGPUSettingChanged, this));
924-
925-
m_pCheckBoxBrowserGPUCompositingEnabled =
926-
reinterpret_cast<CGUICheckBox*>(pManager->CreateCheckBox(m_pTabBrowser, _("Enable GPU compositing"), true));
927-
m_pCheckBoxBrowserGPUCompositingEnabled->SetPosition(CVector2D(vecTemp.fX + 300.0f, vecTemp.fY));
928-
m_pCheckBoxBrowserGPUCompositingEnabled->AutoSize(NULL, 20.0f);
929923

930924
m_pLabelBrowserCustomBlacklist = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(m_pTabBrowser, _("Custom blacklist")));
931925
m_pLabelBrowserCustomBlacklist->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 30.0f));
@@ -3300,12 +3294,6 @@ void CSettings::LoadData()
33003294
CVARS_GET("browser_enable_gpu", bVar);
33013295
m_pCheckBoxBrowserGPUEnabled->SetSelected(bVar);
33023296

3303-
if (!bVar)
3304-
m_pCheckBoxBrowserGPUCompositingEnabled->SetEnabled(false);
3305-
3306-
CVARS_GET("browser_enable_gpu_compositing", bVar);
3307-
m_pCheckBoxBrowserGPUCompositingEnabled->SetSelected(bVar);
3308-
33093297
ReloadBrowserLists();
33103298
}
33113299

@@ -3736,13 +3724,6 @@ void CSettings::SaveData()
37363724
bool bBrowserGPUSettingChanged = (bBrowserGPUSetting != bBrowserGPUEnabled);
37373725
CVARS_SET("browser_enable_gpu", bBrowserGPUSetting);
37383726

3739-
bool bBrowserGPUCompositingEnabled = false;
3740-
CVARS_GET("browser_enable_gpu_compositing", bBrowserGPUCompositingEnabled);
3741-
3742-
bool bBrowserGPUCompositingSetting = m_pCheckBoxBrowserGPUCompositingEnabled->GetSelected();
3743-
bool bBrowserGPUCompositingSettingChanged = (bBrowserGPUCompositingSetting != bBrowserGPUCompositingEnabled);
3744-
CVARS_SET("browser_enable_gpu_compositing", bBrowserGPUCompositingSetting);
3745-
37463727
// Ensure CVARS ranges ok
37473728
CClientVariables::GetSingleton().ValidateValues();
37483729

@@ -3752,8 +3733,7 @@ void CSettings::SaveData()
37523733
gameSettings->Save();
37533734

37543735
// Ask to restart?
3755-
if (bIsVideoModeChanged || bIsAntiAliasingChanged || bIsCustomizedSAFilesChanged || processsDPIAwareChanged || bBrowserGPUSettingChanged ||
3756-
bBrowserGPUCompositingSettingChanged)
3736+
if (bIsVideoModeChanged || bIsAntiAliasingChanged || bIsCustomizedSAFilesChanged || processsDPIAwareChanged || bBrowserGPUSettingChanged)
37573737
ShowRestartQuestion();
37583738
else if (CModManager::GetSingleton().IsLoaded() && bBrowserSettingChanged)
37593739
ShowDisconnectQuestion();
@@ -4906,9 +4886,3 @@ bool CSettings::IsActive()
49064886
{
49074887
return m_pWindow->IsActive();
49084888
}
4909-
4910-
bool CSettings::OnGPUSettingChanged(CGUIElement* pElement)
4911-
{
4912-
m_pCheckBoxBrowserGPUCompositingEnabled->SetEnabled(m_pCheckBoxBrowserGPUEnabled->GetSelected());
4913-
return true;
4914-
}

Client/core/CSettings.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,6 @@ class CSettings
339339
CGUIGridList* m_pGridBrowserWhitelist;
340340
CGUIButton* m_pButtonBrowserWhitelistRemove;
341341
CGUICheckBox* m_pCheckBoxBrowserGPUEnabled;
342-
CGUICheckBox* m_pCheckBoxBrowserGPUCompositingEnabled;
343342
bool m_bBrowserListsChanged;
344343
bool m_bBrowserListsLoadEnabled;
345344

@@ -384,7 +383,6 @@ class CSettings
384383
bool OnBrowserWhitelistRemove(CGUIElement* pElement);
385384
bool OnBrowserWhitelistDomainAddFocused(CGUIElement* pElement);
386385
bool OnBrowserWhitelistDomainAddDefocused(CGUIElement* pElement);
387-
bool OnGPUSettingChanged(CGUIElement* pElement);
388386

389387
bool OnMouseDoubleClick(CGUIMouseEventArgs Args);
390388

Client/sdk/core/CWebCoreInterface.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class CWebCoreInterface
4949
{
5050
public:
5151
virtual ~CWebCoreInterface() {}
52-
virtual bool Initialise(bool gpuEnabled, bool gpuCompositingEnabled) = 0;
52+
virtual bool Initialise(bool gpuEnabled) = 0;
5353

5454
virtual CWebViewInterface* CreateWebView(unsigned int uiWidth, unsigned int uiHeight, bool bIsLocal, CWebBrowserItem* pWebBrowserRenderItem,
5555
bool bTransparent) = 0;
@@ -92,5 +92,4 @@ class CWebCoreInterface
9292
eWebFilterState state = eWebFilterState::WEBFILTER_ALL) = 0;
9393

9494
virtual bool GetGPUEnabled() const noexcept = 0;
95-
virtual bool GetGPUCompositingEnabled() const noexcept = 0;
9695
};

0 commit comments

Comments
 (0)