tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit a6944a13821727f23cdfecc98271d7f723bb6994
parent a87ad8d89c66e4febf935208a8196f96565568c2
Author: Ryan VanderMeulen <rvandermeulen@mozilla.com>
Date:   Wed,  1 Oct 2025 04:19:16 +0000

Bug 1991812 - Remove old macOS HD3000 workarounds. r=gfx-reviewers,lsalzman

Differential Revision: https://phabricator.services.mozilla.com/D266944

Diffstat:
Mgfx/gl/GLContext.cpp | 10----------
Mgfx/gl/GLContext.h | 1-
Mgfx/layers/opengl/CompositorOGL.cpp | 63---------------------------------------------------------------
Mwidget/cocoa/GfxInfo.mm | 6------
4 files changed, 0 insertions(+), 80 deletions(-)

diff --git a/gfx/gl/GLContext.cpp b/gfx/gl/GLContext.cpp @@ -668,7 +668,6 @@ bool GLContext::InitImpl() { "NVIDIA Tegra", "Android Emulator", "Gallium 0.4 on llvmpipe", - "Intel HD Graphics 3000 OpenGL Engine", "Microsoft Basic Render Driver", "Samsung Xclipse", "Unknown"}; @@ -1748,15 +1747,6 @@ void GLContext::InitExtensions() { } #ifdef XP_MACOSX - // Bug 1009642: On OSX Mavericks (10.9), the driver for Intel HD - // 3000 appears to be buggy WRT updating sub-images of S3TC - // textures with glCompressedTexSubImage2D. Works on Intel HD 4000 - // and Intel HD 5000/Iris that I tested. - // Bug 1124996: Appears to be the same on OSX Yosemite (10.10) - if (Renderer() == GLRenderer::IntelHD3000) { - MarkExtensionUnsupported(EXT_texture_compression_s3tc); - } - // OSX supports EXT_texture_sRGB in Legacy contexts, but not in Core // contexts. Though EXT_texture_sRGB was included into GL2.1, it *excludes* // the interactions with s3tc. Strictly speaking, you must advertize support diff --git a/gfx/gl/GLContext.h b/gfx/gl/GLContext.h @@ -177,7 +177,6 @@ enum class GLRenderer { Tegra, AndroidEmulator, GalliumLlvmpipe, - IntelHD3000, MicrosoftBasicRenderDriver, SamsungXclipse, Other diff --git a/gfx/layers/opengl/CompositorOGL.cpp b/gfx/layers/opengl/CompositorOGL.cpp @@ -839,67 +839,6 @@ void CompositorOGL::CreateFBOWithTexture(const gfx::IntRect& aRect, mGLContext->fGenFramebuffers(1, aFBO); } -// Should be called after calls to fReadPixels or fCopyTexImage2D, and other -// GL read calls. -static void WorkAroundAppleIntelHD3000GraphicsGLDriverBug(GLContext* aGL) { -#ifdef XP_MACOSX - if (aGL->WorkAroundDriverBugs() && - aGL->Renderer() == GLRenderer::IntelHD3000) { - // Work around a bug in the Apple Intel HD Graphics 3000 driver (bug - // 1586627, filed with Apple as FB7379358). This bug has been found present - // on 10.9.3 and on 10.13.6, so it likely affects all shipped versions of - // this driver. (macOS 10.14 does not support this GPU.) - // The bug manifests as follows: Reading from a framebuffer puts that - // framebuffer into a state such that deleting that framebuffer can break - // other framebuffers in certain cases. More specifically, if you have two - // framebuffers A and B, the following sequence of events breaks subsequent - // drawing to B: - // 1. A becomes "most recently read-from framebuffer". - // 2. B is drawn to. - // 3. A is deleted, and other GL state (such as GL_SCISSOR enabled state) - // is touched. - // 4. B is drawn to again. - // Now all draws to framebuffer B, including the draw from step 4, will - // render at the wrong position and upside down. - // - // When AfterGLReadCall() is called, the currently bound framebuffer is the - // framebuffer that has been read from most recently. So in the presence of - // this bug, deleting this framebuffer has now become dangerous. We work - // around the bug by creating a new short-lived framebuffer, making that new - // framebuffer the most recently read-from framebuffer (using - // glCopyTexImage2D), and then deleting it under controlled circumstances. - // This deletion is not affected by the bug because our deletion call is not - // interleaved with draw calls to another framebuffer and a touching of the - // GL scissor enabled state. - - ScopedTexture texForReading(aGL); - { - // Initialize a 1x1 texture. - ScopedBindTexture autoBindTexForReading(aGL, texForReading); - aGL->fTexImage2D(LOCAL_GL_TEXTURE_2D, 0, LOCAL_GL_RGBA, 1, 1, 0, - LOCAL_GL_RGBA, LOCAL_GL_UNSIGNED_BYTE, nullptr); - aGL->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_MIN_FILTER, - LOCAL_GL_LINEAR); - aGL->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_MAG_FILTER, - LOCAL_GL_LINEAR); - } - // Make a framebuffer around the texture. - ScopedFramebufferForTexture autoFBForReading(aGL, texForReading); - if (autoFBForReading.IsComplete()) { - // "Read" from the framebuffer, by initializing a new texture using - // glCopyTexImage2D. This flips the bad bit on autoFBForReading.FB(). - ScopedBindFramebuffer autoFB(aGL, autoFBForReading.FB()); - ScopedTexture texReadingDest(aGL); - ScopedBindTexture autoBindTexReadingDest(aGL, texReadingDest); - aGL->fCopyTexImage2D(LOCAL_GL_TEXTURE_2D, 0, LOCAL_GL_RGBA, 0, 0, 1, 1, - 0); - } - // When autoFBForReading goes out of scope, the "poisoned" framebuffer is - // deleted, and the bad state seems to go away along with it. - } -#endif -} - GLuint CompositorOGL::CreateTexture(const IntRect& aRect, bool aCopyFromSource, GLuint aSourceFrameBuffer, IntSize* aAllocSize) { @@ -944,7 +883,6 @@ GLuint CompositorOGL::CreateTexture(const IntRect& aRect, bool aCopyFromSource, mGLContext->fCopyTexImage2D(mFBOTextureTarget, 0, LOCAL_GL_RGBA, clampedRect.X(), FlipY(clampedRect.YMost()), clampedRectWidth, clampedRectHeight, 0); - WorkAroundAppleIntelHD3000GraphicsGLDriverBug(mGLContext); } else { // Curses, incompatible formats. Take a slow path. @@ -955,7 +893,6 @@ GLuint CompositorOGL::CreateTexture(const IntRect& aRect, bool aCopyFromSource, mGLContext->fReadPixels(clampedRect.X(), clampedRect.Y(), clampedRectWidth, clampedRectHeight, LOCAL_GL_RGBA, LOCAL_GL_UNSIGNED_BYTE, buf.get()); - WorkAroundAppleIntelHD3000GraphicsGLDriverBug(mGLContext); mGLContext->fTexImage2D(mFBOTextureTarget, 0, LOCAL_GL_RGBA, clampedRectWidth, clampedRectHeight, 0, LOCAL_GL_RGBA, LOCAL_GL_UNSIGNED_BYTE, buf.get()); diff --git a/widget/cocoa/GfxInfo.mm b/widget/cocoa/GfxInfo.mm @@ -468,12 +468,6 @@ const nsTArray<RefPtr<GfxDriverInfo>>& GfxInfo::GetGfxDriverInfo() { OperatingSystem::OSX, DeviceFamily::IntelWebRenderBlocked, nsIGfxInfo::FEATURE_WEBRENDER, nsIGfxInfo::FEATURE_BLOCKED_DEVICE, "FEATURE_FAILURE_INTEL_GEN5_OR_OLDER"); - - // Intel HD3000 disabled due to bug 1661505 - IMPLEMENT_MAC_DRIVER_BLOCKLIST( - OperatingSystem::OSX, DeviceFamily::IntelSandyBridge, - nsIGfxInfo::FEATURE_WEBRENDER, nsIGfxInfo::FEATURE_BLOCKED_DEVICE, - "FEATURE_FAILURE_INTEL_MAC_HD3000_NO_WEBRENDER"); } return *sDriverInfo; }