feat: 解决了opengl 默认chrome配置不调用的问题

This commit is contained in:
mozzie 2024-09-19 13:01:29 +08:00
parent a0f4ca2f3a
commit ba516af2f7
2 changed files with 8 additions and 3 deletions

View File

@ -39,6 +39,9 @@ const themeTitleBarStyles = {
export const platform = process.platform === "darwin" ? "macos" : "windows";
app.commandLine.appendSwitch('disable-web-security');
app.commandLine.appendSwitch('ignore-gpu-blocklist');
app.commandLine.appendSwitch('use-angle', 'gl');
// app.disableHardwareAcceleration()
function createWindow() {

View File

@ -6,20 +6,20 @@ export const initCornerstoneDICOMImageLoader = () => {
const { preferSizeOverAccuracy, useNorm16Texture } =
cornerstone.getConfiguration().rendering;
console.log("dddd", cornerstone.getConfiguration().rendering);
cornerstone.setUseSharedArrayBuffer(false);
cornerstone.setConfiguration({
detectGPUConfig: {
// benchmarksURL: "http://localhost:9000",
benchmarksURL: "",
},
rendering: {
...cornerstone.getConfiguration().rendering,
// useCPURendering: true,
// useNorm16Texture: true,
},
isMobile: false,
enableCacheOptimization: false,
});
console.log("preferSizeOverAccuracy", preferSizeOverAccuracy);
console.log("useNorm16Texture", useNorm16Texture);
cornerstoneDICOMImageLoader.external.cornerstone = cornerstone;
cornerstoneDICOMImageLoader.external.dicomParser = dicomParser;
@ -27,6 +27,7 @@ export const initCornerstoneDICOMImageLoader = () => {
useWebWorkers: true,
decodeConfig: {
convertFloatPixelDataToInt: false,
// use16BitDataType: false,
use16BitDataType: preferSizeOverAccuracy || useNorm16Texture,
},
});
@ -42,6 +43,7 @@ export const initCornerstoneDICOMImageLoader = () => {
startWebWorkersOnDemand: false,
taskConfiguration: {
decodeTask: {
useNorm16Texture: true,
initializeCodecsOnStartup: false,
strict: false,
},