Skip to content

Commit

Permalink
Mac: Remove OpenGL and OpenGL ES backends
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=217374

Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2020-10-08
Reviewed by Darin Adler.

Remove macOS OpenGL (CGL) and iOS OpenGL ES (EAGL)
implementations of GraphicsContextGLOpenGL. These
are not used anymore and cannot be used for conformant
WebGL. The two removed backends would just create
maintainance burden.

Removes TextureCacheCV, this was not implemented for
ANGLE and in comments it was said to be disabled in
the platform.

Fixes a bug where iOS apps on Mac Apple Silicon would
not use correct texture target to convert the video
frames in VideoTextureCopierCV.

Fixes few instances of using GL types in WebGL implementation
instead of WebCore defined GCGL types. This is needed
now that the includes are (a bit) more correct.

No new tests, a refactoring.

* PlatformMac.cmake:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* html/canvas/ANGLEInstancedArrays.cpp:
(WebCore::ANGLEInstancedArrays::supported):
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
(WebCore::WebGLRenderingContextBase::readPixels):
* platform/graphics/GraphicsContextGL.cpp:
* platform/graphics/GraphicsContextGL.h:
* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLOpenGL::reshapeFBOs):
(WebCore::GraphicsContextGLOpenGL::paintRenderingResultsToCanvas):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
* platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
(WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
(WebCore::GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL):
(WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTarget):
(WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTargetQuery):
(WebCore::GraphicsContextGLOpenGL::EGLIOSurfaceTextureTarget):
(WebCore::GraphicsContextGLOpenGL::makeContextCurrent):
(WebCore::GraphicsContextGLOpenGL::checkGPUStatus):
(WebCore::GraphicsContextGLOpenGL::setContextVisibility):
(WebCore::GraphicsContextGLOpenGL::screenDidChange):
* platform/graphics/cocoa/WebGLLayer.h:
* platform/graphics/cocoa/WebGLLayer.mm:
(-[WebGLLayer initWithGraphicsContextGL:]):
(-[WebGLLayer setAnchorPoint:]):
(-[WebGLLayer copyImageSnapshotWithColorSpace:]):
(-[WebGLLayer prepareForDisplay]):
(-[WebGLLayer display]):
(-[WebGLLayer releaseGLResources]):
(-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]):
(-[WebGLLayer bindFramebufferToNextAvailableSurface]):
* platform/graphics/cv/TextureCacheCV.h: Removed.
* platform/graphics/cv/TextureCacheCV.mm: Removed.
* platform/graphics/cv/VideoTextureCopierCV.cpp:
(WebCore::VideoTextureCopierCV::initializeContextObjects):
(WebCore::VideoTextureCopierCV::initializeUVContextObjects):
(WebCore::VideoTextureCopierCV::attachIOSurfaceToTexture):
(WebCore::VideoTextureCopierCV::detachIOSurfaceFromTexture):
(WebCore::VideoTextureCopierCV::copyImageToPlatformTexture):
(WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture):
* platform/graphics/cv/VideoTextureCopierCV.h:
* platform/graphics/ios/GraphicsContextGLOpenGLESIOS.h: Removed.
* platform/graphics/opengl/ExtensionsGLOpenGL.cpp:
(WebCore::ExtensionsGLOpenGL::blitFramebuffer):
(WebCore::ExtensionsGLOpenGL::createVertexArrayOES):
(WebCore::ExtensionsGLOpenGL::deleteVertexArrayOES):
(WebCore::ExtensionsGLOpenGL::isVertexArrayOES):
(WebCore::ExtensionsGLOpenGL::bindVertexArrayOES):
(WebCore::ExtensionsGLOpenGL::supportsExtension):
(WebCore::ExtensionsGLOpenGL::drawBuffersEXT):
(WebCore::ExtensionsGLOpenGL::drawArraysInstanced):
(WebCore::ExtensionsGLOpenGL::drawElementsInstanced):
(WebCore::ExtensionsGLOpenGL::vertexAttribDivisor):
* platform/graphics/opengl/ExtensionsGLOpenGL.h:
* platform/graphics/opengl/ExtensionsGLOpenGLCommon.cpp:
(WebCore::ExtensionsGLOpenGLCommon::initializeAvailableExtensions):
* platform/graphics/opengl/GraphicsContextGLOpenGL.cpp:
(WebCore::GraphicsContextGLOpenGL::setContextVisibility):
* platform/graphics/opengl/GraphicsContextGLOpenGL.h:
* platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp:
(WebCore::GraphicsContextGLOpenGL::readPixelsAndConvertToBGRAIfNecessary):
(WebCore::GraphicsContextGLOpenGL::reshapeFBOs):
(WebCore::GraphicsContextGLOpenGL::resolveMultisamplingIfNecessary):
(WebCore::GraphicsContextGLOpenGL::getIntegerv):
(WebCore::GraphicsContextGLOpenGL::depthRange):
(WebCore::GraphicsContextGLOpenGL::clearDepth):
(WebCore::GraphicsContextGLOpenGL::getExtensions):
(WebCore::GraphicsContextGLOpenGL::readPixels):
* platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:
(WebCore::GraphicsContextGLOpenGL::paintRenderingResultsToCanvas):
(WebCore::GraphicsContextGLOpenGL::copyTexImage2D):
(WebCore::GraphicsContextGLOpenGL::copyTexSubImage2D):
(WebCore::GraphicsContextGLOpenGL::finish):
(WebCore::GraphicsContextGLOpenGL::flush):
(WebCore::GraphicsContextGLOpenGL::deleteTexture):
* platform/graphics/opengl/GraphicsContextGLOpenGLES.cpp:
* platform/graphics/opengl/GraphicsContextGLOpenGLManager.cpp:
(WebCore::GraphicsContextGLOpenGLManager::updateAllContexts):
(WebCore::GraphicsContextGLOpenGLManager::updateHighPerformanceState):
(WebCore::GraphicsContextGLOpenGLManager::disableHighPerformanceGPUTimerFired):
* platform/graphics/opengl/GraphicsContextGLOpenGLManager.h:

