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"; export const platform = process.platform === "darwin" ? "macos" : "windows";
app.commandLine.appendSwitch('disable-web-security'); app.commandLine.appendSwitch('disable-web-security');
app.commandLine.appendSwitch('ignore-gpu-blocklist');
app.commandLine.appendSwitch('use-angle', 'gl');
// app.disableHardwareAcceleration() // app.disableHardwareAcceleration()
function createWindow() { function createWindow() {

View File

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