From f383e7b44ddfdcf189b5abe595db2c7aac0db354 Mon Sep 17 00:00:00 2001 From: Alexis Hetu Date: Thu, 7 Apr 2022 18:56:42 +0000 Subject: [PATCH] Remove legacy SwiftShader MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: chromium:1060139 Change-Id: I7e0a186a2a47c1c85bee53f2179f2e5c6b63882d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3380402 Reviewed-by: Lei Zhang Reviewed-by: Sergey Ulanov Reviewed-by: Robert Sesek Reviewed-by: danakj Reviewed-by: Robert Kroeger Reviewed-by: Polina Bondarenko Reviewed-by: Zhenyao Mo Reviewed-by: Erik Chen Reviewed-by: Yuly Novikov Reviewed-by: Peter Kvitek Reviewed-by: Samuel Huang Commit-Queue: Alexis Hétu Cr-Commit-Position: refs/heads/main@{#990043} --- .../enterprise/arc_data_snapshotd_manager.cc | 4 +- chrome/BUILD.gn | 44 +------------------ chrome/installer/linux/BUILD.gn | 32 +------------- .../installer/linux/common/installer.include | 9 ---- chrome/installer/mac/signing/parts.py | 2 - .../installer/mini_installer/chrome.release | 6 --- chrome/tools/build/win/FILES.cfg | 20 --------- content/shell/BUILD.gn | 7 +-- fuchsia/engine/BUILD.gn | 2 - fuchsia/runners/BUILD.gn | 2 - gpu/command_buffer/service/feature_info.cc | 5 +-- gpu/config/gpu_info_collector.cc | 21 +-------- gpu/config/gpu_util.cc | 3 +- gpu/ipc/service/gpu_init.cc | 11 ++--- .../service/image_transport_surface_mac.mm | 1 - headless/public/headless_browser.cc | 11 ++--- infra/archive_config/win-archive-rel.json | 4 -- infra/archive_config/win-tagged.json | 2 - infra/archive_config/win32-archive-rel.json | 4 -- infra/scripts/sizes.py | 2 - tools/binary_size/sizes.py | 2 - .../deterministic_build_ignorelist.pyl | 4 -- ui/gl/BUILD.gn | 11 ----- ui/gl/gl_context.cc | 1 - ui/gl/gl_image_io_surface.mm | 5 +-- ui/gl/gl_image_io_surface_egl.h | 10 +---- ui/gl/gl_image_io_surface_egl.mm | 16 ++----- ui/gl/gl_implementation.cc | 28 +----------- ui/gl/gl_implementation.h | 8 +--- ui/gl/gl_surface_egl.cc | 13 ------ ui/gl/gl_switches.cc | 2 - ui/gl/gl_switches.h | 2 - ui/gl/init/gl_factory.cc | 15 ++----- ui/gl/init/gl_factory_mac.cc | 6 +-- ui/gl/init/gl_factory_win.cc | 6 --- ui/gl/init/gl_initializer_mac.cc | 28 +++--------- ui/gl/init/gl_initializer_win.cc | 22 +++------- .../egl_initialization_displays_unittest.cc | 25 ----------- ui/gl/test/gl_surface_test_support.cc | 2 +- ui/ozone/common/egl_util.cc | 35 +-------------- 40 files changed, 45 insertions(+), 388 deletions(-) diff --git a/ash/components/arc/enterprise/arc_data_snapshotd_manager.cc b/ash/components/arc/enterprise/arc_data_snapshotd_manager.cc index 4fbccea640431d..52029c6f95af41 100644 --- a/ash/components/arc/enterprise/arc_data_snapshotd_manager.cc +++ b/ash/components/arc/enterprise/arc_data_snapshotd_manager.cc @@ -75,7 +75,9 @@ void EnableHeadlessMode() { auto* command_line = base::CommandLine::ForCurrentProcess(); command_line->AppendSwitchASCII(switches::kOzonePlatform, kHeadless); command_line->AppendSwitchASCII(switches::kUseGL, - gl::kGLImplementationSwiftShaderName); + gl::kGLImplementationANGLEName); + command_line->AppendSwitchASCII(switches::kUseANGLE, + gl::kANGLEImplementationSwiftShaderName); } // Disables D-Bus clients: diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn index 6b8f8778d17008..5c61307e43d8ad 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn @@ -974,16 +974,11 @@ if (is_win) { # Add the SwiftShader .dylibs in the MODULE_DIR of Chromium.app bundle_data("swiftshader_binaries") { sources = [ - "$root_out_dir/egl_intermediates/libswiftshader_libEGL.dylib", - "$root_out_dir/egl_intermediates/libswiftshader_libGLESv2.dylib", "$root_out_dir/vk_intermediates/libvk_swiftshader.dylib", "$root_out_dir/vk_intermediates/vk_swiftshader_icd.json", ] outputs = [ "{{bundle_contents_dir}}/Libraries/{{source_file_part}}" ] - public_deps = [ - "//ui/gl:swiftshader_egl_library_copy", - "//ui/gl:swiftshader_vk_library_copy", - ] + public_deps = [ "//ui/gl:swiftshader_vk_library_copy" ] } } @@ -1269,8 +1264,6 @@ if (is_win) { "$root_out_dir/chrome_crashpad_handler", "$root_out_dir/libEGL.dylib", "$root_out_dir/libGLESv2.dylib", - "$root_out_dir/libswiftshader_libEGL.dylib", - "$root_out_dir/libswiftshader_libGLESv2.dylib", "$root_out_dir/libvk_swiftshader.dylib", _framework_binary_path, ] @@ -1309,8 +1302,6 @@ if (is_win) { "//components/crash/core/app:chrome_crashpad_handler", "//third_party/angle:libEGL", "//third_party/angle:libGLESv2", - "//third_party/swiftshader/src/OpenGL/libEGL:swiftshader_libEGL", - "//third_party/swiftshader/src/OpenGL/libGLESv2:swiftshader_libGLESv2", "//third_party/swiftshader/src/Vulkan:swiftshader_libvulkan", dump_syms, ] @@ -1336,8 +1327,6 @@ if (is_win) { "$root_out_dir/chrome_crashpad_handler.dSYM", "$root_out_dir/libEGL.dylib.dSYM", "$root_out_dir/libGLESv2.dylib.dSYM", - "$root_out_dir/libswiftshader_libEGL.dylib.dSYM", - "$root_out_dir/libswiftshader_libGLESv2.dylib.dSYM", "$root_out_dir/libvk_swiftshader.dylib.dSYM", ] if (build_with_internal_optimization_guide) { @@ -1350,8 +1339,6 @@ if (is_win) { "//components/crash/core/app:chrome_crashpad_handler", "//third_party/angle:libEGL", "//third_party/angle:libGLESv2", - "//third_party/swiftshader/src/OpenGL/libEGL:swiftshader_libEGL", - "//third_party/swiftshader/src/OpenGL/libGLESv2:swiftshader_libGLESv2", "//third_party/swiftshader/src/Vulkan:swiftshader_libvulkan", ] if (build_with_internal_optimization_guide) { @@ -1725,8 +1712,6 @@ if (is_linux || is_chromeos) { ":angle_gles_symbols", ":chrome_crashpad_symbols", ":chrome_symbols", - ":swiftshader_egl_symbols", - ":swiftshader_gles_symbols", ] if (is_linux) { deps += [ ":swiftshader_vk_symbols" ] @@ -1762,33 +1747,6 @@ if (is_linux || is_chromeos) { deps = [ "//components/crash/core/app:chrome_crashpad_handler" ] } - extract_symbols("swiftshader_egl_symbols") { - binary = "$root_out_dir/swiftshader/libEGL.so" - - if (current_cpu == "x86") { - # GYP used "ia32" so keep that naming for back-compat. - symbol_file = "$root_out_dir/swiftshader_libegl.breakpad.ia32" - } else { - symbol_file = "$root_out_dir/swiftshader_libegl.breakpad.$current_cpu" - } - - deps = - [ "//third_party/swiftshader/src/OpenGL/libEGL:swiftshader_libEGL" ] - } - extract_symbols("swiftshader_gles_symbols") { - binary = "$root_out_dir/swiftshader/libGLESv2.so" - - if (current_cpu == "x86") { - # GYP used "ia32" so keep that naming for back-compat. - symbol_file = "$root_out_dir/swiftshader_libgles.breakpad.ia32" - } else { - symbol_file = "$root_out_dir/swiftshader_libgles.breakpad.$current_cpu" - } - - deps = [ - "//third_party/swiftshader/src/OpenGL/libGLESv2:swiftshader_libGLESv2", - ] - } extract_symbols("swiftshader_vk_symbols") { binary = "$root_out_dir/libvk_swiftshader.so" diff --git a/chrome/installer/linux/BUILD.gn b/chrome/installer/linux/BUILD.gn index fbc20f5d65c1bb..3f0414a3ee4011 100644 --- a/chrome/installer/linux/BUILD.gn +++ b/chrome/installer/linux/BUILD.gn @@ -80,11 +80,7 @@ if (use_egl) { } if (enable_swiftshader) { - packaging_files_shlibs += [ - "$root_out_dir/swiftshader_libEGL.so", - "$root_out_dir/swiftshader_libGLESv2.so", - "$root_out_dir/libvk_swiftshader.so", - ] + packaging_files_shlibs += [ "$root_out_dir/libvk_swiftshader.so" ] } if (build_with_internal_optimization_guide) { @@ -94,18 +90,6 @@ if (build_with_internal_optimization_guide) { packaging_files_binaries = packaging_files_executables + packaging_files_shlibs -copy("swiftshader_libs") { - sources = [ - "$root_out_dir/swiftshader/libEGL.so", - "$root_out_dir/swiftshader/libGLESv2.so", - ] - outputs = [ "$root_out_dir/swiftshader_{{source_file_part}}" ] - public_deps = [ - "//third_party/swiftshader/src/OpenGL/libEGL:swiftshader_libEGL", - "//third_party/swiftshader/src/OpenGL/libGLESv2:swiftshader_libGLESv2", - ] -} - # TODO(mmoss) Any convenient way to get all the relevant build files? # (e.g. all locales, resources, etc.) packaging_files = packaging_files_binaries + [ @@ -224,17 +208,6 @@ strip_binary("strip_libvulkan_shlib") { deps = [ "//third_party/vulkan-deps/vulkan-loader/src:libvulkan" ] } -strip_binary("strip_swiftshader_libEGL_shlib") { - binary_input = "$root_out_dir/swiftshader/libEGL.so" - deps = [ "//third_party/swiftshader/src/OpenGL/libEGL:swiftshader_libEGL" ] -} - -strip_binary("strip_swiftshader_libGLESv2_shlib") { - binary_input = "$root_out_dir/swiftshader/libGLESv2.so" - deps = - [ "//third_party/swiftshader/src/OpenGL/libGLESv2:swiftshader_libGLESv2" ] -} - strip_binary("strip_libvk_swiftshader.shlib") { binary_input = "$root_out_dir/libvk_swiftshader.so" deps = [ "//third_party/swiftshader/src/Vulkan:swiftshader_libvulkan" ] @@ -440,9 +413,6 @@ group("installer_deps") { if (enable_swiftshader) { public_deps += [ ":strip_libvk_swiftshader.shlib", - ":strip_swiftshader_libEGL_shlib", - ":strip_swiftshader_libGLESv2_shlib", - ":swiftshader_libs", "//third_party/swiftshader/src/Vulkan:icd_file", "//third_party/swiftshader/src/Vulkan:swiftshader_libvulkan", ] diff --git a/chrome/installer/linux/common/installer.include b/chrome/installer/linux/common/installer.include index 6b6fa7011e4599..9f0f85bea5dbcd 100644 --- a/chrome/installer/linux/common/installer.include +++ b/chrome/installer/linux/common/installer.include @@ -232,15 +232,6 @@ stage_install_common() { install -m 755 "${strippedfile}" "${STAGEDIR}/${INSTALLDIR}/${file}" fi - # SwiftShader ES - if [ -f "${OUTPUTDIR}/swiftshader/libEGL.so" ]; then - install -m 755 -d "${STAGEDIR}/${INSTALLDIR}/swiftshader/" - for file in libEGL.so libGLESv2.so; do - strippedfile="${OUTPUTDIR}/swiftshader/${file}.stripped" - install -m ${SHLIB_PERMS} "${strippedfile}" "${STAGEDIR}/${INSTALLDIR}/swiftshader/${file}" - done - fi - # SwiftShader VK if [ -f "${OUTPUTDIR}/libvk_swiftshader.so" ]; then install -m 755 -d "${STAGEDIR}/${INSTALLDIR}/" diff --git a/chrome/installer/mac/signing/parts.py b/chrome/installer/mac/signing/parts.py index d4247ed4fe0004..c4037ccb5f82f6 100644 --- a/chrome/installer/mac/signing/parts.py +++ b/chrome/installer/mac/signing/parts.py @@ -120,8 +120,6 @@ def get_parts(config): dylibs = [ 'libEGL.dylib', 'libGLESv2.dylib', - 'libswiftshader_libEGL.dylib', - 'libswiftshader_libGLESv2.dylib', 'libvk_swiftshader.dylib', ] if config.is_chrome_branded(): diff --git a/chrome/installer/mini_installer/chrome.release b/chrome/installer/mini_installer/chrome.release index 9c6346bb8c88fd..5cdaad05767053 100644 --- a/chrome/installer/mini_installer/chrome.release +++ b/chrome/installer/mini_installer/chrome.release @@ -54,12 +54,6 @@ locales\*.pak: %(VersionDir)s\Locales Logo.png: %(VersionDir)s\VisualElements\ SmallLogo.png: %(VersionDir)s\VisualElements\ -# -# SwiftShader sub-dir -# -swiftshader\libEGL.dll: %(VersionDir)s\swiftshader\ -swiftshader\libGLESv2.dll: %(VersionDir)s\swiftshader\ - # # MEI Preload sub dir # diff --git a/chrome/tools/build/win/FILES.cfg b/chrome/tools/build/win/FILES.cfg index e9d32574cae187..b7b4f6aca67258 100644 --- a/chrome/tools/build/win/FILES.cfg +++ b/chrome/tools/build/win/FILES.cfg @@ -383,16 +383,6 @@ FILES = [ 'filegroup': ['default', 'symsrc'], }, # SwiftShader files: - { - 'filename': 'swiftshader/libEGL.dll', - 'buildtype': ['official'], - 'filegroup': ['default', 'symsrc'], - }, - { - 'filename': 'swiftshader/libGLESv2.dll', - 'buildtype': ['official'], - 'filegroup': ['default', 'symsrc'], - }, { 'filename': 'vk_swiftshader.dll', 'buildtype': ['official'], @@ -666,16 +656,6 @@ FILES = [ 'buildtype': ['official'], 'archive': 'chrome-win32-syms.zip', }, - { - 'filename': 'swiftshader/libEGL.dll.pdb', - 'buildtype': ['official'], - 'archive': 'chrome-win32-syms.zip', - }, - { - 'filename': 'swiftshader/libGLESv2.dll.pdb', - 'buildtype': ['official'], - 'archive': 'chrome-win32-syms.zip', - }, { 'filename': 'vk_swiftshader.dll.pdb', 'buildtype': ['official'], diff --git a/content/shell/BUILD.gn b/content/shell/BUILD.gn index 603832550746d0..4ce8514ceefe2f 100644 --- a/content/shell/BUILD.gn +++ b/content/shell/BUILD.gn @@ -824,16 +824,11 @@ if (is_mac) { # Add the SwiftShader .dylibs in the Libraries directory of the Framework. bundle_data("content_shell_swiftshader_binaries") { sources = [ - "$root_out_dir/egl_intermediates/libswiftshader_libEGL.dylib", - "$root_out_dir/egl_intermediates/libswiftshader_libGLESv2.dylib", "$root_out_dir/vk_intermediates/libvk_swiftshader.dylib", "$root_out_dir/vk_intermediates/vk_swiftshader_icd.json", ] outputs = [ "{{bundle_contents_dir}}/Libraries/{{source_file_part}}" ] - public_deps = [ - "//ui/gl:swiftshader_egl_library_copy", - "//ui/gl:swiftshader_vk_library_copy", - ] + public_deps = [ "//ui/gl:swiftshader_vk_library_copy" ] } } diff --git a/fuchsia/engine/BUILD.gn b/fuchsia/engine/BUILD.gn index b789fa7c2b6fd6..f87749bc887633 100644 --- a/fuchsia/engine/BUILD.gn +++ b/fuchsia/engine/BUILD.gn @@ -342,8 +342,6 @@ _web_engine_excluded_files = [ # not be included in the WebEngine package. # Whenever this list is updated the exclusions in the cast_runner package # should be updated as well (see fuchsia/runners/BUILD.gn). - "lib/libswiftshader_libEGL.so", - "lib/libswiftshader_libGLESv2.so", "lib/libvk_swiftshader.so", "vk_swiftshader_icd.json", ] diff --git a/fuchsia/runners/BUILD.gn b/fuchsia/runners/BUILD.gn index 18aff61d2f39d8..4aed1d30cfb6cd 100644 --- a/fuchsia/runners/BUILD.gn +++ b/fuchsia/runners/BUILD.gn @@ -143,8 +143,6 @@ _web_instance_host_deps_files_to_exclude = [ # TODO(crbug.com/1022542): SwiftShader is not used in cast_runner. # This list should match the list of SwiftShader files excluded from the # web_engine package (see fuchsia/engine/BUILD.gn). - "lib/libswiftshader_libEGL.so", - "lib/libswiftshader_libGLESv2.so", "lib/libvk_swiftshader.so", "vk_swiftshader_icd.json", ] diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc index e232df39822180..cc7acaff09ef17 100644 --- a/gpu/command_buffer/service/feature_info.cc +++ b/gpu/command_buffer/service/feature_info.cc @@ -222,9 +222,8 @@ void FeatureInfo::InitializeBasicState(const base::CommandLine* command_line) { const auto useANGLE = command_line->GetSwitchValueASCII(switches::kUseANGLE); feature_flags_.is_swiftshader_for_webgl = - (useGL == gl::kGLImplementationSwiftShaderForWebGLName) || - ((useGL == gl::kGLImplementationANGLEName) && - (useANGLE == gl::kANGLEImplementationSwiftShaderForWebGLName)); + (useGL == gl::kGLImplementationANGLEName) && + (useANGLE == gl::kANGLEImplementationSwiftShaderForWebGLName); // The shader translator is needed to translate from WebGL-conformant GLES SL // to normal GLES SL, enforce WebGL conformance, translate from GLES SL 1.0 to diff --git a/gpu/config/gpu_info_collector.cc b/gpu/config/gpu_info_collector.cc index f4a58fd4ad337a..4d1a80ecf29162 100644 --- a/gpu/config/gpu_info_collector.cc +++ b/gpu/config/gpu_info_collector.cc @@ -299,16 +299,14 @@ bool CollectBasicGraphicsInfo(const base::CommandLine* command_line, &fallback_to_software); // If GL is disabled then we don't need GPUInfo. - if (implementation && *implementation == gl::kGLImplementationDisabled) { + if (implementation == gl::kGLImplementationDisabled) { gpu_info->gl_vendor = "Disabled"; gpu_info->gl_renderer = "Disabled"; gpu_info->gl_version = "Disabled"; return true; } - gl::GLImplementationParts legacy_impl = - gl::GetLegacySoftwareGLImplementation(); - if (implementation && *implementation == legacy_impl) { + if (implementation == gl::GetSoftwareGLImplementation()) { // If using the software GL implementation, use fake vendor and // device ids to make sure it never gets blocklisted. It allows us // to proceed with loading the blocklist which may have non-device @@ -317,21 +315,6 @@ bool CollectBasicGraphicsInfo(const base::CommandLine* command_line, gpu_info->gpu.vendor_id = 0xffff; gpu_info->gpu.device_id = 0xffff; - // Also declare the driver_vendor to be to be able to - // specify exceptions based on driver_vendor== for some - // blocklist rules. - gpu_info->gpu.driver_vendor = gl::GetGLImplementationGLName(legacy_impl); - - return true; - } - - if (implementation && - *implementation == gl::ANGLEImplementation::kSwiftShader) { - // Similarly to the above, use fake vendor and device ids - // to make sure they never gets blocklisted for SwANGLE as well. - gpu_info->gpu.vendor_id = 0xffff; - gpu_info->gpu.device_id = 0xffff; - // Also declare the driver_vendor to be to be able to // specify exceptions based on driver_vendor== for some // blocklist rules. diff --git a/gpu/config/gpu_util.cc b/gpu/config/gpu_util.cc index 38207177382d71..972db1c91dba09 100644 --- a/gpu/config/gpu_util.cc +++ b/gpu/config/gpu_util.cc @@ -540,8 +540,7 @@ GpuFeatureInfo ComputeGpuFeatureInfo(const GPUInfo& gpu_info, std::string use_gl = command_line->GetSwitchValueASCII(switches::kUseGL); std::string use_angle = command_line->GetSwitchValueASCII(switches::kUseANGLE); - if (use_gl == gl::kGLImplementationSwiftShaderForWebGLName || - use_angle == gl::kANGLEImplementationSwiftShaderForWebGLName) { + if (use_angle == gl::kANGLEImplementationSwiftShaderForWebGLName) { return ComputeGpuFeatureInfoForSwiftShader(); } } diff --git a/gpu/ipc/service/gpu_init.cc b/gpu/ipc/service/gpu_init.cc index bd06bfe180ebe4..d8e576d6f8b094 100644 --- a/gpu/ipc/service/gpu_init.cc +++ b/gpu/ipc/service/gpu_init.cc @@ -667,18 +667,15 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line, UMA_HISTOGRAM_MEDIUM_TIMES("GPU.InitializeOneOffMediumTime", elapsed_timer.Elapsed()); - // Software GL is expected to run slowly, so disable the watchdog + // SwANGLE is expected to run slowly, so disable the watchdog // in that case. - // In SwiftShader case, the implementation is actually EGLGLES2. if (!gl_use_swiftshader_ && command_line->HasSwitch(switches::kUseGL)) { std::string use_gl = command_line->GetSwitchValueASCII(switches::kUseGL); std::string use_angle = command_line->GetSwitchValueASCII(switches::kUseANGLE); - if (use_gl == gl::kGLImplementationSwiftShaderName || - use_gl == gl::kGLImplementationSwiftShaderForWebGLName || - (use_gl == gl::kGLImplementationANGLEName && - (use_angle == gl::kANGLEImplementationSwiftShaderName || - use_angle == gl::kANGLEImplementationSwiftShaderForWebGLName))) { + if (use_gl == gl::kGLImplementationANGLEName && + (use_angle == gl::kANGLEImplementationSwiftShaderName || + use_angle == gl::kANGLEImplementationSwiftShaderForWebGLName)) { gl_use_swiftshader_ = true; } } diff --git a/gpu/ipc/service/image_transport_surface_mac.mm b/gpu/ipc/service/image_transport_surface_mac.mm index e22456c7a58b90..ff2e62d1ed9711 100644 --- a/gpu/ipc/service/image_transport_surface_mac.mm +++ b/gpu/ipc/service/image_transport_surface_mac.mm @@ -29,7 +29,6 @@ #if defined(USE_EGL) case gl::kGLImplementationEGLGLES2: case gl::kGLImplementationEGLANGLE: - case gl::kGLImplementationSwiftShaderGL: return base::WrapRefCounted( new ImageTransportSurfaceOverlayMacEGL(delegate)); #endif diff --git a/headless/public/headless_browser.cc b/headless/public/headless_browser.cc index ff9dfa2cb58f60..b808bf97f11474 100644 --- a/headless/public/headless_browser.cc +++ b/headless/public/headless_browser.cc @@ -36,17 +36,12 @@ std::string GetProductNameAndVersion() { Options::Options(int argc, const char** argv) : argc(argc), argv(argv), - gl_implementation(gl::kGLImplementationSwiftShaderForWebGLName), - angle_implementation(gl::kANGLEImplementationNoneName), + gl_implementation(gl::kGLImplementationANGLEName), + angle_implementation(gl::kANGLEImplementationSwiftShaderForWebGLName), product_name_and_version(GetProductNameAndVersion()), user_agent(content::BuildUserAgentFromProduct(product_name_and_version)), window_size(kDefaultWindowSize), - font_render_hinting(kDefaultFontRenderHinting) { -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) - gl_implementation = gl::kGLImplementationANGLEName; - angle_implementation = gl::kANGLEImplementationSwiftShaderForWebGLName; -#endif -} + font_render_hinting(kDefaultFontRenderHinting) {} Options::Options(Options&& options) = default; diff --git a/infra/archive_config/win-archive-rel.json b/infra/archive_config/win-archive-rel.json index 0aa6446c8baaae..f73dc8ee093ef5 100644 --- a/infra/archive_config/win-archive-rel.json +++ b/infra/archive_config/win-archive-rel.json @@ -23,8 +23,6 @@ "nacl_irt_x86_64.nexe", "notification_helper.exe", "resources.pak", - "swiftshader\\libEGL.dll", - "swiftshader\\libGLESv2.dll", "v8_context_snapshot.bin", "vk_swiftshader.dll", "vk_swiftshader_icd.json", @@ -66,8 +64,6 @@ "mojo_core.dll.pdb", "notification_helper.exe.pdb", "setup.exe.pdb", - "swiftshader\\libEGL.dll.pdb", - "swiftshader\\libGLESv2.dll.pdb", "vk_swiftshader.dll.pdb", "vulkan-1.dll.pdb" ], diff --git a/infra/archive_config/win-tagged.json b/infra/archive_config/win-tagged.json index dec56c0f9b9b72..3d6a4350697050 100644 --- a/infra/archive_config/win-tagged.json +++ b/infra/archive_config/win-tagged.json @@ -23,8 +23,6 @@ "nacl_irt_x86_64.nexe", "notification_helper.exe", "resources.pak", - "swiftshader\\libEGL.dll", - "swiftshader\\libGLESv2.dll", "v8_context_snapshot.bin", "vk_swiftshader.dll", "vk_swiftshader_icd.json", diff --git a/infra/archive_config/win32-archive-rel.json b/infra/archive_config/win32-archive-rel.json index 378f9341910588..6d284e19778946 100644 --- a/infra/archive_config/win32-archive-rel.json +++ b/infra/archive_config/win32-archive-rel.json @@ -25,8 +25,6 @@ "nacl_irt_x86_64.nexe", "notification_helper.exe", "resources.pak", - "swiftshader\\libEGL.dll", - "swiftshader\\libGLESv2.dll", "v8_context_snapshot.bin", "vk_swiftshader.dll", "vk_swiftshader_icd.json", @@ -69,8 +67,6 @@ "nacl64.exe.pdb", "notification_helper.exe.pdb", "setup.exe.pdb", - "swiftshader\\libEGL.dll.pdb", - "swiftshader\\libGLESv2.dll.pdb", "vk_swiftshader.dll.pdb", "vulkan-1.dll.pdb" ], diff --git a/infra/scripts/sizes.py b/infra/scripts/sizes.py index 595f26ca5aa767..1ba07e4bb5119b 100755 --- a/infra/scripts/sizes.py +++ b/infra/scripts/sizes.py @@ -406,8 +406,6 @@ def main_win(options, args, results_collector): 'mini_installer.exe', 'resources.pak', 'setup.exe', - 'swiftshader\\libEGL.dll', - 'swiftshader\\libGLESv2.dll', 'WidevineCdm\\_platform_specific\\win_x64\\widevinecdm.dll', 'WidevineCdm\\_platform_specific\\win_x64\\widevinecdmadapter.dll', 'WidevineCdm\\_platform_specific\\win_x86\\widevinecdm.dll', diff --git a/tools/binary_size/sizes.py b/tools/binary_size/sizes.py index 57815a4cba1348..a6b2c509d71ff2 100755 --- a/tools/binary_size/sizes.py +++ b/tools/binary_size/sizes.py @@ -376,8 +376,6 @@ def main_win(output_directory, results_collector, size_path): 'notification_helper.exe', 'resources.pak', 'setup.exe', - 'swiftshader\\libEGL.dll', - 'swiftshader\\libGLESv2.dll', 'WidevineCdm\\_platform_specific\\win_x64\\widevinecdm.dll', 'WidevineCdm\\_platform_specific\\win_x64\\widevinecdmadapter.dll', 'WidevineCdm\\_platform_specific\\win_x86\\widevinecdm.dll', diff --git a/tools/determinism/deterministic_build_ignorelist.pyl b/tools/determinism/deterministic_build_ignorelist.pyl index 514c144f3fbfcd..b178f55fe24dcf 100644 --- a/tools/determinism/deterministic_build_ignorelist.pyl +++ b/tools/determinism/deterministic_build_ignorelist.pyl @@ -194,10 +194,6 @@ 'mini_installer.exe.pdb', 'previous_version_mini_installer.exe', - # https://crbug.com/1163310 - r'swiftshader\libGLESv2.dll', - r'swiftshader\libGLESv2.dll.pdb', - # These probably have mtimes in the zip headers and the scripts creating # them probably should use build_utils.ZipDir() instead. 'mini_installer_tests.zip', diff --git a/ui/gl/BUILD.gn b/ui/gl/BUILD.gn index 56b0584e5965da..b4868aecf6a2de 100644 --- a/ui/gl/BUILD.gn +++ b/ui/gl/BUILD.gn @@ -453,17 +453,6 @@ if (is_mac && use_egl) { } if (enable_swiftshader) { - copy("swiftshader_egl_library_copy") { - sources = [ - "$root_out_dir/libswiftshader_libEGL.dylib", - "$root_out_dir/libswiftshader_libGLESv2.dylib", - ] - outputs = [ "$root_out_dir/egl_intermediates/{{source_file_part}}" ] - deps = [ - "//third_party/swiftshader/src/OpenGL/libEGL:swiftshader_libEGL", - "//third_party/swiftshader/src/OpenGL/libGLESv2:swiftshader_libGLESv2", - ] - } copy("swiftshader_vk_library_copy") { sources = [ "$root_out_dir/libvk_swiftshader.dylib", diff --git a/ui/gl/gl_context.cc b/ui/gl/gl_context.cc index 12538ee218cbea..9362605f039854 100644 --- a/ui/gl/gl_context.cc +++ b/ui/gl/gl_context.cc @@ -297,7 +297,6 @@ bool GLContext::LosesAllContextsOnContextLost() { return false; case kGLImplementationEGLGLES2: case kGLImplementationEGLANGLE: - case kGLImplementationSwiftShaderGL: return true; case kGLImplementationAppleGL: return false; diff --git a/ui/gl/gl_image_io_surface.mm b/ui/gl/gl_image_io_surface.mm index 1de65b1edc7ad7..aff5e328002f2d 100644 --- a/ui/gl/gl_image_io_surface.mm +++ b/ui/gl/gl_image_io_surface.mm @@ -173,10 +173,7 @@ GLenum ConvertRequestedInternalFormat(GLenum internalformat) { switch (GetGLImplementation()) { case kGLImplementationEGLGLES2: case kGLImplementationEGLANGLE: - case kGLImplementationSwiftShaderGL: - return new GLImageIOSurfaceEGL( - size, internalformat, - GetGLImplementation() == kGLImplementationSwiftShaderGL); + return new GLImageIOSurfaceEGL(size, internalformat); default: break; } diff --git a/ui/gl/gl_image_io_surface_egl.h b/ui/gl/gl_image_io_surface_egl.h index a0ed3c94f6592f..4ac9b29a7abfc6 100644 --- a/ui/gl/gl_image_io_surface_egl.h +++ b/ui/gl/gl_image_io_surface_egl.h @@ -15,9 +15,7 @@ namespace gl { // EGL_ANGLE_iosurface_client_buffer extension to bind the IOSurface to textures class GL_EXPORT GLImageIOSurfaceEGL : public GLImageIOSurface { public: - GLImageIOSurfaceEGL(const gfx::Size& size, - unsigned internalformat, - bool emulate_rgb); + GLImageIOSurfaceEGL(const gfx::Size& size, unsigned internalformat); void ReleaseTexImage(unsigned target) override; @@ -27,12 +25,6 @@ class GL_EXPORT GLImageIOSurfaceEGL : public GLImageIOSurface { bool CopyTexImage(unsigned target) override; private: - // If Swiftshader is being used, use the RGB emulation paths in the validating - // command decoder instead of creating the IOSurface with an RGB format. ANGLE - // handles the emulation internally. This can be removed once Swiftshader is - // used as an ANGLE backend. - bool emulate_rgb_; - EGLDisplay display_; EGLSurface pbuffer_; EGLConfig dummy_config_; diff --git a/ui/gl/gl_image_io_surface_egl.mm b/ui/gl/gl_image_io_surface_egl.mm index 5945ec8068f7eb..6e2117e25a9270 100644 --- a/ui/gl/gl_image_io_surface_egl.mm +++ b/ui/gl/gl_image_io_surface_egl.mm @@ -33,8 +33,7 @@ // Convert a gfx::BufferFormat to a (internal format, type) combination from the // EGL_ANGLE_iosurface_client_buffer extension spec. -InternalFormatType BufferFormatToInternalFormatType(gfx::BufferFormat format, - bool emulate_rgb) { +InternalFormatType BufferFormatToInternalFormatType(gfx::BufferFormat format) { switch (format) { case gfx::BufferFormat::R_8: return {GL_RED, GL_UNSIGNED_BYTE}; @@ -46,11 +45,7 @@ InternalFormatType BufferFormatToInternalFormatType(gfx::BufferFormat format, case gfx::BufferFormat::RG_1616: return {GL_RG, GL_UNSIGNED_SHORT}; case gfx::BufferFormat::BGRX_8888: - if (emulate_rgb) { - return {GL_BGRA_EXT, GL_UNSIGNED_BYTE}; - } else { - return {GL_RGB, GL_UNSIGNED_BYTE}; - } + return {GL_RGB, GL_UNSIGNED_BYTE}; case gfx::BufferFormat::BGRA_8888: case gfx::BufferFormat::RGBA_8888: return {GL_BGRA_EXT, GL_UNSIGNED_BYTE}; @@ -116,10 +111,8 @@ GLenum TargetGetterFromGLTarget(GLint gl_target) { } // anonymous namespace GLImageIOSurfaceEGL::GLImageIOSurfaceEGL(const gfx::Size& size, - unsigned internalformat, - bool emulate_rgb) + unsigned internalformat) : GLImageIOSurface(size, internalformat), - emulate_rgb_(emulate_rgb), display_(GLSurfaceEGL::GetHardwareDisplay()), pbuffer_(EGL_NO_SURFACE), dummy_config_(nullptr), @@ -205,8 +198,7 @@ GLenum TargetGetterFromGLTarget(GLint gl_target) { // in the constructor if we're going to be used to bind plane 0 to a texture, // or to transform YUV to RGB. if (pbuffer_ == EGL_NO_SURFACE) { - InternalFormatType formatType = - BufferFormatToInternalFormatType(format_, emulate_rgb_); + InternalFormatType formatType = BufferFormatToInternalFormatType(format_); // clang-format off const EGLint attribs[] = { diff --git a/ui/gl/gl_implementation.cc b/ui/gl/gl_implementation.cc index 52dde28ec4c36f..a3cec15e679a01 100644 --- a/ui/gl/gl_implementation.cc +++ b/ui/gl/gl_implementation.cc @@ -68,9 +68,6 @@ std::string GLImplementationParts::ToString() const { case GLImplementation::kGLImplementationDesktopGLCoreProfile: s << "desktop-gl-core-profile"; break; - case GLImplementation::kGLImplementationSwiftShaderGL: - s << "swiftshader-gl"; - break; case GLImplementation::kGLImplementationAppleGL: s << "apple-gl"; break; @@ -136,8 +133,6 @@ const struct { } kGLImplementationNamePairs[] = { {kGLImplementationDesktopName, kANGLEImplementationNoneName, GLImplementationParts(kGLImplementationDesktopGL)}, - {kGLImplementationSwiftShaderName, kANGLEImplementationNoneName, - GLImplementationParts(kGLImplementationSwiftShaderGL)}, #if BUILDFLAG(IS_APPLE) {kGLImplementationAppleName, kANGLEImplementationNoneName, GLImplementationParts(kGLImplementationAppleGL)}, @@ -262,26 +257,12 @@ GLImplementationParts GetNamedGLImplementation(const std::string& gl_name, return GLImplementationParts(kGLImplementationNone); } -GLImplementationParts GetLegacySoftwareGLImplementation() { - return GLImplementationParts(kGLImplementationSwiftShaderGL); -} - GLImplementationParts GetSoftwareGLImplementation() { return GLImplementationParts(ANGLEImplementation::kSwiftShader); } -GLImplementationParts GetSoftwareGLImplementationForPlatform() { -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \ - BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) - return GetSoftwareGLImplementation(); -#else - return GetLegacySoftwareGLImplementation(); -#endif -} - bool IsSoftwareGLImplementation(GLImplementationParts implementation) { - return (implementation == GetLegacySoftwareGLImplementation()) || - (implementation == GetSoftwareGLImplementation()); + return (implementation == GetSoftwareGLImplementation()); } void SetSoftwareGLCommandLineSwitches(base::CommandLine* command_line) { @@ -304,7 +285,7 @@ GetRequestedGLImplementationFromCommandLine( bool* fallback_to_software_gl) { *fallback_to_software_gl = false; if (command_line->HasSwitch(switches::kOverrideUseSoftwareGLForTests)) { - return GetSoftwareGLImplementationForPlatform(); + return GetSoftwareGLImplementation(); } if (!command_line->HasSwitch(switches::kUseGL) && @@ -327,11 +308,6 @@ GetRequestedGLImplementationFromCommandLine( return absl::nullopt; } - if ((gl_name == kGLImplementationSwiftShaderName) || - (gl_name == kGLImplementationSwiftShaderForWebGLName)) { - return GLImplementationParts(kGLImplementationSwiftShaderGL); - } - if ((gl_name == kGLImplementationANGLEName) && ((angle_name == kANGLEImplementationSwiftShaderName) || (angle_name == kANGLEImplementationSwiftShaderForWebGLName))) { diff --git a/ui/gl/gl_implementation.h b/ui/gl/gl_implementation.h index c4e6aae257bc89..497152c13427fd 100644 --- a/ui/gl/gl_implementation.h +++ b/ui/gl/gl_implementation.h @@ -34,7 +34,8 @@ enum GLImplementation { kGLImplementationNone = 0, kGLImplementationDesktopGL = 1, kGLImplementationDesktopGLCoreProfile = 2, - kGLImplementationSwiftShaderGL = 3, + // Note: 3 used to be legacy SwiftShader, so 3 is skipped and should not be + // reused. kGLImplementationAppleGL = 4, kGLImplementationEGLGLES2 = 5, // Native EGL/GLES2 kGLImplementationMockGL = 6, @@ -164,13 +165,8 @@ GL_EXPORT void SetANGLEImplementation(ANGLEImplementation implementation); GL_EXPORT ANGLEImplementation GetANGLEImplementation(); // Get the software GL implementation -GL_EXPORT GLImplementationParts GetLegacySoftwareGLImplementation(); GL_EXPORT GLImplementationParts GetSoftwareGLImplementation(); -// Returns the software GL implementation used by default on the current -// platform -GL_EXPORT GLImplementationParts GetSoftwareGLImplementationForPlatform(); - // Set the software GL implementation on the provided command line GL_EXPORT void SetSoftwareGLCommandLineSwitches( base::CommandLine* command_line); diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc index c3d5aa5b036b41..bc2b2e4d9504ca 100644 --- a/ui/gl/gl_surface_egl.cc +++ b/ui/gl/gl_surface_egl.cc @@ -861,19 +861,6 @@ void GetEGLInitDisplays(bool supports_angle_d3d, bool supports_angle_metal, const base::CommandLine* command_line, std::vector* init_displays) { - bool usingSoftwareGL = - command_line->HasSwitch(switches::kOverrideUseSoftwareGLForTests); - bool isSwANGLE = GetGLImplementationParts() == GetSoftwareGLImplementation(); - - // SwiftShader does not use the platform extensions - // Note: Do not use SwiftShader if we've explicitly selected SwANGLE - if (command_line->GetSwitchValueASCII(switches::kUseGL) == - kGLImplementationSwiftShaderForWebGLName && - !(usingSoftwareGL && isSwANGLE)) { - AddInitDisplay(init_displays, SWIFT_SHADER); - return; - } - // If we're already requesting software GL, make sure we don't fallback to the // GPU bool forceSoftwareGL = IsSoftwareGLImplementation(GetGLImplementationParts()); diff --git a/ui/gl/gl_switches.cc b/ui/gl/gl_switches.cc index 0912ccb6b53a0a..4a92078cf4593b 100644 --- a/ui/gl/gl_switches.cc +++ b/ui/gl/gl_switches.cc @@ -16,8 +16,6 @@ const char kGLImplementationDesktopName[] = "desktop"; const char kGLImplementationAppleName[] = "apple"; const char kGLImplementationEGLName[] = "egl"; const char kGLImplementationANGLEName[] = "angle"; -const char kGLImplementationSwiftShaderName[] = "swiftshader"; -const char kGLImplementationSwiftShaderForWebGLName[] = "swiftshader-webgl"; const char kGLImplementationMockName[] = "mock"; const char kGLImplementationStubName[] = "stub"; const char kGLImplementationDisabledName[] = "disabled"; diff --git a/ui/gl/gl_switches.h b/ui/gl/gl_switches.h index 174d12ea38f43c..0e47d04c19ad26 100644 --- a/ui/gl/gl_switches.h +++ b/ui/gl/gl_switches.h @@ -18,8 +18,6 @@ GL_EXPORT extern const char kGLImplementationDesktopName[]; GL_EXPORT extern const char kGLImplementationAppleName[]; GL_EXPORT extern const char kGLImplementationEGLName[]; GL_EXPORT extern const char kGLImplementationANGLEName[]; -GL_EXPORT extern const char kGLImplementationSwiftShaderName[]; -GL_EXPORT extern const char kGLImplementationSwiftShaderForWebGLName[]; GL_EXPORT extern const char kGLImplementationMockName[]; GL_EXPORT extern const char kGLImplementationStubName[]; GL_EXPORT extern const char kGLImplementationDisabledName[]; diff --git a/ui/gl/init/gl_factory.cc b/ui/gl/init/gl_factory.cc index 7ed039ca098cca..01b8dd9ab91950 100644 --- a/ui/gl/init/gl_factory.cc +++ b/ui/gl/init/gl_factory.cc @@ -81,15 +81,11 @@ GLImplementationParts GetRequestedGLImplementation( if (g_is_angle_enabled && UsePassthroughCommandDecoder(cmd)) { std::vector angle_impls = {}; bool software_gl_allowed = false; - bool legacy_software_gl_allowed = false; auto iter = allowed_impls.begin(); while (iter != allowed_impls.end()) { if ((*iter) == GetSoftwareGLImplementation()) { software_gl_allowed = true; allowed_impls.erase(iter); - } else if ((*iter) == GetLegacySoftwareGLImplementation()) { - legacy_software_gl_allowed = true; - allowed_impls.erase(iter); } else if (iter->gl == kGLImplementationEGLANGLE) { angle_impls.emplace_back(*iter); allowed_impls.erase(iter); @@ -104,9 +100,6 @@ GLImplementationParts GetRequestedGLImplementation( if (software_gl_allowed) { allowed_impls.emplace_back(GetSoftwareGLImplementation()); } - if (legacy_software_gl_allowed) { - allowed_impls.emplace_back(GetLegacySoftwareGLImplementation()); - } } if (allowed_impls.empty()) { @@ -204,8 +197,7 @@ bool InitializeStaticGLBindingsImplementation(GLImplementationParts impl, bool initialized = InitializeStaticGLBindings(impl); if (!initialized && fallback_to_software_gl) { ShutdownGL(/*due_to_fallback*/ true); - initialized = - InitializeStaticGLBindings(GetSoftwareGLImplementationForPlatform()); + initialized = InitializeStaticGLBindings(GetSoftwareGLImplementation()); } if (!initialized) { ShutdownGL(/*due_to_fallback*/ false); @@ -224,9 +216,8 @@ bool InitializeGLOneOffPlatformImplementation(bool fallback_to_software_gl, bool initialized = InitializeGLOneOffPlatform(system_device_id); if (!initialized && fallback_to_software_gl) { ShutdownGL(/*due_to_fallback*/ true); - initialized = - InitializeStaticGLBindings(GetSoftwareGLImplementationForPlatform()) && - InitializeGLOneOffPlatform(system_device_id); + initialized = InitializeStaticGLBindings(GetSoftwareGLImplementation()) && + InitializeGLOneOffPlatform(system_device_id); } if (initialized && init_extensions) { initialized = InitializeExtensionSettingsOneOffPlatform(); diff --git a/ui/gl/init/gl_factory_mac.cc b/ui/gl/init/gl_factory_mac.cc index a1f6303a693d9d..9cf7edf151df36 100644 --- a/ui/gl/init/gl_factory_mac.cc +++ b/ui/gl/init/gl_factory_mac.cc @@ -70,7 +70,6 @@ std::vector GetAllowedGLImplementations() { #if defined(USE_EGL) impls.emplace_back(GLImplementationParts(kGLImplementationEGLGLES2)); impls.emplace_back(GLImplementationParts(kGLImplementationEGLANGLE)); - impls.emplace_back(GLImplementationParts(kGLImplementationSwiftShaderGL)); #endif // defined(USE_EGL) return impls; } @@ -93,7 +92,6 @@ scoped_refptr CreateGLContext(GLShareGroup* share_group, #if defined(USE_EGL) case kGLImplementationEGLGLES2: case kGLImplementationEGLANGLE: - case kGLImplementationSwiftShaderGL: return InitializeGLContext(new GLContextEGL(share_group), compatible_surface, attribs); #endif // defined(USE_EGL) @@ -118,8 +116,7 @@ scoped_refptr CreateViewGLSurface(gfx::AcceleratedWidget window) { case kGLImplementationDesktopGLCoreProfile: case kGLImplementationAppleGL: case kGLImplementationEGLGLES2: - case kGLImplementationEGLANGLE: - case kGLImplementationSwiftShaderGL: { + case kGLImplementationEGLANGLE: { NOTIMPLEMENTED() << "No onscreen support on Mac."; return nullptr; } @@ -144,7 +141,6 @@ scoped_refptr CreateOffscreenGLSurfaceWithFormat( #if defined(USE_EGL) case kGLImplementationEGLGLES2: case kGLImplementationEGLANGLE: - case kGLImplementationSwiftShaderGL: if (GLSurfaceEGL::IsEGLSurfacelessContextSupported() && size.width() == 0 && size.height() == 0) { return InitializeGLSurfaceWithFormat(new SurfacelessEGL(size), format); diff --git a/ui/gl/init/gl_factory_win.cc b/ui/gl/init/gl_factory_win.cc index 22b59253283f74..a938498faa029c 100644 --- a/ui/gl/init/gl_factory_win.cc +++ b/ui/gl/init/gl_factory_win.cc @@ -24,7 +24,6 @@ namespace init { std::vector GetAllowedGLImplementations() { std::vector impls; impls.emplace_back(GLImplementationParts(kGLImplementationEGLANGLE)); - impls.emplace_back(GLImplementationParts(kGLImplementationSwiftShaderGL)); return impls; } @@ -43,7 +42,6 @@ scoped_refptr CreateGLContext(GLShareGroup* share_group, const GLContextAttribs& attribs) { TRACE_EVENT0("gpu", "gl::init::CreateGLContext"); switch (GetGLImplementation()) { - case kGLImplementationSwiftShaderGL: case kGLImplementationEGLANGLE: return InitializeGLContext(new GLContextEGL(share_group), compatible_surface, attribs); @@ -64,7 +62,6 @@ scoped_refptr CreateGLContext(GLShareGroup* share_group, scoped_refptr CreateViewGLSurface(gfx::AcceleratedWidget window) { TRACE_EVENT0("gpu", "gl::init::CreateViewGLSurface"); switch (GetGLImplementation()) { - case kGLImplementationSwiftShaderGL: case kGLImplementationEGLANGLE: { DCHECK_NE(window, gfx::kNullAcceleratedWidget); return InitializeGLSurface(base::MakeRefCounted( @@ -83,7 +80,6 @@ scoped_refptr CreateOffscreenGLSurfaceWithFormat( const gfx::Size& size, GLSurfaceFormat format) { TRACE_EVENT0("gpu", "gl::init::CreateOffscreenGLSurface"); switch (GetGLImplementation()) { - case kGLImplementationSwiftShaderGL: case kGLImplementationEGLANGLE: if (GLSurfaceEGL::IsEGLSurfacelessContextSupported() && size.width() == 0 && size.height() == 0) { @@ -108,7 +104,6 @@ void SetDisabledExtensionsPlatform(const std::string& disabled_extensions) { case kGLImplementationEGLANGLE: SetDisabledExtensionsEGL(disabled_extensions); break; - case kGLImplementationSwiftShaderGL: case kGLImplementationMockGL: case kGLImplementationStubGL: break; @@ -123,7 +118,6 @@ bool InitializeExtensionSettingsOneOffPlatform() { switch (implementation) { case kGLImplementationEGLANGLE: return InitializeExtensionSettingsOneOffEGL(); - case kGLImplementationSwiftShaderGL: case kGLImplementationMockGL: case kGLImplementationStubGL: return true; diff --git a/ui/gl/init/gl_initializer_mac.cc b/ui/gl/init/gl_initializer_mac.cc index 4c78f4c18ee15c..b1fbd1fedf16f4 100644 --- a/ui/gl/init/gl_initializer_mac.cc +++ b/ui/gl/init/gl_initializer_mac.cc @@ -94,10 +94,11 @@ bool InitializeStaticCGLInternal(GLImplementation implementation) { const char kGLESv2ANGLELibraryName[] = "libGLESv2.dylib"; const char kEGLANGLELibraryName[] = "libEGL.dylib"; -const char kGLESv2SwiftShaderLibraryName[] = "libswiftshader_libGLESv2.dylib"; -const char kEGLSwiftShaderLibraryName[] = "libswiftshader_libEGL.dylib"; - bool InitializeStaticEGLInternalFromLibrary(GLImplementation implementation) { +#if BUILDFLAG(USE_STATIC_ANGLE) + NOTREACHED(); +#endif + // Some unit test targets depend on Angle/SwiftShader but aren't built // as app bundles. In that case, the .dylib is next to the executable. base::FilePath base_dir; @@ -111,28 +112,13 @@ bool InitializeStaticEGLInternalFromLibrary(GLImplementation implementation) { base_dir = base_dir.DirName(); } - base::FilePath glesv2_path; - base::FilePath egl_path; - if (implementation == kGLImplementationSwiftShaderGL) { -#if BUILDFLAG(ENABLE_SWIFTSHADER) - glesv2_path = base_dir.Append(kGLESv2SwiftShaderLibraryName); - egl_path = base_dir.Append(kEGLSwiftShaderLibraryName); -#else - return false; -#endif - } else { - glesv2_path = base_dir.Append(kGLESv2ANGLELibraryName); - egl_path = base_dir.Append(kEGLANGLELibraryName); -#if BUILDFLAG(USE_STATIC_ANGLE) - NOTREACHED(); -#endif - } - + base::FilePath glesv2_path = base_dir.Append(kGLESv2ANGLELibraryName); base::NativeLibrary gles_library = LoadLibraryAndPrintError(glesv2_path); if (!gles_library) { return false; } + base::FilePath egl_path = base_dir.Append(kEGLANGLELibraryName); base::NativeLibrary egl_library = LoadLibraryAndPrintError(egl_path); if (!egl_library) { base::UnloadNativeLibrary(gles_library); @@ -197,7 +183,6 @@ bool InitializeGLOneOffPlatform(uint64_t system_device_id) { #if defined(USE_EGL) case kGLImplementationEGLGLES2: case kGLImplementationEGLANGLE: - case kGLImplementationSwiftShaderGL: if (!GLSurfaceEGL::InitializeOneOff(EGLDisplayPlatform(0), system_device_id)) { LOG(ERROR) << "GLSurfaceEGL::InitializeOneOff failed."; @@ -230,7 +215,6 @@ bool InitializeStaticGLBindings(GLImplementationParts implementation) { #if defined(USE_EGL) case kGLImplementationEGLGLES2: case kGLImplementationEGLANGLE: - case kGLImplementationSwiftShaderGL: return InitializeStaticEGLInternal(implementation); #endif // #if defined(USE_EGL) case kGLImplementationMockGL: diff --git a/ui/gl/init/gl_initializer_win.cc b/ui/gl/init/gl_initializer_win.cc index 05b9e03b2b2745..06798da4e51574 100644 --- a/ui/gl/init/gl_initializer_win.cc +++ b/ui/gl/init/gl_initializer_win.cc @@ -45,6 +45,10 @@ bool LoadD3DXLibrary(const base::FilePath& module_path, } bool InitializeStaticEGLInternalFromLibrary(GLImplementation implementation) { +#if BUILDFLAG(USE_STATIC_ANGLE) + NOTREACHED(); +#endif + base::FilePath module_path; if (!base::PathService::Get(base::DIR_MODULE, &module_path)) return false; @@ -54,21 +58,7 @@ bool InitializeStaticEGLInternalFromLibrary(GLImplementation implementation) { // load the OS version. LoadD3DXLibrary(module_path, kD3DCompiler); - base::FilePath gles_path; - if (implementation == kGLImplementationSwiftShaderGL) { -#if BUILDFLAG(ENABLE_SWIFTSHADER) - gles_path = module_path.Append(L"swiftshader/"); - // Preload library - LoadLibrary(L"ddraw.dll"); -#else - return false; -#endif - } else { - gles_path = module_path; -#if BUILDFLAG(USE_STATIC_ANGLE) - NOTREACHED(); -#endif - } + base::FilePath gles_path = module_path; // Load libglesv2.dll before libegl.dll because the latter is dependent on // the former and if there is another version of libglesv2.dll in the dll @@ -136,7 +126,6 @@ bool InitializeGLOneOffPlatform(uint64_t system_device_id) { VSyncProviderWin::InitializeOneOff(); switch (GetGLImplementation()) { - case kGLImplementationSwiftShaderGL: case kGLImplementationEGLANGLE: if (!GLSurfaceEGL::InitializeOneOff(EGLDisplayPlatform(GetDC(nullptr)), system_device_id)) { @@ -167,7 +156,6 @@ bool InitializeStaticGLBindings(GLImplementationParts implementation) { base::ThreadRestrictions::ScopedAllowIO allow_io; switch (implementation.gl) { - case kGLImplementationSwiftShaderGL: case kGLImplementationEGLANGLE: return InitializeStaticEGLInternal(implementation); case kGLImplementationMockGL: diff --git a/ui/gl/test/egl_initialization_displays_unittest.cc b/ui/gl/test/egl_initialization_displays_unittest.cc index 939da7ca639a32..b0d34bab6a327c 100644 --- a/ui/gl/test/egl_initialization_displays_unittest.cc +++ b/ui/gl/test/egl_initialization_displays_unittest.cc @@ -39,31 +39,6 @@ TEST(EGLInitializationDisplaysTest, DisableD3D11) { EXPECT_FALSE(base::Contains(displays, gl::ANGLE_D3D11)); } -TEST(EGLInitializationDisplaysTest, SwiftShader) { - std::unique_ptr command_line( - new base::CommandLine(base::CommandLine::NO_PROGRAM)); - - std::vector displays; - - // If swiftshader is requested, only SWIFT_SHADER should be returned - command_line->AppendSwitchASCII(switches::kUseGL, - gl::kGLImplementationSwiftShaderForWebGLName); - displays.clear(); - GetEGLInitDisplays(true, true, true, true, true, true, true, - command_line.get(), &displays); - EXPECT_TRUE(base::Contains(displays, gl::SWIFT_SHADER)); - EXPECT_EQ(displays.size(), 1u); - - // Even if there are other flags, swiftshader should take prescedence - command_line->AppendSwitchASCII(switches::kUseANGLE, - gl::kANGLEImplementationD3D11Name); - displays.clear(); - GetEGLInitDisplays(true, true, true, true, true, true, true, - command_line.get(), &displays); - EXPECT_TRUE(base::Contains(displays, gl::SWIFT_SHADER)); - EXPECT_EQ(displays.size(), 1u); -} - TEST(EGLInitializationDisplaysTest, DefaultRenderers) { std::unique_ptr command_line( new base::CommandLine(base::CommandLine::NO_PROGRAM)); diff --git a/ui/gl/test/gl_surface_test_support.cc b/ui/gl/test/gl_surface_test_support.cc index 9f63da7a3b9ef7..22ee46ef58605e 100644 --- a/ui/gl/test/gl_surface_test_support.cc +++ b/ui/gl/test/gl_surface_test_support.cc @@ -58,7 +58,7 @@ void InitializeOneOffHelper(bool init_extensions) { GLImplementationParts impl = allowed_impls[0]; if (use_software_gl) { - impl = gl::GetSoftwareGLImplementationForPlatform(); + impl = gl::GetSoftwareGLImplementation(); } DCHECK(!base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGL)) diff --git a/ui/ozone/common/egl_util.cc b/ui/ozone/common/egl_util.cc index 08d42145b1d75e..9ebf5d4d121a84 100644 --- a/ui/ozone/common/egl_util.cc +++ b/ui/ozone/common/egl_util.cc @@ -46,25 +46,6 @@ const base::FilePath::CharType kAngleGlesSoname[] = FILE_PATH_LITERAL("libGLESv2.so"); #endif // BUILDFLAG(IS_WIN) -#if BUILDFLAG(ENABLE_SWIFTSHADER) -#if BUILDFLAG(IS_WIN) -const base::FilePath::CharType kGLESv2SwiftShaderLibraryName[] = - FILE_PATH_LITERAL("libGLESv2.dll"); -const base::FilePath::CharType kEGLSwiftShaderLibraryName[] = - FILE_PATH_LITERAL("libEGL.dll"); -#elif BUILDFLAG(IS_FUCHSIA) -const base::FilePath::CharType kGLESv2SwiftShaderLibraryName[] = - FILE_PATH_LITERAL("libswiftshader_libGLESv2.so"); -const base::FilePath::CharType kEGLSwiftShaderLibraryName[] = - FILE_PATH_LITERAL("libswiftshader_libEGL.so"); -#else -const base::FilePath::CharType kGLESv2SwiftShaderLibraryName[] = - FILE_PATH_LITERAL("libGLESv2.so"); -const base::FilePath::CharType kEGLSwiftShaderLibraryName[] = - FILE_PATH_LITERAL("libEGL.so"); -#endif -#endif // BUILDFLAG(ENABLE_SWIFTSHADER) - bool LoadEGLGLES2Bindings(const base::FilePath& egl_library_path, const base::FilePath& gles_library_path) { base::NativeLibraryLoadError error; @@ -154,21 +135,7 @@ bool LoadDefaultEGLGLES2Bindings( base::FilePath glesv2_path; base::FilePath egl_path; - if (implementation.gl == gl::kGLImplementationSwiftShaderGL) { -#if BUILDFLAG(ENABLE_SWIFTSHADER) - base::FilePath module_path; -#if !BUILDFLAG(IS_FUCHSIA) - if (!base::PathService::Get(base::DIR_MODULE, &module_path)) - return false; - module_path = module_path.Append(FILE_PATH_LITERAL("swiftshader/")); -#endif - - glesv2_path = module_path.Append(kGLESv2SwiftShaderLibraryName); - egl_path = module_path.Append(kEGLSwiftShaderLibraryName); -#else - return false; -#endif - } else if (implementation.gl == gl::kGLImplementationEGLANGLE) { + if (implementation.gl == gl::kGLImplementationEGLANGLE) { base::FilePath module_path; #if !BUILDFLAG(IS_FUCHSIA) if (!base::PathService::Get(base::DIR_MODULE, &module_path))