Canonical link: https://commits.webkit.org/230256@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268198 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
kkinnunen-apple authored and webkit-commit-queue committed Oct 8, 2020
1 parent fce9392 commit a16b2d8
Show file tree
Hide file tree
Showing 31 changed files with 345 additions and 1,366 deletions.
115 changes: 115 additions & 0 deletions Source/WebCore/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,118 @@
2020-10-08 Kimmo Kinnunen <kkinnunen@apple.com>

Mac: Remove OpenGL and OpenGL ES backends
https://bugs.webkit.org/show_bug.cgi?id=217374

Reviewed by Darin Adler.

Remove macOS OpenGL (CGL) and iOS OpenGL ES (EAGL)
implementations of GraphicsContextGLOpenGL. These
are not used anymore and cannot be used for conformant
WebGL. The two removed backends would just create
maintainance burden.

Removes TextureCacheCV, this was not implemented for
ANGLE and in comments it was said to be disabled in
the platform.

Fixes a bug where iOS apps on Mac Apple Silicon would
not use correct texture target to convert the video
frames in VideoTextureCopierCV.

Fixes few instances of using GL types in WebGL implementation
instead of WebCore defined GCGL types. This is needed
now that the includes are (a bit) more correct.

No new tests, a refactoring.

* PlatformMac.cmake:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* html/canvas/ANGLEInstancedArrays.cpp:
(WebCore::ANGLEInstancedArrays::supported):
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
(WebCore::WebGLRenderingContextBase::readPixels):
* platform/graphics/GraphicsContextGL.cpp:
* platform/graphics/GraphicsContextGL.h:
* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLOpenGL::reshapeFBOs):
(WebCore::GraphicsContextGLOpenGL::paintRenderingResultsToCanvas):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
* platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
(WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
(WebCore::GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL):
(WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTarget):
(WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTargetQuery):
(WebCore::GraphicsContextGLOpenGL::EGLIOSurfaceTextureTarget):
(WebCore::GraphicsContextGLOpenGL::makeContextCurrent):
(WebCore::GraphicsContextGLOpenGL::checkGPUStatus):
(WebCore::GraphicsContextGLOpenGL::setContextVisibility):
(WebCore::GraphicsContextGLOpenGL::screenDidChange):
* platform/graphics/cocoa/WebGLLayer.h:
* platform/graphics/cocoa/WebGLLayer.mm:
(-[WebGLLayer initWithGraphicsContextGL:]):
(-[WebGLLayer setAnchorPoint:]):
(-[WebGLLayer copyImageSnapshotWithColorSpace:]):
(-[WebGLLayer prepareForDisplay]):
(-[WebGLLayer display]):
(-[WebGLLayer releaseGLResources]):
(-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]):
(-[WebGLLayer bindFramebufferToNextAvailableSurface]):
* platform/graphics/cv/TextureCacheCV.h: Removed.
* platform/graphics/cv/TextureCacheCV.mm: Removed.
* platform/graphics/cv/VideoTextureCopierCV.cpp:
(WebCore::VideoTextureCopierCV::initializeContextObjects):
(WebCore::VideoTextureCopierCV::initializeUVContextObjects):
(WebCore::VideoTextureCopierCV::attachIOSurfaceToTexture):
(WebCore::VideoTextureCopierCV::detachIOSurfaceFromTexture):
(WebCore::VideoTextureCopierCV::copyImageToPlatformTexture):
(WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture):
* platform/graphics/cv/VideoTextureCopierCV.h:
* platform/graphics/ios/GraphicsContextGLOpenGLESIOS.h: Removed.
* platform/graphics/opengl/ExtensionsGLOpenGL.cpp:
(WebCore::ExtensionsGLOpenGL::blitFramebuffer):
(WebCore::ExtensionsGLOpenGL::createVertexArrayOES):
(WebCore::ExtensionsGLOpenGL::deleteVertexArrayOES):
(WebCore::ExtensionsGLOpenGL::isVertexArrayOES):
(WebCore::ExtensionsGLOpenGL::bindVertexArrayOES):
(WebCore::ExtensionsGLOpenGL::supportsExtension):
(WebCore::ExtensionsGLOpenGL::drawBuffersEXT):
(WebCore::ExtensionsGLOpenGL::drawArraysInstanced):
(WebCore::ExtensionsGLOpenGL::drawElementsInstanced):
(WebCore::ExtensionsGLOpenGL::vertexAttribDivisor):
* platform/graphics/opengl/ExtensionsGLOpenGL.h:
* platform/graphics/opengl/ExtensionsGLOpenGLCommon.cpp:
(WebCore::ExtensionsGLOpenGLCommon::initializeAvailableExtensions):
* platform/graphics/opengl/GraphicsContextGLOpenGL.cpp:
(WebCore::GraphicsContextGLOpenGL::setContextVisibility):
* platform/graphics/opengl/GraphicsContextGLOpenGL.h:
* platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp:
(WebCore::GraphicsContextGLOpenGL::readPixelsAndConvertToBGRAIfNecessary):
(WebCore::GraphicsContextGLOpenGL::reshapeFBOs):
(WebCore::GraphicsContextGLOpenGL::resolveMultisamplingIfNecessary):
(WebCore::GraphicsContextGLOpenGL::getIntegerv):
(WebCore::GraphicsContextGLOpenGL::depthRange):
(WebCore::GraphicsContextGLOpenGL::clearDepth):
(WebCore::GraphicsContextGLOpenGL::getExtensions):
(WebCore::GraphicsContextGLOpenGL::readPixels):
* platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:
(WebCore::GraphicsContextGLOpenGL::paintRenderingResultsToCanvas):
(WebCore::GraphicsContextGLOpenGL::copyTexImage2D):
(WebCore::GraphicsContextGLOpenGL::copyTexSubImage2D):
(WebCore::GraphicsContextGLOpenGL::finish):
(WebCore::GraphicsContextGLOpenGL::flush):
(WebCore::GraphicsContextGLOpenGL::deleteTexture):
* platform/graphics/opengl/GraphicsContextGLOpenGLES.cpp:
* platform/graphics/opengl/GraphicsContextGLOpenGLManager.cpp:
(WebCore::GraphicsContextGLOpenGLManager::updateAllContexts):
(WebCore::GraphicsContextGLOpenGLManager::updateHighPerformanceState):
(WebCore::GraphicsContextGLOpenGLManager::disableHighPerformanceGPUTimerFired):
* platform/graphics/opengl/GraphicsContextGLOpenGLManager.h:

