Changeset 247521 in webkit


Ignore:
Timestamp:
Jul 17, 2019 10:50:45 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Make ANGLE work inside WebKit2's sandbox
https://bugs.webkit.org/show_bug.cgi?id=199844

Patch by Kenneth Russell <kbr@chromium.org> on 2019-07-17
Reviewed by Alex Christensen.

Source/ThirdParty/ANGLE:

Cherry-pick fix for crbug.com/angleproject/3383 to eliminate use
of deprecated API in SystemInfo_mac.mm.

  • BUILD.gn:
  • src/gpu_info_util/SystemInfo.cpp:

(angle::FindActiveGPU):
(angle::PrintSystemInfo):
(angle::FindPrimaryGPU): Deleted.

  • src/gpu_info_util/SystemInfo.h:
  • src/gpu_info_util/SystemInfo_internal.h:
  • src/gpu_info_util/SystemInfo_linux.cpp:

(angle::GetSystemInfo):

  • src/gpu_info_util/SystemInfo_mac.mm:

(angle::GetSystemInfo):

  • src/gpu_info_util/SystemInfo_win.cpp:

(angle::GetSystemInfo):

  • src/tests/BUILD.gn:
  • src/tests/test_expectations/GPUTestConfig.cpp:
  • src/tests/test_utils/angle_test_instantiate.cpp:

(angle::IsConfigWhitelisted):

Source/WebCore:

Fix missing #import introduced at the last minute while removing
some debugging code in the last patch.

Tested with San Angeles WebGL demo and some conformance tests.

  • platform/graphics/cocoa/WebGLLayer.mm:
