Issue/2244 different mouse cursors (#3388)

* Update CEF version number

* Set OpenSpace_Helper version of C++ to 20

* Update C++ syntax to v 20

* Remove deprecated function (now default)

* Set the cache folder for cef

* Make static function in webbrowsermodule that determines if we can use accelerated rendering

* Add flag for accelerated rendering to webrenderhandler

* Use accelerated rendering

* Implement function to see if gui should absorb click

* Adhere to 80 char linewidth

* Make only the UI GPU accelerated

* Use dirty rects size for the texture to remove crash

* Better comments

* Make has content function work for GPU acceleration

* Make it so all browsers can be accelerated

Tried making it so only the gui was accelerated for simplicity. Performance plummeted, so reverted that

* Tidy up

* Add accelerated rendering flag to the screenspacerenderable shader

* Add temporary fix to make the sky browser work

* Remove flag from gui render handler

* Enable webgl in a nicer way

* Unbind texture in screenspacerenderable

* Add better comments for error handling

* Tidy up

* Address PR comments

* Make the acceleration Windows only

* Remove unnecessary setting of shader dictionary

* Add display handler to browser client

* Make glfw change mouse cursor depending on cef cursor

* formatting

* Add switch to main

* Update modules/webbrowser/src/browserclient.cpp

Co-authored-by: Alexander Bock <alexander.bock@liu.se>

* Address comments on PR

* Update again

* Update modules/webbrowser/src/browserclient.cpp

Co-authored-by: Emma Broman <emma.broman@liu.se>

* Address PR comments

---------

Co-authored-by: Ylva Selling <ylva.selling@liu.se>
Co-authored-by: Alexander Bock <alexander.bock@liu.se>
Co-authored-by: Emma Broman <emma.broman@liu.se>
This commit is contained in:
Ylva Selling
2024-08-28 10:44:17 +02:00
committed by GitHub
parent fd586e30a3
commit aed2c0b0c8
6 changed files with 128 additions and 3 deletions

View File

@@ -51,6 +51,13 @@ public:
IMPLEMENT_REFCOUNTING(NoContextMenuHandler);
};
class DisplayHandler : public CefDisplayHandler {
bool OnCursorChange(CefRefPtr<CefBrowser> browser,
CefCursorHandle cursor,
cef_cursor_type_t type,
const CefCursorInfo& custom_cursor_info) override;
IMPLEMENT_REFCOUNTING(DisplayHandler);
};
BrowserClient(WebRenderHandler* handler, WebKeyboardHandler* keyboardHandler);
CefRefPtr<CefRenderHandler> GetRenderHandler() override;
@@ -58,6 +65,7 @@ public:
CefRefPtr<CefRequestHandler> GetRequestHandler() override;
CefRefPtr<CefKeyboardHandler> GetKeyboardHandler() override;
CefRefPtr<CefContextMenuHandler> GetContextMenuHandler() override;
CefRefPtr<CefDisplayHandler> GetDisplayHandler() override;
private:
CefRefPtr<CefRenderHandler> _renderHandler;
@@ -65,6 +73,7 @@ private:
CefRefPtr<CefLifeSpanHandler> _lifeSpanHandler;
CefRefPtr<CefRequestHandler> _requestHandler;
CefRefPtr<CefContextMenuHandler> _contextMenuHandler;
CefRefPtr<CefDisplayHandler> _displayHandler;
IMPLEMENT_REFCOUNTING(BrowserClient);
};

View File

@@ -57,9 +57,10 @@ class WebKeyboardHandler;
class BrowserInstance {
public:
static constexpr int SingleClick = 1;
// @TODO (ylvse 2024-08-20): remove third argument when the sky browser rewrite is done.
// The browser instance should always accelerate the rendering if possible but for
// now the skybrowser is not accelerated. Will be when the rewrite is done.
// @TODO (ylvse 2024-08-20): remove third argument when the sky browser rewrite is
// done.
// The browser instance should always accelerate the rendering if possible but for
// now the skybrowser is not accelerated. Will be when the rewrite is done.
BrowserInstance(WebRenderHandler* renderer,
WebKeyboardHandler* keyboardHandler,
bool accelerateRendering = true

View File

@@ -37,6 +37,7 @@
#endif // _MSC_VER
#include <include/cef_render_handler.h>
#include <include/cef_display_handler.h>
#ifdef _MSC_VER
#pragma warning (pop)