2020-10-08 Antti Koivisto <antti@apple.com>

[LFC][Integration] Convert RenderText::positionForPoint use iterator
Expand Down
5 changes: 0 additions & 5 deletions Source/WebCore/PlatformMac.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,6 @@ list(APPEND WebCore_SOURCES

platform/graphics/cv/ImageRotationSessionVT.mm
platform/graphics/cv/PixelBufferConformerCV.cpp
platform/graphics/cv/TextureCacheCV.mm
platform/graphics/cv/VideoTextureCopierCV.cpp

platform/graphics/gpu/Texture.cpp
Expand All @@ -348,11 +347,7 @@ list(APPEND WebCore_SOURCES
platform/graphics/mac/SimpleFontDataCoreText.cpp
platform/graphics/mac/WebLayer.mm

platform/graphics/opengl/ExtensionsGLOpenGL.cpp
platform/graphics/opengl/ExtensionsGLOpenGLCommon.cpp
platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp
platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp
platform/graphics/opengl/TemporaryOpenGLSetting.cpp

platform/graphics/opentype/OpenTypeCG.cpp
platform/graphics/opentype/OpenTypeMathData.cpp
Expand Down
5 changes: 0 additions & 5 deletions Source/WebCore/SourcesCocoa.txt
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,6 @@ platform/graphics/coretext/FontPlatformDataCoreText.cpp
platform/graphics/coretext/GlyphPageCoreText.cpp
platform/graphics/cv/ImageTransferSessionVT.mm
platform/graphics/cv/PixelBufferConformerCV.cpp
platform/graphics/cv/TextureCacheCV.mm
platform/graphics/cv/VideoTextureCopierCV.cpp
platform/graphics/coreimage/FilterEffectRendererCoreImage.mm
platform/graphics/gpu/Texture.cpp
Expand Down Expand Up @@ -416,12 +415,8 @@ platform/graphics/mac/SimpleFontDataCoreText.cpp
platform/graphics/mac/SwitchingGPUClient.cpp
platform/graphics/mac/WebKitNSImageExtras.mm
platform/graphics/mac/WebLayer.mm
platform/graphics/opengl/ExtensionsGLOpenGL.cpp
platform/graphics/opengl/ExtensionsGLOpenGLCommon.cpp
platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp
platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp
platform/graphics/opengl/GraphicsContextGLOpenGLManager.cpp
platform/graphics/opengl/TemporaryOpenGLSetting.cpp
platform/graphics/opentype/OpenTypeCG.cpp
platform/ios/ColorIOS.mm
platform/ios/Device.cpp
Expand Down
Loading

0 comments on commit a16b2d8

Please sign in to comment.