Location:
trunk/Source
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/ThirdParty/ANGLE/BUILD.gn

    r245088 r247521  
    290290
    291291angle_static_library("angle_gpu_info_util") {
    292   public_configs += [ ":angle_gpu_info_util_config" ]
     292  public_configs += [
     293    ":angle_gpu_info_util_config",
     294    ":angle_backend_config",
     295  ]
    293296  public_deps = [
    294297    ":angle_common",
     
    306309    sources += libangle_gpu_info_util_win_sources
    307310    libs += [ "setupapi.lib" ]
    308     defines += [ "GPU_INFO_USE_SETUPAPI" ]
     311    libs += [ "dxgi.lib" ]
    309312  }
    310313
     
    444447}
    445448
     449config("angle_backend_config") {
     450  defines = []
     451
     452  if (angle_enable_d3d9) {
     453    defines += [ "ANGLE_ENABLE_D3D9" ]
     454  }
     455  if (angle_enable_d3d11) {
     456    defines += [ "ANGLE_ENABLE_D3D11" ]
     457  }
     458  if (angle_enable_gl) {
     459    defines += [ "ANGLE_ENABLE_OPENGL" ]
     460    if (use_x11) {
     461      defines += [ "ANGLE_USE_X11" ]
     462    }
     463    if (angle_enable_gl_null) {
     464      defines += [ "ANGLE_ENABLE_OPENGL_NULL" ]
     465    }
     466  }
     467  if (angle_enable_vulkan) {
     468    defines += [ "ANGLE_ENABLE_VULKAN" ]
     469    if (angle_enable_custom_vulkan_cmd_buffers) {
     470      defines += [ "ANGLE_USE_CUSTOM_VULKAN_CMD_BUFFERS=1" ]
     471    }
     472  }
     473  if (angle_enable_null) {
     474    defines += [ "ANGLE_ENABLE_NULL" ]
     475  }
     476}
     477
    446478config("libANGLE_config") {
    447479  cflags = []
     
    450482  ldflags = []
    451483  if (angle_enable_d3d9) {
    452     defines += [ "ANGLE_ENABLE_D3D9" ]
    453484    ldflags += [ "/DELAYLOAD:d3d9.dll" ]
    454   }
    455   if (angle_enable_d3d11) {
    456     defines += [ "ANGLE_ENABLE_D3D11" ]
    457   }
    458   if (angle_enable_gl) {
    459     defines += [ "ANGLE_ENABLE_OPENGL" ]
    460     if (use_x11) {
    461       defines += [ "ANGLE_USE_X11" ]
    462     }
    463     if (angle_enable_gl_null) {
    464       defines += [ "ANGLE_ENABLE_OPENGL_NULL" ]
    465     }
    466   }
    467   if (angle_enable_vulkan) {
    468     defines += [ "ANGLE_ENABLE_VULKAN" ]
    469     if (angle_enable_custom_vulkan_cmd_buffers) {
    470       defines += [ "ANGLE_USE_CUSTOM_VULKAN_CMD_BUFFERS=1" ]
    471     }
    472   }
    473   if (angle_enable_null) {
    474     defines += [ "ANGLE_ENABLE_NULL" ]
    475485  }
    476486  defines += [ "LIBANGLE_IMPLEMENTATION" ]
     
    666676
    667677  configs += [ ":debug_annotations_config" ]
    668   public_configs += [ ":libANGLE_config" ]
     678  public_configs += [
     679    ":libANGLE_config",
     680    ":angle_backend_config",
     681  ]
    669682
    670683  # Windows ARM64 is available since 10.0.16299 so no need to copy
  • trunk/Source/ThirdParty/ANGLE/ChangeLog

    r247324 r247521  
     12019-07-17  Kenneth Russell  <kbr@chromium.org>
     2
     3        Make ANGLE work inside WebKit2's sandbox
     4        https://bugs.webkit.org/show_bug.cgi?id=199844
     5
     6        Reviewed by Alex Christensen.
     7
     8        Cherry-pick fix for crbug.com/angleproject/3383 to eliminate use
     9        of deprecated API in SystemInfo_mac.mm.
     10
     11        * BUILD.gn:
     12        * src/gpu_info_util/SystemInfo.cpp:
     13        (angle::FindActiveGPU):
     14        (angle::PrintSystemInfo):
     15        (angle::FindPrimaryGPU): Deleted.
     16        * src/gpu_info_util/SystemInfo.h:
     17        * src/gpu_info_util/SystemInfo_internal.h:
     18        * src/gpu_info_util/SystemInfo_linux.cpp:
     19        (angle::GetSystemInfo):
     20        * src/gpu_info_util/SystemInfo_mac.mm:
     21        (angle::GetSystemInfo):
     22        * src/gpu_info_util/SystemInfo_win.cpp:
     23        (angle::GetSystemInfo):
     24        * src/tests/BUILD.gn:
     25        * src/tests/test_expectations/GPUTestConfig.cpp:
     26        * src/tests/test_utils/angle_test_instantiate.cpp:
     27        (angle::IsConfigWhitelisted):
     28
    1292019-07-10  Alex Christensen  <achristensen@webkit.org>
    230
  • trunk/Source/ThirdParty/ANGLE/src/gpu_info_util/SystemInfo.cpp

    r245248 r247521  
    239239}
    240240
    241 void FindPrimaryGPU(SystemInfo *info)
     241void FindActiveGPU(SystemInfo *info)
    242242{
    243243    ASSERT(!info->gpus.empty());
    244244
    245     // On dual-GPU systems we assume the non-Intel GPU is the primary one.
    246     int primary   = 0;
     245    // On dual-GPU systems we assume the non-Intel GPU is the graphics one.
     246    int active    = 0;
    247247    bool hasIntel = false;
    248248    for (size_t i = 0; i < info->gpus.size(); ++i)
     
    252252            hasIntel = true;
    253253        }
    254         if (IsIntel(info->gpus[primary].vendorId))
    255         {
    256             primary = static_cast<int>(i);
     254        if (IsIntel(info->gpus[active].vendorId))
     255        {
     256            active = static_cast<int>(i);
    257257        }
    258258    }
    259259
    260260    // Assume that a combination of NVIDIA or AMD with Intel means Optimus or AMD Switchable
    261     info->primaryGPUIndex = primary;
    262     info->isOptimus       = hasIntel && IsNVIDIA(info->gpus[primary].vendorId);
    263     info->isAMDSwitchable = hasIntel && IsAMD(info->gpus[primary].vendorId);
     261    info->activeGPUIndex  = active;
     262    info->primaryGPUIndex = active;
     263    info->isOptimus       = hasIntel && IsNVIDIA(info->gpus[active].vendorId);
     264    info->isAMDSwitchable = hasIntel && IsAMD(info->gpus[active].vendorId);
    264265}
    265266
     
    290291    std::cout << "\n";
    291292    std::cout << "Active GPU: " << info.activeGPUIndex << "\n";
    292     std::cout << "Primary GPU: " << info.primaryGPUIndex << "\n";
    293293
    294294    std::cout << "\n";
     
    309309        std::cout << "Machine Model Version: " << info.machineModelVersion << "\n";
    310310    }
    311     if (!info.primaryDisplayDeviceId.empty())
    312     {
    313         std::cout << "Primary Display Device: " << info.primaryDisplayDeviceId << "\n";
    314     }
    315311    std::cout << std::endl;
    316312}
  • trunk/Source/ThirdParty/ANGLE/src/gpu_info_util/SystemInfo.h

    r245088 r247521  
    5959    std::vector<GPUDeviceInfo> gpus;
    6060
    61     // Index of the primary GPU (the discrete one on dual GPU systems) in `gpus`.
    62     // Will never be -1 after a successful GetSystemInfo.
     61    // Index of the GPU expected to be used for 3D graphics. Based on a best-guess heuristic on
     62    // some platforms. On windows, this is accurate.
     63    int activeGPUIndex = -1;
     64
     65    // Deprecated, same as activeGPUIndex
    6366    int primaryGPUIndex = -1;
    64     // Index of the currently active GPU in `gpus`, can be -1 if the active GPU could not be
    65     // detected.
    66     int activeGPUIndex = -1;
    6767
    6868    bool isOptimus       = false;
     
    7979    // Only available on macOS
    8080    std::string machineModelVersion;
    81 
    82     // Only available on Windows, set even on failure.
    83     std::string primaryDisplayDeviceId;
    8481};
    8582
  • trunk/Source/ThirdParty/ANGLE/src/gpu_info_util/SystemInfo_internal.h

    r215490 r247521  
    3030bool CMDeviceIDToDeviceAndVendorID(const std::string &id, uint32_t *vendorId, uint32_t *deviceId);
    3131
    32 // In the case there are multiple GPUs, this finds the primary one and sets Optimus or AMD
    33 // Switchable
    34 void FindPrimaryGPU(SystemInfo *info);
     32// Use a heuristic to attempt to find the GPU used for 3D graphics. Sets activeGPUIndex,
     33// isOptimus, and isAMDSwitchable. Deprecated: also sets primaryGPUIndex.
     34void FindActiveGPU(SystemInfo *info);
    3535
    3636}  // namespace angle
  • trunk/Source/ThirdParty/ANGLE/src/gpu_info_util/SystemInfo_linux.cpp

    r245088 r247521  
    8282    }
    8383
    84     FindPrimaryGPU(info);
     84    FindActiveGPU(info);
    8585
    8686    for (size_t i = 0; i < info->gpus.size(); ++i)
     
    119119        }
    120120
    121         // In dual-GPU cases the PCI scan sometimes only gives us the Intel GPU.
    122         // If we are able to query for the Nvidia driver version, it means there
    123         // was hidden Nvidia GPU, so we add it to the list and make it primary.
     121        // In dual-GPU cases the PCI scan sometimes only gives us the Intel GPU. If we are able to
     122        // query for the Nvidia driver version, it means there was hidden Nvidia GPU, so we add it
     123        // to the list.
    124124        if (IsIntel(gpu->vendorId) && info->gpus.size() == 1)
    125125        {
  • trunk/Source/ThirdParty/ANGLE/src/gpu_info_util/SystemInfo_mac.mm

    r245248 r247521  
    7373}
    7474
    75 // CGDisplayIOServicePort is deprecated as of macOS 10.9, but has no replacement, see
    76 // https://crbug.com/650837
    77 #pragma clang diagnostic push
    78 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
    79 
    80 // Find the info of the current GPU.
    81 bool GetActiveGPU(VendorID *vendorId, DeviceID *deviceId)
    82 {
    83     io_registry_entry_t port = CGDisplayIOServicePort(kCGDirectMainDisplay);
    84 
    85     return GetEntryProperty(port, CFSTR("vendor-id"), vendorId) &&
    86            GetEntryProperty(port, CFSTR("device-id"), deviceId);
    87 }
    88 
    89 #pragma clang diagnostic pop
    90 
    9175// Gathers the vendor and device IDs for the PCI GPUs
    9276bool GetPCIDevices(std::vector<GPUDeviceInfo> *devices)
     
    146130    }
    147131
    148     // Find the active GPU
    149     {
    150         VendorID activeVendor;
    151         DeviceID activeDevice;
    152         if (!GetActiveGPU(&activeVendor, &activeDevice))
    153         {
    154             return false;
    155         }
    156 
    157         for (size_t i = 0; i < info->gpus.size(); ++i)
    158         {
    159             if (info->gpus[i].vendorId == activeVendor && info->gpus[i].deviceId == activeDevice)
    160             {
    161                 info->activeGPUIndex = static_cast<int>(i);
    162                 break;
    163             }
    164         }
    165     }
    166 
    167     FindPrimaryGPU(info);
     132    FindActiveGPU(info);
    168133
    169134    // Figure out whether this is a dual-GPU system.
  • trunk/Source/ThirdParty/ANGLE/src/gpu_info_util/SystemInfo_win.cpp

    r245088 r247521  
    1515#include <windows.h>
    1616
    17 #if defined(GPU_INFO_USE_SETUPAPI)
    18 // Remove parts of commctrl.h that have compile errors
    19 #    define NOTOOLBAR
    20 #    define NOTOOLTIPS
    21 #    include <cfgmgr32.h>
    22 #    include <setupapi.h>
    23 #elif defined(GPU_INFO_USE_DXGI)
    24 #    include <d3d10.h>
    25 #    include <dxgi.h>
    26 #else
    27 #    error "SystemInfo_win needs at least GPU_INFO_USE_SETUPAPI or GPU_INFO_USE_DXGI defined"
    28 #endif
     17#include <d3d10.h>
     18#include <dxgi.h>
    2919
    3020#include <array>
     
    3626namespace
    3727{
    38 
    39 // Returns the CM device ID of the primary GPU.
    40 std::string GetPrimaryDisplayDeviceId()
    41 {
    42     DISPLAY_DEVICEA displayDevice;
    43     displayDevice.cb = sizeof(DISPLAY_DEVICEA);
    44 
    45     for (int i = 0; EnumDisplayDevicesA(nullptr, i, &displayDevice, 0); ++i)
    46     {
    47         if (displayDevice.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE)
    48         {
    49             return displayDevice.DeviceID;
    50         }
    51     }
    52 
    53     return "";
    54 }
    55 
    56 #if defined(GPU_INFO_USE_SETUPAPI)
    57 
    58 std::string GetRegistryStringValue(HKEY key, const char *valueName)
    59 {
    60     std::array<char, 255> value;
    61     DWORD valueSize = sizeof(value);
    62     if (RegQueryValueExA(key, valueName, nullptr, nullptr, reinterpret_cast<LPBYTE>(value.data()),
    63                          &valueSize) == ERROR_SUCCESS)
    64     {
    65         return value.data();
    66     }
    67     return "";
    68 }
    69 
    70 // Gathers information about the devices from the registry. The reason why we aren't using
    71 // a dedicated API such as DXGI is that we need information like the driver vendor and date.
    72 // DXGI doesn't provide a way to know the device registry key from an IDXGIAdapter.
    73 bool GetDevicesFromRegistry(std::vector<GPUDeviceInfo> *devices)
    74 {
    75     // Display adapter class GUID from
    76     // https://msdn.microsoft.com/en-us/library/windows/hardware/ff553426%28v=vs.85%29.aspx
    77     GUID displayClass = {
    78         0x4d36e968, 0xe325, 0x11ce, {0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18}};
    79 
    80     HDEVINFO deviceInfo = SetupDiGetClassDevsW(&displayClass, nullptr, nullptr, DIGCF_PRESENT);
    81 
    82     if (deviceInfo == INVALID_HANDLE_VALUE)
    83     {
    84         return false;
    85     }
    86 
    87     // This iterates over the devices of the "Display adapter" class
    88     DWORD deviceIndex = 0;
    89     SP_DEVINFO_DATA deviceData;
    90     deviceData.cbSize = sizeof(deviceData);
    91     while (SetupDiEnumDeviceInfo(deviceInfo, deviceIndex++, &deviceData))
    92     {
    93         // The device and vendor IDs can be gathered directly, but information about the driver
    94         // requires some registry digging
    95         char fullDeviceID[MAX_DEVICE_ID_LEN];
    96         if (CM_Get_Device_IDA(deviceData.DevInst, fullDeviceID, MAX_DEVICE_ID_LEN, 0) != CR_SUCCESS)
    97         {
    98             continue;
    99         }
    100 
    101         GPUDeviceInfo device;
    102 
    103         if (!CMDeviceIDToDeviceAndVendorID(fullDeviceID, &device.vendorId, &device.deviceId))
    104         {
    105             continue;
    106         }
    107 
    108         // The driver key will end with something like {<displayClass>}/<4 digit number>.
    109         std::array<WCHAR, 255> value;
    110         if (!SetupDiGetDeviceRegistryPropertyW(deviceInfo, &deviceData, SPDRP_DRIVER, nullptr,
    111                                                reinterpret_cast<PBYTE>(value.data()), sizeof(value),
    112                                                nullptr))
    113         {
    114             continue;
    115         }
    116 
    117         std::wstring driverKey = L"System\\CurrentControlSet\\Control\\Class\\";
    118         driverKey += value.data();
    119 
    120         HKEY key;
    121         if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, driverKey.c_str(), 0, KEY_QUERY_VALUE, &key) !=
    122             ERROR_SUCCESS)
    123         {
    124             continue;
    125         }
    126 
    127         device.driverVersion = GetRegistryStringValue(key, "DriverVersion");
    128         device.driverDate    = GetRegistryStringValue(key, "DriverDate");
    129         device.driverVendor  = GetRegistryStringValue(key, "ProviderName");
    130 
    131         RegCloseKey(key);
    132 
    133         devices->push_back(device);
    134     }
    135 
    136     SetupDiDestroyDeviceInfoList(deviceInfo);
    137 
    138     return true;
    139 }
    140 
    141 #elif defined(GPU_INFO_USE_DXGI)
    14228
    14329bool GetDevicesFromDXGI(std::vector<GPUDeviceInfo> *devices)
     
    18672    factory->Release();
    18773
    188     return true;
     74    return (i > 0);
    18975}
    190 
    191 #else
    192 #    error
    193 #endif
    19476
    19577}  // anonymous namespace
     
    19779bool GetSystemInfo(SystemInfo *info)
    19880{
    199     // Get the CM device ID first so that it is returned even in error cases.
    200     info->primaryDisplayDeviceId = GetPrimaryDisplayDeviceId();
    201 
    202 #if defined(GPU_INFO_USE_SETUPAPI)
    203     if (!GetDevicesFromRegistry(&info->gpus))
    204     {
    205         return false;
    206     }
    207 #elif defined(GPU_INFO_USE_DXGI)
    20881    if (!GetDevicesFromDXGI(&info->gpus))
    20982    {
    21083        return false;
    21184    }
    212 #else
    213 #    error
    214 #endif
    21585
    21686    if (info->gpus.size() == 0)
     
    21989    }
    22090
    221     FindPrimaryGPU(info);
     91    // Call FindActiveGPU to populate activeGPUIndex, isOptimus, and isAMDSwitchable.
     92    FindActiveGPU(info);
    22293
    223     // Override the primary GPU index with what we gathered from EnumDisplayDevices
    224     uint32_t primaryVendorId = 0;
    225     uint32_t primaryDeviceId = 0;
     94    // Override activeGPUIndex. The first index returned by EnumAdapters is the active GPU. We
     95    // can override the heuristic to find the active GPU
     96    info->activeGPUIndex = 0;
     97    // Deprecated: set primaryGPUIndex to the same index.
     98    info->primaryGPUIndex = 0;
    22699
    227     if (!CMDeviceIDToDeviceAndVendorID(info->primaryDisplayDeviceId, &primaryVendorId,
    228                                        &primaryDeviceId))
    229     {
    230         return false;
    231     }
    232 
    233     bool foundPrimary = false;
    234     for (size_t i = 0; i < info->gpus.size(); ++i)
    235     {
    236         if (info->gpus[i].vendorId == primaryVendorId && info->gpus[i].deviceId == primaryDeviceId)
    237         {
    238             info->primaryGPUIndex = static_cast<int>(i);
    239             foundPrimary          = true;
    240         }
    241     }
    242     ASSERT(foundPrimary);
    243 
    244     // nvd3d9wrap.dll is loaded into all processes when Optimus is enabled.
     100    // Override isOptimus. nvd3d9wrap.dll is loaded into all processes when Optimus is enabled.
    245101    HMODULE nvd3d9wrap = GetModuleHandleW(L"nvd3d9wrap.dll");
    246102    info->isOptimus    = nvd3d9wrap != nullptr;
  • trunk/Source/ThirdParty/ANGLE/src/tests/BUILD.gn

    r245088 r247521  
    542542      "${angle_root}:libANGLE_config",
    543543      "${angle_root}:library_name_config",
     544      "${angle_root}:angle_backend_config",
    544545    ]
    545546
  • trunk/Source/ThirdParty/ANGLE/src/tests/test_expectations/GPUTestConfig.cpp

    r245088 r247521  
    332332}
    333333
    334 // Get the primary GPUDeviceInfo from the SystemInfo struct.
    335 // Returns false if devInfo is not guaranteed to be set to the primary device.
    336 inline bool GetPrimaryGPU(GPUDeviceInfo **devInfo)
     334// Get the active GPUDeviceInfo from the SystemInfo struct.
     335// Returns false if devInfo is not guaranteed to be set to the active device.
     336inline bool GetActiveGPU(GPUDeviceInfo **devInfo)
    337337{
    338338    SystemInfo *systemInfo = nullptr;
     
    344344    // Default to the first index
    345345    uint32_t index = 0;
    346     // See if the primaryGPUIndex was set first
    347     if (systemInfo->primaryGPUIndex != -1)
    348     {
    349         index = systemInfo->primaryGPUIndex;
     346    // See if the activeGPUIndex was set first
     347    if (systemInfo->activeGPUIndex != -1)
     348    {
     349        index = systemInfo->activeGPUIndex;
    350350    }
    351351    ASSERT(index < systemInfo->gpus.size());
     
    354354}
    355355
    356 // Get the vendor ID of the primary GPU from the SystemInfo struct.
     356// Get the vendor ID of the active GPU from the SystemInfo struct.
    357357// Returns 0 if there is an error.
    358 inline VendorID GetPrimaryGPUVendorID()
    359 {
    360     GPUDeviceInfo *primaryGPU = nullptr;
    361     if (GetPrimaryGPU(&primaryGPU))
    362     {
    363         return primaryGPU->vendorId;
     358inline VendorID GetActiveGPUVendorID()
     359{
     360    GPUDeviceInfo *activeGPU = nullptr;
     361    if (GetActiveGPU(&activeGPU))
     362    {
     363        return activeGPU->vendorId;
    364364    }
    365365    else
     
    369369}
    370370
    371 // Get the device ID of the primary GPU from the SystemInfo struct.
     371// Get the device ID of the active GPU from the SystemInfo struct.
    372372// Returns 0 if there is an error.
    373 inline DeviceID GetPrimaryGPUDeviceID()
    374 {
    375     GPUDeviceInfo *primaryGPU = nullptr;
    376     if (GetPrimaryGPU(&primaryGPU))
    377     {
    378         return primaryGPU->deviceId;
     373inline DeviceID GetActiveGPUDeviceID()
     374{
     375    GPUDeviceInfo *activeGPU = nullptr;
     376    if (GetActiveGPU(&activeGPU))
     377    {
     378        return activeGPU->deviceId;
    379379    }
    380380    else
     
    384384}
    385385
    386 // Check whether the primary GPU is NVIDIA.
     386// Check whether the active GPU is NVIDIA.
    387387inline bool IsNVIDIA()
    388388{
    389     return angle::IsNVIDIA(GetPrimaryGPUVendorID());
    390 }
    391 
    392 // Check whether the primary GPU is AMD.
     389    return angle::IsNVIDIA(GetActiveGPUVendorID());
     390}
     391
     392// Check whether the active GPU is AMD.
    393393inline bool IsAMD()
    394394{
    395     return angle::IsAMD(GetPrimaryGPUVendorID());
    396 }
    397 
    398 // Check whether the primary GPU is Intel.
     395    return angle::IsAMD(GetActiveGPUVendorID());
     396}
     397
     398// Check whether the active GPU is Intel.
    399399inline bool IsIntel()
    400400{
    401     return angle::IsIntel(GetPrimaryGPUVendorID());
    402 }
    403 
    404 // Check whether the primary GPU is VMWare.
     401    return angle::IsIntel(GetActiveGPUVendorID());
     402}
     403
     404// Check whether the active GPU is VMWare.
    405405inline bool IsVMWare()
    406406{
    407     return angle::IsVMWare(GetPrimaryGPUVendorID());
     407    return angle::IsVMWare(GetActiveGPUVendorID());
    408408}
    409409
     
    461461        return false;
    462462    }
    463     return (deviceId == GetPrimaryGPUDeviceID());
     463    return (deviceId == GetActiveGPUDeviceID());
    464464}
    465465
  • trunk/Source/ThirdParty/ANGLE/src/tests/test_utils/angle_test_instantiate.cpp

    r245088 r247521  
    186186bool IsConfigWhitelisted(const SystemInfo &systemInfo, const PlatformParameters &param)
    187187{
    188     VendorID vendorID = systemInfo.gpus[systemInfo.primaryGPUIndex].vendorId;
     188    VendorID vendorID = systemInfo.gpus[systemInfo.activeGPUIndex].vendorId;
    189189
    190190    // We support the default and null back-ends on every platform.
  • trunk/Source/WebCore/ChangeLog

    r247519 r247521  
     12019-07-17  Kenneth Russell  <kbr@chromium.org>
     2
     3        Make ANGLE work inside WebKit2's sandbox
     4        https://bugs.webkit.org/show_bug.cgi?id=199844
     5
     6        Reviewed by Alex Christensen.
     7
     8        Fix missing #import introduced at the last minute while removing
     9        some debugging code in the last patch.
     10
     11        Tested with San Angeles WebGL demo and some conformance tests.
     12
     13        * platform/graphics/cocoa/WebGLLayer.mm:
     14
    1152019-07-17  Andres Gonzalez  <andresg_22@apple.com>
    216
  • trunk/Source/WebCore/platform/graphics/cocoa/WebGLLayer.mm

    r247315 r247521  
    3434#import "GraphicsLayerCA.h"
    3535#import "ImageBufferUtilitiesCG.h"
     36#import "NotImplemented.h"
    3637#import "PlatformCALayer.h"
    3738#import <pal/spi/cocoa/QuartzCoreSPI.h>
Note: See TracChangeset for help on using the changeset viewer.