diff --git a/modules/webbrowser/src/webbrowserapp.cpp b/modules/webbrowser/src/webbrowserapp.cpp index dc49bd8fa9..f5f1aa05ac 100644 --- a/modules/webbrowser/src/webbrowserapp.cpp +++ b/modules/webbrowser/src/webbrowserapp.cpp @@ -43,8 +43,9 @@ void WebBrowserApp::OnContextCreated(CefRefPtr, CefRefPtr, void WebBrowserApp::OnBeforeCommandLineProcessing(const CefString&, CefRefPtr commandLine) { -// command_line->AppendSwitch("disable-gpu"); -// command_line->AppendSwitch("disable-gpu-compositing"); + commandLine->AppendSwitch("disable-gpu"); + commandLine->AppendSwitch("disable-gpu-compositing"); + commandLine->AppendSwitch("enable-begin-frame-scheduling"); commandLine->AppendSwitchWithValue("autoplay-policy", "no-user-gesture-required"); } diff --git a/modules/webbrowser/webbrowsermodule.cpp b/modules/webbrowser/webbrowsermodule.cpp index bf11e5eb34..eb86fe070b 100644 --- a/modules/webbrowser/webbrowsermodule.cpp +++ b/modules/webbrowser/webbrowsermodule.cpp @@ -142,16 +142,6 @@ void WebBrowserModule::internalInitialize(const ghoul::Dictionary& dictionary) { _cefHost = std::make_unique(_webHelperLocation); LDEBUG("Starting CEF... done!"); - global::callback::preSync.emplace_back([this]() { - if (_cefHost && !_browsers.empty()) { - _cefHost->doMessageLoopWork(); - - const std::chrono::time_point timeAfter = - std::chrono::high_resolution_clock::now(); - webbrowser::latestCall = timeAfter; - } - }); - if (dictionary.hasValue(UpdateBrowserBetweenRenderablesInfo.identifier)) { _updateBrowserBetweenRenderables = dictionary.value(UpdateBrowserBetweenRenderablesInfo.identifier); @@ -218,14 +208,18 @@ bool WebBrowserModule::isEnabled() const { return _enabled; } -namespace webbrowser { - /** * Logic for the webbrowser performance hotfix, * described in more detail in globalscallbacks.h. */ +namespace webbrowser { -std::chrono::microseconds interval = std::chrono::microseconds(1); + /** +* The time interval to describe how often the CEF message loop needs to +* be pumped to work properly. A value of 10000 us updates CEF a 100 times +* per second which is enough for fluid interaction without wasting resources +*/ +std::chrono::microseconds interval = std::chrono::microseconds(10000); std::chrono::time_point latestCall; CefHost* cefHost = nullptr;