diff options
Diffstat (limited to 'views/script/menu_gpuinfo.js')
-rw-r--r-- | views/script/menu_gpuinfo.js | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/views/script/menu_gpuinfo.js b/views/script/menu_gpuinfo.js new file mode 100644 index 0000000..4177cfc --- /dev/null +++ b/views/script/menu_gpuinfo.js @@ -0,0 +1,69 @@ +if (require('os').platform !== "darwin") { + gpuinfo = require('@electron/remote').app.getGPUFeatureStatus(); + document.write("kartik<br>"); + document.write("├ kartik.accel<br>"); + if (gpuinfo['2d_canvas'].startsWith("enabled")) { + document.write("│ ├ <span style='color:lightgreen;'>kartik.accel.Canvas</span><br>"); + } else { + document.write("│ ├ <span style='color:lightcoral;'>kartik.accel.Canvas</span><br>"); + } + if (gpuinfo['gpu_compositing'].startsWith("enabled")) { + document.write("│ ├ <span style='color:lightgreen;'>kartik.accel.Compositing</span><br>"); + } else { + document.write("│ ├ <span style='color:lightcoral;'>kartik.accel.Compositing</span><br>"); + } + if (gpuinfo['video_decode'].startsWith("enabled")) { + document.write("│ └ <span style='color:lightgreen;'>kartik.accel.VideoDecode</span><br>"); + } else { + document.write("│ └ <span style='color:lightcoral;'>kartik.accel.VideoDecode</span><br>"); + } + document.write("├ kartik.raster<br>"); + if (gpuinfo['multiple_raster_threads'].startsWith("enabled")) { + document.write("│ ├ <span style='color:lightgreen;'>kartik.raster.Threaded</span><br>"); + } else { + document.write("│ ├ <span style='color:lightcoral;'>kartik.raster.Threaded</span><br>"); + } + if (gpuinfo['oop_rasterization'].startsWith("enabled")) { + document.write("│ ├ <span style='color:lightgreen;'>kartik.raster.ObjectOP</span><br>"); + } else { + document.write("│ ├ <span style='color:lightcoral;'>kartik.raster.ObjectOP</span><br>"); + } + if (gpuinfo['rasterization'].startsWith("enabled")) { + document.write("│ └ <span style='color:lightgreen;'>kartik.raster.Common</span><br>"); + } else { + document.write("│ └ <span style='color:lightcoral;'>kartik.raster.Common</span><br>"); + } + document.write("└ kartik.renderer<br>"); + if (gpuinfo['opengl'].startsWith("enabled")) { + document.write(" ├ <span style='color:lightgreen;'>kartik.renderer.OpenGL</span><br>"); + } else { + document.write(" ├ <span style='color:lightcoral;'>kartik.renderer.OpenGL</span><br>"); + } + if (gpuinfo['skia_renderer'].startsWith("enabled")) { + document.write(" ├ <span style='color:lightgreen;'>kartik.renderer.Skia</span><br>"); + } else { + document.write(" ├ <span style='color:lightcoral;'>kartik.renderer.Skia</span><br>"); + } + if (gpuinfo['vulkan'].startsWith("enabled")) { + document.write(" └ <span style='color:lightgreen;'>kartik.renderer.Vulkan</span><br>"); + } else { + document.write(" └ <span style='color:lightcoral;'>kartik.renderer.Vulkan</span></span><br>"); + } +} else { + document.write("You are using macOS<br><br>Kartik can't detect GPU info<br>for Apple macOS."); +} + +document.onkeydown = (e) => { + if (e.shiftKey) { + document.getElementById('gpuinfo-inner').style.opacity = "1"; + document.getElementById('gpuinfo-outer').style.display = "none"; + } else { + document.getElementById('gpuinfo-inner').style.opacity = "0"; + document.getElementById('gpuinfo-outer').style.display = ""; + } +} + +document.onkeyup = (e) => { + document.getElementById('gpuinfo-inner').style.opacity = "0"; + document.getElementById('gpuinfo-outer').style.display = ""; +}
\ No newline at end of file |