feat: getGPUInfo not longer supports 'complete' on macOS
See https://chromium-review.googlesource.com/c/chromium/src/+/1208362
This commit is contained in:
parent
e28eeb0c2e
commit
a6256c672a
5 changed files with 14 additions and 8 deletions
|
@ -1173,7 +1173,7 @@ v8::Local<v8::Promise> App::GetGPUInfo(v8::Isolate* isolate,
|
||||||
|
|
||||||
auto* const info_mgr = GPUInfoManager::GetInstance();
|
auto* const info_mgr = GPUInfoManager::GetInstance();
|
||||||
if (info_type == "complete") {
|
if (info_type == "complete") {
|
||||||
#if defined(OS_MACOSX) || defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
info_mgr->FetchCompleteInfo(promise);
|
info_mgr->FetchCompleteInfo(promise);
|
||||||
#else
|
#else
|
||||||
info_mgr->FetchBasicInfo(promise);
|
info_mgr->FetchBasicInfo(promise);
|
||||||
|
|
|
@ -25,11 +25,9 @@ GPUInfoManager::~GPUInfoManager() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Based on
|
// Based on
|
||||||
// https://chromium.googlesource.com/chromium/src.git/+/66.0.3359.181/content/browser/gpu/gpu_data_manager_impl_private.cc#810
|
// https://chromium.googlesource.com/chromium/src.git/+/69.0.3497.106/content/browser/gpu/gpu_data_manager_impl_private.cc#810
|
||||||
bool GPUInfoManager::NeedsCompleteGpuInfoCollection() {
|
bool GPUInfoManager::NeedsCompleteGpuInfoCollection() {
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_WIN)
|
||||||
return gpu_data_manager_->GetGPUInfo().gl_vendor.empty();
|
|
||||||
#elif defined(OS_WIN)
|
|
||||||
const auto& gpu_info = gpu_data_manager_->GetGPUInfo();
|
const auto& gpu_info = gpu_data_manager_->GetGPUInfo();
|
||||||
return (gpu_info.dx_diagnostics.values.empty() &&
|
return (gpu_info.dx_diagnostics.values.empty() &&
|
||||||
gpu_info.dx_diagnostics.children.empty());
|
gpu_info.dx_diagnostics.children.empty());
|
||||||
|
|
|
@ -912,7 +912,7 @@ Returns [`GPUFeatureStatus`](structures/gpu-feature-status.md) - The Graphics Fe
|
||||||
Returns `Promise`
|
Returns `Promise`
|
||||||
|
|
||||||
For `infoType` equal to `complete`:
|
For `infoType` equal to `complete`:
|
||||||
Promise is fulfilled with `Object` containing all the GPU Information as in [chromium's GPUInfo object](https://chromium.googlesource.com/chromium/src.git/+/66.0.3359.181/gpu/config/gpu_info.cc). This includes the version and driver information that's shown on `chrome://gpu` page.
|
Promise is fulfilled with `Object` containing all the GPU Information as in [chromium's GPUInfo object](https://chromium.googlesource.com/chromium/src.git/+/69.0.3497.106/gpu/config/gpu_info.cc). This includes the version and driver information that's shown on `chrome://gpu` page.
|
||||||
|
|
||||||
For `infoType` equal to `basic`:
|
For `infoType` equal to `basic`:
|
||||||
Promise is fulfilled with `Object` containing fewer attributes than when requested with `complete`. Here's an example of basic response:
|
Promise is fulfilled with `Object` containing fewer attributes than when requested with `complete`. Here's an example of basic response:
|
||||||
|
|
|
@ -34,6 +34,14 @@ app.releaseSingleInstance()
|
||||||
app.releaseSingleInstanceLock()
|
app.releaseSingleInstanceLock()
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## `app.getGPUInfo`
|
||||||
|
|
||||||
|
```js
|
||||||
|
app.getGPUInfo('complete')
|
||||||
|
// Now behaves the same with `basic` on macOS
|
||||||
|
app.getGPUInfo('basic')
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
# Breaking API Changes (3.0)
|
# Breaking API Changes (3.0)
|
||||||
|
|
||||||
|
|
|
@ -846,8 +846,8 @@ describe('app module', () => {
|
||||||
|
|
||||||
it('succeeds with complete GPUInfo', async () => {
|
it('succeeds with complete GPUInfo', async () => {
|
||||||
const completeInfo = await getGPUInfo('complete')
|
const completeInfo = await getGPUInfo('complete')
|
||||||
if (process.platform === 'linux') {
|
if (process.platform === 'linux' || process.platform === 'darwin') {
|
||||||
// For linux complete info is same as basic info
|
// For linux and macOS complete info is same as basic info
|
||||||
await verifyBasicGPUInfo(completeInfo)
|
await verifyBasicGPUInfo(completeInfo)
|
||||||
const basicInfo = await getGPUInfo('basic')
|
const basicInfo = await getGPUInfo('basic')
|
||||||
expect(completeInfo).to.deep.equal(basicInfo)
|
expect(completeInfo).to.deep.equal(basicInfo)
|
||||||
|
|
Loading…
Reference in a new issue