소스 검색

feat(webgl): linux

Keeping up with the joneses
- https://github.com/Boscop/web-view/pull/76
Daniel Thompson-Yvetot 5 년 전
부모
커밋
15a80d349a
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      ui/tauri-gtk.c

+ 7 - 0
ui/tauri-gtk.c

@@ -83,6 +83,13 @@ WEBVIEW_API int webview_init(struct webview *w) {
                    G_CALLBACK(webview_load_changed_cb), w);
   gtk_container_add(GTK_CONTAINER(w->priv.scroller), w->priv.webview);
 
+  WebKitSettings *settings =
+      webkit_web_view_get_settings(WEBKIT_WEB_VIEW(w->priv.webview));
+
+  // Enable webgl and canvas features.
+  webkit_settings_set_enable_webgl(settings, true);
+  webkit_settings_set_enable_accelerated_2d_canvas(settings, true);
+
   if (w->debug) {
     WebKitSettings *settings =
         webkit_web_view_get_settings(WEBKIT_WEB_VIEW(w->priv.webview));