WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-217216-20201103152636.patch (text/plain), 315.83 KB, created by
Kimmo Kinnunen
on 2020-11-03 05:26:38 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Kimmo Kinnunen
Created:
2020-11-03 05:26:38 PST
Size:
315.83 KB
patch
obsolete
>Subversion Revision: 269141 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index d5fab3cd38da17cd5f331a259c6995ef260d0420..2f70239dd452a550a180698c4d48143b4231879b 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,114 @@ >+2020-11-03 Kimmo Kinnunen <kkinnunen@apple.com> >+ >+ Implement RemoteGraphicsContextGL >+ https://bugs.webkit.org/show_bug.cgi?id=217216 >+ <rdar://problem/69876258> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Implements a remote version of GraphicsContextGL for GPU process. >+ Current implementation is using WebKit IPC and is incomplete. >+ >+ Implemented with a generator script implementing the IPC to pass >+ the GraphicsContextGL member function calls from web process to >+ the GPU process. The script is run during development time and the >+ results are committed to the repo for ease of review. >+ >+ Changes GraphicsContextGL and ExtensionsGL to not have duplicate names >+ and have the correct function signatures. >+ >+ WIP: >+ - Not tested. >+ - Implemented: 164, unimplemented: 151, total: 315 >+ >+ No new tests (OOPS!). >+ >+ * Modules/mediarecorder/MediaRecorderProvider.h: >+ * SourcesCocoa.txt: >+ * WebCore.xcodeproj/project.pbxproj: >+ * html/canvas/WebGLRenderingContextBase.cpp: >+ (WebCore::WebGLRenderingContextBase::create): >+ * page/Chrome.cpp: >+ (WebCore::Chrome::createGraphicsContextGL const): >+ (WebCore::Chrome::windowScreenDidChange): >+ * page/Chrome.h: >+ * page/ChromeClient.h: >+ (WebCore::ChromeClient::createGraphicsContextGL const): >+ * platform/HostWindow.h: >+ * platform/graphics/ExtensionsGL.h: >+ * platform/graphics/GraphicsContextGL.cpp: >+ (WebCore::GraphicsContextGL::create): >+ * platform/graphics/GraphicsContextGL.h: >+ * platform/graphics/GraphicsTypesGL.h: >+ * platform/graphics/ImageBuffer.h: >+ * platform/graphics/PlatformRemoteGraphicsContextGLProxyBase.h: Copied from Source/WebCore/platform/graphics/GraphicsTypesGL.h. >+ * platform/graphics/RemoteGraphicsContextGLBase.h: Added. >+ * platform/graphics/angle/ExtensionsGLANGLE.cpp: >+ (WebCore::ExtensionsGLANGLE::getGraphicsResetStatusARB): >+ (WebCore::ExtensionsGLANGLE::getTranslatedShaderSourceANGLE): >+ (WebCore::ExtensionsGLANGLE::blitFramebufferANGLE): >+ (WebCore::ExtensionsGLANGLE::renderbufferStorageMultisampleANGLE): >+ (WebCore::ExtensionsGLANGLE::drawArraysInstancedANGLE): >+ (WebCore::ExtensionsGLANGLE::drawElementsInstancedANGLE): >+ (WebCore::ExtensionsGLANGLE::vertexAttribDivisorANGLE): >+ (WebCore::ExtensionsGLANGLE::getUniformfvRobustANGLE): >+ (WebCore::ExtensionsGLANGLE::getUniformivRobustANGLE): >+ (WebCore::ExtensionsGLANGLE::readPixelsRobustANGLE): >+ (WebCore::ExtensionsGLANGLE::texImage2DRobustANGLE): >+ (WebCore::ExtensionsGLANGLE::texSubImage2DRobustANGLE): >+ (WebCore::ExtensionsGLANGLE::compressedTexImage2DRobustANGLE): >+ (WebCore::ExtensionsGLANGLE::compressedTexSubImage2DRobustANGLE): >+ (WebCore::ExtensionsGLANGLE::compressedTexImage3DRobustANGLE): >+ (WebCore::ExtensionsGLANGLE::compressedTexSubImage3DRobustANGLE): >+ (WebCore::ExtensionsGLANGLE::texImage3DRobustANGLE): >+ (WebCore::ExtensionsGLANGLE::texSubImage3DRobustANGLE): >+ (WebCore::ExtensionsGLANGLE::getUniformuivRobustANGLE): >+ (WebCore::ExtensionsGLANGLE::getTexLevelParameterivRobustANGLE): >+ (WebCore::ExtensionsGLANGLE::getTexLevelParameterfvRobustANGLE): >+ (WebCore::wipeAlphaChannelFromPixels): >+ (WebCore::ExtensionsGLANGLE::readnPixelsRobustANGLE): >+ (WebCore::ExtensionsGLANGLE::getnUniformfvRobustANGLE): >+ (WebCore::ExtensionsGLANGLE::getnUniformivRobustANGLE): >+ (WebCore::ExtensionsGLANGLE::getnUniformuivRobustANGLE): >+ * platform/graphics/angle/ExtensionsGLANGLE.h: >+ * platform/graphics/cocoa/RemoteGraphicsContextGLProxyBaseCocoa.h: Added. >+ * platform/graphics/cocoa/RemoteGraphicsContextGLProxyBaseCocoa.mm: Added. >+ (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::RemoteGraphicsContextGLProxyBaseCocoa): >+ (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::~RemoteGraphicsContextGLProxyBaseCocoa): >+ (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::platformGraphicsContextGL const): >+ (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::platformTexture const): >+ (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::platformLayer const): >+ (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::enablePreserveDrawingBuffer): >+ (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::reshape): >+ (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::setContextVisibility): >+ (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::powerPreferenceUsedForCreation const): >+ (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::isGLES2Compliant const): >+ (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::synthesizeGLError): >+ (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::moveErrorsToSyntheticErrorList): >+ (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::setFailNextGPUStatusCheck): >+ (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::prepareForDisplay): >+ (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::markContextChanged): >+ (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::layerComposited const): >+ (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::setBuffersToAutoClear): >+ (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::getBuffersToAutoClear const): >+ (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::paintRenderingResultsToCanvas): >+ (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::paintRenderingResultsToImageData): >+ (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::paintCompositedResultsToCanvas): >+ (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::markLayerComposited): >+ (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::simulateContextChanged): >+ * platform/graphics/coreimage/FilterEffectRendererCoreImage.mm: >+ * platform/graphics/opengl/ExtensionsGLOpenGL.cpp: >+ (WebCore::ExtensionsGLOpenGL::drawArraysInstancedANGLE): >+ * platform/graphics/opengl/ExtensionsGLOpenGLES.cpp: >+ (WebCore::ExtensionsGLOpenGLES::drawArraysInstancedANGLE): >+ (WebCore::ExtensionsGLOpenGLES::drawElementsInstancedANGLE): >+ (WebCore::ExtensionsGLOpenGLES::vertexAttribDivisorANGLE): >+ * platform/graphics/opengl/GraphicsContextGLOpenGL.h: >+ * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp: >+ (WebCore::GraphicsContextGLOpenGL::drawArraysInstanced): >+ (WebCore::GraphicsContextGLOpenGL::drawElementsInstanced): >+ (WebCore::GraphicsContextGLOpenGL::vertexAttribDivisor): >+ > 2020-10-29 Kimmo Kinnunen <kkinnunen@apple.com> > > Final refactor for WebGL implementation to use only GraphicsContextGL >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 334c43a00beeb54b962d2c19145066698c014a11..acc68db38d9d13ee1434989f24573a94e174c557 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,311 @@ >+2020-11-03 Kimmo Kinnunen <kkinnunen@apple.com> >+ >+ Implement RemoteWebGLBackend >+ https://bugs.webkit.org/show_bug.cgi?id=217216 >+ <rdar://problem/69876258> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Implements a remote version of GraphicsContextGL for GPU process. >+ Current implementation is using WebKit IPC and is incomplete. >+ >+ Implemented with a generator script implementing the IPC to pass >+ the GraphicsContextGL member function calls from web process to >+ the GPU process. >+ >+ Changes GraphicsContextGL and ExtensionsGL to not have duplicate names >+ and have the correct function signatures. >+ >+ WIP: >+ - Not tested. >+ >+ * CMakeLists.txt: >+ * DerivedSources-input.xcfilelist: >+ * DerivedSources-output.xcfilelist: >+ * DerivedSources.make: >+ * GPUProcess/GPUConnectionToWebProcess.cpp: >+ (WebKit::GPUConnectionToWebProcess::createGraphicsContextGL): >+ (WebKit::GPUConnectionToWebProcess::releaseGraphicsContextGL): >+ * GPUProcess/GPUConnectionToWebProcess.h: >+ * GPUProcess/GPUConnectionToWebProcess.messages.in: >+ * GPUProcess/graphics/RemoteGraphicsContextGL.cpp: Added. >+ (WebKit::RemoteGraphicsContextGL::create): >+ (WebKit::RemoteGraphicsContextGL::RemoteGraphicsContextGL): >+ (WebKit::RemoteGraphicsContextGL::~RemoteGraphicsContextGL): >+ (WebKit::RemoteGraphicsContextGL::gpuConnectionToWebProcess const): >+ (WebKit::RemoteGraphicsContextGL::messageSenderConnection const): >+ (WebKit::RemoteGraphicsContextGL::messageSenderDestinationID const): >+ * GPUProcess/graphics/RemoteGraphicsContextGL.h: Added. >+ * GPUProcess/graphics/RemoteGraphicsContextGL.messages.in: Added. >+ * GPUProcess/graphics/RemoteGraphicsContextGLFunctionsGenerated.h: Added. >+ (activeTexture): >+ (attachShader): >+ (bindAttribLocation): >+ (bindBuffer): >+ (bindFramebuffer): >+ (bindRenderbuffer): >+ (bindTexture): >+ (blendColor): >+ (blendEquation): >+ (blendEquationSeparate): >+ (blendFunc): >+ (blendFuncSeparate): >+ (checkFramebufferStatus): >+ (clear): >+ (clearColor): >+ (clearDepth): >+ (clearStencil): >+ (colorMask): >+ (compileShader): >+ (copyTexImage2D): >+ (copyTexSubImage2D): >+ (createBuffer): >+ (createFramebuffer): >+ (createProgram): >+ (createRenderbuffer): >+ (createShader): >+ (createTexture): >+ (cullFace): >+ (deleteBuffer): >+ (deleteFramebuffer): >+ (deleteProgram): >+ (deleteRenderbuffer): >+ (deleteShader): >+ (deleteTexture): >+ (depthFunc): >+ (depthMask): >+ (depthRange): >+ (detachShader): >+ (disable): >+ (disableVertexAttribArray): >+ (drawArrays): >+ (drawElements): >+ (enable): >+ (enableVertexAttribArray): >+ (finish): >+ (flush): >+ (framebufferRenderbuffer): >+ (framebufferTexture2D): >+ (frontFace): >+ (generateMipmap): >+ (getAttribLocation): >+ (getString): >+ (getError): >+ (getProgramInfoLog): >+ (getShaderInfoLog): >+ (getShaderSource): >+ (getUniformLocation): >+ (getVertexAttribOffset): >+ (hint): >+ (isBuffer): >+ (isEnabled): >+ (isFramebuffer): >+ (isProgram): >+ (isRenderbuffer): >+ (isShader): >+ (isTexture): >+ (lineWidth): >+ (linkProgram): >+ (pixelStorei): >+ (polygonOffset): >+ (renderbufferStorage): >+ (sampleCoverage): >+ (scissor): >+ (shaderSource): >+ (stencilFunc): >+ (stencilFuncSeparate): >+ (stencilMask): >+ (stencilMaskSeparate): >+ (stencilOp): >+ (stencilOpSeparate): >+ (texParameterf): >+ (texParameteri): >+ (uniform1f): >+ (uniform1i): >+ (uniform2f): >+ (uniform2i): >+ (uniform3f): >+ (uniform3i): >+ (uniform4f): >+ (uniform4i): >+ (useProgram): >+ (validateProgram): >+ (vertexAttrib1f): >+ (vertexAttrib2f): >+ (vertexAttrib3f): >+ (vertexAttrib4f): >+ (vertexAttribPointer): >+ (viewport): >+ (bufferData): >+ (drawArraysInstanced): >+ (drawElementsInstanced): >+ (vertexAttribDivisor): >+ (createVertexArray): >+ (deleteVertexArray): >+ (isVertexArray): >+ (bindVertexArray): >+ (copyBufferSubData): >+ (unmapBuffer): >+ (blitFramebuffer): >+ (framebufferTextureLayer): >+ (readBuffer): >+ (renderbufferStorageMultisample): >+ (texStorage2D): >+ (texStorage3D): >+ (copyTexSubImage3D): >+ (getFragDataLocation): >+ (uniform1ui): >+ (uniform2ui): >+ (uniform3ui): >+ (uniform4ui): >+ (vertexAttribI4i): >+ (vertexAttribI4ui): >+ (vertexAttribIPointer): >+ (drawRangeElements): >+ (clearBufferfi): >+ (createQuery): >+ (deleteQuery): >+ (isQuery): >+ (beginQuery): >+ (endQuery): >+ (getQuery): >+ (createSampler): >+ (deleteSampler): >+ (isSampler): >+ (bindSampler): >+ (samplerParameteri): >+ (samplerParameterf): >+ (createTransformFeedback): >+ (deleteTransformFeedback): >+ (isTransformFeedback): >+ (bindTransformFeedback): >+ (beginTransformFeedback): >+ (endTransformFeedback): >+ (pauseTransformFeedback): >+ (resumeTransformFeedback): >+ (bindBufferBase): >+ (bindBufferRange): >+ (getUniformBlockIndex): >+ (getActiveUniformBlockName): >+ (uniformBlockBinding): >+ (getGraphicsResetStatusARB): >+ (blitFramebufferANGLE): >+ (renderbufferStorageMultisampleANGLE): >+ (createVertexArrayOES): >+ (deleteVertexArrayOES): >+ (isVertexArrayOES): >+ (bindVertexArrayOES): >+ (getTranslatedShaderSourceANGLE): >+ (insertEventMarkerEXT): >+ (pushGroupMarkerEXT): >+ (popGroupMarkerEXT): >+ (drawArraysInstancedANGLE): >+ (drawElementsInstancedANGLE): >+ (vertexAttribDivisorANGLE): >+ * Scripts/webkit/messages.py: >+ * Shared/WebCoreArgumentCoders.cpp: >+ (IPC::ArgumentCoder<WebCore::GraphicsContextGLAttributes>::encode): >+ (IPC::ArgumentCoder<WebCore::GraphicsContextGLAttributes>::decode): >+ * Shared/WebCoreArgumentCoders.h: >+ * Shared/WebPageCreationParameters.cpp: >+ (WebKit::WebPageCreationParameters::encode const): >+ (WebKit::WebPageCreationParameters::decode): >+ * Shared/WebPageCreationParameters.h: >+ * Sources.txt: >+ * SourcesCocoa.txt: >+ * UIProcess/WebPageProxy.cpp: >+ (WebKit::m_limitsNavigationsToAppBoundDomains): >+ (WebKit::WebPageProxy::setFindClient): >+ (WebKit::WebPageProxy::launchProcessForReload): >+ (WebKit::WebPageProxy::reload): >+ (WebKit::WebPageProxy::handleKeyboardEvent): >+ (WebKit::WebPageProxy::receivedPolicyDecision): >+ (WebKit::WebPageProxy::listenForLayoutMilestones): >+ (WebKit::WebPageProxy::setPaginationLineGridEnabled): >+ (WebKit::WebPageProxy::getRenderTreeExternalRepresentation): >+ (WebKit::WebPageProxy::getSourceForFrame): >+ (WebKit::WebPageProxy::getBytecodeProfile): >+ (WebKit::WebPageProxy::getSamplingProfilerOutput): >+ (WebKit::WebPageProxy::getSelectionOrContentsAsString): >+ (WebKit::WebPageProxy::getSelectionAsWebArchiveData): >+ (WebKit::WebPageProxy::getMainResourceDataOfFrame): >+ (WebKit::WebPageProxy::getResourceDataFromFrame): >+ (WebKit::WebPageProxy::getWebArchiveOfFrame): >+ (WebKit::WebPageProxy::forceRepaint): >+ (WebKit::WebPageProxy::didCreateSubframe): >+ (WebKit::WebPageProxy::didReceiveTitleForFrame): >+ (WebKit::WebPageProxy::didReachLayoutMilestone): >+ (WebKit::WebPageProxy::decidePolicyForNavigationAction): >+ (WebKit::WebPageProxy::nonEphemeralWebPageProxy): >+ (WebKit::WebPageProxy::logFrameNavigation): >+ (WebKit::WebPageProxy::decidePolicyForNewWindowAction): >+ (WebKit::WebPageProxy::decidePolicyForResponseShared): >+ (WebKit::WebPageProxy::didPerformClientRedirectShared): >+ (WebKit::WebPageProxy::didPerformServerRedirectShared): >+ (WebKit::WebPageProxy::setMediaVolume): >+ (WebKit::WebPageProxy::currentlyProcessedMouseDownEvent): >+ (WebKit::WebPageProxy::contextMenuItemSelected): >+ (WebKit::WebPageProxy::didCancelForOpenPanel): >+ (WebKit::WebPageProxy::processDidBecomeResponsive): >+ (WebKit::WebPageProxy::resetState): >+ (WebKit::WebPageProxy::creationParameters): >+ (WebKit::WebPageProxy::requestNotificationPermission): >+ (WebKit::WebPageProxy::drawRectToImage): >+ (WebKit::WebPageProxy::drawPagesToPDF): >+ (WebKit::WebPageProxy::setScrollPinningBehavior): >+ (WebKit::WebPageProxy::signedPublicKeyAndChallengeString): >+ (WebKit::WebPageProxy::setUseSystemAppearance): >+ (WebKit::WebPageProxy::clearWheelEventTestMonitor): >+ (WebKit::WebPageProxy::updateAttachmentIcon): >+ (WebKit::WebPageProxy::resetSpeechSynthesizer): >+ * WebKit.xcodeproj/project.pbxproj: >+ * WebProcess/GPU/graphics/GraphicsContextGLIdentifier.h: Copied from Source/WebCore/Modules/mediarecorder/MediaRecorderProvider.h. >+ * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp: Added. >+ (WebKit::RemoteGraphicsContextGLProxy::create): >+ (WebKit::RemoteGraphicsContextGLProxy::RemoteGraphicsContextGLProxy): >+ (WebKit::RemoteGraphicsContextGLProxy::~RemoteGraphicsContextGLProxy): >+ (WebKit::RemoteGraphicsContextGLProxy::messageSenderConnection const): >+ (WebKit::RemoteGraphicsContextGLProxy::messageSenderDestinationID const): >+ (WebKit::RemoteGraphicsContextGLProxy::waitForWasCreated): >+ (WebKit::RemoteGraphicsContextGLProxy::wasCreated): >+ * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.h: Added. >+ * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.messages.in: Copied from Source/WebKit/GPUProcess/GPUConnectionToWebProcess.messages.in. >+ * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxyFunctionsGenerated.h: Added. >+ * WebProcess/GPU/webrtc/MediaRecorderPrivate.h: >+ * WebProcess/WebCoreSupport/WebChromeClient.cpp: >+ (WebKit::WebChromeClient::toolbarsVisible): >+ (WebKit::WebChromeClient::menubarVisible): >+ (WebKit::WebChromeClient::exceededDatabaseQuota): >+ (WebKit::WebChromeClient::createGraphicsContextGL const): >+ * WebProcess/WebCoreSupport/WebChromeClient.h: >+ * WebProcess/WebPage/IPCTestingAPI.cpp: >+ (WebKit::IPCTestingAPI::encodeArgument): >+ * WebProcess/WebPage/WebPage.cpp: >+ (WebKit::m_limitsNavigationsToAppBoundDomains): >+ (WebKit::WebPage::~WebPage): >+ (WebKit::WebPage::executeEditingCommand): >+ (WebKit::WebPage::isEditingCommandEnabled): >+ (WebKit::WebPage::loadAlternateHTML): >+ (WebKit::WebPage::scrollMainFrameIfNotAtMaxScrollPosition): >+ (WebKit::dumpHistoryItem): >+ (WebKit::WebPage::dumpHistoryForTesting): >+ (WebKit::WebPage::updateIsInWindow): >+ (WebKit::WebPage::setActivityState): >+ (WebKit::WebPage::performDragControllerAction): >+ (WebKit::WebPage::updateMainFrameScrollOffsetPinning): >+ (WebKit::WebPage::windowAndViewFramesChanged): >+ (WebKit::WebPage::didReceiveSyncMessage): >+ (WebKit::WebPage::mainFrameView const): >+ (WebKit::WebPage::insertTextAsync): >+ (WebKit::WebPage::didCommitLoad): >+ (WebKit::WebPage::determinePrimarySnapshottedPlugInTimerFired): >+ (WebKit::WebPage::updateWebsitePolicies): >+ (WebKit::WebPage::dispatchDidReachLayoutMilestone): >+ (WebKit::WebPage::urlSchemeTaskDidPerformRedirection): >+ (WebKit::WebPage::shouldUseRemoteWebGL): >+ (WebKit::WebPage::setIsNavigatingToAppBoundDomain): >+ * WebProcess/WebPage/WebPage.h: >+ > 2020-10-29 Kimmo Kinnunen <kkinnunen@apple.com> > > Final refactor for WebGL implementation to use only GraphicsContextGL >diff --git a/Source/WebCore/Modules/mediarecorder/MediaRecorderProvider.h b/Source/WebCore/Modules/mediarecorder/MediaRecorderProvider.h >index 654ae25b022e71dcf39a35f090ee7292d7ddf2de..d7d93408fe3d49a1674159e20197cd7cf9b5c110 100644 >--- a/Source/WebCore/Modules/mediarecorder/MediaRecorderProvider.h >+++ b/Source/WebCore/Modules/mediarecorder/MediaRecorderProvider.h >@@ -25,6 +25,8 @@ > > #pragma once > >+#include <wtf/text/WTFString.h> >+ > namespace WebCore { > > class MediaRecorderPrivate; >diff --git a/Source/WebCore/SourcesCocoa.txt b/Source/WebCore/SourcesCocoa.txt >index b1e040185a72d70327d3e7a94fd88d19d112b962..facd1626c221b37601ec21d4575c7539d9459a3f 100644 >--- a/Source/WebCore/SourcesCocoa.txt >+++ b/Source/WebCore/SourcesCocoa.txt >@@ -360,6 +360,7 @@ platform/graphics/cocoa/IOSurface.mm > platform/graphics/cocoa/IOSurfacePoolCocoa.mm > platform/graphics/cocoa/IntRectCocoa.mm > platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp >+platform/graphics/cocoa/RemoteGraphicsContextGLProxyBaseCocoa.mm > platform/graphics/cocoa/SourceBufferParser.cpp > platform/graphics/cocoa/SourceBufferParserWebM.cpp > platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index cf2a3e822b3c85220ffc1421df6de9372b9756b2..f461bea25a2152ba9e7e6abdb88ef223f3428b46 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -2029,7 +2029,7 @@ > 6E47E66110B7944B00B186C8 /* WebGLAny.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E47E65F10B7944B00B186C8 /* WebGLAny.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 6E4ABCD5138EA0B70071D291 /* JSHTMLUnknownElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E4ABCD3138EA0B70071D291 /* JSHTMLUnknownElement.h */; }; > 6E4E91AF10F7FB3100A2779C /* WebGLContextAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E4E91AA10F7FB3100A2779C /* WebGLContextAttributes.h */; settings = {ATTRIBUTES = (Private, ); }; }; >- 6E67D2A91280E8BD008758F7 /* ExtensionsGL.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E67D2A81280E8BD008758F7 /* ExtensionsGL.h */; }; >+ 6E67D2A91280E8BD008758F7 /* ExtensionsGL.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E67D2A81280E8BD008758F7 /* ExtensionsGL.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 6E72F54C229DCD0C00B3E151 /* ExtensionsGLANGLE.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E27F243229C9F8400F1F632 /* ExtensionsGLANGLE.cpp */; }; > 6E72F54E229DCD1000B3E151 /* GraphicsContextGLANGLE.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E27F2422298CE4B00F1F632 /* GraphicsContextGLANGLE.cpp */; }; > 6E72F54F229DCD1300B3E151 /* TemporaryANGLESetting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E290861229DB950000986E2 /* TemporaryANGLESetting.cpp */; }; >@@ -2219,6 +2219,8 @@ > 7AF9B20F18CFB5F400C64BEF /* JSVTTRegionList.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AF9B20B18CFB5F300C64BEF /* JSVTTRegionList.h */; }; > 7B10339E2549721700C8C1AC /* GraphicsContextGLCV.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B10339D2549720100C8C1AC /* GraphicsContextGLCV.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 7B10339F2549721E00C8C1AC /* GraphicsContextGLCVANGLE.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B10339C2549720100C8C1AC /* GraphicsContextGLCVANGLE.h */; settings = {ATTRIBUTES = (Private, ); }; }; >+ 7B64C0AE254C16F90006B4AF /* RemoteGraphicsContextGLProxyBaseCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B64C0AC254C16EE0006B4AF /* RemoteGraphicsContextGLProxyBaseCocoa.h */; settings = {ATTRIBUTES = (Private, ); }; }; >+ 7B90417025501142006EEB8C /* PlatformRemoteGraphicsContextGLProxyBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B90416E25501109006EEB8C /* PlatformRemoteGraphicsContextGLProxyBase.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 7BB34A1725345CB200029D08 /* GraphicsContextGLANGLEUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 7BB34A1625345CB200029D08 /* GraphicsContextGLANGLEUtilities.h */; }; > 7BB34A48253776CA00029D08 /* GraphicsContextGLImageExtractor.h in Headers */ = {isa = PBXBuildFile; fileRef = 7BB34A45253776C600029D08 /* GraphicsContextGLImageExtractor.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 7BE7427381FA906FBB4F0F2C /* JSSVGGraphicsElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 950C4C02BED8936F818E2F99 /* JSSVGGraphicsElement.h */; }; >@@ -9223,6 +9225,7 @@ > 582DE3221C30C85400BE02A8 /* TextDecorationPainter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextDecorationPainter.cpp; sourceTree = "<group>"; }; > 582DE3231C30C85400BE02A8 /* TextDecorationPainter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextDecorationPainter.h; sourceTree = "<group>"; }; > 5868C7C42539DA3300BF9DF3 /* JSResizeObserverCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSResizeObserverCustom.cpp; sourceTree = "<group>"; }; >+ 5868C7D52546E0B300BF9DF3 /* JSIntersectionObserverCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSIntersectionObserverCustom.cpp; sourceTree = "<group>"; }; > 5884FE5622813E2D0040AFF6 /* JSResizeObserverEntryCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSResizeObserverEntryCustom.cpp; sourceTree = "<group>"; }; > 589556EC18D4A44000764B03 /* BorderEdge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BorderEdge.h; sourceTree = "<group>"; }; > 58AEE2F318D4BCCF0022E7FE /* BorderEdge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BorderEdge.cpp; sourceTree = "<group>"; }; >@@ -10013,7 +10016,6 @@ > 77A17AA312F28B2A004E02F6 /* JSOESVertexArrayObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSOESVertexArrayObject.h; sourceTree = "<group>"; }; > 77AAD6831ECFB66200BFA2D1 /* CredentialCreationOptions.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CredentialCreationOptions.idl; sourceTree = "<group>"; }; > 77AAD6851ECFBD3900BFA2D1 /* CredentialCreationOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CredentialCreationOptions.h; sourceTree = "<group>"; }; >- 5868C7D52546E0B300BF9DF3 /* JSIntersectionObserverCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSIntersectionObserverCustom.cpp; sourceTree = "<group>"; }; > 77C13F042165658A002D9C5F /* JSIntersectionObserverEntryCustom.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSIntersectionObserverEntryCustom.cpp; sourceTree = "<group>"; }; > 77CAAAEF1F2FC35000CB5C8D /* VisualViewport.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VisualViewport.idl; sourceTree = "<group>"; }; > 77D50FFA1ED4EC7800DA4C87 /* CredentialRequestOptions.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CredentialRequestOptions.idl; sourceTree = "<group>"; }; >@@ -10092,6 +10094,9 @@ > 7B10339A2549720000C8C1AC /* GraphicsContextGLCVANGLE.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContextGLCVANGLE.cpp; sourceTree = "<group>"; }; > 7B10339C2549720100C8C1AC /* GraphicsContextGLCVANGLE.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GraphicsContextGLCVANGLE.h; sourceTree = "<group>"; }; > 7B10339D2549720100C8C1AC /* GraphicsContextGLCV.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GraphicsContextGLCV.h; sourceTree = "<group>"; }; >+ 7B64C0AC254C16EE0006B4AF /* RemoteGraphicsContextGLProxyBaseCocoa.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RemoteGraphicsContextGLProxyBaseCocoa.h; sourceTree = "<group>"; }; >+ 7B64C0B4254C3B160006B4AF /* RemoteGraphicsContextGLProxyBaseCocoa.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteGraphicsContextGLProxyBaseCocoa.mm; sourceTree = "<group>"; }; >+ 7B90416E25501109006EEB8C /* PlatformRemoteGraphicsContextGLProxyBase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlatformRemoteGraphicsContextGLProxyBase.h; sourceTree = "<group>"; }; > 7BB34A1625345CB200029D08 /* GraphicsContextGLANGLEUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsContextGLANGLEUtilities.h; sourceTree = "<group>"; }; > 7BB34A45253776C600029D08 /* GraphicsContextGLImageExtractor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GraphicsContextGLImageExtractor.h; sourceTree = "<group>"; }; > 7BB34A47253776C700029D08 /* GraphicsContextGLImageExtractor.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContextGLImageExtractor.cpp; sourceTree = "<group>"; }; >@@ -26365,6 +26370,7 @@ > 550640AD240756DA00AAE045 /* PlatformImageBufferBackend.h */, > 0562F9601573F88F0031CA16 /* PlatformLayer.h */, > CEEFCD7B19DB33DC003876D7 /* PlatformMediaResourceLoader.h */, >+ 7B90416E25501109006EEB8C /* PlatformRemoteGraphicsContextGLProxyBase.h */, > 072847E216EBC5B00043CFA4 /* PlatformTextTrack.h */, > 074E82B818A69F0E007EF54C /* PlatformTimeRanges.cpp */, > 074E82B918A69F0E007EF54C /* PlatformTimeRanges.h */, >@@ -26540,6 +26546,8 @@ > B27535500B053814002CE64F /* IntRectCocoa.mm */, > 2D0B4AA918DA1CCD00434DE1 /* IOSurface.h */, > 2D0B4AAA18DA1CCD00434DE1 /* IOSurface.mm */, >+ 7B64C0AC254C16EE0006B4AF /* RemoteGraphicsContextGLProxyBaseCocoa.h */, >+ 7B64C0B4254C3B160006B4AF /* RemoteGraphicsContextGLProxyBaseCocoa.mm */, > AD9FF6E01908391D003B61E0 /* IOSurfacePoolCocoa.mm */, > CDC48AC82149CF2A0024FD59 /* MediaEngineConfigurationFactoryCocoa.cpp */, > CDC48AC72149CF2A0024FD59 /* MediaEngineConfigurationFactoryCocoa.h */, >@@ -32054,6 +32062,7 @@ > 9B864F02234C028A006D10EB /* IdleRequestOptions.h in Headers */, > C0C054CD1118C8E400CE2636 /* IDLParser.pm in Headers */, > 7C5222961E1DAE03002CB8F7 /* IDLTypes.h in Headers */, >+ 7B64C0AE254C16F90006B4AF /* RemoteGraphicsContextGLProxyBaseCocoa.h in Headers */, > C3CF17A515B0063F00276D39 /* IdTargetObserver.h in Headers */, > C3CF17A715B0063F00276D39 /* IdTargetObserverRegistry.h in Headers */, > 8AB4BC77126FDB7100DEB727 /* IgnoreDestructiveWriteCountIncrementer.h in Headers */, >@@ -33407,6 +33416,7 @@ > BCEF43DD0E674012001C1287 /* NinePieceImage.h in Headers */, > 14115B5209F84B7100CA4FC1 /* Node.h in Headers */, > E377FE4D1DADE16500CDD025 /* NodeConstants.h in Headers */, >+ 7B90417025501142006EEB8C /* PlatformRemoteGraphicsContextGLProxyBase.h in Headers */, > 854FE7310A2297BE0058D7AD /* NodeFilter.h in Headers */, > 854FE7330A2297BE0058D7AD /* NodeFilterCondition.h in Headers */, > 854FE7350A2297BE0058D7AD /* NodeIterator.h in Headers */, >diff --git a/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp b/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp >index 62f4f79993bbb84eeb7c2969ab78215a121cb131..7f055d916eaca8c50f1b54a2744e2eb2bb17da9c 100644 >--- a/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp >+++ b/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp >@@ -710,8 +710,7 @@ std::unique_ptr<WebGLRenderingContextBase> WebGLRenderingContextBase::create(Can > renderingContext->suspendIfNeeded(); > return renderingContext; > } >- >- auto context = GraphicsContextGLOpenGL::create(attributes, hostWindow); >+ auto context = GraphicsContextGL::create(attributes, hostWindow); > if (!context) { > if (canvasElement) { > canvasElement->dispatchEvent(WebGLContextEvent::create(eventNames().webglcontextcreationerrorEvent, >diff --git a/Source/WebCore/page/Chrome.cpp b/Source/WebCore/page/Chrome.cpp >index f79b3390dd2f78e4635b4eb80669b5eac947c4a1..2f36c543adfe6a5f42664bf22236bc72f3065cf7 100644 >--- a/Source/WebCore/page/Chrome.cpp >+++ b/Source/WebCore/page/Chrome.cpp >@@ -528,6 +528,13 @@ std::unique_ptr<ImageBuffer> Chrome::createImageBuffer(const FloatSize& size, Re > return m_client.createImageBuffer(size, renderingMode, purpose, resolutionScale, colorSpace); > } > >+#if ENABLE(WEBGL) >+RefPtr<GraphicsContextGL> Chrome::createGraphicsContextGL(const GraphicsContextGLAttributes& attributes) const >+{ >+ return m_client.createGraphicsContextGL(attributes, displayID()); >+} >+#endif >+ > PlatformDisplayID Chrome::displayID() const > { > return m_page.displayID(); >@@ -541,6 +548,7 @@ void Chrome::windowScreenDidChange(PlatformDisplayID displayID, Optional<unsigne > m_page.windowScreenDidChange(displayID, nominalFrameInterval); > > #if PLATFORM(MAC) && ENABLE(GRAPHICS_CONTEXT_GL) >+ // TODO: GPU process. Change to GCGLManager, make it work, return null for others. > GraphicsContextGLOpenGLManager::sharedManager().screenDidChange(displayID, this); > #endif > } >diff --git a/Source/WebCore/page/Chrome.h b/Source/WebCore/page/Chrome.h >index db4f32186cc7ee1ebcc9d24cbc1ad32320eeb066..35346e55bf820055b1ffcda69b8d23cc38fcf585 100644 >--- a/Source/WebCore/page/Chrome.h >+++ b/Source/WebCore/page/Chrome.h >@@ -86,6 +86,10 @@ public: > > std::unique_ptr<ImageBuffer> createImageBuffer(const FloatSize&, RenderingMode, RenderingPurpose, float resolutionScale, ColorSpace) const override; > >+#if ENABLE(WEBGL) >+ RefPtr<GraphicsContextGL> createGraphicsContextGL(const GraphicsContextGLAttributes&) const override; >+#endif >+ > PlatformDisplayID displayID() const override; > void windowScreenDidChange(PlatformDisplayID, Optional<unsigned>) override; > >diff --git a/Source/WebCore/page/ChromeClient.h b/Source/WebCore/page/ChromeClient.h >index 104124079ec1927f02bb805d2c4c2ed623e7c942..16e14e8d98c516cb58d60d00e055bf0316834dbd 100644 >--- a/Source/WebCore/page/ChromeClient.h >+++ b/Source/WebCore/page/ChromeClient.h >@@ -324,7 +324,9 @@ public: > virtual RefPtr<DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) const { return nullptr; } > > virtual std::unique_ptr<ImageBuffer> createImageBuffer(const FloatSize&, RenderingMode, RenderingPurpose, float, ColorSpace) const { return nullptr; } >- >+#if ENABLE(WEBGL) >+ virtual RefPtr<GraphicsContextGL> createGraphicsContextGL(const GraphicsContextGLAttributes&, WebCore::PlatformDisplayID) const { return nullptr; } >+#endif > // Pass nullptr as the GraphicsLayer to detatch the root layer. > virtual void attachRootGraphicsLayer(Frame&, GraphicsLayer*) = 0; > virtual void attachViewOverlayGraphicsLayer(GraphicsLayer*) = 0; >diff --git a/Source/WebCore/platform/HostWindow.h b/Source/WebCore/platform/HostWindow.h >index 4a9f5d47ea84187139304ae73ae2fe5ab65e2c68..654fdca3940ef8e29547a8586202f1a9fb35e61c 100644 >--- a/Source/WebCore/platform/HostWindow.h >+++ b/Source/WebCore/platform/HostWindow.h >@@ -26,6 +26,7 @@ > #pragma once > > #include "Widget.h" >+#include "GraphicsContextGL.h" > > namespace WebCore { > >@@ -61,7 +62,9 @@ public: > virtual IntRect rootViewToAccessibilityScreen(const IntRect&) const = 0; > > virtual std::unique_ptr<ImageBuffer> createImageBuffer(const FloatSize&, RenderingMode, RenderingPurpose, float resolutionScale, ColorSpace) const = 0; >- >+#if ENABLE(WEBGL) >+ virtual RefPtr<GraphicsContextGL> createGraphicsContextGL(const GraphicsContextGLAttributes&) const = 0; >+#endif > // Method for retrieving the native client of the page. > virtual PlatformPageClient platformPageClient() const = 0; > >diff --git a/Source/WebCore/platform/graphics/ExtensionsGL.h b/Source/WebCore/platform/graphics/ExtensionsGL.h >index 8a2fe6efdf796c1e9a2d4cff05f87c2e7a5f6200..9ac4aab0c7d66a7784a2f82c6fa34ff1fb06c171 100644 >--- a/Source/WebCore/platform/graphics/ExtensionsGL.h >+++ b/Source/WebCore/platform/graphics/ExtensionsGL.h >@@ -266,7 +266,7 @@ public: > COLOR_ATTACHMENT15_EXT = 0x8CEF > }; > >- // WebGL functions in format generate-gpup-webgl understands. >+ // WebGL functions. This list is used by generate-gpup-webgl script. > > // GL_ARB_robustness > // Note: This method's behavior differs from the GL_ARB_robustness >@@ -275,13 +275,13 @@ public: > // If getGraphicsResetStatusARB returns an error, it should continue > // returning the same error. Restoring the GraphicsContextGLOpenGL is handled > // externally. >- virtual int getGraphicsResetStatusARB() = 0; >+ virtual GCGLint getGraphicsResetStatusARB() = 0; > > // GL_ANGLE_framebuffer_blit >- virtual void blitFramebuffer(long srcX0, long srcY0, long srcX1, long srcY1, long dstX0, long dstY0, long dstX1, long dstY1, unsigned long mask, unsigned long filter) = 0; >+ virtual void blitFramebufferANGLE(GCGLint srcX0, GCGLint srcY0, GCGLint srcX1, GCGLint srcY1, GCGLint dstX0, GCGLint dstY0, GCGLint dstX1, GCGLint dstY1, GCGLbitfield mask, GCGLenum filter) = 0; > > // GL_ANGLE_framebuffer_multisample >- virtual void renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height) = 0; >+ virtual void renderbufferStorageMultisampleANGLE(GCGLenum target, GCGLsizei samples, GCGLenum internalformat, GCGLsizei width, GCGLsizei height) = 0; > > // GL_OES_vertex_array_object > virtual PlatformGLObject createVertexArrayOES() = 0; >@@ -295,15 +295,15 @@ public: > // GL_EXT_debug_marker > virtual void insertEventMarkerEXT(const String&) = 0; > virtual void pushGroupMarkerEXT(const String&) = 0; >- virtual void popGroupMarkerEXT(void) = 0; >+ virtual void popGroupMarkerEXT() = 0; > > // GL_ARB_draw_buffers / GL_EXT_draw_buffers > virtual void drawBuffersEXT(GCGLsizei n, const GCGLenum* bufs) = 0; > > // GL_ANGLE_instanced_arrays >- virtual void drawArraysInstanced(GCGLenum mode, GCGLint first, GCGLsizei count, GCGLsizei primcount) = 0; >- virtual void drawElementsInstanced(GCGLenum mode, GCGLsizei count, GCGLenum type, long long offset, GCGLsizei primcount) = 0; >- virtual void vertexAttribDivisor(GCGLuint index, GCGLuint divisor) = 0; >+ virtual void drawArraysInstancedANGLE(GCGLenum mode, GCGLint first, GCGLsizei count, GCGLsizei primcount) = 0; >+ virtual void drawElementsInstancedANGLE(GCGLenum mode, GCGLsizei count, GCGLenum type, GCGLvoidptr offset, GCGLsizei primcount) = 0; >+ virtual void vertexAttribDivisorANGLE(GCGLuint index, GCGLuint divisor) = 0; > > // GL_ANGLE_robust_client_memory > virtual void getBooleanvRobustANGLE(GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLboolean* data) = 0; >@@ -316,23 +316,23 @@ public: > virtual void getShaderivRobustANGLE(GCGLuint shader, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) = 0; > virtual void getTexParameterfvRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLfloat* params) = 0; > virtual void getTexParameterivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) = 0; >- virtual void getUniformfvRobustANGLE(GCGLuint program, int location, GCGLsizei bufSize, GCGLsizei* length, GCGLfloat* params) = 0; >- virtual void getUniformivRobustANGLE(GCGLuint program, int location, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) = 0; >+ virtual void getUniformfvRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei* length, GCGLfloat* params) = 0; >+ virtual void getUniformivRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) = 0; > virtual void getVertexAttribfvRobustANGLE(GCGLuint index, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLfloat* params) = 0; > virtual void getVertexAttribivRobustANGLE(GCGLuint index, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) = 0; > virtual void getVertexAttribPointervRobustANGLE(GCGLuint index, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, void** pointer) = 0; >- virtual void readPixelsRobustANGLE(int x, int y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, GCGLsizei* length, GCGLsizei* columns, GCGLsizei* rows, void* pixels) = 0; >- virtual void texImage2DRobustANGLE(GCGLenum target, int level, int internalformat, GCGLsizei width, GCGLsizei height, int border, GCGLenum format, GCGLenum type, GCGLsizei bufSize, const void* pixels) = 0; >+ virtual void readPixelsRobustANGLE(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, GCGLsizei* length, GCGLsizei* columns, GCGLsizei* rows, void* pixels) = 0; >+ virtual void texImage2DRobustANGLE(GCGLenum target, GCGLint level, GCGLint internalformat, GCGLsizei width, GCGLsizei height, GCGLint border, GCGLenum format, GCGLenum type, GCGLsizei bufSize, const void* pixels) = 0; > virtual void texParameterfvRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, const GCGLfloat* params) = 0; > virtual void texParameterivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, const GCGLint* params) = 0; >- virtual void texSubImage2DRobustANGLE(GCGLenum target, int level, int xoffset, int yoffset, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, const void* pixels) = 0; >- virtual void compressedTexImage2DRobustANGLE(GCGLenum target, int level, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, int border, GCGLsizei imageSize, GCGLsizei bufSize, const void* data) = 0; >- virtual void compressedTexSubImage2DRobustANGLE(GCGLenum target, int level, int xoffset, int yoffset, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLsizei imageSize, GCGLsizei bufSize, const void* data) = 0; >- virtual void compressedTexImage3DRobustANGLE(GCGLenum target, int level, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, GCGLsizei depth, int border, GCGLsizei imageSize, GCGLsizei bufSize, const void* data) = 0; >- virtual void compressedTexSubImage3DRobustANGLE(GCGLenum target, int level, int xoffset, int yoffset, int zoffset, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLenum format, GCGLsizei imageSize, GCGLsizei bufSize, const void* data) = 0; >- >- virtual void texImage3DRobustANGLE(GCGLenum target, int level, int internalformat, GCGLsizei width, GCGLsizei height, GCGLsizei depth, int border, GCGLenum format, GCGLenum type, GCGLsizei bufSize, const void* pixels) = 0; >- virtual void texSubImage3DRobustANGLE(GCGLenum target, int level, int xoffset, int yoffset, int zoffset, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLenum format, GCGLenum type, GCGLsizei bufSize, const void* pixels) = 0; >+ virtual void texSubImage2DRobustANGLE(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, const void* pixels) = 0; >+ virtual void compressedTexImage2DRobustANGLE(GCGLenum target, GCGLint level, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, GCGLint border, GCGLsizei imageSize, GCGLsizei bufSize, const void* data) = 0; >+ virtual void compressedTexSubImage2DRobustANGLE(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLsizei imageSize, GCGLsizei bufSize, const void* data) = 0; >+ virtual void compressedTexImage3DRobustANGLE(GCGLenum target, GCGLint level, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLint border, GCGLsizei imageSize, GCGLsizei bufSize, const void* data) = 0; >+ virtual void compressedTexSubImage3DRobustANGLE(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLint zoffset, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLenum format, GCGLsizei imageSize, GCGLsizei bufSize, const void* data) = 0; >+ >+ virtual void texImage3DRobustANGLE(GCGLenum target, GCGLint level, GCGLint internalformat, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLint border, GCGLenum format, GCGLenum type, GCGLsizei bufSize, const void* pixels) = 0; >+ virtual void texSubImage3DRobustANGLE(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLint zoffset, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLenum format, GCGLenum type, GCGLsizei bufSize, const void* pixels) = 0; > virtual void getQueryivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) = 0; > virtual void getQueryObjectuivRobustANGLE(GCGLuint id, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLuint* params) = 0; > virtual void getBufferPointervRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, void** params) = 0; >@@ -340,7 +340,7 @@ public: > virtual void getInternalformativRobustANGLE(GCGLenum target, GCGLenum internalformat, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) = 0; > virtual void getVertexAttribIivRobustANGLE(GCGLuint index, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) = 0; > virtual void getVertexAttribIuivRobustANGLE(GCGLuint index, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLuint* params) = 0; >- virtual void getUniformuivRobustANGLE(GCGLuint program, int location, GCGLsizei bufSize, GCGLsizei* length, GCGLuint* params) = 0; >+ virtual void getUniformuivRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei* length, GCGLuint* params) = 0; > virtual void getActiveUniformBlockivRobustANGLE(GCGLuint program, GCGLuint uniformBlockIndex, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) = 0; > virtual void getInteger64vRobustANGLE(GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint64* data) = 0; > virtual void getInteger64i_vRobustANGLE(GCGLenum target, GCGLuint index, GCGLsizei bufSize, GCGLsizei* length, GCGLint64* data) = 0; // NOLINT >@@ -354,14 +354,14 @@ public: > virtual void getProgramInterfaceivRobustANGLE(GCGLuint program, GCGLenum programInterface, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) = 0; > virtual void getBooleani_vRobustANGLE(GCGLenum target, GCGLuint index, GCGLsizei bufSize, GCGLsizei* length, GCGLboolean* data) = 0; // NOLINT > virtual void getMultisamplefvRobustANGLE(GCGLenum pname, GCGLuint index, GCGLsizei bufSize, GCGLsizei* length, GCGLfloat* val) = 0; >- virtual void getTexLevelParameterivRobustANGLE(GCGLenum target, int level, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) = 0; >- virtual void getTexLevelParameterfvRobustANGLE(GCGLenum target, int level, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLfloat* params) = 0; >+ virtual void getTexLevelParameterivRobustANGLE(GCGLenum target, GCGLint level, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) = 0; >+ virtual void getTexLevelParameterfvRobustANGLE(GCGLenum target, GCGLint level, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLfloat* params) = 0; > > virtual void getPointervRobustANGLERobustANGLE(GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, void** params) = 0; >- virtual void readnPixelsRobustANGLE(int x, int y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, GCGLsizei* length, GCGLsizei* columns, GCGLsizei* rows, void* data, bool readingToPixelBufferObject) = 0; >- virtual void getnUniformfvRobustANGLE(GCGLuint program, int location, GCGLsizei bufSize, GCGLsizei* length, GCGLfloat* params) = 0; >- virtual void getnUniformivRobustANGLE(GCGLuint program, int location, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) = 0; >- virtual void getnUniformuivRobustANGLE(GCGLuint program, int location, GCGLsizei bufSize, GCGLsizei* length, GCGLuint* params) = 0; >+ virtual void readnPixelsRobustANGLE(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, GCGLsizei* length, GCGLsizei* columns, GCGLsizei* rows, void* data, bool readingToPixelBufferObject) = 0; >+ virtual void getnUniformfvRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei* length, GCGLfloat* params) = 0; >+ virtual void getnUniformivRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) = 0; >+ virtual void getnUniformuivRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei* length, GCGLuint* params) = 0; > virtual void texParameterIivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, const GCGLint* params) = 0; > virtual void texParameterIuivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, const GCGLuint* params) = 0; > virtual void getTexParameterIivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) = 0; >@@ -378,9 +378,9 @@ public: > // Other functions. > #if !USE(ANGLE) > // EXT Robustness - uses getGraphicsResetStatusARB >- virtual void readnPixelsEXT(int x, int y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, void* data) = 0; >- virtual void getnUniformfvEXT(GCGLuint program, int location, GCGLsizei bufSize, float* params) = 0; >- virtual void getnUniformivEXT(GCGLuint program, int location, GCGLsizei bufSize, int* params) = 0; >+ virtual void readnPixelsEXT(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, void* data) = 0; >+ virtual void getnUniformfvEXT(GCGLuint program, GCGLint location, GCGLsizei bufSize, float* params) = 0; >+ virtual void getnUniformivEXT(GCGLuint program, GCGLint location, GCGLsizei bufSize, int* params) = 0; > #endif > > virtual bool isNVIDIA() = 0; >diff --git a/Source/WebCore/platform/graphics/GraphicsContextGL.cpp b/Source/WebCore/platform/graphics/GraphicsContextGL.cpp >index df4a119a320dac6aeb6306d4c509551588a1973e..34d556b0cc4a9bb1aea7a5a968bc695b3a2e278a 100644 >--- a/Source/WebCore/platform/graphics/GraphicsContextGL.cpp >+++ b/Source/WebCore/platform/graphics/GraphicsContextGL.cpp >@@ -27,11 +27,13 @@ > > #include "config.h" > #include "GraphicsContextGL.h" >+#include "GraphicsContextGLOpenGL.h" > > #if ENABLE(GRAPHICS_CONTEXT_GL) > > #include "ExtensionsGL.h" > #include "FormatConverter.h" >+#include "HostWindow.h" > #include "Image.h" > #include "ImageData.h" > #include "ImageObserver.h" >@@ -403,6 +405,15 @@ static bool packPixels(const uint8_t* sourceData, GraphicsContextGL::DataFormat > return true; > } > >+RefPtr<GraphicsContextGL> GraphicsContextGL::create(const GraphicsContextGLAttributes& attributes, HostWindow* hostWindow) >+{ >+ RefPtr<GraphicsContextGL> result; >+ if (hostWindow) >+ result = hostWindow->createGraphicsContextGL(attributes); >+ if (!result) >+ result = GraphicsContextGLOpenGL::create(attributes, hostWindow); >+ return result; >+} > > GraphicsContextGL::GraphicsContextGL(GraphicsContextGLAttributes attrs, Destination destination, GraphicsContextGL*) > : m_attrs(attrs) >diff --git a/Source/WebCore/platform/graphics/GraphicsContextGL.h b/Source/WebCore/platform/graphics/GraphicsContextGL.h >index a2ccf962cd126c335986731daa3fef36d20c2332..1491704d49326b86645e9fdb81787f74f610c046 100644 >--- a/Source/WebCore/platform/graphics/GraphicsContextGL.h >+++ b/Source/WebCore/platform/graphics/GraphicsContextGL.h >@@ -59,6 +59,8 @@ class ImageData; > class GraphicsContextGLCV; > #endif > >+ >+// Base class for graphics context for implementing WebGL rendering model. > class GraphicsContextGL : public RefCounted<GraphicsContextGL> { > public: > enum { >@@ -913,13 +915,17 @@ public: > GCGLint size; > }; > >+ // Creates a GraphicsContextGL instance to render into offscreen destination in context of HostWindow. >+ // HostWindow might affect the decision which backend is to be used. >+ static RefPtr<GraphicsContextGL> create(const GraphicsContextGLAttributes&, HostWindow*); >+ > GraphicsContextGL(GraphicsContextGLAttributes, Destination = Destination::Offscreen, GraphicsContextGL* sharedContext = nullptr); > virtual ~GraphicsContextGL() = default; > > void addClient(Client& client) { m_clients.add(&client); } > void removeClient(Client& client) { m_clients.remove(&client); } > >- // WebGL functions in format generate-gpup-webgl understands. >+ // WebGL functions. This list is used by generate-gpup-webgl script. > > virtual void activeTexture(GCGLenum texture) = 0; > virtual void attachShader(PlatformGLObject program, PlatformGLObject shader) = 0; >diff --git a/Source/WebCore/platform/graphics/GraphicsTypesGL.h b/Source/WebCore/platform/graphics/GraphicsTypesGL.h >index 49b79d849e92f3927f8de3ccb1a03b8318a1dcd6..a70cc0c106fdc667df0934cb232398f7bd2da0dd 100644 >--- a/Source/WebCore/platform/graphics/GraphicsTypesGL.h >+++ b/Source/WebCore/platform/graphics/GraphicsTypesGL.h >@@ -25,6 +25,8 @@ > > #pragma once > >+#include <cstdint> >+#include <type_traits> > #include <wtf/Forward.h> > > // GCGL types match the corresponding GL types as defined in OpenGL ES 2.0 >@@ -44,6 +46,7 @@ typedef unsigned short GCGLhalffloat; > typedef float GCGLclampf; > typedef intptr_t GCGLintptr; > typedef intptr_t GCGLsizeiptr; >+typedef intptr_t GCGLvoidptr; > typedef char GCGLchar; > typedef long long GCGLint64; > typedef unsigned long long GCGLuint64; >@@ -54,3 +57,26 @@ typedef GCGLuint PlatformGLObject; > #if !PLATFORM(COCOA) > typedef unsigned GLuint; > #endif >+ >+// The GCGL types map to following WebKit IPC types. The list is used by generate-gpup-webgl script. >+static_assert(std::is_same_v<GCGLenum, uint32_t>); >+static_assert(sizeof(GCGLboolean) == sizeof(bool)); >+static_assert(std::is_same_v<GCGLbitfield, uint32_t>); >+static_assert(std::is_same_v<GCGLbyte, int8_t>); >+static_assert(std::is_same_v<GCGLubyte, uint8_t>); >+static_assert(std::is_same_v<GCGLshort, int16_t>); >+static_assert(std::is_same_v<GCGLushort, uint16_t>); >+static_assert(std::is_same_v<GCGLint, int32_t>); >+static_assert(std::is_same_v<GCGLsizei, int32_t>); >+static_assert(std::is_same_v<GCGLuint, uint32_t>); >+static_assert(std::is_same_v<GCGLfloat, float>); >+static_assert(std::is_same_v<GCGLhalffloat, uint16_t>); >+static_assert(std::is_same_v<GCGLclampf, float>); >+static_assert(sizeof(GCGLintptr) == sizeof(uint64_t)); >+static_assert(sizeof(GCGLsizeiptr) == sizeof(uint64_t)); >+static_assert(sizeof(GCGLvoidptr) == sizeof(uint64_t)); >+static_assert(sizeof(GCGLchar)== sizeof(uint8_t)); >+static_assert(std::is_same_v<GCGLint64, int64_t>); >+static_assert(std::is_same_v<GCGLuint64, uint64_t>); >+static_assert(std::is_same_v<PlatformGLObject, uint32_t>); >+static_assert(sizeof(GCGLsync) == sizeof(uint64_t)); >diff --git a/Source/WebCore/platform/graphics/ImageBuffer.h b/Source/WebCore/platform/graphics/ImageBuffer.h >index c6f542adc8930790ba0dcb73aafb1630b5bbf8fe..2a67f3836a32cca1f3ad932e197ae5d4c269f437 100644 >--- a/Source/WebCore/platform/graphics/ImageBuffer.h >+++ b/Source/WebCore/platform/graphics/ImageBuffer.h >@@ -58,12 +58,12 @@ public: > static FloatRect clampedRect(const FloatRect&); > > static IntSize compatibleBufferSize(const FloatSize&, const GraphicsContext&); >- >+ > WEBCORE_EXPORT virtual ~ImageBuffer() = default; > > virtual bool isAccelerated() const = 0; > virtual RenderingResourceIdentifier renderingResourceIdentifier() const { return { }; } >- >+ > virtual GraphicsContext& context() const = 0; > virtual void flushContext() = 0; > >@@ -107,7 +107,7 @@ public: > // with textures that are RGB or RGBA format, and UNSIGNED_BYTE type. > virtual bool copyToPlatformTexture(GraphicsContextGL&, GCGLenum, PlatformGLObject, GCGLenum, bool, bool) const = 0; > virtual PlatformLayer* platformLayer() const = 0; >- >+ > protected: > ImageBuffer() = default; > >diff --git a/Source/WebCore/platform/graphics/PlatformRemoteGraphicsContextGLProxyBase.h b/Source/WebCore/platform/graphics/PlatformRemoteGraphicsContextGLProxyBase.h >new file mode 100644 >index 0000000000000000000000000000000000000000..6dfd1f6561c87d268cc881336f9453039da9095a >--- /dev/null >+++ b/Source/WebCore/platform/graphics/PlatformRemoteGraphicsContextGLProxyBase.h >@@ -0,0 +1,47 @@ >+/* >+ * Copyright (C) 2020 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL) >+ >+#if PLATFORM(COCOA) >+#include "RemoteGraphicsContextGLProxyBaseCocoa.h" >+#endif >+ >+namespace WebCore >+{ >+ // Name for the platform specific base class of RemoteGraphicsContextGL proxy. >+ // Due to the lack of abstractions, we currently need to inherit the >+ // platform dependent implementation in the middle of the inheritance chain >+ // of RemoteGraphicsContextGLProxy. >+ // This means we cannot have a real platform independent RemoteGraphicsContextGLProxy base class. >+ // For this reason we must refer to the concrete class for the time being. >+#if PLATFORM(COCOA) >+ using PlatformRemoteGraphicsContextGLProxyBase = RemoteGraphicsContextGLProxyBaseCocoa; >+#endif >+} >+ >+#endif >diff --git a/Source/WebCore/platform/graphics/RemoteGraphicsContextGLBase.h b/Source/WebCore/platform/graphics/RemoteGraphicsContextGLBase.h >new file mode 100644 >index 0000000000000000000000000000000000000000..f7d574465a9c1011c1df1eff577dde6f953c430b >--- /dev/null >+++ b/Source/WebCore/platform/graphics/RemoteGraphicsContextGLBase.h >@@ -0,0 +1,77 @@ >+/* >+ * Copyright (C) 2020 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL) && PLATFORM(COCOA) >+ >+#include "ExtensionsGL.h" >+#include "GraphicsContextGL.h" >+ >+namespace WebCore { >+ >+// A base class for remote GraphicsContextGL implementations. >+// This implements the parts that are using WebCore internal functionality: >+// - Drawing buffer tracking management. >+// - Compositing support. >+// The parts were needed to be implemented due to lack of abstractions and >+// small pending fixes at the time of writing. >+WEBCORE_EXPORT class RemoteGraphicsContextGLProxyBaseCocoa : public GraphicsContextGL, public ExtensionsGL { >+public: >+ RemoteGraphicsContextGLBase(const GraphicsContextGLAttributes&); >+ ~RemoteGraphicsContextGLBase() override; >+ >+ // Other WebCore::GraphicsContextGL overrides. >+ PlatformGraphicsContextGL platformGraphicsContextGL() const final; >+ PlatformGLObject platformTexture() const final; >+ PlatformLayer* platformLayer() const final; >+ void enablePreserveDrawingBuffer() final; >+ ExtensionsGL& getExtensions() final { return *this; } >+ void reshape(int width, int height) final; >+ void setContextVisibility(bool) final; >+ GraphicsContextGLPowerPreference powerPreferenceUsedForCreation() const final; >+ bool isGLES2Compliant() const final; >+ void synthesizeGLError(GCGLenum error) final; >+ bool moveErrorsToSyntheticErrorList() final; >+ void setFailNextGPUStatusCheck() final; >+ void prepareForDisplay() final; >+ void markContextChanged() final; >+ bool layerComposited() const final; >+ void setBuffersToAutoClear(GCGLbitfield) final; >+ GCGLbitfield getBuffersToAutoClear() const final; >+ void paintRenderingResultsToCanvas(ImageBuffer*) final; >+ RefPtr<ImageData> paintRenderingResultsToImageData() final; >+ bool paintCompositedResultsToCanvas(ImageBuffer*) final; >+ void markLayerComposited() final; >+ void simulateContextChanged() final; >+ >+#if ENABLE(VIDEO) && USE(AVFOUNDATION) >+ GraphicsContextGLCV* asCV() final { return nullptr }; >+#endif >+ RetainPtr<WebGLLayer> m_webGLLayer; >+ >+}; >+ >+#endif >diff --git a/Source/WebCore/platform/graphics/angle/ExtensionsGLANGLE.cpp b/Source/WebCore/platform/graphics/angle/ExtensionsGLANGLE.cpp >index 1c8bc42550f1c1d95c3082f67376a569506bfab3..9663036d17c68c4e1a2d21f3c22458f14dc582de 100644 >--- a/Source/WebCore/platform/graphics/angle/ExtensionsGLANGLE.cpp >+++ b/Source/WebCore/platform/graphics/angle/ExtensionsGLANGLE.cpp >@@ -103,7 +103,7 @@ bool ExtensionsGLANGLE::isEnabled(const String& name) > return m_availableExtensions.contains(name) || m_enabledExtensions.contains(name); > } > >-int ExtensionsGLANGLE::getGraphicsResetStatusARB() >+GLint ExtensionsGLANGLE::getGraphicsResetStatusARB() > { > return GraphicsContextGL::NO_ERROR; > } >@@ -113,12 +113,12 @@ String ExtensionsGLANGLE::getTranslatedShaderSourceANGLE(PlatformGLObject shader > if (!m_context->makeContextCurrent()) > return String(); > >- int sourceLength = 0; >+ GCGLint sourceLength = 0; > m_context->getShaderiv(shader, GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE, &sourceLength); > if (!sourceLength) > return emptyString(); > Vector<GLchar> name(sourceLength); // GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE includes null termination. >- int returnedLength = 0; >+ GCGLint returnedLength = 0; > gl::GetTranslatedShaderSourceANGLE(shader, sourceLength, &returnedLength, name.data()); > if (!returnedLength) > return emptyString(); >@@ -148,7 +148,7 @@ void ExtensionsGLANGLE::initializeAvailableExtensions() > m_initializedAvailableExtensions = true; > } > >-void ExtensionsGLANGLE::blitFramebuffer(long srcX0, long srcY0, long srcX1, long srcY1, long dstX0, long dstY0, long dstX1, long dstY1, unsigned long mask, unsigned long filter) >+void ExtensionsGLANGLE::blitFramebufferANGLE(GCGLint srcX0, GCGLint srcY0, GCGLint srcX1, GCGLint srcY1, GCGLint dstX0, GCGLint dstY0, GCGLint dstX1, GCGLint dstY1, GCGLbitfield mask, GCGLenum filter) > { > // FIXME: consider adding support for APPLE_framebuffer_multisample. > if (!m_context->makeContextCurrent()) >@@ -157,7 +157,7 @@ void ExtensionsGLANGLE::blitFramebuffer(long srcX0, long srcY0, long srcX1, long > gl::BlitFramebufferANGLE(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); > } > >-void ExtensionsGLANGLE::renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height) >+void ExtensionsGLANGLE::renderbufferStorageMultisampleANGLE(GCGLenum target, GCGLsizei samples, GCGLenum internalformat, GCGLsizei width, GCGLsizei height) > { > if (!m_context->makeContextCurrent()) > return; >@@ -236,7 +236,7 @@ void ExtensionsGLANGLE::drawBuffersEXT(GCGLsizei n, const GCGLenum* bufs) > gl::DrawBuffersEXT(n, bufs); > } > >-void ExtensionsGLANGLE::drawArraysInstanced(GCGLenum mode, GCGLint first, GCGLsizei count, GCGLsizei primcount) >+void ExtensionsGLANGLE::drawArraysInstancedANGLE(GCGLenum mode, GCGLint first, GCGLsizei count, GCGLsizei primcount) > { > if (!m_context->makeContextCurrent()) > return; >@@ -244,15 +244,15 @@ void ExtensionsGLANGLE::drawArraysInstanced(GCGLenum mode, GCGLint first, GCGLsi > gl::DrawArraysInstancedANGLE(mode, first, count, primcount); > } > >-void ExtensionsGLANGLE::drawElementsInstanced(GCGLenum mode, GCGLsizei count, GCGLenum type, long long offset, GCGLsizei primcount) >+void ExtensionsGLANGLE::drawElementsInstancedANGLE(GCGLenum mode, GCGLsizei count, GCGLenum type, GCGLvoidptr offset, GCGLsizei primcount) > { > if (!m_context->makeContextCurrent()) > return; > >- gl::DrawElementsInstancedANGLE(mode, count, type, reinterpret_cast<GLvoid*>(static_cast<intptr_t>(offset)), primcount); >+ gl::DrawElementsInstancedANGLE(mode, count, type, reinterpret_cast<GLvoid*>(offset), primcount); > } > >-void ExtensionsGLANGLE::vertexAttribDivisor(GCGLuint index, GCGLuint divisor) >+void ExtensionsGLANGLE::vertexAttribDivisorANGLE(GCGLuint index, GCGLuint divisor) > { > if (!m_context->makeContextCurrent()) > return; >@@ -359,7 +359,7 @@ void ExtensionsGLANGLE::getTexParameterivRobustANGLE(GCGLenum target, GCGLenum p > gl::GetTexParameterivRobustANGLE(target, pname, bufSize, length, params); > } > >-void ExtensionsGLANGLE::getUniformfvRobustANGLE(GCGLuint program, int location, GCGLsizei bufSize, GCGLsizei *length, GCGLfloat *params) >+void ExtensionsGLANGLE::getUniformfvRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei *length, GCGLfloat *params) > { > if (!m_context->makeContextCurrent()) > return; >@@ -367,7 +367,7 @@ void ExtensionsGLANGLE::getUniformfvRobustANGLE(GCGLuint program, int location, > gl::GetUniformfvRobustANGLE(program, location, bufSize, length, params); > } > >-void ExtensionsGLANGLE::getUniformivRobustANGLE(GCGLuint program, int location, GCGLsizei bufSize, GCGLsizei *length, GCGLint *params) >+void ExtensionsGLANGLE::getUniformivRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei *length, GCGLint *params) > { > if (!m_context->makeContextCurrent()) > return; >@@ -399,7 +399,7 @@ void ExtensionsGLANGLE::getVertexAttribPointervRobustANGLE(GCGLuint index, GCGLe > gl::GetVertexAttribPointervRobustANGLE(index, pname, bufSize, length, pointer); > } > >-void ExtensionsGLANGLE::readPixelsRobustANGLE(int x, int y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, GCGLsizei *length, GCGLsizei *columns, GCGLsizei *rows, void *pixels) >+void ExtensionsGLANGLE::readPixelsRobustANGLE(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, GCGLsizei *length, GCGLsizei *columns, GCGLsizei *rows, void *pixels) > { > if (!m_context->makeContextCurrent()) > return; >@@ -407,7 +407,7 @@ void ExtensionsGLANGLE::readPixelsRobustANGLE(int x, int y, GCGLsizei width, GCG > gl::ReadPixelsRobustANGLE(x, y, width, height, format, type, bufSize, length, columns, rows, pixels); > } > >-void ExtensionsGLANGLE::texImage2DRobustANGLE(GCGLenum target, int level, int internalformat, GCGLsizei width, GCGLsizei height, int border, GCGLenum format, GCGLenum type, GCGLsizei bufSize, const void *pixels) >+void ExtensionsGLANGLE::texImage2DRobustANGLE(GCGLenum target, GCGLint level, GCGLint internalformat, GCGLsizei width, GCGLsizei height, GCGLint border, GCGLenum format, GCGLenum type, GCGLsizei bufSize, const void *pixels) > { > if (!m_context->m_isForWebGL2) > internalformat = adjustWebGL1TextureInternalFormat(internalformat, format, type); >@@ -433,7 +433,7 @@ void ExtensionsGLANGLE::texParameterivRobustANGLE(GCGLenum target, GCGLenum pnam > gl::TexParameterivRobustANGLE(target, pname, bufSize, params); > } > >-void ExtensionsGLANGLE::texSubImage2DRobustANGLE(GCGLenum target, int level, int xoffset, int yoffset, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, const void *pixels) >+void ExtensionsGLANGLE::texSubImage2DRobustANGLE(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, const void *pixels) > { > if (!m_context->makeContextCurrent()) > return; >@@ -441,7 +441,7 @@ void ExtensionsGLANGLE::texSubImage2DRobustANGLE(GCGLenum target, int level, int > gl::TexSubImage2DRobustANGLE(target, level, xoffset, yoffset, width, height, format, type, bufSize, pixels); > } > >-void ExtensionsGLANGLE::compressedTexImage2DRobustANGLE(GCGLenum target, int level, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, int border, GCGLsizei imageSize, GCGLsizei bufSize, const void* data) >+void ExtensionsGLANGLE::compressedTexImage2DRobustANGLE(GCGLenum target, GCGLint level, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, GCGLint border, GCGLsizei imageSize, GCGLsizei bufSize, const void* data) > { > if (!m_context->makeContextCurrent()) > return; >@@ -451,7 +451,7 @@ void ExtensionsGLANGLE::compressedTexImage2DRobustANGLE(GCGLenum target, int lev > > } > >-void ExtensionsGLANGLE::compressedTexSubImage2DRobustANGLE(GCGLenum target, int level, int xoffset, int yoffset, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLsizei imageSize, GCGLsizei bufSize, const void* data) >+void ExtensionsGLANGLE::compressedTexSubImage2DRobustANGLE(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLsizei imageSize, GCGLsizei bufSize, const void* data) > { > if (!m_context->makeContextCurrent()) > return; >@@ -460,7 +460,7 @@ void ExtensionsGLANGLE::compressedTexSubImage2DRobustANGLE(GCGLenum target, int > m_context->m_state.textureSeedCount.add(m_context->m_state.currentBoundTexture()); > } > >-void ExtensionsGLANGLE::compressedTexImage3DRobustANGLE(GCGLenum target, int level, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, GCGLsizei depth, int border, GCGLsizei imageSize, GCGLsizei bufSize, const void* data) >+void ExtensionsGLANGLE::compressedTexImage3DRobustANGLE(GCGLenum target, GCGLint level, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLint border, GCGLsizei imageSize, GCGLsizei bufSize, const void* data) > { > if (!m_context->makeContextCurrent()) > return; >@@ -468,7 +468,7 @@ void ExtensionsGLANGLE::compressedTexImage3DRobustANGLE(GCGLenum target, int lev > gl::CompressedTexImage3DRobustANGLE(target, level, internalformat, width, height, depth, border, imageSize, bufSize, data); > } > >-void ExtensionsGLANGLE::compressedTexSubImage3DRobustANGLE(GCGLenum target, int level, int xoffset, int yoffset, int zoffset, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLenum format, GCGLsizei imageSize, GCGLsizei bufSize, const void* data) >+void ExtensionsGLANGLE::compressedTexSubImage3DRobustANGLE(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLint zoffset, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLenum format, GCGLsizei imageSize, GCGLsizei bufSize, const void* data) > { > if (!m_context->makeContextCurrent()) > return; >@@ -477,7 +477,7 @@ void ExtensionsGLANGLE::compressedTexSubImage3DRobustANGLE(GCGLenum target, int > } > > >-void ExtensionsGLANGLE::texImage3DRobustANGLE(GCGLenum target, int level, int internalformat, GCGLsizei width, GCGLsizei height, GCGLsizei depth, int border, GCGLenum format, GCGLenum type, GCGLsizei bufSize, const void *pixels) >+void ExtensionsGLANGLE::texImage3DRobustANGLE(GCGLenum target, GCGLint level, GCGLint internalformat, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLint border, GCGLenum format, GCGLenum type, GCGLsizei bufSize, const void *pixels) > { > if (!m_context->makeContextCurrent()) > return; >@@ -485,7 +485,7 @@ void ExtensionsGLANGLE::texImage3DRobustANGLE(GCGLenum target, int level, int in > gl::TexImage3DRobustANGLE(target, level, internalformat, width, height, depth, border, format, type, bufSize, pixels); > } > >-void ExtensionsGLANGLE::texSubImage3DRobustANGLE(GCGLenum target, int level, int xoffset, int yoffset, int zoffset, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLenum format, GCGLenum type, GCGLsizei bufSize, const void *pixels) >+void ExtensionsGLANGLE::texSubImage3DRobustANGLE(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLint zoffset, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLenum format, GCGLenum type, GCGLsizei bufSize, const void *pixels) > { > if (!m_context->makeContextCurrent()) > return; >@@ -549,7 +549,7 @@ void ExtensionsGLANGLE::getVertexAttribIuivRobustANGLE(GCGLuint index, GCGLenum > gl::GetVertexAttribIuivRobustANGLE(index, pname, bufSize, length, params); > } > >-void ExtensionsGLANGLE::getUniformuivRobustANGLE(GCGLuint program, int location, GCGLsizei bufSize, GCGLsizei *length, GCGLuint *params) >+void ExtensionsGLANGLE::getUniformuivRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei *length, GCGLuint *params) > { > if (!m_context->makeContextCurrent()) > return; >@@ -654,7 +654,7 @@ void ExtensionsGLANGLE::getMultisamplefvRobustANGLE(GCGLenum pname, GCGLuint ind > gl::GetMultisamplefvRobustANGLE(pname, index, bufSize, length, val); > } > >-void ExtensionsGLANGLE::getTexLevelParameterivRobustANGLE(GCGLenum target, int level, GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, GCGLint *params) >+void ExtensionsGLANGLE::getTexLevelParameterivRobustANGLE(GCGLenum target, GCGLint level, GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, GCGLint *params) > { > if (!m_context->makeContextCurrent()) > return; >@@ -662,7 +662,7 @@ void ExtensionsGLANGLE::getTexLevelParameterivRobustANGLE(GCGLenum target, int l > gl::GetTexLevelParameterivRobustANGLE(target, level, pname, bufSize, length, params); > } > >-void ExtensionsGLANGLE::getTexLevelParameterfvRobustANGLE(GCGLenum target, int level, GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, GCGLfloat *params) >+void ExtensionsGLANGLE::getTexLevelParameterfvRobustANGLE(GCGLenum target, GCGLint level, GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, GCGLfloat *params) > { > if (!m_context->makeContextCurrent()) > return; >@@ -680,17 +680,17 @@ void ExtensionsGLANGLE::getPointervRobustANGLERobustANGLE(GCGLenum pname, GCGLsi > } > > #if PLATFORM(MAC) || PLATFORM(IOS_FAMILY) >-static void wipeAlphaChannelFromPixels(int width, int height, unsigned char* pixels) >+static void wipeAlphaChannelFromPixels(GCGLint width, GCGLint height, unsigned char* pixels) > { > // We can assume this doesn't overflow because the calling functions > // use checked arithmetic. >- int totalBytes = width * height * 4; >- for (int i = 0; i < totalBytes; i += 4) >+ GCGLint totalBytes = width * height * 4; >+ for (GCGLint i = 0; i < totalBytes; i += 4) > pixels[i + 3] = 255; > } > #endif > >-void ExtensionsGLANGLE::readnPixelsRobustANGLE(int x, int y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, GCGLsizei *length, GCGLsizei *columns, GCGLsizei *rows, void *data, bool readingToPixelBufferObject) >+void ExtensionsGLANGLE::readnPixelsRobustANGLE(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, GCGLsizei *length, GCGLsizei *columns, GCGLsizei *rows, void *data, bool readingToPixelBufferObject) > { > if (!m_context->makeContextCurrent()) > return; >@@ -727,7 +727,7 @@ void ExtensionsGLANGLE::readnPixelsRobustANGLE(int x, int y, GCGLsizei width, GC > #endif > } > >-void ExtensionsGLANGLE::getnUniformfvRobustANGLE(GCGLuint program, int location, GCGLsizei bufSize, GCGLsizei *length, GCGLfloat *params) >+void ExtensionsGLANGLE::getnUniformfvRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei *length, GCGLfloat *params) > { > if (!m_context->makeContextCurrent()) > return; >@@ -735,7 +735,7 @@ void ExtensionsGLANGLE::getnUniformfvRobustANGLE(GCGLuint program, int location, > gl::GetnUniformfvRobustANGLE(program, location, bufSize, length, params); > } > >-void ExtensionsGLANGLE::getnUniformivRobustANGLE(GCGLuint program, int location, GCGLsizei bufSize, GCGLsizei *length, GCGLint *params) >+void ExtensionsGLANGLE::getnUniformivRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei *length, GCGLint *params) > { > if (!m_context->makeContextCurrent()) > return; >@@ -743,7 +743,7 @@ void ExtensionsGLANGLE::getnUniformivRobustANGLE(GCGLuint program, int location, > gl::GetnUniformivRobustANGLE(program, location, bufSize, length, params); > } > >-void ExtensionsGLANGLE::getnUniformuivRobustANGLE(GCGLuint program, int location, GCGLsizei bufSize, GCGLsizei *length, GCGLuint *params) >+void ExtensionsGLANGLE::getnUniformuivRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei *length, GCGLuint *params) > { > if (!m_context->makeContextCurrent()) > return; >diff --git a/Source/WebCore/platform/graphics/angle/ExtensionsGLANGLE.h b/Source/WebCore/platform/graphics/angle/ExtensionsGLANGLE.h >index 7562e986c38307d1854d4823898276aba765ae82..2294f28b082e6da3c61ab3918553659656800657 100644 >--- a/Source/WebCore/platform/graphics/angle/ExtensionsGLANGLE.h >+++ b/Source/WebCore/platform/graphics/angle/ExtensionsGLANGLE.h >@@ -43,7 +43,7 @@ public: > bool supports(const String&) override; > void ensureEnabled(const String&) override; > bool isEnabled(const String&) override; >- int getGraphicsResetStatusARB() override; >+ GCGLint getGraphicsResetStatusARB() override; > > PlatformGLObject createVertexArrayOES() override; > void deleteVertexArrayOES(PlatformGLObject) override; >@@ -56,12 +56,12 @@ public: > > String getTranslatedShaderSourceANGLE(PlatformGLObject) override; > >- void blitFramebuffer(long srcX0, long srcY0, long srcX1, long srcY1, long dstX0, long dstY0, long dstX1, long dstY1, unsigned long mask, unsigned long filter) override; >- void renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height) override; >+ void blitFramebufferANGLE(GCGLint srcX0, GCGLint srcY0, GCGLint srcX1, GCGLint srcY1, GCGLint dstX0, GCGLint dstY0, GCGLint dstX1, GCGLint dstY1, GCGLbitfield mask, GCGLenum filter) override; >+ void renderbufferStorageMultisampleANGLE(GCGLenum target, GCGLsizei samples, GCGLenum internalformat, GCGLsizei width, GCGLsizei height) override; > >- void drawArraysInstanced(GCGLenum mode, GCGLint first, GCGLsizei count, GCGLsizei primcount) override; >- void drawElementsInstanced(GCGLenum mode, GCGLsizei count, GCGLenum type, long long offset, GCGLsizei primcount) override; >- void vertexAttribDivisor(GCGLuint index, GCGLuint divisor) override; >+ void drawArraysInstancedANGLE(GCGLenum mode, GCGLint first, GCGLsizei count, GCGLsizei primcount) override; >+ void drawElementsInstancedANGLE(GCGLenum mode, GCGLsizei count, GCGLenum type, GCGLvoidptr offset, GCGLsizei primcount) override; >+ void vertexAttribDivisorANGLE(GCGLuint index, GCGLuint divisor) override; > > bool isNVIDIA() override { return m_isNVIDIA; } > bool isAMD() override { return m_isAMD; } >@@ -83,31 +83,31 @@ public: > void getShaderivRobustANGLE(GCGLuint shader, GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, GCGLint *params) override; > void getTexParameterfvRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, GCGLfloat *params) override; > void getTexParameterivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, GCGLint *params) override; >- void getUniformfvRobustANGLE(GCGLuint program, int location, GCGLsizei bufSize, GCGLsizei *length, GCGLfloat *params) override; >- void getUniformivRobustANGLE(GCGLuint program, int location, GCGLsizei bufSize, GCGLsizei *length, GCGLint *params) override; >+ void getUniformfvRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei *length, GCGLfloat *params) override; >+ void getUniformivRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei *length, GCGLint *params) override; > void getVertexAttribfvRobustANGLE(GCGLuint index, GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, GCGLfloat *params) override; > void getVertexAttribivRobustANGLE(GCGLuint index, GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, GCGLint *params) override; > void getVertexAttribPointervRobustANGLE(GCGLuint index, GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, void **pointer) override; >- void readPixelsRobustANGLE(int x, int y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, GCGLsizei *length, GCGLsizei *columns, GCGLsizei *rows, void *pixels) override; >- void texImage2DRobustANGLE(GCGLenum target, int level, int internalformat, GCGLsizei width, GCGLsizei height, int border, GCGLenum format, GCGLenum type, GCGLsizei bufSize, const void *pixels) override; >+ void readPixelsRobustANGLE(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, GCGLsizei *length, GCGLsizei *columns, GCGLsizei *rows, void *pixels) override; >+ void texImage2DRobustANGLE(GCGLenum target, GCGLint level, GCGLint internalformat, GCGLsizei width, GCGLsizei height, GCGLint border, GCGLenum format, GCGLenum type, GCGLsizei bufSize, const void *pixels) override; > void texParameterfvRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, const GCGLfloat *params) override; > void texParameterivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, const GCGLint *params) override; >- void texSubImage2DRobustANGLE(GCGLenum target, int level, int xoffset, int yoffset, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, const void *pixels) override; >- void compressedTexImage2DRobustANGLE(GCGLenum target, int level, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, int border, GCGLsizei imageSize, GCGLsizei bufSize, const void* data) override; >- void compressedTexSubImage2DRobustANGLE(GCGLenum target, int level, int xoffset, int yoffset, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLsizei imageSize, GCGLsizei bufSize, const void* data) override; >- void compressedTexImage3DRobustANGLE(GCGLenum target, int level, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, GCGLsizei depth, int border, GCGLsizei imageSize, GCGLsizei bufSize, const void* data) override; >- void compressedTexSubImage3DRobustANGLE(GCGLenum target, int level, int xoffset, int yoffset, int zoffset, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLenum format, GCGLsizei imageSize, GCGLsizei bufSize, const void* data) override; >- >- void texImage3DRobustANGLE(GCGLenum target, int level, int internalformat, GCGLsizei width, GCGLsizei height, GCGLsizei depth, int border, GCGLenum format, GCGLenum type, GCGLsizei bufSize, const void *pixels) override; >- void texSubImage3DRobustANGLE(GCGLenum target, int level, int xoffset, int yoffset, int zoffset, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLenum format, GCGLenum type, GCGLsizei bufSize, const void *pixels) override; >+ void texSubImage2DRobustANGLE(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, const void *pixels) override; >+ void compressedTexImage2DRobustANGLE(GCGLenum target, GCGLint level, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, GCGLint border, GCGLsizei imageSize, GCGLsizei bufSize, const void* data) override; >+ void compressedTexSubImage2DRobustANGLE(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLsizei imageSize, GCGLsizei bufSize, const void* data) override; >+ void compressedTexImage3DRobustANGLE(GCGLenum target, GCGLint level, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLint border, GCGLsizei imageSize, GCGLsizei bufSize, const void* data) override; >+ void compressedTexSubImage3DRobustANGLE(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLint zoffset, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLenum format, GCGLsizei imageSize, GCGLsizei bufSize, const void* data) override; >+ >+ void texImage3DRobustANGLE(GCGLenum target, GCGLint level, GCGLint internalformat, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLint border, GCGLenum format, GCGLenum type, GCGLsizei bufSize, const void *pixels) override; >+ void texSubImage3DRobustANGLE(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLint zoffset, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLenum format, GCGLenum type, GCGLsizei bufSize, const void *pixels) override; > void getQueryivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, GCGLint *params) override; > void getQueryObjectuivRobustANGLE(GCGLuint id, GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, GCGLuint *params) override; > void getBufferPointervRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, void **params) override; >- void getIntegeri_vRobustANGLE(GCGLenum target, GCGLuint index, GCGLsizei bufSize, GCGLsizei *length, int *data) override; >+ void getIntegeri_vRobustANGLE(GCGLenum target, GCGLuint index, GCGLsizei bufSize, GCGLsizei *length, GCGLint *data) override; > void getInternalformativRobustANGLE(GCGLenum target, GCGLenum internalformat, GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, GCGLint *params) override; > void getVertexAttribIivRobustANGLE(GCGLuint index, GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, GCGLint *params) override; > void getVertexAttribIuivRobustANGLE(GCGLuint index, GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, GCGLuint *params) override; >- void getUniformuivRobustANGLE(GCGLuint program, int location, GCGLsizei bufSize, GCGLsizei *length, GCGLuint *params) override; >+ void getUniformuivRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei *length, GCGLuint *params) override; > void getActiveUniformBlockivRobustANGLE(GCGLuint program, GCGLuint uniformBlockIndex, GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, GCGLint *params) override; > void getInteger64vRobustANGLE(GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, GCGLint64 *data) override; > void getInteger64i_vRobustANGLE(GCGLenum target, GCGLuint index, GCGLsizei bufSize, GCGLsizei *length, GCGLint64 *data) override; >@@ -121,14 +121,14 @@ public: > void getProgramInterfaceivRobustANGLE(GCGLuint program, GCGLenum programInterface, GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, GCGLint *params) override; > void getBooleani_vRobustANGLE(GCGLenum target, GCGLuint index, GCGLsizei bufSize, GCGLsizei *length, GCGLboolean *data) override; > void getMultisamplefvRobustANGLE(GCGLenum pname, GCGLuint index, GCGLsizei bufSize, GCGLsizei *length, GCGLfloat *val) override; >- void getTexLevelParameterivRobustANGLE(GCGLenum target, int level, GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, GCGLint *params) override; >- void getTexLevelParameterfvRobustANGLE(GCGLenum target, int level, GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, GCGLfloat *params) override; >+ void getTexLevelParameterivRobustANGLE(GCGLenum target, GCGLint level, GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, GCGLint *params) override; >+ void getTexLevelParameterfvRobustANGLE(GCGLenum target, GCGLint level, GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, GCGLfloat *params) override; > > void getPointervRobustANGLERobustANGLE(GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, void **params) override; >- void readnPixelsRobustANGLE(int x, int y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, GCGLsizei *length, GCGLsizei *columns, GCGLsizei *rows, void *data, bool readingToPixelBufferObject) override; >- void getnUniformfvRobustANGLE(GCGLuint program, int location, GCGLsizei bufSize, GCGLsizei *length, GCGLfloat *params) override; >- void getnUniformivRobustANGLE(GCGLuint program, int location, GCGLsizei bufSize, GCGLsizei *length, GCGLint *params) override; >- void getnUniformuivRobustANGLE(GCGLuint program, int location, GCGLsizei bufSize, GCGLsizei *length, GCGLuint *params) override; >+ void readnPixelsRobustANGLE(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, GCGLsizei *length, GCGLsizei *columns, GCGLsizei *rows, void *data, bool readingToPixelBufferObject) override; >+ void getnUniformfvRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei *length, GCGLfloat *params) override; >+ void getnUniformivRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei *length, GCGLint *params) override; >+ void getnUniformuivRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei *length, GCGLuint *params) override; > void texParameterIivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, const GCGLint *params) override; > void texParameterIuivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, const GCGLuint *params) override; > void getTexParameterIivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, GCGLint *params) override; >diff --git a/Source/WebCore/platform/graphics/cocoa/RemoteGraphicsContextGLProxyBaseCocoa.h b/Source/WebCore/platform/graphics/cocoa/RemoteGraphicsContextGLProxyBaseCocoa.h >new file mode 100644 >index 0000000000000000000000000000000000000000..91892fc1a1f66a29e2e0b7c405568a957967db85 >--- /dev/null >+++ b/Source/WebCore/platform/graphics/cocoa/RemoteGraphicsContextGLProxyBaseCocoa.h >@@ -0,0 +1,94 @@ >+/* >+ * Copyright (C) 2020 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL) >+ >+#include "GraphicsContextGL.h" >+#include "ExtensionsGL.h" >+#include <wtf/RetainPtr.h> >+ >+OBJC_CLASS WebGLLayer; >+ >+namespace WebCore { >+ >+// A base class for RemoteGraphicsContextGL proxy side implementation on Cocoa. >+// This implements the parts that are using WebCore internal functionality: >+// - Drawing buffer tracking management. >+// - Compositing support. >+// The parts were needed to be implemented due to lack of abstractions and >+// small pending fixes at the time of writing. >+class WEBCORE_EXPORT RemoteGraphicsContextGLProxyBaseCocoa : public GraphicsContextGL, public ExtensionsGL { >+public: >+ RemoteGraphicsContextGLProxyBaseCocoa(const GraphicsContextGLAttributes&); >+ ~RemoteGraphicsContextGLProxyBaseCocoa() override; >+ >+ // Other WebCore::GraphicsContextGL overrides. >+ using GraphicsContextGL::isEnabled; >+ PlatformGraphicsContextGL platformGraphicsContextGL() const final; >+ PlatformGLObject platformTexture() const final; >+ PlatformLayer* platformLayer() const final; >+ void enablePreserveDrawingBuffer() final; >+ ExtensionsGL& getExtensions() final { return *this; } >+ void reshape(int width, int height) final; >+ void setContextVisibility(bool) final; >+ GraphicsContextGLPowerPreference powerPreferenceUsedForCreation() const final; >+ bool isGLES2Compliant() const final; >+ void synthesizeGLError(GCGLenum error) final; >+ bool moveErrorsToSyntheticErrorList() final; >+ void setFailNextGPUStatusCheck() final; >+ void prepareForDisplay() final; >+ void markContextChanged() final; >+ bool layerComposited() const final; >+ void setBuffersToAutoClear(GCGLbitfield) final; >+ GCGLbitfield getBuffersToAutoClear() const final; >+ void paintRenderingResultsToCanvas(ImageBuffer*) final; >+ RefPtr<ImageData> paintRenderingResultsToImageData() final; >+ bool paintCompositedResultsToCanvas(ImageBuffer*) final; >+ void markLayerComposited() final; >+ void simulateContextChanged() final; >+#if ENABLE(VIDEO) && USE(AVFOUNDATION) >+ GraphicsContextGLCV* asCV() final { return nullptr; } >+#endif >+ // Other ExtensionGL overrides. >+ using ExtensionsGL::isEnabled; >+ bool supports(const String&) final { return false; } >+ void ensureEnabled(const String&) final { } >+ bool isEnabled(const String&) final { return false; } >+ bool isNVIDIA() final { return false; } >+ bool isAMD() final { return false; } >+ bool isIntel() final { return false; } >+ bool isImagination() final { return false; } >+ String vendor() final { return ""; } >+ bool requiresBuiltInFunctionEmulation() final { return false; } >+ bool requiresRestrictedMaximumTextureSize() final { return false; } >+ >+ RetainPtr<WebGLLayer> m_webGLLayer; >+ >+}; >+ >+} >+#endif >diff --git a/Source/WebCore/platform/graphics/cocoa/RemoteGraphicsContextGLProxyBaseCocoa.mm b/Source/WebCore/platform/graphics/cocoa/RemoteGraphicsContextGLProxyBaseCocoa.mm >new file mode 100644 >index 0000000000000000000000000000000000000000..020538ad9dc2dd3fe9a2cc56ecd98389c4087688 >--- /dev/null >+++ b/Source/WebCore/platform/graphics/cocoa/RemoteGraphicsContextGLProxyBaseCocoa.mm >@@ -0,0 +1,140 @@ >+/* >+ * Copyright (C) 2020 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#import "config.h" >+#import "RemoteGraphicsContextGLProxyBaseCocoa.h" >+ >+#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL) >+ >+#import "ImageData.h" >+#import "WebGLLayer.h" >+ >+namespace WebCore { >+ >+RemoteGraphicsContextGLProxyBaseCocoa::RemoteGraphicsContextGLProxyBaseCocoa(const GraphicsContextGLAttributes& attrs) >+ : GraphicsContextGL(attrs) >+{ >+} >+ >+RemoteGraphicsContextGLProxyBaseCocoa::~RemoteGraphicsContextGLProxyBaseCocoa() >+{ >+} >+ >+PlatformGraphicsContextGL RemoteGraphicsContextGLProxyBaseCocoa::platformGraphicsContextGL() const >+{ >+ return 0; >+} >+ >+PlatformGLObject RemoteGraphicsContextGLProxyBaseCocoa::platformTexture() const >+{ >+ return 0; >+} >+ >+PlatformLayer* RemoteGraphicsContextGLProxyBaseCocoa::platformLayer() const >+{ >+ return m_webGLLayer.get(); >+} >+ >+void RemoteGraphicsContextGLProxyBaseCocoa::enablePreserveDrawingBuffer() >+{ >+} >+ >+void RemoteGraphicsContextGLProxyBaseCocoa::reshape(int, int) >+{ >+} >+ >+void RemoteGraphicsContextGLProxyBaseCocoa::setContextVisibility(bool) >+{ >+} >+ >+GraphicsContextGLPowerPreference RemoteGraphicsContextGLProxyBaseCocoa::powerPreferenceUsedForCreation() const >+{ >+ return {}; >+} >+ >+bool RemoteGraphicsContextGLProxyBaseCocoa::isGLES2Compliant() const >+{ >+ return false; >+} >+ >+void RemoteGraphicsContextGLProxyBaseCocoa::synthesizeGLError(GCGLenum) >+{ >+} >+ >+bool RemoteGraphicsContextGLProxyBaseCocoa::moveErrorsToSyntheticErrorList() >+{ >+ return false; >+} >+ >+void RemoteGraphicsContextGLProxyBaseCocoa::setFailNextGPUStatusCheck() >+{ >+} >+ >+void RemoteGraphicsContextGLProxyBaseCocoa::prepareForDisplay() >+{ >+} >+ >+void RemoteGraphicsContextGLProxyBaseCocoa::markContextChanged() >+{ >+} >+ >+bool RemoteGraphicsContextGLProxyBaseCocoa::layerComposited() const >+{ >+ return false; >+} >+ >+void RemoteGraphicsContextGLProxyBaseCocoa::setBuffersToAutoClear(GCGLbitfield) >+{ >+} >+ >+GCGLbitfield RemoteGraphicsContextGLProxyBaseCocoa::getBuffersToAutoClear() const >+{ >+ return 0; >+} >+ >+void RemoteGraphicsContextGLProxyBaseCocoa::paintRenderingResultsToCanvas(ImageBuffer*) >+{ >+} >+ >+RefPtr<ImageData> RemoteGraphicsContextGLProxyBaseCocoa::paintRenderingResultsToImageData() >+{ >+ return nullptr; >+} >+ >+bool RemoteGraphicsContextGLProxyBaseCocoa::paintCompositedResultsToCanvas(ImageBuffer*) >+{ >+ return false; >+} >+ >+void RemoteGraphicsContextGLProxyBaseCocoa::markLayerComposited() >+{ >+} >+ >+void RemoteGraphicsContextGLProxyBaseCocoa::simulateContextChanged() >+{ >+} >+ >+} >+#endif >diff --git a/Source/WebCore/platform/graphics/coreimage/FilterEffectRendererCoreImage.mm b/Source/WebCore/platform/graphics/coreimage/FilterEffectRendererCoreImage.mm >index 513f455cad8e5e6052728d347c393d9f447fe388..817587e8a7ce73d17013d3a90605122e3a9bc4f1 100644 >--- a/Source/WebCore/platform/graphics/coreimage/FilterEffectRendererCoreImage.mm >+++ b/Source/WebCore/platform/graphics/coreimage/FilterEffectRendererCoreImage.mm >@@ -36,6 +36,7 @@ > #import "FloatConversion.h" > #import "GraphicsContextCG.h" > #import "ImageBuffer.h" >+#import "Logging.h" > #import "PlatformImageBuffer.h" > #import "SourceGraphic.h" > #import <CoreImage/CIContext.h> >diff --git a/Source/WebCore/platform/graphics/opengl/ExtensionsGLOpenGL.cpp b/Source/WebCore/platform/graphics/opengl/ExtensionsGLOpenGL.cpp >index 17786a64ba4e1da00964eae997d292764dad1896..6179644b93c1f28b8e12df41f01bb02b070ca450 100644 >--- a/Source/WebCore/platform/graphics/opengl/ExtensionsGLOpenGL.cpp >+++ b/Source/WebCore/platform/graphics/opengl/ExtensionsGLOpenGL.cpp >@@ -222,7 +222,7 @@ void ExtensionsGLOpenGL::drawBuffersEXT(GCGLsizei n, const GCGLenum* bufs) > #endif > } > >-void ExtensionsGLOpenGL::drawArraysInstanced(GCGLenum mode, GCGLint first, GCGLsizei count, GCGLsizei primcount) >+void ExtensionsGLOpenGL::drawArraysInstancedANGLE(GCGLenum mode, GCGLint first, GCGLsizei count, GCGLsizei primcount) > { > if (!m_context->makeContextCurrent()) > return; >diff --git a/Source/WebCore/platform/graphics/opengl/ExtensionsGLOpenGLES.cpp b/Source/WebCore/platform/graphics/opengl/ExtensionsGLOpenGLES.cpp >index ab8cb54f5e879ef4b8a90d19a7ec92c89ce2057b..d6445837cb53c4f991ea51b5d3b8fc47f44dc809 100644 >--- a/Source/WebCore/platform/graphics/opengl/ExtensionsGLOpenGLES.cpp >+++ b/Source/WebCore/platform/graphics/opengl/ExtensionsGLOpenGLES.cpp >@@ -254,7 +254,7 @@ void ExtensionsGLOpenGLES::getnUniformivEXT(GCGLuint program, int location, GCGL > m_context->synthesizeGLError(GL_INVALID_OPERATION); > } > >-void ExtensionsGLOpenGLES::drawArraysInstanced(GCGLenum mode, GCGLint first, GCGLsizei count, GCGLsizei primcount) >+void ExtensionsGLOpenGLES::drawArraysInstancedANGLE(GCGLenum mode, GCGLint first, GCGLsizei count, GCGLsizei primcount) > { > if (!m_glDrawArraysInstancedANGLE) { > m_context->synthesizeGLError(GL_INVALID_OPERATION); >@@ -267,7 +267,7 @@ void ExtensionsGLOpenGLES::drawArraysInstanced(GCGLenum mode, GCGLint first, GCG > m_glDrawArraysInstancedANGLE(mode, first, count, primcount); > } > >-void ExtensionsGLOpenGLES::drawElementsInstanced(GCGLenum mode, GCGLsizei count, GCGLenum type, long long offset, GCGLsizei primcount) >+void ExtensionsGLOpenGLES::drawElementsInstancedANGLE(GCGLenum mode, GCGLsizei count, GCGLenum type, long long offset, GCGLsizei primcount) > { > if (!m_glDrawElementsInstancedANGLE) { > m_context->synthesizeGLError(GL_INVALID_OPERATION); >@@ -280,7 +280,7 @@ void ExtensionsGLOpenGLES::drawElementsInstanced(GCGLenum mode, GCGLsizei count, > m_glDrawElementsInstancedANGLE(mode, count, type, reinterpret_cast<GLvoid*>(static_cast<intptr_t>(offset)), primcount); > } > >-void ExtensionsGLOpenGLES::vertexAttribDivisor(GCGLuint index, GCGLuint divisor) >+void ExtensionsGLOpenGLES::vertexAttribDivisorANGLE(GCGLuint index, GCGLuint divisor) > { > if (!m_glVertexAttribDivisorANGLE) { > m_context->synthesizeGLError(GL_INVALID_OPERATION); >diff --git a/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.h b/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.h >index f1f42351fa105e126e2daccd6cc39d91f9ef93d3..eed21708c9f4a9b43e7627c789e9c32fd98dca89 100644 >--- a/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.h >+++ b/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.h >@@ -86,7 +86,7 @@ typedef WTF::HashMap<CString, uint64_t> ShaderNameHash; > > class GraphicsContextGLOpenGLPrivate; > >-class GraphicsContextGLOpenGL final : public GraphicsContextGL >+class WEBCORE_EXPORT GraphicsContextGLOpenGL final : public GraphicsContextGL > { > public: > static RefPtr<GraphicsContextGLOpenGL> create(GraphicsContextGLAttributes, HostWindow*, Destination = Destination::Offscreen); >diff --git a/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp b/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp >index b28128bb05473f27511dabbe39e8ce4212532257..fb9bbd22de4464fec67bb80dc69832c80ef431cd 100644 >--- a/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp >+++ b/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp >@@ -2286,19 +2286,19 @@ void GraphicsContextGLOpenGL::texImage2DDirect(GCGLenum target, GCGLint level, G > > void GraphicsContextGLOpenGL::drawArraysInstanced(GCGLenum mode, GCGLint first, GCGLsizei count, GCGLsizei primcount) > { >- getExtensions().drawArraysInstanced(mode, first, count, primcount); >+ getExtensions().drawArraysInstancedANGLE(mode, first, count, primcount); > checkGPUStatus(); > } > > void GraphicsContextGLOpenGL::drawElementsInstanced(GCGLenum mode, GCGLsizei count, GCGLenum type, GCGLintptr offset, GCGLsizei primcount) > { >- getExtensions().drawElementsInstanced(mode, count, type, offset, primcount); >+ getExtensions().drawElementsInstancedANGLE(mode, count, type, offset, primcount); > checkGPUStatus(); > } > > void GraphicsContextGLOpenGL::vertexAttribDivisor(GCGLuint index, GCGLuint divisor) > { >- getExtensions().vertexAttribDivisor(index, divisor); >+ getExtensions().vertexAttribDivisorANGLE(index, divisor); > } > > #if HAVE(OPENGL_4) && ENABLE(WEBGL2) >diff --git a/Source/WebKit/CMakeLists.txt b/Source/WebKit/CMakeLists.txt >index 71e4b31e0a2e99879024391e2f811921037eb7f3..7b6d9c9e3ddc2a938389086a9b1211f42fb08c92 100644 >--- a/Source/WebKit/CMakeLists.txt >+++ b/Source/WebKit/CMakeLists.txt >@@ -124,6 +124,7 @@ set(WebKit_MESSAGES_IN_FILES > GPUProcess/GPUProcess > > GPUProcess/graphics/RemoteRenderingBackend >+ GPUProcess/graphics/RemoteGraphicsContextGL > > GPUProcess/media/RemoteAudioDestinationManager > GPUProcess/media/RemoteAudioSessionProxy >@@ -216,6 +217,7 @@ set(WebKit_MESSAGES_IN_FILES > WebProcess/GPU/GPUProcessConnection > > WebProcess/GPU/graphics/RemoteRenderingBackendProxy >+ WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy > > WebProcess/GPU/media/MediaPlayerPrivateRemote > WebProcess/GPU/media/RemoteAudioDestinationProxy >diff --git a/Source/WebKit/DerivedSources-input.xcfilelist b/Source/WebKit/DerivedSources-input.xcfilelist >index c0efcad574503a8a9ab7c7ec05ef459d3054f39f..363189152bc111a3c90150c989e003dbf098de79 100644 >--- a/Source/WebKit/DerivedSources-input.xcfilelist >+++ b/Source/WebKit/DerivedSources-input.xcfilelist >@@ -20,6 +20,7 @@ $(JAVASCRIPTCORE_PRIVATE_HEADERS_DIR)/models.py > $(JAVASCRIPTCORE_PRIVATE_HEADERS_DIR)/xxd.pl > $(PROJECT_DIR)/GPUProcess/GPUConnectionToWebProcess.messages.in > $(PROJECT_DIR)/GPUProcess/GPUProcess.messages.in >+$(PROJECT_DIR)/GPUProcess/graphics/RemoteGraphicsContextGL.messages.in > $(PROJECT_DIR)/GPUProcess/graphics/RemoteRenderingBackend.messages.in > $(PROJECT_DIR)/GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in > $(PROJECT_DIR)/GPUProcess/media/RemoteAudioDestinationManager.messages.in >@@ -127,6 +128,7 @@ $(PROJECT_DIR)/WebProcess/Cache/WebCacheStorageConnection.messages.in > $(PROJECT_DIR)/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in > $(PROJECT_DIR)/WebProcess/FullScreen/WebFullScreenManager.messages.in > $(PROJECT_DIR)/WebProcess/GPU/GPUProcessConnection.messages.in >+$(PROJECT_DIR)/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.messages.in > $(PROJECT_DIR)/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.messages.in > $(PROJECT_DIR)/WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in > $(PROJECT_DIR)/WebProcess/GPU/media/RemoteAudioDestinationProxy.messages.in >diff --git a/Source/WebKit/DerivedSources-output.xcfilelist b/Source/WebKit/DerivedSources-output.xcfilelist >index 262fbd133e858bc39119e24ce61659f05ee1eb6e..a0b6fffd68d310f2dfaf8894119d399cf0f4f70c 100644 >--- a/Source/WebKit/DerivedSources-output.xcfilelist >+++ b/Source/WebKit/DerivedSources-output.xcfilelist >@@ -175,6 +175,12 @@ $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteCDMProxyMessagesReplies.h > $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteCaptureSampleManagerMessageReceiver.cpp > $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteCaptureSampleManagerMessages.h > $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteCaptureSampleManagerMessagesReplies.h >+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteGraphicsContextGLMessageReceiver.cpp >+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteGraphicsContextGLMessages.h >+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteGraphicsContextGLMessagesReplies.h >+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteGraphicsContextGLProxyMessageReceiver.cpp >+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteGraphicsContextGLProxyMessages.h >+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteGraphicsContextGLProxyMessagesReplies.h > $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteLayerTreeDrawingAreaProxyMessageReceiver.cpp > $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteLayerTreeDrawingAreaProxyMessages.h > $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteLayerTreeDrawingAreaProxyMessagesReplies.h >diff --git a/Source/WebKit/DerivedSources.make b/Source/WebKit/DerivedSources.make >index 3eb24613615a4e71f0e8ea2c133affc0f8c6141d..29fcc668a2cffaecc26c0ab85c87b36836538599 100644 >--- a/Source/WebKit/DerivedSources.make >+++ b/Source/WebKit/DerivedSources.make >@@ -170,6 +170,7 @@ MESSAGE_RECEIVERS = \ > WebProcess/Databases/IndexedDB/WebIDBConnectionToServer \ > WebProcess/GPU/GPUProcessConnection \ > WebProcess/GPU/graphics/RemoteRenderingBackendProxy \ >+ WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy \ > WebProcess/GPU/webrtc/LibWebRTCCodecs \ > WebProcess/GPU/webrtc/SampleBufferDisplayLayer \ > WebProcess/GPU/media/MediaPlayerPrivateRemote \ >@@ -223,6 +224,7 @@ MESSAGE_RECEIVERS = \ > PluginProcess/PluginProcess \ > GPUProcess/GPUConnectionToWebProcess \ > GPUProcess/graphics/RemoteRenderingBackend \ >+ GPUProcess/graphics/RemoteGraphicsContextGL \ > GPUProcess/webrtc/LibWebRTCCodecsProxy \ > GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager \ > GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererManager \ >diff --git a/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp b/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp >index 0e2e8832b1e20f1e0f319d5d9f25d72ce1bf73ad..44b9f63e14c50b741993d6f35a5a95f5afd80a5a 100644 >--- a/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp >+++ b/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp >@@ -64,6 +64,10 @@ > #include <WebCore/MediaSessionManagerIOS.h> > #endif > >+#if ENABLE(WEBGL) >+#include "RemoteGraphicsContextGL.h" >+#endif >+ > #if ENABLE(ENCRYPTED_MEDIA) > #include "RemoteCDMFactoryProxy.h" > #include "RemoteCDMFactoryProxyMessages.h" >@@ -290,6 +294,21 @@ void GPUConnectionToWebProcess::releaseRenderingBackend(RenderingBackendIdentifi > ASSERT_UNUSED(found, found); > } > >+#if ENABLE(WEBGL) >+void GPUConnectionToWebProcess::createGraphicsContextGL(WebCore::GraphicsContextGLAttributes attributes, GraphicsContextGLIdentifier graphicsContextGLIdentifier) >+{ >+ auto addResult = m_remoteGraphicsContextGLMap.ensure(graphicsContextGLIdentifier, [&]() { >+ return RemoteGraphicsContextGL::create(attributes, *this, graphicsContextGLIdentifier); >+ }); >+ ASSERT_UNUSED(addResult, addResult.isNewEntry); >+} >+ >+void GPUConnectionToWebProcess::releaseGraphicsContextGL(GraphicsContextGLIdentifier graphicsContextGLIdentifier) >+{ >+ bool found = m_remoteGraphicsContextGLMap.remove(graphicsContextGLIdentifier); >+ ASSERT_UNUSED(found, found); >+} >+#endif > void GPUConnectionToWebProcess::clearNowPlayingInfo() > { > gpuProcess().nowPlayingManager().clearNowPlayingInfoClient(*this); >diff --git a/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.h b/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.h >index 2678dbc4e5d365fad28e8b4827863762a3c4578d..1d4c8dffaf439e82dcf9194d970f21e2e50bcaf4 100644 >--- a/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.h >+++ b/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.h >@@ -32,6 +32,8 @@ > #include "MessageReceiverMap.h" > #include "RemoteAudioSessionIdentifier.h" > #include "RenderingBackendIdentifier.h" >+ >+#include <WebCore/GraphicsContextGLAttributes.h> > #include <WebCore/LibWebRTCEnumTraits.h> > #include <WebCore/NowPlayingManager.h> > #include <WebCore/ProcessIdentifier.h> >@@ -39,6 +41,10 @@ > #include <wtf/Logger.h> > #include <wtf/RefCounted.h> > >+#if ENABLE(WEBGL) >+#include "GraphicsContextGLIdentifier.h" >+#endif >+ > namespace WebKit { > > class GPUProcess; >@@ -54,6 +60,7 @@ class RemoteMediaRecorderManager; > class RemoteMediaResourceManager; > class RemoteMediaSessionHelperProxy; > class RemoteRenderingBackend; >+class RemoteGraphicsContextGL; > class RemoteSampleBufferDisplayLayerManager; > class UserMediaCaptureManagerProxy; > struct RemoteAudioSessionConfiguration; >@@ -119,6 +126,11 @@ private: > void createRenderingBackend(RenderingBackendIdentifier); > void releaseRenderingBackend(RenderingBackendIdentifier); > >+#if ENABLE(WEBGL) >+ void createGraphicsContextGL(WebCore::GraphicsContextGLAttributes, GraphicsContextGLIdentifier); >+ void releaseGraphicsContextGL(GraphicsContextGLIdentifier); >+#endif >+ > void clearNowPlayingInfo(); > void setNowPlayingInfo(bool setAsNowPlayingApplication, WebCore::NowPlayingInfo&&); > >@@ -180,7 +192,10 @@ private: > > using RemoteRenderingBackendMap = HashMap<RenderingBackendIdentifier, std::unique_ptr<RemoteRenderingBackend>>; > RemoteRenderingBackendMap m_remoteRenderingBackendMap; >- >+#if ENABLE(WEBGL) >+ using RemoteGraphicsContextGLMap = HashMap<GraphicsContextGLIdentifier, std::unique_ptr<RemoteGraphicsContextGL>>; >+ RemoteGraphicsContextGLMap m_remoteGraphicsContextGLMap; >+#endif > #if ENABLE(ENCRYPTED_MEDIA) > std::unique_ptr<RemoteCDMFactoryProxy> m_cdmFactoryProxy; > #endif >diff --git a/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.messages.in b/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.messages.in >index 5194fb4f6085d624d5983f6252c365eb3271f344..9d54e164595b0a361dfe4c75bff4018a85759c8f 100644 >--- a/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.messages.in >+++ b/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.messages.in >@@ -25,6 +25,10 @@ > messages -> GPUConnectionToWebProcess WantsDispatchMessage { > void CreateRenderingBackend(WebKit::RenderingBackendIdentifier renderingBackendIdentifier) > void ReleaseRenderingBackend(WebKit::RenderingBackendIdentifier renderingBackendIdentifier) >+#if ENABLE(WEBGL) >+ void CreateGraphicsContextGL(struct WebCore::GraphicsContextGLAttributes attributes, WebKit::GraphicsContextGLIdentifier graphicsContextGLIdentifier) >+ void ReleaseGraphicsContextGL(WebKit::GraphicsContextGLIdentifier graphicsContextGLIdentifier) >+#endif > void ClearNowPlayingInfo() > void SetNowPlayingInfo(bool setAsNowPlayingApplication, struct WebCore::NowPlayingInfo nowPlayingInfo) > #if USE(AUDIO_SESSION) >diff --git a/Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.cpp b/Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..7508debecc1adf74e889e50d3f0425b251c93af6 >--- /dev/null >+++ b/Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.cpp >@@ -0,0 +1,80 @@ >+/* >+ * Copyright (C) 2020 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "RemoteGraphicsContextGL.h" >+ >+#if ENABLE(GPU_PROCESS) >+ >+#include "GPUConnectionToWebProcess.h" >+#include "RemoteGraphicsContextGLMessages.h" >+#include "RemoteGraphicsContextGLProxyMessages.h" >+ >+#include <WebCore/GraphicsContextGLOpenGL.h> >+ >+namespace WebKit { >+using namespace WebCore; >+ >+std::unique_ptr<RemoteGraphicsContextGL> RemoteGraphicsContextGL::create(const WebCore::GraphicsContextGLAttributes& attributes, GPUConnectionToWebProcess& gpuConnectionToWebProcess, GraphicsContextGLIdentifier graphicsContextGLIdentifier) >+{ >+ return std::unique_ptr<RemoteGraphicsContextGL>(new RemoteGraphicsContextGL(attributes, gpuConnectionToWebProcess, graphicsContextGLIdentifier)); >+} >+ >+RemoteGraphicsContextGL::RemoteGraphicsContextGL(const WebCore::GraphicsContextGLAttributes& attributes, GPUConnectionToWebProcess& gpuConnectionToWebProcess, GraphicsContextGLIdentifier graphicsContextGLIdentifier) >+ : m_gpuConnectionToWebProcess(makeWeakPtr(gpuConnectionToWebProcess)) >+ , m_graphicsContextGLIdentifier(graphicsContextGLIdentifier) >+{ >+ if (auto* gpuConnectionToWebProcess = m_gpuConnectionToWebProcess.get()) >+ gpuConnectionToWebProcess->messageReceiverMap().addMessageReceiver(Messages::RemoteGraphicsContextGL::messageReceiverName(), graphicsContextGLIdentifier.toUInt64(), *this); >+ m_context = GraphicsContextGLOpenGL::create(attributes, nullptr); >+ send(Messages::RemoteGraphicsContextGLProxy::WasCreated(), m_graphicsContextGLIdentifier); >+} >+ >+RemoteGraphicsContextGL::~RemoteGraphicsContextGL() >+{ >+ if (auto* gpuConnectionToWebProcess = m_gpuConnectionToWebProcess.get()) >+ gpuConnectionToWebProcess->messageReceiverMap().removeMessageReceiver(Messages::RemoteGraphicsContextGL::messageReceiverName(), m_graphicsContextGLIdentifier.toUInt64()); >+} >+ >+GPUConnectionToWebProcess* RemoteGraphicsContextGL::gpuConnectionToWebProcess() const >+{ >+ return m_gpuConnectionToWebProcess.get(); >+} >+ >+IPC::Connection* RemoteGraphicsContextGL::messageSenderConnection() const >+{ >+ if (auto* gpuConnectionToWebProcess = m_gpuConnectionToWebProcess.get()) >+ return &gpuConnectionToWebProcess->connection(); >+ return nullptr; >+} >+ >+uint64_t RemoteGraphicsContextGL::messageSenderDestinationID() const >+{ >+ return m_graphicsContextGLIdentifier.toUInt64(); >+} >+ >+} // namespace WebKit >+ >+#endif // ENABLE(GPU_PROCESS) >diff --git a/Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.h b/Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.h >new file mode 100644 >index 0000000000000000000000000000000000000000..f997d0644beb9b17d553377be6f52194f277d18e >--- /dev/null >+++ b/Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.h >@@ -0,0 +1,77 @@ >+/* >+ * Copyright (C) 2020 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#if ENABLE(GPU_PROCESS) >+ >+#include "Connection.h" >+#include "GraphicsContextGLIdentifier.h" >+#include "MessageReceiver.h" >+#include "MessageSender.h" >+#include "RemoteResourceCache.h" >+#include <WebCore/ExtensionsGL.h> >+#include <WebCore/GraphicsContextGLOpenGL.h> >+#include <wtf/WeakPtr.h> >+ >+namespace WebCore { >+struct GraphicsContextGLAttributes; >+} >+ >+namespace WebKit { >+ >+class GPUConnectionToWebProcess; >+ >+class RemoteGraphicsContextGL >+ : public IPC::MessageSender >+ , private IPC::MessageReceiver { >+public: >+ static std::unique_ptr<RemoteGraphicsContextGL> create(const WebCore::GraphicsContextGLAttributes&, GPUConnectionToWebProcess&, GraphicsContextGLIdentifier); >+ virtual ~RemoteGraphicsContextGL(); >+ >+ GPUConnectionToWebProcess* gpuConnectionToWebProcess() const; >+ >+private: >+ RemoteGraphicsContextGL(const WebCore::GraphicsContextGLAttributes&, GPUConnectionToWebProcess&, GraphicsContextGLIdentifier); >+ >+ // IPC::MessageSender overrides. >+ IPC::Connection* messageSenderConnection() const override; >+ uint64_t messageSenderDestinationID() const override; >+ >+ // IPC::MessageReceiver overrides. >+ void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override; >+ void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override; >+ >+ // Messages to be received. >+#include "RemoteGraphicsContextGLFunctionsGenerated.h" >+ >+ RefPtr<WebCore::GraphicsContextGLOpenGL> m_context; >+ WeakPtr<GPUConnectionToWebProcess> m_gpuConnectionToWebProcess; >+ GraphicsContextGLIdentifier m_graphicsContextGLIdentifier; >+}; >+ >+} // namespace WebKit >+ >+#endif // ENABLE(GPU_PROCESS) >diff --git a/Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.messages.in b/Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.messages.in >new file mode 100644 >index 0000000000000000000000000000000000000000..5ab20ff66c14408d88df191dc9e42a16ab265489 >--- /dev/null >+++ b/Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.messages.in >@@ -0,0 +1,197 @@ >+ >+/* Copyright (C) 2020 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND >+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR >+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL >+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR >+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER >+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, >+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+// This file is generated by generate-gpup-webgl. Do not edit. >+ >+#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL) >+ >+messages -> RemoteGraphicsContextGL NotRefCounted { >+ void ActiveTexture(uint32_t texture) >+ void AttachShader(uint32_t program, uint32_t shader) >+ void BindAttribLocation(uint32_t arg0, uint32_t index, String name) >+ void BindBuffer(uint32_t target, uint32_t arg1) >+ void BindFramebuffer(uint32_t target, uint32_t arg1) >+ void BindRenderbuffer(uint32_t target, uint32_t arg1) >+ void BindTexture(uint32_t target, uint32_t arg1) >+ void BlendColor(float red, float green, float blue, float alpha) >+ void BlendEquation(uint32_t mode) >+ void BlendEquationSeparate(uint32_t modeRGB, uint32_t modeAlpha) >+ void BlendFunc(uint32_t sfactor, uint32_t dfactor) >+ void BlendFuncSeparate(uint32_t srcRGB, uint32_t dstRGB, uint32_t srcAlpha, uint32_t dstAlpha) >+ void CheckFramebufferStatus(uint32_t target) -> (uint32_t result) Synchronous >+ void Clear(uint32_t mask) >+ void ClearColor(float red, float green, float blue, float alpha) >+ void ClearDepth(float depth) >+ void ClearStencil(int32_t s) >+ void ColorMask(bool red, bool green, bool blue, bool alpha) >+ void CompileShader(uint32_t arg0) >+ void CopyTexImage2D(uint32_t target, int32_t level, uint32_t internalformat, int32_t x, int32_t y, int32_t width, int32_t height, int32_t border) >+ void CopyTexSubImage2D(uint32_t target, int32_t level, int32_t xoffset, int32_t yoffset, int32_t x, int32_t y, int32_t width, int32_t height) >+ void CreateBuffer() -> (uint32_t result) Synchronous >+ void CreateFramebuffer() -> (uint32_t result) Synchronous >+ void CreateProgram() -> (uint32_t result) Synchronous >+ void CreateRenderbuffer() -> (uint32_t result) Synchronous >+ void CreateShader(uint32_t arg0) -> (uint32_t result) Synchronous >+ void CreateTexture() -> (uint32_t result) Synchronous >+ void CullFace(uint32_t mode) >+ void DeleteBuffer(uint32_t arg0) >+ void DeleteFramebuffer(uint32_t arg0) >+ void DeleteProgram(uint32_t arg0) >+ void DeleteRenderbuffer(uint32_t arg0) >+ void DeleteShader(uint32_t arg0) >+ void DeleteTexture(uint32_t arg0) >+ void DepthFunc(uint32_t func) >+ void DepthMask(bool flag) >+ void DepthRange(float zNear, float zFar) >+ void DetachShader(uint32_t arg0, uint32_t arg1) >+ void Disable(uint32_t cap) >+ void DisableVertexAttribArray(uint32_t index) >+ void DrawArrays(uint32_t mode, int32_t first, int32_t count) >+ void DrawElements(uint32_t mode, int32_t count, uint32_t type, uint64_t offset) >+ void Enable(uint32_t cap) >+ void EnableVertexAttribArray(uint32_t index) >+ void Finish() >+ void Flush() >+ void FramebufferRenderbuffer(uint32_t target, uint32_t attachment, uint32_t renderbuffertarget, uint32_t arg3) >+ void FramebufferTexture2D(uint32_t target, uint32_t attachment, uint32_t textarget, uint32_t arg3, int32_t level) >+ void FrontFace(uint32_t mode) >+ void GenerateMipmap(uint32_t target) >+ void GetAttribLocation(uint32_t arg0, String name) -> (int32_t result) Synchronous >+ void GetString(uint32_t name) -> (String result) Synchronous >+ void GetError() -> (uint32_t result) Synchronous >+ void GetProgramInfoLog(uint32_t arg0) -> (String result) Synchronous >+ void GetShaderInfoLog(uint32_t arg0) -> (String result) Synchronous >+ void GetShaderSource(uint32_t arg0) -> (String result) Synchronous >+ void GetUniformLocation(uint32_t arg0, String name) -> (int32_t result) Synchronous >+ void GetVertexAttribOffset(uint32_t index, uint32_t pname) -> (uint64_t result) Synchronous >+ void Hint(uint32_t target, uint32_t mode) >+ void IsBuffer(uint32_t arg0) -> (bool result) Synchronous >+ void IsEnabled(uint32_t cap) -> (bool result) Synchronous >+ void IsFramebuffer(uint32_t arg0) -> (bool result) Synchronous >+ void IsProgram(uint32_t arg0) -> (bool result) Synchronous >+ void IsRenderbuffer(uint32_t arg0) -> (bool result) Synchronous >+ void IsShader(uint32_t arg0) -> (bool result) Synchronous >+ void IsTexture(uint32_t arg0) -> (bool result) Synchronous >+ void LineWidth(float arg0) >+ void LinkProgram(uint32_t arg0) >+ void PixelStorei(uint32_t pname, int32_t param) >+ void PolygonOffset(float factor, float units) >+ void RenderbufferStorage(uint32_t target, uint32_t internalformat, int32_t width, int32_t height) >+ void SampleCoverage(float value, bool invert) >+ void Scissor(int32_t x, int32_t y, int32_t width, int32_t height) >+ void ShaderSource(uint32_t arg0, String string) >+ void StencilFunc(uint32_t func, int32_t ref, uint32_t mask) >+ void StencilFuncSeparate(uint32_t face, uint32_t func, int32_t ref, uint32_t mask) >+ void StencilMask(uint32_t mask) >+ void StencilMaskSeparate(uint32_t face, uint32_t mask) >+ void StencilOp(uint32_t fail, uint32_t zfail, uint32_t zpass) >+ void StencilOpSeparate(uint32_t face, uint32_t fail, uint32_t zfail, uint32_t zpass) >+ void TexParameterf(uint32_t target, uint32_t pname, float param) >+ void TexParameteri(uint32_t target, uint32_t pname, int32_t param) >+ void Uniform1f(int32_t location, float x) >+ void Uniform1i(int32_t location, int32_t x) >+ void Uniform2f(int32_t location, float x, float y) >+ void Uniform2i(int32_t location, int32_t x, int32_t y) >+ void Uniform3f(int32_t location, float x, float y, float z) >+ void Uniform3i(int32_t location, int32_t x, int32_t y, int32_t z) >+ void Uniform4f(int32_t location, float x, float y, float z, float w) >+ void Uniform4i(int32_t location, int32_t x, int32_t y, int32_t z, int32_t w) >+ void UseProgram(uint32_t arg0) >+ void ValidateProgram(uint32_t arg0) >+ void VertexAttrib1f(uint32_t index, float x) >+ void VertexAttrib2f(uint32_t index, float x, float y) >+ void VertexAttrib3f(uint32_t index, float x, float y, float z) >+ void VertexAttrib4f(uint32_t index, float x, float y, float z, float w) >+ void VertexAttribPointer(uint32_t index, int32_t size, uint32_t type, bool normalized, int32_t stride, uint64_t offset) >+ void Viewport(int32_t x, int32_t y, int32_t width, int32_t height) >+ void BufferData(uint32_t target, uint64_t size, uint32_t usage) >+ void DrawArraysInstanced(uint32_t mode, int32_t first, int32_t count, int32_t primcount) >+ void DrawElementsInstanced(uint32_t mode, int32_t count, uint32_t type, uint64_t offset, int32_t primcount) >+ void VertexAttribDivisor(uint32_t index, uint32_t divisor) >+ void CreateVertexArray() -> (uint32_t result) Synchronous >+ void DeleteVertexArray(uint32_t arg0) >+ void IsVertexArray(uint32_t arg0) -> (bool result) Synchronous >+ void BindVertexArray(uint32_t arg0) >+ void CopyBufferSubData(uint32_t readTarget, uint32_t writeTarget, uint64_t readOffset, uint64_t writeOffset, uint64_t size) >+ void UnmapBuffer(uint32_t target) -> (bool result) Synchronous >+ void BlitFramebuffer(int32_t srcX0, int32_t srcY0, int32_t srcX1, int32_t srcY1, int32_t dstX0, int32_t dstY0, int32_t dstX1, int32_t dstY1, uint32_t mask, uint32_t filter) >+ void FramebufferTextureLayer(uint32_t target, uint32_t attachment, uint32_t texture, int32_t level, int32_t layer) >+ void ReadBuffer(uint32_t src) >+ void RenderbufferStorageMultisample(uint32_t target, int32_t samples, uint32_t internalformat, int32_t width, int32_t height) >+ void TexStorage2D(uint32_t target, int32_t levels, uint32_t internalformat, int32_t width, int32_t height) >+ void TexStorage3D(uint32_t target, int32_t levels, uint32_t internalformat, int32_t width, int32_t height, int32_t depth) >+ void CopyTexSubImage3D(uint32_t target, int32_t level, int32_t xoffset, int32_t yoffset, int32_t zoffset, int32_t x, int32_t y, int32_t width, int32_t height) >+ void GetFragDataLocation(uint32_t program, String name) -> (int32_t result) Synchronous >+ void Uniform1ui(int32_t location, uint32_t v0) >+ void Uniform2ui(int32_t location, uint32_t v0, uint32_t v1) >+ void Uniform3ui(int32_t location, uint32_t v0, uint32_t v1, uint32_t v2) >+ void Uniform4ui(int32_t location, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3) >+ void VertexAttribI4i(uint32_t index, int32_t x, int32_t y, int32_t z, int32_t w) >+ void VertexAttribI4ui(uint32_t index, uint32_t x, uint32_t y, uint32_t z, uint32_t w) >+ void VertexAttribIPointer(uint32_t index, int32_t size, uint32_t type, int32_t stride, uint64_t offset) >+ void DrawRangeElements(uint32_t mode, uint32_t start, uint32_t end, int32_t count, uint32_t type, uint64_t offset) >+ void ClearBufferfi(uint32_t buffer, int32_t drawbuffer, float depth, int32_t stencil) >+ void CreateQuery() -> (uint32_t result) Synchronous >+ void DeleteQuery(uint32_t query) >+ void IsQuery(uint32_t query) -> (bool result) Synchronous >+ void BeginQuery(uint32_t target, uint32_t query) >+ void EndQuery(uint32_t target) >+ void GetQuery(uint32_t target, uint32_t pname) -> (uint32_t result) Synchronous >+ void CreateSampler() -> (uint32_t result) Synchronous >+ void DeleteSampler(uint32_t sampler) >+ void IsSampler(uint32_t sampler) -> (bool result) Synchronous >+ void BindSampler(uint32_t unit, uint32_t sampler) >+ void SamplerParameteri(uint32_t sampler, uint32_t pname, int32_t param) >+ void SamplerParameterf(uint32_t sampler, uint32_t pname, float param) >+ void CreateTransformFeedback() -> (uint32_t result) Synchronous >+ void DeleteTransformFeedback(uint32_t id) >+ void IsTransformFeedback(uint32_t id) -> (bool result) Synchronous >+ void BindTransformFeedback(uint32_t target, uint32_t id) >+ void BeginTransformFeedback(uint32_t primitiveMode) >+ void EndTransformFeedback() >+ void PauseTransformFeedback() >+ void ResumeTransformFeedback() >+ void BindBufferBase(uint32_t target, uint32_t index, uint32_t buffer) >+ void BindBufferRange(uint32_t target, uint32_t index, uint32_t buffer, uint64_t offset, uint64_t size) >+ void GetUniformBlockIndex(uint32_t program, String uniformBlockName) -> (uint32_t result) Synchronous >+ void GetActiveUniformBlockName(uint32_t program, uint32_t uniformBlockIndex) -> (String result) Synchronous >+ void UniformBlockBinding(uint32_t program, uint32_t uniformBlockIndex, uint32_t uniformBlockBinding) >+ void GetGraphicsResetStatusARB() -> (int32_t result) Synchronous >+ void BlitFramebufferANGLE(int32_t srcX0, int32_t srcY0, int32_t srcX1, int32_t srcY1, int32_t dstX0, int32_t dstY0, int32_t dstX1, int32_t dstY1, uint32_t mask, uint32_t filter) >+ void RenderbufferStorageMultisampleANGLE(uint32_t target, int32_t samples, uint32_t internalformat, int32_t width, int32_t height) >+ void CreateVertexArrayOES() -> (uint32_t result) Synchronous >+ void DeleteVertexArrayOES(uint32_t arg0) >+ void IsVertexArrayOES(uint32_t arg0) -> (bool result) Synchronous >+ void BindVertexArrayOES(uint32_t arg0) >+ void GetTranslatedShaderSourceANGLE(uint32_t arg0) -> (String result) Synchronous >+ void InsertEventMarkerEXT(String arg0) >+ void PushGroupMarkerEXT(String arg0) >+ void PopGroupMarkerEXT() >+ void DrawArraysInstancedANGLE(uint32_t mode, int32_t first, int32_t count, int32_t primcount) >+ void DrawElementsInstancedANGLE(uint32_t mode, int32_t count, uint32_t type, uint64_t offset, int32_t primcount) >+ void VertexAttribDivisorANGLE(uint32_t index, uint32_t divisor) >+} >+ >+#endif >+ >diff --git a/Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGLFunctionsGenerated.h b/Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGLFunctionsGenerated.h >new file mode 100644 >index 0000000000000000000000000000000000000000..e8a99eb1fdd041be5f1bab16e6bc1c05456b0b94 >--- /dev/null >+++ b/Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGLFunctionsGenerated.h >@@ -0,0 +1,686 @@ >+ >+/* Copyright (C) 2020 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND >+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR >+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL >+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR >+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER >+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, >+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+// This file is generated by generate-gpup-webgl. Do not edit. >+ >+// This file should be included in the private section of the >+// RemoteGraphicsContextGL implementations. >+#pragma once >+ void activeTexture(uint32_t texture) >+ { >+ m_context->activeTexture(texture); >+ } >+ void attachShader(uint32_t program, uint32_t shader) >+ { >+ m_context->attachShader(program, shader); >+ } >+ void bindAttribLocation(uint32_t arg0, uint32_t index, String name) >+ { >+ m_context->bindAttribLocation(arg0, index, name); >+ } >+ void bindBuffer(uint32_t target, uint32_t arg1) >+ { >+ m_context->bindBuffer(target, arg1); >+ } >+ void bindFramebuffer(uint32_t target, uint32_t arg1) >+ { >+ m_context->bindFramebuffer(target, arg1); >+ } >+ void bindRenderbuffer(uint32_t target, uint32_t arg1) >+ { >+ m_context->bindRenderbuffer(target, arg1); >+ } >+ void bindTexture(uint32_t target, uint32_t arg1) >+ { >+ m_context->bindTexture(target, arg1); >+ } >+ void blendColor(float red, float green, float blue, float alpha) >+ { >+ m_context->blendColor(red, green, blue, alpha); >+ } >+ void blendEquation(uint32_t mode) >+ { >+ m_context->blendEquation(mode); >+ } >+ void blendEquationSeparate(uint32_t modeRGB, uint32_t modeAlpha) >+ { >+ m_context->blendEquationSeparate(modeRGB, modeAlpha); >+ } >+ void blendFunc(uint32_t sfactor, uint32_t dfactor) >+ { >+ m_context->blendFunc(sfactor, dfactor); >+ } >+ void blendFuncSeparate(uint32_t srcRGB, uint32_t dstRGB, uint32_t srcAlpha, uint32_t dstAlpha) >+ { >+ m_context->blendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha); >+ } >+ void checkFramebufferStatus(uint32_t target, CompletionHandler<void(uint32_t)>&& completionHandler) >+ { >+ completionHandler(m_context->checkFramebufferStatus(target)); >+ } >+ void clear(uint32_t mask) >+ { >+ m_context->clear(mask); >+ } >+ void clearColor(float red, float green, float blue, float alpha) >+ { >+ m_context->clearColor(red, green, blue, alpha); >+ } >+ void clearDepth(float depth) >+ { >+ m_context->clearDepth(depth); >+ } >+ void clearStencil(int32_t s) >+ { >+ m_context->clearStencil(s); >+ } >+ void colorMask(bool red, bool green, bool blue, bool alpha) >+ { >+ m_context->colorMask(red, green, blue, alpha); >+ } >+ void compileShader(uint32_t arg0) >+ { >+ m_context->compileShader(arg0); >+ } >+ void copyTexImage2D(uint32_t target, int32_t level, uint32_t internalformat, int32_t x, int32_t y, int32_t width, int32_t height, int32_t border) >+ { >+ m_context->copyTexImage2D(target, level, internalformat, x, y, width, height, border); >+ } >+ void copyTexSubImage2D(uint32_t target, int32_t level, int32_t xoffset, int32_t yoffset, int32_t x, int32_t y, int32_t width, int32_t height) >+ { >+ m_context->copyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); >+ } >+ void createBuffer(CompletionHandler<void(uint32_t)>&& completionHandler) >+ { >+ completionHandler(m_context->createBuffer()); >+ } >+ void createFramebuffer(CompletionHandler<void(uint32_t)>&& completionHandler) >+ { >+ completionHandler(m_context->createFramebuffer()); >+ } >+ void createProgram(CompletionHandler<void(uint32_t)>&& completionHandler) >+ { >+ completionHandler(m_context->createProgram()); >+ } >+ void createRenderbuffer(CompletionHandler<void(uint32_t)>&& completionHandler) >+ { >+ completionHandler(m_context->createRenderbuffer()); >+ } >+ void createShader(uint32_t arg0, CompletionHandler<void(uint32_t)>&& completionHandler) >+ { >+ completionHandler(m_context->createShader(arg0)); >+ } >+ void createTexture(CompletionHandler<void(uint32_t)>&& completionHandler) >+ { >+ completionHandler(m_context->createTexture()); >+ } >+ void cullFace(uint32_t mode) >+ { >+ m_context->cullFace(mode); >+ } >+ void deleteBuffer(uint32_t arg0) >+ { >+ m_context->deleteBuffer(arg0); >+ } >+ void deleteFramebuffer(uint32_t arg0) >+ { >+ m_context->deleteFramebuffer(arg0); >+ } >+ void deleteProgram(uint32_t arg0) >+ { >+ m_context->deleteProgram(arg0); >+ } >+ void deleteRenderbuffer(uint32_t arg0) >+ { >+ m_context->deleteRenderbuffer(arg0); >+ } >+ void deleteShader(uint32_t arg0) >+ { >+ m_context->deleteShader(arg0); >+ } >+ void deleteTexture(uint32_t arg0) >+ { >+ m_context->deleteTexture(arg0); >+ } >+ void depthFunc(uint32_t func) >+ { >+ m_context->depthFunc(func); >+ } >+ void depthMask(bool flag) >+ { >+ m_context->depthMask(flag); >+ } >+ void depthRange(float zNear, float zFar) >+ { >+ m_context->depthRange(zNear, zFar); >+ } >+ void detachShader(uint32_t arg0, uint32_t arg1) >+ { >+ m_context->detachShader(arg0, arg1); >+ } >+ void disable(uint32_t cap) >+ { >+ m_context->disable(cap); >+ } >+ void disableVertexAttribArray(uint32_t index) >+ { >+ m_context->disableVertexAttribArray(index); >+ } >+ void drawArrays(uint32_t mode, int32_t first, int32_t count) >+ { >+ m_context->drawArrays(mode, first, count); >+ } >+ void drawElements(uint32_t mode, int32_t count, uint32_t type, uint64_t offset) >+ { >+ m_context->drawElements(mode, count, type, offset); >+ } >+ void enable(uint32_t cap) >+ { >+ m_context->enable(cap); >+ } >+ void enableVertexAttribArray(uint32_t index) >+ { >+ m_context->enableVertexAttribArray(index); >+ } >+ void finish() >+ { >+ m_context->finish(); >+ } >+ void flush() >+ { >+ m_context->flush(); >+ } >+ void framebufferRenderbuffer(uint32_t target, uint32_t attachment, uint32_t renderbuffertarget, uint32_t arg3) >+ { >+ m_context->framebufferRenderbuffer(target, attachment, renderbuffertarget, arg3); >+ } >+ void framebufferTexture2D(uint32_t target, uint32_t attachment, uint32_t textarget, uint32_t arg3, int32_t level) >+ { >+ m_context->framebufferTexture2D(target, attachment, textarget, arg3, level); >+ } >+ void frontFace(uint32_t mode) >+ { >+ m_context->frontFace(mode); >+ } >+ void generateMipmap(uint32_t target) >+ { >+ m_context->generateMipmap(target); >+ } >+ void getAttribLocation(uint32_t arg0, String name, CompletionHandler<void(int32_t)>&& completionHandler) >+ { >+ completionHandler(m_context->getAttribLocation(arg0, name)); >+ } >+ void getString(uint32_t name, CompletionHandler<void(String)>&& completionHandler) >+ { >+ completionHandler(m_context->getString(name)); >+ } >+ void getError(CompletionHandler<void(uint32_t)>&& completionHandler) >+ { >+ completionHandler(m_context->getError()); >+ } >+ void getProgramInfoLog(uint32_t arg0, CompletionHandler<void(String)>&& completionHandler) >+ { >+ completionHandler(m_context->getProgramInfoLog(arg0)); >+ } >+ void getShaderInfoLog(uint32_t arg0, CompletionHandler<void(String)>&& completionHandler) >+ { >+ completionHandler(m_context->getShaderInfoLog(arg0)); >+ } >+ void getShaderSource(uint32_t arg0, CompletionHandler<void(String)>&& completionHandler) >+ { >+ completionHandler(m_context->getShaderSource(arg0)); >+ } >+ void getUniformLocation(uint32_t arg0, String name, CompletionHandler<void(int32_t)>&& completionHandler) >+ { >+ completionHandler(m_context->getUniformLocation(arg0, name)); >+ } >+ void getVertexAttribOffset(uint32_t index, uint32_t pname, CompletionHandler<void(uint64_t)>&& completionHandler) >+ { >+ completionHandler(m_context->getVertexAttribOffset(index, pname)); >+ } >+ void hint(uint32_t target, uint32_t mode) >+ { >+ m_context->hint(target, mode); >+ } >+ void isBuffer(uint32_t arg0, CompletionHandler<void(bool)>&& completionHandler) >+ { >+ completionHandler(m_context->isBuffer(arg0)); >+ } >+ void isEnabled(uint32_t cap, CompletionHandler<void(bool)>&& completionHandler) >+ { >+ completionHandler(m_context->isEnabled(cap)); >+ } >+ void isFramebuffer(uint32_t arg0, CompletionHandler<void(bool)>&& completionHandler) >+ { >+ completionHandler(m_context->isFramebuffer(arg0)); >+ } >+ void isProgram(uint32_t arg0, CompletionHandler<void(bool)>&& completionHandler) >+ { >+ completionHandler(m_context->isProgram(arg0)); >+ } >+ void isRenderbuffer(uint32_t arg0, CompletionHandler<void(bool)>&& completionHandler) >+ { >+ completionHandler(m_context->isRenderbuffer(arg0)); >+ } >+ void isShader(uint32_t arg0, CompletionHandler<void(bool)>&& completionHandler) >+ { >+ completionHandler(m_context->isShader(arg0)); >+ } >+ void isTexture(uint32_t arg0, CompletionHandler<void(bool)>&& completionHandler) >+ { >+ completionHandler(m_context->isTexture(arg0)); >+ } >+ void lineWidth(float arg0) >+ { >+ m_context->lineWidth(arg0); >+ } >+ void linkProgram(uint32_t arg0) >+ { >+ m_context->linkProgram(arg0); >+ } >+ void pixelStorei(uint32_t pname, int32_t param) >+ { >+ m_context->pixelStorei(pname, param); >+ } >+ void polygonOffset(float factor, float units) >+ { >+ m_context->polygonOffset(factor, units); >+ } >+ void renderbufferStorage(uint32_t target, uint32_t internalformat, int32_t width, int32_t height) >+ { >+ m_context->renderbufferStorage(target, internalformat, width, height); >+ } >+ void sampleCoverage(float value, bool invert) >+ { >+ m_context->sampleCoverage(value, invert); >+ } >+ void scissor(int32_t x, int32_t y, int32_t width, int32_t height) >+ { >+ m_context->scissor(x, y, width, height); >+ } >+ void shaderSource(uint32_t arg0, String string) >+ { >+ m_context->shaderSource(arg0, string); >+ } >+ void stencilFunc(uint32_t func, int32_t ref, uint32_t mask) >+ { >+ m_context->stencilFunc(func, ref, mask); >+ } >+ void stencilFuncSeparate(uint32_t face, uint32_t func, int32_t ref, uint32_t mask) >+ { >+ m_context->stencilFuncSeparate(face, func, ref, mask); >+ } >+ void stencilMask(uint32_t mask) >+ { >+ m_context->stencilMask(mask); >+ } >+ void stencilMaskSeparate(uint32_t face, uint32_t mask) >+ { >+ m_context->stencilMaskSeparate(face, mask); >+ } >+ void stencilOp(uint32_t fail, uint32_t zfail, uint32_t zpass) >+ { >+ m_context->stencilOp(fail, zfail, zpass); >+ } >+ void stencilOpSeparate(uint32_t face, uint32_t fail, uint32_t zfail, uint32_t zpass) >+ { >+ m_context->stencilOpSeparate(face, fail, zfail, zpass); >+ } >+ void texParameterf(uint32_t target, uint32_t pname, float param) >+ { >+ m_context->texParameterf(target, pname, param); >+ } >+ void texParameteri(uint32_t target, uint32_t pname, int32_t param) >+ { >+ m_context->texParameteri(target, pname, param); >+ } >+ void uniform1f(int32_t location, float x) >+ { >+ m_context->uniform1f(location, x); >+ } >+ void uniform1i(int32_t location, int32_t x) >+ { >+ m_context->uniform1i(location, x); >+ } >+ void uniform2f(int32_t location, float x, float y) >+ { >+ m_context->uniform2f(location, x, y); >+ } >+ void uniform2i(int32_t location, int32_t x, int32_t y) >+ { >+ m_context->uniform2i(location, x, y); >+ } >+ void uniform3f(int32_t location, float x, float y, float z) >+ { >+ m_context->uniform3f(location, x, y, z); >+ } >+ void uniform3i(int32_t location, int32_t x, int32_t y, int32_t z) >+ { >+ m_context->uniform3i(location, x, y, z); >+ } >+ void uniform4f(int32_t location, float x, float y, float z, float w) >+ { >+ m_context->uniform4f(location, x, y, z, w); >+ } >+ void uniform4i(int32_t location, int32_t x, int32_t y, int32_t z, int32_t w) >+ { >+ m_context->uniform4i(location, x, y, z, w); >+ } >+ void useProgram(uint32_t arg0) >+ { >+ m_context->useProgram(arg0); >+ } >+ void validateProgram(uint32_t arg0) >+ { >+ m_context->validateProgram(arg0); >+ } >+ void vertexAttrib1f(uint32_t index, float x) >+ { >+ m_context->vertexAttrib1f(index, x); >+ } >+ void vertexAttrib2f(uint32_t index, float x, float y) >+ { >+ m_context->vertexAttrib2f(index, x, y); >+ } >+ void vertexAttrib3f(uint32_t index, float x, float y, float z) >+ { >+ m_context->vertexAttrib3f(index, x, y, z); >+ } >+ void vertexAttrib4f(uint32_t index, float x, float y, float z, float w) >+ { >+ m_context->vertexAttrib4f(index, x, y, z, w); >+ } >+ void vertexAttribPointer(uint32_t index, int32_t size, uint32_t type, bool normalized, int32_t stride, uint64_t offset) >+ { >+ m_context->vertexAttribPointer(index, size, type, normalized, stride, offset); >+ } >+ void viewport(int32_t x, int32_t y, int32_t width, int32_t height) >+ { >+ m_context->viewport(x, y, width, height); >+ } >+ void bufferData(uint32_t target, uint64_t size, uint32_t usage) >+ { >+ m_context->bufferData(target, size, usage); >+ } >+ void drawArraysInstanced(uint32_t mode, int32_t first, int32_t count, int32_t primcount) >+ { >+ m_context->drawArraysInstanced(mode, first, count, primcount); >+ } >+ void drawElementsInstanced(uint32_t mode, int32_t count, uint32_t type, uint64_t offset, int32_t primcount) >+ { >+ m_context->drawElementsInstanced(mode, count, type, offset, primcount); >+ } >+ void vertexAttribDivisor(uint32_t index, uint32_t divisor) >+ { >+ m_context->vertexAttribDivisor(index, divisor); >+ } >+ void createVertexArray(CompletionHandler<void(uint32_t)>&& completionHandler) >+ { >+ completionHandler(m_context->createVertexArray()); >+ } >+ void deleteVertexArray(uint32_t arg0) >+ { >+ m_context->deleteVertexArray(arg0); >+ } >+ void isVertexArray(uint32_t arg0, CompletionHandler<void(bool)>&& completionHandler) >+ { >+ completionHandler(m_context->isVertexArray(arg0)); >+ } >+ void bindVertexArray(uint32_t arg0) >+ { >+ m_context->bindVertexArray(arg0); >+ } >+ void copyBufferSubData(uint32_t readTarget, uint32_t writeTarget, uint64_t readOffset, uint64_t writeOffset, uint64_t size) >+ { >+ m_context->copyBufferSubData(readTarget, writeTarget, readOffset, writeOffset, size); >+ } >+ void unmapBuffer(uint32_t target, CompletionHandler<void(bool)>&& completionHandler) >+ { >+ completionHandler(m_context->unmapBuffer(target)); >+ } >+ void blitFramebuffer(int32_t srcX0, int32_t srcY0, int32_t srcX1, int32_t srcY1, int32_t dstX0, int32_t dstY0, int32_t dstX1, int32_t dstY1, uint32_t mask, uint32_t filter) >+ { >+ m_context->blitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); >+ } >+ void framebufferTextureLayer(uint32_t target, uint32_t attachment, uint32_t texture, int32_t level, int32_t layer) >+ { >+ m_context->framebufferTextureLayer(target, attachment, texture, level, layer); >+ } >+ void readBuffer(uint32_t src) >+ { >+ m_context->readBuffer(src); >+ } >+ void renderbufferStorageMultisample(uint32_t target, int32_t samples, uint32_t internalformat, int32_t width, int32_t height) >+ { >+ m_context->renderbufferStorageMultisample(target, samples, internalformat, width, height); >+ } >+ void texStorage2D(uint32_t target, int32_t levels, uint32_t internalformat, int32_t width, int32_t height) >+ { >+ m_context->texStorage2D(target, levels, internalformat, width, height); >+ } >+ void texStorage3D(uint32_t target, int32_t levels, uint32_t internalformat, int32_t width, int32_t height, int32_t depth) >+ { >+ m_context->texStorage3D(target, levels, internalformat, width, height, depth); >+ } >+ void copyTexSubImage3D(uint32_t target, int32_t level, int32_t xoffset, int32_t yoffset, int32_t zoffset, int32_t x, int32_t y, int32_t width, int32_t height) >+ { >+ m_context->copyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height); >+ } >+ void getFragDataLocation(uint32_t program, String name, CompletionHandler<void(int32_t)>&& completionHandler) >+ { >+ completionHandler(m_context->getFragDataLocation(program, name)); >+ } >+ void uniform1ui(int32_t location, uint32_t v0) >+ { >+ m_context->uniform1ui(location, v0); >+ } >+ void uniform2ui(int32_t location, uint32_t v0, uint32_t v1) >+ { >+ m_context->uniform2ui(location, v0, v1); >+ } >+ void uniform3ui(int32_t location, uint32_t v0, uint32_t v1, uint32_t v2) >+ { >+ m_context->uniform3ui(location, v0, v1, v2); >+ } >+ void uniform4ui(int32_t location, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3) >+ { >+ m_context->uniform4ui(location, v0, v1, v2, v3); >+ } >+ void vertexAttribI4i(uint32_t index, int32_t x, int32_t y, int32_t z, int32_t w) >+ { >+ m_context->vertexAttribI4i(index, x, y, z, w); >+ } >+ void vertexAttribI4ui(uint32_t index, uint32_t x, uint32_t y, uint32_t z, uint32_t w) >+ { >+ m_context->vertexAttribI4ui(index, x, y, z, w); >+ } >+ void vertexAttribIPointer(uint32_t index, int32_t size, uint32_t type, int32_t stride, uint64_t offset) >+ { >+ m_context->vertexAttribIPointer(index, size, type, stride, offset); >+ } >+ void drawRangeElements(uint32_t mode, uint32_t start, uint32_t end, int32_t count, uint32_t type, uint64_t offset) >+ { >+ m_context->drawRangeElements(mode, start, end, count, type, offset); >+ } >+ void clearBufferfi(uint32_t buffer, int32_t drawbuffer, float depth, int32_t stencil) >+ { >+ m_context->clearBufferfi(buffer, drawbuffer, depth, stencil); >+ } >+ void createQuery(CompletionHandler<void(uint32_t)>&& completionHandler) >+ { >+ completionHandler(m_context->createQuery()); >+ } >+ void deleteQuery(uint32_t query) >+ { >+ m_context->deleteQuery(query); >+ } >+ void isQuery(uint32_t query, CompletionHandler<void(bool)>&& completionHandler) >+ { >+ completionHandler(m_context->isQuery(query)); >+ } >+ void beginQuery(uint32_t target, uint32_t query) >+ { >+ m_context->beginQuery(target, query); >+ } >+ void endQuery(uint32_t target) >+ { >+ m_context->endQuery(target); >+ } >+ void getQuery(uint32_t target, uint32_t pname, CompletionHandler<void(uint32_t)>&& completionHandler) >+ { >+ completionHandler(m_context->getQuery(target, pname)); >+ } >+ void createSampler(CompletionHandler<void(uint32_t)>&& completionHandler) >+ { >+ completionHandler(m_context->createSampler()); >+ } >+ void deleteSampler(uint32_t sampler) >+ { >+ m_context->deleteSampler(sampler); >+ } >+ void isSampler(uint32_t sampler, CompletionHandler<void(bool)>&& completionHandler) >+ { >+ completionHandler(m_context->isSampler(sampler)); >+ } >+ void bindSampler(uint32_t unit, uint32_t sampler) >+ { >+ m_context->bindSampler(unit, sampler); >+ } >+ void samplerParameteri(uint32_t sampler, uint32_t pname, int32_t param) >+ { >+ m_context->samplerParameteri(sampler, pname, param); >+ } >+ void samplerParameterf(uint32_t sampler, uint32_t pname, float param) >+ { >+ m_context->samplerParameterf(sampler, pname, param); >+ } >+ void createTransformFeedback(CompletionHandler<void(uint32_t)>&& completionHandler) >+ { >+ completionHandler(m_context->createTransformFeedback()); >+ } >+ void deleteTransformFeedback(uint32_t id) >+ { >+ m_context->deleteTransformFeedback(id); >+ } >+ void isTransformFeedback(uint32_t id, CompletionHandler<void(bool)>&& completionHandler) >+ { >+ completionHandler(m_context->isTransformFeedback(id)); >+ } >+ void bindTransformFeedback(uint32_t target, uint32_t id) >+ { >+ m_context->bindTransformFeedback(target, id); >+ } >+ void beginTransformFeedback(uint32_t primitiveMode) >+ { >+ m_context->beginTransformFeedback(primitiveMode); >+ } >+ void endTransformFeedback() >+ { >+ m_context->endTransformFeedback(); >+ } >+ void pauseTransformFeedback() >+ { >+ m_context->pauseTransformFeedback(); >+ } >+ void resumeTransformFeedback() >+ { >+ m_context->resumeTransformFeedback(); >+ } >+ void bindBufferBase(uint32_t target, uint32_t index, uint32_t buffer) >+ { >+ m_context->bindBufferBase(target, index, buffer); >+ } >+ void bindBufferRange(uint32_t target, uint32_t index, uint32_t buffer, uint64_t offset, uint64_t size) >+ { >+ m_context->bindBufferRange(target, index, buffer, offset, size); >+ } >+ void getUniformBlockIndex(uint32_t program, String uniformBlockName, CompletionHandler<void(uint32_t)>&& completionHandler) >+ { >+ completionHandler(m_context->getUniformBlockIndex(program, uniformBlockName)); >+ } >+ void getActiveUniformBlockName(uint32_t program, uint32_t uniformBlockIndex, CompletionHandler<void(String)>&& completionHandler) >+ { >+ completionHandler(m_context->getActiveUniformBlockName(program, uniformBlockIndex)); >+ } >+ void uniformBlockBinding(uint32_t program, uint32_t uniformBlockIndex, uint32_t uniformBlockBinding) >+ { >+ m_context->uniformBlockBinding(program, uniformBlockIndex, uniformBlockBinding); >+ } >+ void getGraphicsResetStatusARB(CompletionHandler<void(int32_t)>&& completionHandler) >+ { >+ completionHandler(m_context->getExtensions().getGraphicsResetStatusARB()); >+ } >+ void blitFramebufferANGLE(int32_t srcX0, int32_t srcY0, int32_t srcX1, int32_t srcY1, int32_t dstX0, int32_t dstY0, int32_t dstX1, int32_t dstY1, uint32_t mask, uint32_t filter) >+ { >+ m_context->getExtensions().blitFramebufferANGLE(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); >+ } >+ void renderbufferStorageMultisampleANGLE(uint32_t target, int32_t samples, uint32_t internalformat, int32_t width, int32_t height) >+ { >+ m_context->getExtensions().renderbufferStorageMultisampleANGLE(target, samples, internalformat, width, height); >+ } >+ void createVertexArrayOES(CompletionHandler<void(uint32_t)>&& completionHandler) >+ { >+ completionHandler(m_context->getExtensions().createVertexArrayOES()); >+ } >+ void deleteVertexArrayOES(uint32_t arg0) >+ { >+ m_context->getExtensions().deleteVertexArrayOES(arg0); >+ } >+ void isVertexArrayOES(uint32_t arg0, CompletionHandler<void(bool)>&& completionHandler) >+ { >+ completionHandler(m_context->getExtensions().isVertexArrayOES(arg0)); >+ } >+ void bindVertexArrayOES(uint32_t arg0) >+ { >+ m_context->getExtensions().bindVertexArrayOES(arg0); >+ } >+ void getTranslatedShaderSourceANGLE(uint32_t arg0, CompletionHandler<void(String)>&& completionHandler) >+ { >+ completionHandler(m_context->getExtensions().getTranslatedShaderSourceANGLE(arg0)); >+ } >+ void insertEventMarkerEXT(String arg0) >+ { >+ m_context->getExtensions().insertEventMarkerEXT(arg0); >+ } >+ void pushGroupMarkerEXT(String arg0) >+ { >+ m_context->getExtensions().pushGroupMarkerEXT(arg0); >+ } >+ void popGroupMarkerEXT() >+ { >+ m_context->getExtensions().popGroupMarkerEXT(); >+ } >+ void drawArraysInstancedANGLE(uint32_t mode, int32_t first, int32_t count, int32_t primcount) >+ { >+ m_context->getExtensions().drawArraysInstancedANGLE(mode, first, count, primcount); >+ } >+ void drawElementsInstancedANGLE(uint32_t mode, int32_t count, uint32_t type, uint64_t offset, int32_t primcount) >+ { >+ m_context->getExtensions().drawElementsInstancedANGLE(mode, count, type, offset, primcount); >+ } >+ void vertexAttribDivisorANGLE(uint32_t index, uint32_t divisor) >+ { >+ m_context->getExtensions().vertexAttribDivisorANGLE(index, divisor); >+ } >+ >diff --git a/Source/WebKit/Scripts/webkit/messages.py b/Source/WebKit/Scripts/webkit/messages.py >index 99111a7890b5785f4e1062d688206547d52503bd..783f427137d215b6fb14a625318c512a36fc6908 100644 >--- a/Source/WebKit/Scripts/webkit/messages.py >+++ b/Source/WebKit/Scripts/webkit/messages.py >@@ -213,6 +213,7 @@ def types_that_cannot_be_forward_declared(): > 'WebCore::DocumentOrWorkerIdentifier', > 'WebCore::FetchIdentifier', > 'WebCore::FrameIdentifier', >+ 'WebCore::GraphicsContextGLAttributes', > 'WebCore::LibWebRTCSocketIdentifier', > 'WebCore::PlaybackTargetClientContextIdentifier', > 'WebCore::MediaPlayerIdentifier', >@@ -241,6 +242,7 @@ def types_that_cannot_be_forward_declared(): > 'WebKit::DisplayListFlushIdentifier', > 'WebKit::DownloadID', > 'WebKit::GeolocationIdentifier', >+ 'WebKit::GraphicsContextGLIdentifier', > 'WebKit::ImageBufferBackendHandle', > 'WebKit::LayerHostingContextID', > 'WebKit::LegacyCustomProtocolID', >diff --git a/Source/WebKit/Shared/WebCoreArgumentCoders.cpp b/Source/WebKit/Shared/WebCoreArgumentCoders.cpp >index 3379596be69d924ae0ca6d8f9f1ffb01b20c3d6c..dff5eeab36a072b437b635496eb0c89edde1a7e9 100644 >--- a/Source/WebKit/Shared/WebCoreArgumentCoders.cpp >+++ b/Source/WebKit/Shared/WebCoreArgumentCoders.cpp >@@ -3242,4 +3242,62 @@ Optional<RefPtr<WebCore::ImageData>> ArgumentCoder<RefPtr<WebCore::ImageData>>:: > return { WTFMove(*result) }; > } > >+#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL) >+void ArgumentCoder<WebCore::GraphicsContextGLAttributes>::encode(Encoder& encoder, const WebCore::GraphicsContextGLAttributes& attributes) >+{ >+ encoder << attributes.alpha; >+ encoder << attributes.depth; >+ encoder << attributes.stencil; >+ encoder << attributes.antialias; >+ encoder << attributes.premultipliedAlpha; >+ encoder << attributes.preserveDrawingBuffer; >+ encoder << attributes.failIfMajorPerformanceCaveat; >+ encoder << attributes.powerPreference; >+ encoder << attributes.shareResources; >+ encoder << attributes.isWebGL2; >+ encoder << attributes.noExtensions; >+ encoder << attributes.devicePixelRatio; >+ encoder << attributes.initialPowerPreference; >+#if ENABLE(WEBXR) >+ encoder << attributes.xrCompatible; >+#endif >+} >+ >+Optional<WebCore::GraphicsContextGLAttributes> ArgumentCoder<WebCore::GraphicsContextGLAttributes>::decode(Decoder& decoder) >+{ >+ GraphicsContextGLAttributes attributes; >+ if (!decoder.decode(attributes.alpha)) >+ return WTF::nullopt; >+ if (!decoder.decode(attributes.depth)) >+ return WTF::nullopt; >+ if (!decoder.decode(attributes.stencil)) >+ return WTF::nullopt; >+ if (!decoder.decode(attributes.antialias)) >+ return WTF::nullopt; >+ if (!decoder.decode(attributes.premultipliedAlpha)) >+ return WTF::nullopt; >+ if (!decoder.decode(attributes.preserveDrawingBuffer)) >+ return WTF::nullopt; >+ if (!decoder.decode(attributes.failIfMajorPerformanceCaveat)) >+ return WTF::nullopt; >+ if (!decoder.decode(attributes.powerPreference)) >+ return WTF::nullopt; >+ if (!decoder.decode(attributes.shareResources)) >+ return WTF::nullopt; >+ if (!decoder.decode(attributes.isWebGL2)) >+ return WTF::nullopt; >+ if (!decoder.decode(attributes.noExtensions)) >+ return WTF::nullopt; >+ if (!decoder.decode(attributes.devicePixelRatio)) >+ return WTF::nullopt; >+ if (!decoder.decode(attributes.initialPowerPreference)) >+ return WTF::nullopt; >+#if ENABLE(WEBXR) >+ if (!decoder.decode(attributes.xrCompatible)) >+ return WTF::nullopt; >+#endif >+ return attributes; >+} >+#endif >+ > } // namespace IPC >diff --git a/Source/WebKit/Shared/WebCoreArgumentCoders.h b/Source/WebKit/Shared/WebCoreArgumentCoders.h >index abca0240b6da94f83585baf19cb496b09b92b8e3..57576f41b64029253fe09044ea54e13a0ae35da4 100644 >--- a/Source/WebKit/Shared/WebCoreArgumentCoders.h >+++ b/Source/WebKit/Shared/WebCoreArgumentCoders.h >@@ -71,6 +71,10 @@ > #include "ArgumentCodersGtk.h" > #endif > >+#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL) >+#include <WebCore/GraphicsContextGLAttributes.h> >+#endif >+ > #if PLATFORM(COCOA) > namespace WTF { > class MachSendRight; >@@ -203,6 +207,10 @@ struct SerializedAttachmentData; > using IDBKeyPath = Variant<String, Vector<String>>; > #endif > >+#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL) >+struct GraphicsContextGLAttributes; >+#endif >+ > namespace DOMCacheEngine { > struct CacheInfo; > struct Record; >@@ -873,6 +881,13 @@ template<> struct ArgumentCoder<WebCore::PaymentInstallmentConfiguration> { > }; > #endif > >+#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL) >+template<> struct ArgumentCoder<WebCore::GraphicsContextGLAttributes> { >+ static void encode(Encoder&, const WebCore::GraphicsContextGLAttributes&); >+ static Optional<WebCore::GraphicsContextGLAttributes> decode(Decoder&); >+}; >+#endif >+ > } // namespace IPC > > namespace WTF { >@@ -1041,4 +1056,15 @@ template <> struct EnumTraits<WebCore::CDMInstance::HDCPStatus> { > > #endif > >+#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL) >+template <> struct EnumTraits<WebCore::GraphicsContextGLPowerPreference> { >+ using values = EnumValues < >+ WebCore::GraphicsContextGLPowerPreference, >+ WebCore::GraphicsContextGLPowerPreference::Default, >+ WebCore::GraphicsContextGLPowerPreference::LowPower, >+ WebCore::GraphicsContextGLPowerPreference::HighPerformance >+ >; >+}; >+#endif >+ > } // namespace WTF >diff --git a/Source/WebKit/Shared/WebPageCreationParameters.cpp b/Source/WebKit/Shared/WebPageCreationParameters.cpp >index cfe8492b8d2ef574e79d330dacfc014cd0c1caa9..4f8a76efe66d27edaa9852e8f7919faad70a0d7c 100644 >--- a/Source/WebKit/Shared/WebPageCreationParameters.cpp >+++ b/Source/WebKit/Shared/WebPageCreationParameters.cpp >@@ -155,6 +155,9 @@ void WebPageCreationParameters::encode(IPC::Encoder& encoder) const > encoder << shouldCaptureVideoInGPUProcess; > encoder << shouldCaptureDisplayInUIProcess; > encoder << shouldRenderCanvasInGPUProcess; >+#if ENABLE(WEBGL) >+ encoder << shouldRenderWebGLInGPUProcess; >+#endif > encoder << shouldEnableVP9Decoder; > encoder << shouldEnableVP9SWDecoder; > #if ENABLE(APP_BOUND_DOMAINS) >@@ -494,6 +497,11 @@ Optional<WebPageCreationParameters> WebPageCreationParameters::decode(IPC::Decod > if (!decoder.decode(parameters.shouldRenderCanvasInGPUProcess)) > return WTF::nullopt; > >+#if ENABLE(WEBGL) >+ if (!decoder.decode(parameters.shouldRenderWebGLInGPUProcess)) >+ return WTF::nullopt; >+#endif >+ > if (!decoder.decode(parameters.shouldEnableVP9Decoder)) > return WTF::nullopt; > >diff --git a/Source/WebKit/Shared/WebPageCreationParameters.h b/Source/WebKit/Shared/WebPageCreationParameters.h >index b565293db82cd22ff895f37e504367a0bf531cec..a22c087d1e75725f6ab2c5d69be59c8399db2163 100644 >--- a/Source/WebKit/Shared/WebPageCreationParameters.h >+++ b/Source/WebKit/Shared/WebPageCreationParameters.h >@@ -227,6 +227,9 @@ struct WebPageCreationParameters { > bool shouldCaptureVideoInGPUProcess { false }; > bool shouldCaptureDisplayInUIProcess { false }; > bool shouldRenderCanvasInGPUProcess { false }; >+#if ENABLE(WEBGL) >+ bool shouldRenderWebGLInGPUProcess { false }; >+#endif > bool shouldEnableVP9Decoder { false }; > bool shouldEnableVP9SWDecoder { false }; > #if ENABLE(APP_BOUND_DOMAINS) >diff --git a/Source/WebKit/Sources.txt b/Source/WebKit/Sources.txt >index ffe9787deae547526736e2110042b0b9f8dc0801..2cb01717f0880c084724c47d0ba80a74bdb01e9e 100644 >--- a/Source/WebKit/Sources.txt >+++ b/Source/WebKit/Sources.txt >@@ -25,6 +25,7 @@ GPUProcess/GPUProcess.cpp > GPUProcess/GPUConnectionToWebProcess.cpp > GPUProcess/GPUProcessCreationParameters.cpp > GPUProcess/graphics/RemoteRenderingBackend.cpp >+GPUProcess/graphics/RemoteGraphicsContextGL.cpp > GPUProcess/graphics/RemoteResourceCache.cpp > GPUProcess/media/RemoteAudioSessionProxy.cpp > GPUProcess/media/RemoteAudioSessionProxyManager.cpp >@@ -682,3 +683,5 @@ WebProcess/WebStorage/StorageAreaImpl.cpp > WebProcess/WebStorage/StorageAreaMap.cpp > WebProcess/WebStorage/StorageNamespaceImpl.cpp > WebProcess/WebStorage/WebStorageNamespaceProvider.cpp >+ >+RemoteGraphicsContextGLMessageReceiver.cpp >diff --git a/Source/WebKit/SourcesCocoa.txt b/Source/WebKit/SourcesCocoa.txt >index 99bea1fb59e96d6a00ef1bba08a724b1f2887004..f65f2f5eac00f1c763da605111a436b78a8a2aa8 100644 >--- a/Source/WebKit/SourcesCocoa.txt >+++ b/Source/WebKit/SourcesCocoa.txt >@@ -63,6 +63,7 @@ GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm > GPUProcess/media/ios/RemoteMediaSessionHelperProxy.cpp > GPUProcess/webrtc/LibWebRTCCodecsProxy.mm > >+ > Platform/cf/ModuleCF.cpp > > Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp >@@ -571,6 +572,7 @@ WebProcess/cocoa/WebProcessCocoa.mm > WebProcess/EntryPoint/Cocoa/XPCService/WebContentServiceEntryPoint.mm > > WebProcess/GPU/graphics/cocoa/ImageBufferShareableIOSurfaceBackend.cpp >+WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp > WebProcess/GPU/media/RemoteAudioSourceProvider.cpp > WebProcess/GPU/media/RemoteAudioSourceProviderManager.cpp > WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm >@@ -682,6 +684,7 @@ RemoteMediaSessionHelperMessageReceiver.cpp > RemoteMediaSessionHelperProxyMessageReceiver.cpp > RemoteRenderingBackendMessageReceiver.cpp > RemoteRenderingBackendProxyMessageReceiver.cpp >+RemoteGraphicsContextGLProxyMessageReceiver.cpp > RemoteSampleBufferDisplayLayerManagerMessageReceiver.cpp > RemoteSampleBufferDisplayLayerMessageReceiver.cpp > SampleBufferDisplayLayerMessageReceiver.cpp >diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp >index 2617fdfa62fb58ffe3eed0641efbc85bc7e6b1df..0b7ee340ed895bbab41aa1b10af6f4a8fcd50271 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.cpp >+++ b/Source/WebKit/UIProcess/WebPageProxy.cpp >@@ -529,7 +529,7 @@ WebPageProxy::WebPageProxy(PageClient& pageClient, WebProcessProxy& process, Ref > updateActivityState(); > updateThrottleState(); > updateHiddenPageThrottlingAutoIncreases(); >- >+ > #if HAVE(OUT_OF_PROCESS_LAYER_HOSTING) > m_layerHostingMode = m_activityState & ActivityState::IsInWindow ? WebPageProxy::pageClient().viewLayerHostingMode() : LayerHostingMode::OutOfProcess; > #endif >@@ -554,7 +554,7 @@ WebPageProxy::WebPageProxy(PageClient& pageClient, WebProcessProxy& process, Ref > > #if PLATFORM(IOS_FAMILY) > DeprecatedGlobalSettings::setDisableScreenSizeOverride(m_preferences->disableScreenSizeOverride()); >- >+ > if (m_configuration->preferences()->serviceWorkerEntitlementDisabledForTesting()) > disableServiceWorkerEntitlementInNetworkProcess(); > #endif >@@ -669,7 +669,7 @@ void WebPageProxy::setPreferences(WebPreferences& preferences) > > preferencesDidChange(); > } >- >+ > void WebPageProxy::setHistoryClient(UniqueRef<API::HistoryClient>&& historyClient) > { > m_historyClient = WTFMove(historyClient); >@@ -745,7 +745,7 @@ void WebPageProxy::setFindClient(std::unique_ptr<API::FindClient>&& findClient) > m_findClient = makeUnique<API::FindClient>(); > return; > } >- >+ > m_findClient = WTFMove(findClient); > } > >@@ -1032,7 +1032,7 @@ RefPtr<API::Navigation> WebPageProxy::launchProcessForReload() > RELEASE_LOG_IF_ALLOWED(Loading, "launchProcessForReload: page is closed"); > return nullptr; > } >- >+ > ASSERT(!hasRunningProcess()); > auto registrableDomain = m_backForwardList->currentItem() ? RegistrableDomain { URL(URL(), m_backForwardList->currentItem()->url()) } : RegistrableDomain { }; > launchProcess(registrableDomain, ProcessLaunchReason::Crash); >@@ -1583,7 +1583,7 @@ RefPtr<API::Navigation> WebPageProxy::reload(OptionSet<WebCore::ReloadOption> op > > if (!hasRunningProcess()) > return launchProcessForReload(); >- >+ > auto navigation = m_navigationState->createReloadNavigation(m_backForwardList->currentItem()); > > if (!url.isEmpty()) { >@@ -2322,7 +2322,7 @@ void WebPageProxy::executeEditCommand(const String& commandName, const String& a > callbackFunction(); > }); > } >- >+ > void WebPageProxy::executeEditCommand(const String& commandName, const String& argument) > { > static NeverDestroyed<String> ignoreSpellingCommandName(MAKE_STATIC_STRING_IMPL("ignoreSpelling")); >@@ -2370,7 +2370,7 @@ void WebPageProxy::setEditable(bool editable) > > send(Messages::WebPage::SetEditable(editable)); > } >- >+ > void WebPageProxy::setMediaStreamCaptureMuted(bool muted) > { > if (muted) >@@ -2493,7 +2493,7 @@ void WebPageProxy::didStartDrag() > discardQueuedMouseEvents(); > send(Messages::WebPage::DidStartDrag()); > } >- >+ > void WebPageProxy::dragCancelled() > { > if (hasRunningProcess()) >@@ -2577,7 +2577,7 @@ void WebPageProxy::handleMouseEvent(const NativeWebMouseEvent& event) > if (m_mouseEventQueue.size() == 1) // Otherwise, called from DidReceiveEvent message handler. > processNextQueuedMouseEvent(); > } >- >+ > void WebPageProxy::processNextQueuedMouseEvent() > { > if (!hasRunningProcess()) >@@ -2686,7 +2686,7 @@ bool WebPageProxy::handleKeyboardEvent(const NativeWebKeyboardEvent& event) > { > if (!hasRunningProcess()) > return false; >- >+ > LOG(KeyHandling, "WebPageProxy::handleKeyboardEvent: %s", webKeyboardEventTypeString(event.type())); > > m_keyEventQueue.append(event); >@@ -3047,7 +3047,7 @@ public: > } > > PolicyCheckIdentifier identifier() { return m_identifier; } >- >+ > private: > PolicyDecisionSender(PolicyCheckIdentifier identifier, SendFunction sendFunction) > : m_sendFunction(WTFMove(sendFunction)) >@@ -3250,7 +3250,7 @@ void WebPageProxy::receivedPolicyDecision(PolicyAction action, API::Navigation* > handleDownloadRequest(download); > m_decidePolicyForResponseRequest = { }; > } >- >+ > Optional<WebsitePoliciesData> websitePoliciesData; > if (websitePolicies) > websitePoliciesData = websitePolicies->data(); >@@ -3521,7 +3521,7 @@ bool WebPageProxy::supportsTextZoom() const > > return true; > } >- >+ > void WebPageProxy::setTextZoomFactor(double zoomFactor) > { > if (m_textZoomFactor == zoomFactor) >@@ -3742,7 +3742,7 @@ void WebPageProxy::setAlwaysShowsVerticalScroller(bool alwaysShowsVerticalScroll > } > > void WebPageProxy::listenForLayoutMilestones(OptionSet<WebCore::LayoutMilestone> milestones) >-{ >+{ > if (milestones == m_observedLayoutMilestones) > return; > >@@ -3806,7 +3806,7 @@ void WebPageProxy::setRubberBandsAtBottom(bool rubberBandsAtBottom) > { > m_rubberBandsAtBottom = rubberBandsAtBottom; > } >- >+ > void WebPageProxy::setEnableVerticalRubberBanding(bool enableVerticalRubberBanding) > { > if (enableVerticalRubberBanding == m_enableVerticalRubberBanding) >@@ -3818,12 +3818,12 @@ void WebPageProxy::setEnableVerticalRubberBanding(bool enableVerticalRubberBandi > return; > send(Messages::WebPage::SetEnableVerticalRubberBanding(enableVerticalRubberBanding)); > } >- >+ > bool WebPageProxy::verticalRubberBandingIsEnabled() const > { > return m_enableVerticalRubberBanding; > } >- >+ > void WebPageProxy::setEnableHorizontalRubberBanding(bool enableHorizontalRubberBanding) > { > if (enableHorizontalRubberBanding == m_enableHorizontalRubberBanding) >@@ -3835,7 +3835,7 @@ void WebPageProxy::setEnableHorizontalRubberBanding(bool enableHorizontalRubberB > return; > send(Messages::WebPage::SetEnableHorizontalRubberBanding(enableHorizontalRubberBanding)); > } >- >+ > bool WebPageProxy::horizontalRubberBandingIsEnabled() const > { > return m_enableHorizontalRubberBanding; >@@ -3910,9 +3910,9 @@ void WebPageProxy::setPaginationLineGridEnabled(bool lineGridEnabled) > { > if (lineGridEnabled == m_paginationLineGridEnabled) > return; >- >+ > m_paginationLineGridEnabled = lineGridEnabled; >- >+ > if (!hasRunningProcess()) > return; > send(Messages::WebPage::SetPaginationLineGridEnabled(lineGridEnabled)); >@@ -4030,7 +4030,7 @@ void WebPageProxy::getRenderTreeExternalRepresentation(WTF::Function<void (const > callbackFunction(String(), CallbackBase::Error::Unknown); > return; > } >- >+ > auto callbackID = m_callbacks.put(WTFMove(callbackFunction), m_process->throttler().backgroundActivity("WebPageProxy::getRenderTreeExternalRepresentation"_s)); > send(Messages::WebPage::GetRenderTreeExternalRepresentation(callbackID)); > } >@@ -4041,7 +4041,7 @@ void WebPageProxy::getSourceForFrame(WebFrameProxy* frame, WTF::Function<void (c > callbackFunction(String(), CallbackBase::Error::Unknown); > return; > } >- >+ > auto callbackID = m_callbacks.put(WTFMove(callbackFunction), m_process->throttler().backgroundActivity("WebPageProxy::getSourceForFrame"_s)); > m_loadDependentStringCallbackIDs.add(callbackID); > send(Messages::WebPage::GetSourceForFrame(frame->frameID(), callbackID)); >@@ -4082,7 +4082,7 @@ void WebPageProxy::getBytecodeProfile(WTF::Function<void (const String&, Callbac > callbackFunction(String(), CallbackBase::Error::Unknown); > return; > } >- >+ > auto callbackID = m_callbacks.put(WTFMove(callbackFunction), m_process->throttler().backgroundActivity("WebPageProxy::getBytecodeProfile"_s)); > m_loadDependentStringCallbackIDs.add(callbackID); > send(Messages::WebPage::GetBytecodeProfile(callbackID)); >@@ -4094,7 +4094,7 @@ void WebPageProxy::getSamplingProfilerOutput(WTF::Function<void (const String&, > callbackFunction(String(), CallbackBase::Error::Unknown); > return; > } >- >+ > auto callbackID = m_callbacks.put(WTFMove(callbackFunction), m_process->throttler().backgroundActivity("WebPageProxy::getSamplingProfilerOutput"_s)); > m_loadDependentStringCallbackIDs.add(callbackID); > send(Messages::WebPage::GetSamplingProfilerOutput(callbackID)); >@@ -4119,7 +4119,7 @@ void WebPageProxy::getSelectionOrContentsAsString(WTF::Function<void (const Stri > callbackFunction(String(), CallbackBase::Error::Unknown); > return; > } >- >+ > auto callbackID = m_callbacks.put(WTFMove(callbackFunction), m_process->throttler().backgroundActivity("WebPageProxy::getSelectionOrContentsAsString"_s)); > send(Messages::WebPage::GetSelectionOrContentsAsString(callbackID)); > } >@@ -4130,7 +4130,7 @@ void WebPageProxy::getSelectionAsWebArchiveData(Function<void (API::Data*, Callb > callbackFunction(nullptr, CallbackBase::Error::Unknown); > return; > } >- >+ > auto callbackID = m_callbacks.put(WTFMove(callbackFunction), m_process->throttler().backgroundActivity("WebPageProxy::getSelectionAsWebArchiveData"_s)); > send(Messages::WebPage::GetSelectionAsWebArchiveData(callbackID)); > } >@@ -4141,7 +4141,7 @@ void WebPageProxy::getMainResourceDataOfFrame(WebFrameProxy* frame, Function<voi > callbackFunction(nullptr, CallbackBase::Error::Unknown); > return; > } >- >+ > auto callbackID = m_callbacks.put(WTFMove(callbackFunction), m_process->throttler().backgroundActivity("WebPageProxy::getMainResourceDataOfFrame"_s)); > send(Messages::WebPage::GetMainResourceDataOfFrame(frame->frameID(), callbackID)); > } >@@ -4152,7 +4152,7 @@ void WebPageProxy::getResourceDataFromFrame(WebFrameProxy* frame, API::URL* reso > callbackFunction(nullptr, CallbackBase::Error::Unknown); > return; > } >- >+ > auto callbackID = m_callbacks.put(WTFMove(callbackFunction), m_process->throttler().backgroundActivity("WebPageProxy::getResourceDataFromFrame"_s)); > send(Messages::WebPage::GetResourceDataFromFrame(frame->frameID(), resourceURL->string(), callbackID)); > } >@@ -4163,7 +4163,7 @@ void WebPageProxy::getWebArchiveOfFrame(WebFrameProxy* frame, Function<void (API > callbackFunction(nullptr, CallbackBase::Error::Unknown); > return; > } >- >+ > auto callbackID = m_callbacks.put(WTFMove(callbackFunction), m_process->throttler().backgroundActivity("WebPageProxy::getWebArchiveOfFrame"_s)); > send(Messages::WebPage::GetWebArchiveOfFrame(frame->frameID(), callbackID)); > } >@@ -4186,7 +4186,7 @@ void WebPageProxy::forceRepaint(RefPtr<VoidCallback>&& callback) > callback->invalidate(CallbackBase::Error::OwnerWasInvalidated); > return; > } >- >+ > callAfterNextPresentationUpdate([callback = WTFMove(callback)](CallbackBase::Error error) { > if (error != CallbackBase::Error::None) { > callback->invalidate(error); >@@ -4260,7 +4260,7 @@ void WebPageProxy::didCreateSubframe(FrameIdentifier frameID) > return; > > MESSAGE_CHECK(m_process, m_process->canCreateFrame(frameID)); >- >+ > auto subFrame = WebFrameProxy::create(*this, frameID); > > // Add the frame to the process wide map. >@@ -4915,7 +4915,7 @@ void WebPageProxy::didReceiveTitleForFrame(FrameIdentifier frameID, const String > m_pageLoadState.setTitle(transaction, title); > > frame->didChangeTitle(title); >- >+ > m_pageLoadState.commitChanges(); > > #if ENABLE(REMOTE_INSPECTOR) >@@ -4953,7 +4953,7 @@ void WebPageProxy::didReachLayoutMilestone(OptionSet<WebCore::LayoutMilestone> l > > if (layoutMilestones.contains(DidFirstVisuallyNonEmptyLayout)) > pageClient().clearSafeBrowsingWarningIfForMainFrameNavigation(); >- >+ > if (m_loaderClient) > m_loaderClient->didReachLayoutMilestone(*this, layoutMilestones); > m_navigationClient->renderingProgressDidChange(*this, layoutMilestones); >@@ -5106,7 +5106,7 @@ void WebPageProxy::decidePolicyForNavigationAction(Ref<WebProcessProxy>&& proces > #if ENABLE(APP_BOUND_DOMAINS) > shouldExpectAppBoundDomainResult = ShouldExpectAppBoundDomainResult::Yes; > #endif >- >+ > auto listener = makeRef(frame.setUpPolicyListenerProxy([this, protectedThis = makeRef(*this), frame = makeRef(frame), sender = WTFMove(sender), navigation, frameInfo, userDataObject = process->transformHandlesToObjects(userData.object()).get()] (PolicyAction policyAction, API::WebsitePolicies* policies, ProcessSwapRequestedByClient processSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&& safeBrowsingWarning, Optional<NavigatingToAppBoundDomain> isAppBoundDomain) mutable { > RELEASE_LOG_IF_ALLOWED(Loading, "decidePolicyForNavigationAction: listener called: frameID: %llu, navigationID: %llu, policyAction: %u, safeBrowsingWarning: %d, isAppBoundDomain: %d", frame->frameID().toUInt64(), navigation ? navigation->navigationID() : 0, (unsigned)policyAction, !!safeBrowsingWarning, !!isAppBoundDomain); > >@@ -5235,11 +5235,11 @@ WebPageProxy* WebPageProxy::nonEphemeralWebPageProxy() > auto processPools = WebProcessPool::allProcessPools(); > if (processPools.isEmpty()) > return nullptr; >- >+ > auto processPool = processPools[0]; > if (!processPool) > return nullptr; >- >+ > for (auto& webProcess : processPool->processes()) { > for (auto& page : webProcess->pages()) { > if (page->sessionID().isEphemeral()) >@@ -5254,7 +5254,7 @@ WebPageProxy* WebPageProxy::nonEphemeralWebPageProxy() > void WebPageProxy::logFrameNavigation(const WebFrameProxy& frame, const URL& pageURL, const WebCore::ResourceRequest& request, const URL& redirectURL, bool wasPotentiallyInitiatedByUser) > { > ASSERT(RunLoop::isMain()); >- >+ > auto sourceURL = redirectURL; > bool isRedirect = !redirectURL.isNull(); > if (!isRedirect) { >@@ -5262,15 +5262,15 @@ void WebPageProxy::logFrameNavigation(const WebFrameProxy& frame, const URL& pag > if (sourceURL.isNull()) > sourceURL = pageURL; > } >- >+ > auto& targetURL = request.url(); >- >+ > if (!targetURL.isValid() || !pageURL.isValid()) > return; >- >+ > auto targetHost = targetURL.host(); > auto mainFrameHost = pageURL.host(); >- >+ > if (targetHost.isEmpty() || mainFrameHost.isEmpty() || targetHost == sourceURL.host()) > return; > >@@ -5342,7 +5342,7 @@ void WebPageProxy::decidePolicyForNewWindowAction(FrameIdentifier frameID, Frame > m_navigationClient->decidePolicyForNavigationAction(*this, navigationAction.get(), WTFMove(listener), m_process->transformHandlesToObjects(userData.object()).get()); > > } >- >+ > } > > void WebPageProxy::decidePolicyForResponse(FrameIdentifier frameID, FrameInfoData&& frameInfo, PolicyCheckIdentifier identifier, >@@ -5372,7 +5372,7 @@ void WebPageProxy::decidePolicyForResponseShared(Ref<WebProcessProxy>&& process, > auto sender = PolicyDecisionSender::create(identifier, [webPageID, frameID, listenerID, process = WTFMove(process)] (const auto& policyDecision) { > process->send(Messages::WebPage::DidReceivePolicyDecision(frameID, listenerID, policyDecision), webPageID); > }); >- >+ > receivedPolicyDecision(policyAction, navigation.get(), nullptr, WTFMove(sender)); > }, ShouldExpectSafeBrowsingResult::No, ShouldExpectAppBoundDomainResult::No)); > if (m_policyClient) >@@ -5414,7 +5414,7 @@ void WebPageProxy::contentRuleListNotification(URL&& url, ContentRuleListResults > { > m_navigationClient->contentRuleListNotification(*this, WTFMove(url), WTFMove(results)); > } >- >+ > void WebPageProxy::didNavigateWithNavigationData(const WebNavigationDataStore& store, FrameIdentifier frameID) > { > didNavigateWithNavigationDataShared(m_process.copyRef(), store, frameID); >@@ -5448,7 +5448,7 @@ void WebPageProxy::didPerformClientRedirectShared(Ref<WebProcessProxy>&& process > > if (sourceURLString.isEmpty() || destinationURLString.isEmpty()) > return; >- >+ > WebFrameProxy* frame = process->webFrame(frameID); > MESSAGE_CHECK(process, frame); > MESSAGE_CHECK(process, frame->page() == this); >@@ -5475,7 +5475,7 @@ void WebPageProxy::didPerformServerRedirectShared(Ref<WebProcessProxy>&& process > > if (sourceURLString.isEmpty() || destinationURLString.isEmpty()) > return; >- >+ > WebFrameProxy* frame = process->webFrame(frameID); > MESSAGE_CHECK(process, frame); > MESSAGE_CHECK(process, frame->page() == this); >@@ -5550,7 +5550,7 @@ void WebPageProxy::createNewPage(FrameInfoData&& originatingFrameInfoData, WebPa > m_uiClient->createNewPage(*this, WTFMove(windowFeatures), WTFMove(navigationAction), WTFMove(completionHandler)); > }); > } >- >+ > void WebPageProxy::showPage() > { > m_uiClient->showPage(this); >@@ -5763,7 +5763,7 @@ void WebPageProxy::screenToRootView(const IntPoint& screenPoint, Messages::WebPa > { > reply(pageClient().screenToRootView(screenPoint)); > } >- >+ > void WebPageProxy::rootViewToScreen(const IntRect& viewRect, Messages::WebPageProxy::RootViewToScreen::DelayedReply&& reply) > { > reply(pageClient().rootViewToScreen(viewRect)); >@@ -5875,7 +5875,7 @@ void WebPageProxy::showContactPicker(const WebCore::ContactsRequestData& request > MESSAGE_CHECK(m_process, m_preferences->contactPickerAPIEnabled()); > pageClient().showContactPicker(requestData, WTFMove(completionHandler)); > } >- >+ > void WebPageProxy::printFrame(FrameIdentifier frameID, CompletionHandler<void()>&& completionHandler) > { > ASSERT(!m_isPerformingDOMPrintOperation); >@@ -5895,12 +5895,12 @@ void WebPageProxy::setMediaVolume(float volume) > { > if (volume == m_mediaVolume) > return; >- >+ > m_mediaVolume = volume; >- >+ > if (!hasRunningProcess()) > return; >- >+ > send(Messages::WebPage::SetMediaVolume(volume)); > } > >@@ -6204,7 +6204,7 @@ void WebPageProxy::setFullscreenClient(std::unique_ptr<API::FullscreenClient>&& > m_fullscreenClient = WTFMove(client); > } > #endif >- >+ > #if ENABLE(VIDEO_PRESENTATION_MODE) > PlaybackSessionManagerProxy* WebPageProxy::playbackSessionManager() > { >@@ -6322,7 +6322,7 @@ void WebPageProxy::registerEditCommandForUndo(WebUndoStepID commandID, const Str > { > registerEditCommand(WebEditCommandProxy::create(commandID, label, *this), UndoOrRedo::Undo); > } >- >+ > void WebPageProxy::registerInsertionUndoGrouping() > { > #if USE(INSERTION_UNDO_GROUPING) >@@ -6453,7 +6453,7 @@ NativeWebMouseEvent* WebPageProxy::currentlyProcessedMouseDownEvent() > > if (m_mouseEventQueue.isEmpty()) > return nullptr; >- >+ > auto& event = m_mouseEventQueue.first(); > if (event.type() != WebEvent::Type::MouseDown) > return nullptr; >@@ -6581,7 +6581,7 @@ void WebPageProxy::contextMenuItemSelected(const WebContextMenuItemData& item) > if (item.action() == ContextMenuItemTagCorrectSpellingAutomatically) { > TextChecker::setAutomaticSpellingCorrectionEnabled(!TextChecker::state().isAutomaticSpellingCorrectionEnabled); > m_process->updateTextCheckerState(); >- return; >+ return; > } > if (item.action() == ContextMenuItemTagShowSubstitutions) { > TextChecker::toggleSubstitutionsPanelIsShowing(); >@@ -6590,7 +6590,7 @@ void WebPageProxy::contextMenuItemSelected(const WebContextMenuItemData& item) > #endif > if (item.action() == ContextMenuItemTagDownloadImageToDisk) { > m_process->processPool().download(m_websiteDataStore, this, URL(URL(), m_activeContextMenuContextData.webHitTestResultData().absoluteImageURL)); >- return; >+ return; > } > if (item.action() == ContextMenuItemTagDownloadLinkToDisk) { > auto& hitTestResult = m_activeContextMenuContextData.webHitTestResultData(); >@@ -6718,7 +6718,7 @@ void WebPageProxy::didCancelForOpenPanel() > return; > > send(Messages::WebPage::DidCancelForOpenPanel()); >- >+ > m_openPanelResultListener->invalidate(); > m_openPanelResultListener = nullptr; > } >@@ -7313,7 +7313,7 @@ void WebPageProxy::processDidBecomeResponsive() > > if (!hasRunningProcess()) > return; >- >+ > updateBackingStoreDiscardableState(); > > m_navigationClient->processDidBecomeResponsive(*this); >@@ -7597,7 +7597,7 @@ void WebPageProxy::resetState(ResetStateReason resetStateReason) > #if ENABLE(POINTER_LOCK) > requestPointerUnlock(); > #endif >- >+ > #if ENABLE(SPEECH_SYNTHESIS) > resetSpeechSynthesizer(); > #endif >@@ -7786,7 +7786,7 @@ WebPageCreationParameters WebPageProxy::creationParameters(WebProcessProxy& proc > #else > parameters.appleMailPaginationQuirkEnabled = false; > #endif >- >+ > #if PLATFORM(MAC) > // FIXME: Need to support iOS too, but there is no isAppleMail for iOS. > parameters.appleMailLinesClampEnabled = appleMailLinesClampEnabled(); >@@ -7851,6 +7851,10 @@ WebPageCreationParameters WebPageProxy::creationParameters(WebProcessProxy& proc > parameters.shouldCaptureVideoInUIProcess = preferences().captureVideoInUIProcessEnabled(); > parameters.shouldCaptureVideoInGPUProcess = preferences().captureVideoInGPUProcessEnabled(); > parameters.shouldRenderCanvasInGPUProcess = preferences().useGPUProcessForCanvasRenderingEnabled(); >+#if ENABLE(WEBGL) >+ parameters.shouldRenderWebGLInGPUProcess = preferences().useGPUProcessForWebGLEnabled(); >+#endif >+ > parameters.shouldEnableVP9Decoder = preferences().vp9DecoderEnabled(); > #if ENABLE(VP9) && PLATFORM(COCOA) > parameters.shouldEnableVP9SWDecoder = preferences().vp9DecoderEnabled() && (!WebCore::systemHasBattery() || preferences().vp9SWDecoderEnabledOnBattery()); >@@ -8139,7 +8143,7 @@ void WebPageProxy::requestNotificationPermission(uint64_t requestID, const Strin > > auto origin = API::SecurityOrigin::createFromString(originString); > auto request = m_notificationPermissionRequestManager.createRequest(requestID); >- >+ > m_uiClient->decidePolicyForNotificationPermissionRequest(*this, origin.get(), [request = WTFMove(request)](bool allowed) { > if (allowed) > request->allow(); >@@ -8357,7 +8361,7 @@ void WebPageProxy::drawRectToImage(WebFrameProxy* frame, const PrintInfo& printI > callback->invalidate(); > return; > } >- >+ > auto callbackID = callback->callbackID(); > m_callbacks.put(WTFMove(callback)); > send(Messages::WebPage::DrawRectToImage(frame->frameID(), printInfo, rect, imageSize, callbackID), printingSendOptions(m_isPerformingDOMPrintOperation)); >@@ -8369,7 +8373,7 @@ void WebPageProxy::drawPagesToPDF(WebFrameProxy* frame, const PrintInfo& printIn > callback->invalidate(); > return; > } >- >+ > auto callbackID = callback->callbackID(); > m_callbacks.put(WTFMove(callback)); > send(Messages::WebPage::DrawPagesToPDF(frame->frameID(), printInfo, first, count, callbackID), printingSendOptions(m_isPerformingDOMPrintOperation)); >@@ -8639,7 +8643,7 @@ void WebPageProxy::setScrollPinningBehavior(ScrollPinningBehavior pinning) > { > if (m_scrollPinningBehavior == pinning) > return; >- >+ > m_scrollPinningBehavior = pinning; > > if (hasRunningProcess()) >@@ -8700,7 +8704,7 @@ void WebPageProxy::signedPublicKeyAndChallengeString(unsigned keySizeIndex, cons > > if (auto apiString = m_navigationClient->signedPublicKeyAndChallengeString(*this, keySizeIndex, API::String::create(challengeString), url)) > return completionHandler(apiString->string()); >- >+ > completionHandler({ }); > } > >@@ -9099,12 +9103,12 @@ void WebPageProxy::didHandleAcceptedCandidate() > { > pageClient().didHandleAcceptedCandidate(); > } >- >+ > void WebPageProxy::setUseSystemAppearance(bool useSystemAppearance) >-{ >+{ > if (useSystemAppearance == m_useSystemAppearance) > return; >- >+ > m_useSystemAppearance = useSystemAppearance; > > if (!hasRunningProcess()) >@@ -9112,7 +9116,7 @@ void WebPageProxy::setUseSystemAppearance(bool useSystemAppearance) > > send(Messages::WebPage::SetUseSystemAppearance(useSystemAppearance)); > } >- >+ > void WebPageProxy::setHeaderBannerHeightForTesting(int height) > { > send(Messages::WebPage::SetHeaderBannerHeightForTesting(height)); >@@ -9254,7 +9258,7 @@ void WebPageProxy::clearWheelEventTestMonitor() > { > if (!hasRunningProcess()) > return; >- >+ > send(Messages::WebPage::clearWheelEventTestMonitor()); > } > >@@ -9358,7 +9362,7 @@ void WebPageProxy::requestPointerLock() > } > m_uiClient->requestPointerLock(this); > } >- >+ > void WebPageProxy::didAllowPointerLock() > { > ASSERT(m_isPointerLockPending && !m_isPointerLocked); >@@ -9370,7 +9374,7 @@ void WebPageProxy::didAllowPointerLock() > #endif > send(Messages::WebPage::DidAcquirePointerLock()); > } >- >+ > void WebPageProxy::didDenyPointerLock() > { > ASSERT(m_isPointerLockPending && !m_isPointerLocked); >@@ -9547,7 +9551,7 @@ void WebPageProxy::updateAttachmentIcon(const String& identifier, const RefPtr<S > { > if (!hasRunningProcess()) > return; >- >+ > ShareableBitmap::Handle handle; > if (bitmap) > bitmap->createHandle(handle); >@@ -9916,7 +9920,7 @@ void WebPageProxy::resetSpeechSynthesizer() > { > if (!m_speechSynthesisData) > return; >- >+ > auto& synthesisData = speechSynthesisData(); > synthesisData.speakingFinishedCompletionHandler = nullptr; > synthesisData.speakingStartedCompletionHandler = nullptr; >diff --git a/Source/WebKit/WebKit.xcodeproj/project.pbxproj b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >index 4406e9b6e7e6f4a0362e6c56bb849bfebec8c0c7..6ad77123e83d20d1495624b31f6092e05296192d 100644 >--- a/Source/WebKit/WebKit.xcodeproj/project.pbxproj >+++ b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >@@ -4275,6 +4275,15 @@ > 7AFBD36521E51BAB005DBACB /* ResourceLoadStatisticsMemoryStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ResourceLoadStatisticsMemoryStore.h; path = Classifier/ResourceLoadStatisticsMemoryStore.h; sourceTree = "<group>"; }; > 7AFBD36D21E546E3005DBACB /* PersistencyUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PersistencyUtils.h; sourceTree = "<group>"; }; > 7AFBD36E21E546E3005DBACB /* PersistencyUtils.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PersistencyUtils.cpp; sourceTree = "<group>"; }; >+ 7B64C0B1254C36900006B4AF /* RemoteGraphicsContextGLProxyFunctionsGenerated.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RemoteGraphicsContextGLProxyFunctionsGenerated.h; sourceTree = "<group>"; }; >+ 7B64C0B6254C5C250006B4AF /* GraphicsContextGLIdentifier.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GraphicsContextGLIdentifier.h; sourceTree = "<group>"; }; >+ 7B904165254AFDEA006EEB8C /* RemoteGraphicsContextGLProxy.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RemoteGraphicsContextGLProxy.cpp; sourceTree = "<group>"; }; >+ 7B904166254AFDEB006EEB8C /* RemoteGraphicsContextGLProxy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RemoteGraphicsContextGLProxy.h; sourceTree = "<group>"; }; >+ 7B904167254AFE17006EEB8C /* RemoteGraphicsContextGLProxy.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = RemoteGraphicsContextGLProxy.messages.in; sourceTree = "<group>"; }; >+ 7B904168254AFEA7006EEB8C /* RemoteGraphicsContextGL.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = RemoteGraphicsContextGL.messages.in; sourceTree = "<group>"; }; >+ 7B904169254AFEA7006EEB8C /* RemoteGraphicsContextGL.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RemoteGraphicsContextGL.cpp; sourceTree = "<group>"; }; >+ 7B90416A254AFEA7006EEB8C /* RemoteGraphicsContextGL.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RemoteGraphicsContextGL.h; sourceTree = "<group>"; }; >+ 7B90416D2550108C006EEB8C /* RemoteGraphicsContextGLFunctionsGenerated.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RemoteGraphicsContextGLFunctionsGenerated.h; sourceTree = "<group>"; }; > 7C065F291C8CD95F00C2D950 /* WebUserContentControllerDataTypes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebUserContentControllerDataTypes.cpp; sourceTree = "<group>"; }; > 7C065F2A1C8CD95F00C2D950 /* WebUserContentControllerDataTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebUserContentControllerDataTypes.h; sourceTree = "<group>"; }; > 7C135AA6173B0BCA00586AE2 /* WKPluginInformation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKPluginInformation.cpp; sourceTree = "<group>"; }; >@@ -8148,9 +8157,14 @@ > 5506409D2407160900AAE045 /* RemoteRenderingBackendProxy.cpp */, > 5506409E2407160900AAE045 /* RemoteRenderingBackendProxy.h */, > 550640A0240719E100AAE045 /* RemoteRenderingBackendProxy.messages.in */, >+ 7B904165254AFDEA006EEB8C /* RemoteGraphicsContextGLProxy.cpp */, >+ 7B904166254AFDEB006EEB8C /* RemoteGraphicsContextGLProxy.h */, >+ 7B904167254AFE17006EEB8C /* RemoteGraphicsContextGLProxy.messages.in */, > 72B53157253C1E4D0049295A /* RemoteResourceCacheProxy.cpp */, > 72B53158253C1E4D0049295A /* RemoteResourceCacheProxy.h */, > 5506409F2407196A00AAE045 /* RenderingBackendIdentifier.h */, >+ 7B64C0B6254C5C250006B4AF /* GraphicsContextGLIdentifier.h */, >+ 7B64C0B1254C36900006B4AF /* RemoteGraphicsContextGLProxyFunctionsGenerated.h */, > ); > path = graphics; > sourceTree = "<group>"; >@@ -8165,6 +8179,10 @@ > 550640A424071C2100AAE045 /* RemoteRenderingBackend.messages.in */, > 726D56DD253A64810002EF90 /* RemoteResourceCache.cpp */, > 726D56DE253A64810002EF90 /* RemoteResourceCache.h */, >+ 7B904169254AFEA7006EEB8C /* RemoteGraphicsContextGL.cpp */, >+ 7B90416A254AFEA7006EEB8C /* RemoteGraphicsContextGL.h */, >+ 7B904168254AFEA7006EEB8C /* RemoteGraphicsContextGL.messages.in */, >+ 7B90416D2550108C006EEB8C /* RemoteGraphicsContextGLFunctionsGenerated.h */, > ); > path = graphics; > sourceTree = "<group>"; >diff --git a/Source/WebKit/WebProcess/GPU/graphics/GraphicsContextGLIdentifier.h b/Source/WebKit/WebProcess/GPU/graphics/GraphicsContextGLIdentifier.h >new file mode 100644 >index 0000000000000000000000000000000000000000..359048a6b175ab6126b9d29ae4e019dbab2cc53c >--- /dev/null >+++ b/Source/WebKit/WebProcess/GPU/graphics/GraphicsContextGLIdentifier.h >@@ -0,0 +1,39 @@ >+/* >+ * Copyright (C) 2020 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL) >+ >+#include <wtf/ObjectIdentifier.h> >+ >+namespace WebKit { >+ >+enum GraphicsContextGLIdentifierType { }; >+using GraphicsContextGLIdentifier = ObjectIdentifier<GraphicsContextGLIdentifierType>; >+ >+} // namespace WebKit >+ >+#endif // ENABLE(GPU_PROCESS) && ENABLE(WEBGL) >diff --git a/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp b/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..2fc103f7fdbb5e896b077c0f3e07810e3f96bdb4 >--- /dev/null >+++ b/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp >@@ -0,0 +1,88 @@ >+/* >+ * Copyright (C) 2020 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "RemoteGraphicsContextGLProxy.h" >+ >+#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL) >+ >+#include "GPUConnectionToWebProcess.h" >+#include "GPUProcessConnection.h" >+#include "RemoteGraphicsContextGLMessages.h" >+#include "RemoteGraphicsContextGLProxyMessages.h" >+#include "WebProcess.h" >+ >+namespace WebKit { >+ >+using namespace WebCore; >+ >+RefPtr<RemoteGraphicsContextGLProxy> RemoteGraphicsContextGLProxy::create(const GraphicsContextGLAttributes& attributes) >+{ >+ return RefPtr<RemoteGraphicsContextGLProxy>(new RemoteGraphicsContextGLProxy(attributes)); >+} >+ >+RemoteGraphicsContextGLProxy::RemoteGraphicsContextGLProxy(const GraphicsContextGLAttributes& attributes) >+ : PlatformRemoteGraphicsContextGLProxyBase(attributes) >+{ >+ // Register itself as a MessageReceiver in the GPUProcessConnection. >+ IPC::MessageReceiverMap& messageReceiverMap = WebProcess::singleton().ensureGPUProcessConnection().messageReceiverMap(); >+ messageReceiverMap.addMessageReceiver(Messages::RemoteGraphicsContextGLProxy::messageReceiverName(), m_graphicsContextGLIdentifier.toUInt64(), *this); >+ >+ send(Messages::GPUConnectionToWebProcess::CreateGraphicsContextGL(attributes, m_graphicsContextGLIdentifier), 0); >+} >+ >+RemoteGraphicsContextGLProxy::~RemoteGraphicsContextGLProxy() >+{ >+ // Un-register itself as a MessageReceiver. >+ IPC::MessageReceiverMap& messageReceiverMap = WebProcess::singleton().ensureGPUProcessConnection().messageReceiverMap(); >+ messageReceiverMap.removeMessageReceiver(*this); >+ >+ // Release the RemoteGraphicsContextGL. >+ send(Messages::GPUConnectionToWebProcess::ReleaseGraphicsContextGL(m_graphicsContextGLIdentifier), 0); >+} >+ >+IPC::Connection* RemoteGraphicsContextGLProxy::messageSenderConnection() const >+{ >+ return &WebProcess::singleton().ensureGPUProcessConnection().connection(); >+} >+ >+uint64_t RemoteGraphicsContextGLProxy::messageSenderDestinationID() const >+{ >+ return m_graphicsContextGLIdentifier.toUInt64(); >+} >+ >+bool RemoteGraphicsContextGLProxy::waitForWasCreated() >+{ >+ Ref<IPC::Connection> connection = WebProcess::singleton().ensureGPUProcessConnection().connection(); >+ return connection->waitForAndDispatchImmediately<Messages::RemoteGraphicsContextGLProxy::WasCreated>(m_graphicsContextGLIdentifier, 1_s, IPC::WaitForOption::InterruptWaitingIfSyncMessageArrives); >+} >+ >+void RemoteGraphicsContextGLProxy::wasCreated() >+{ >+} >+ >+} // namespace WebKit >+ >+#endif >diff --git a/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.h b/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.h >new file mode 100644 >index 0000000000000000000000000000000000000000..3d3b7133e9b38ac56572fc66d05f5bc982ac5266 >--- /dev/null >+++ b/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.h >@@ -0,0 +1,74 @@ >+/* >+ * Copyright (C) 2020 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL) >+ >+#include "GraphicsContextGLIdentifier.h" >+#include "MessageReceiver.h" >+#include "MessageSender.h" >+#include "RemoteGraphicsContextGLMessages.h" >+#include "RemoteResourceCacheProxy.h" >+#include <WebCore/PlatformRemoteGraphicsContextGLProxyBase.h> >+#include <wtf/HashMap.h> >+#include <wtf/WeakPtr.h> >+ >+namespace WebKit { >+ >+class RemoteGraphicsContextGLProxy >+ : public IPC::MessageSender >+ , private IPC::MessageReceiver >+ , public CanMakeWeakPtr<RemoteGraphicsContextGLProxy> >+ , public WebCore::PlatformRemoteGraphicsContextGLProxyBase { >+public: >+ static RefPtr<RemoteGraphicsContextGLProxy> create(const WebCore::GraphicsContextGLAttributes&); >+ >+ ~RemoteGraphicsContextGLProxy(); >+ >+ // IPC::MessageSender overrides. >+ IPC::Connection* messageSenderConnection() const override; >+ uint64_t messageSenderDestinationID() const override; >+ >+ // IPC::MessageReceiver overrides. >+ void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override; >+ >+ bool waitForWasCreated(); >+ >+ using WebCore::PlatformRemoteGraphicsContextGLProxyBase::isEnabled; >+ >+#include "RemoteGraphicsContextGLProxyFunctionsGenerated.h" >+ >+private: >+ void wasCreated(); >+ >+ RemoteGraphicsContextGLProxy(const WebCore::GraphicsContextGLAttributes&); >+ >+ GraphicsContextGLIdentifier m_graphicsContextGLIdentifier { GraphicsContextGLIdentifier::generate() }; >+}; >+ >+} // namespace WebKit >+ >+#endif // ENABLE(GPU_PROCESS) >diff --git a/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.messages.in b/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.messages.in >new file mode 100644 >index 0000000000000000000000000000000000000000..b0184a28a1429e1acd1f64b1eb3d3cb6d05e88c2 >--- /dev/null >+++ b/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.messages.in >@@ -0,0 +1,29 @@ >+# Copyright (C) 2020 Apple Inc. All rights reserved. >+# >+# Redistribution and use in source and binary forms, with or without >+# modification, are permitted provided that the following conditions >+# are met: >+# 1. Redistributions of source code must retain the above copyright >+# notice, this list of conditions and the following disclaimer. >+# 2. Redistributions in binary form must reproduce the above copyright >+# notice, this list of conditions and the following disclaimer in the >+# documentation and/or other materials provided with the distribution. >+# >+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND >+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR >+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL >+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR >+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER >+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, >+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ >+#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL) >+ >+messages -> RemoteGraphicsContextGLProxy NotRefCounted { >+ void WasCreated() >+} >+ >+#endif >diff --git a/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxyFunctionsGenerated.h b/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxyFunctionsGenerated.h >new file mode 100644 >index 0000000000000000000000000000000000000000..bbcd18ddd78dac5ad6a30e68892bc6c2316dec4e >--- /dev/null >+++ b/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxyFunctionsGenerated.h >@@ -0,0 +1,915 @@ >+ >+/* Copyright (C) 2020 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND >+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR >+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL >+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR >+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER >+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, >+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+// This file is generated by generate-gpup-webgl. Do not edit. >+ >+// This file should be included in the public section of the >+// RemoteGraphicsContextGLProxy implementations. >+#pragma once >+ >+ void activeTexture(GCGLenum texture) final >+ { >+ send(Messages::RemoteGraphicsContextGL::ActiveTexture(texture), m_graphicsContextGLIdentifier); >+ } >+ void attachShader(PlatformGLObject program, PlatformGLObject shader) final >+ { >+ send(Messages::RemoteGraphicsContextGL::AttachShader(program, shader), m_graphicsContextGLIdentifier); >+ } >+ void bindAttribLocation(PlatformGLObject arg0, GCGLuint index, const String& name) final >+ { >+ send(Messages::RemoteGraphicsContextGL::BindAttribLocation(arg0, index, name), m_graphicsContextGLIdentifier); >+ } >+ void bindBuffer(GCGLenum target, PlatformGLObject arg1) final >+ { >+ send(Messages::RemoteGraphicsContextGL::BindBuffer(target, arg1), m_graphicsContextGLIdentifier); >+ } >+ void bindFramebuffer(GCGLenum target, PlatformGLObject arg1) final >+ { >+ send(Messages::RemoteGraphicsContextGL::BindFramebuffer(target, arg1), m_graphicsContextGLIdentifier); >+ } >+ void bindRenderbuffer(GCGLenum target, PlatformGLObject arg1) final >+ { >+ send(Messages::RemoteGraphicsContextGL::BindRenderbuffer(target, arg1), m_graphicsContextGLIdentifier); >+ } >+ void bindTexture(GCGLenum target, PlatformGLObject arg1) final >+ { >+ send(Messages::RemoteGraphicsContextGL::BindTexture(target, arg1), m_graphicsContextGLIdentifier); >+ } >+ void blendColor(GCGLclampf red, GCGLclampf green, GCGLclampf blue, GCGLclampf alpha) final >+ { >+ send(Messages::RemoteGraphicsContextGL::BlendColor(red, green, blue, alpha), m_graphicsContextGLIdentifier); >+ } >+ void blendEquation(GCGLenum mode) final >+ { >+ send(Messages::RemoteGraphicsContextGL::BlendEquation(mode), m_graphicsContextGLIdentifier); >+ } >+ void blendEquationSeparate(GCGLenum modeRGB, GCGLenum modeAlpha) final >+ { >+ send(Messages::RemoteGraphicsContextGL::BlendEquationSeparate(modeRGB, modeAlpha), m_graphicsContextGLIdentifier); >+ } >+ void blendFunc(GCGLenum sfactor, GCGLenum dfactor) final >+ { >+ send(Messages::RemoteGraphicsContextGL::BlendFunc(sfactor, dfactor), m_graphicsContextGLIdentifier); >+ } >+ void blendFuncSeparate(GCGLenum srcRGB, GCGLenum dstRGB, GCGLenum srcAlpha, GCGLenum dstAlpha) final >+ { >+ send(Messages::RemoteGraphicsContextGL::BlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha), m_graphicsContextGLIdentifier); >+ } >+ GCGLenum checkFramebufferStatus(GCGLenum target) final >+ { >+ uint32_t result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::CheckFramebufferStatus(target), Messages::RemoteGraphicsContextGL::CheckFramebufferStatus::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return result; >+ } >+ void clear(GCGLbitfield mask) final >+ { >+ send(Messages::RemoteGraphicsContextGL::Clear(mask), m_graphicsContextGLIdentifier); >+ } >+ void clearColor(GCGLclampf red, GCGLclampf green, GCGLclampf blue, GCGLclampf alpha) final >+ { >+ send(Messages::RemoteGraphicsContextGL::ClearColor(red, green, blue, alpha), m_graphicsContextGLIdentifier); >+ } >+ void clearDepth(GCGLclampf depth) final >+ { >+ send(Messages::RemoteGraphicsContextGL::ClearDepth(depth), m_graphicsContextGLIdentifier); >+ } >+ void clearStencil(GCGLint s) final >+ { >+ send(Messages::RemoteGraphicsContextGL::ClearStencil(s), m_graphicsContextGLIdentifier); >+ } >+ void colorMask(GCGLboolean red, GCGLboolean green, GCGLboolean blue, GCGLboolean alpha) final >+ { >+ send(Messages::RemoteGraphicsContextGL::ColorMask(static_cast<bool>(red), static_cast<bool>(green), static_cast<bool>(blue), static_cast<bool>(alpha)), m_graphicsContextGLIdentifier); >+ } >+ void compileShader(PlatformGLObject arg0) final >+ { >+ send(Messages::RemoteGraphicsContextGL::CompileShader(arg0), m_graphicsContextGLIdentifier); >+ } >+ void copyTexImage2D(GCGLenum target, GCGLint level, GCGLenum internalformat, GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLint border) final >+ { >+ send(Messages::RemoteGraphicsContextGL::CopyTexImage2D(target, level, internalformat, x, y, width, height, border), m_graphicsContextGLIdentifier); >+ } >+ void copyTexSubImage2D(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height) final >+ { >+ send(Messages::RemoteGraphicsContextGL::CopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height), m_graphicsContextGLIdentifier); >+ } >+ PlatformGLObject createBuffer() final >+ { >+ uint32_t result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::CreateBuffer(), Messages::RemoteGraphicsContextGL::CreateBuffer::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return result; >+ } >+ PlatformGLObject createFramebuffer() final >+ { >+ uint32_t result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::CreateFramebuffer(), Messages::RemoteGraphicsContextGL::CreateFramebuffer::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return result; >+ } >+ PlatformGLObject createProgram() final >+ { >+ uint32_t result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::CreateProgram(), Messages::RemoteGraphicsContextGL::CreateProgram::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return result; >+ } >+ PlatformGLObject createRenderbuffer() final >+ { >+ uint32_t result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::CreateRenderbuffer(), Messages::RemoteGraphicsContextGL::CreateRenderbuffer::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return result; >+ } >+ PlatformGLObject createShader(GCGLenum arg0) final >+ { >+ uint32_t result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::CreateShader(arg0), Messages::RemoteGraphicsContextGL::CreateShader::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return result; >+ } >+ PlatformGLObject createTexture() final >+ { >+ uint32_t result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::CreateTexture(), Messages::RemoteGraphicsContextGL::CreateTexture::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return result; >+ } >+ void cullFace(GCGLenum mode) final >+ { >+ send(Messages::RemoteGraphicsContextGL::CullFace(mode), m_graphicsContextGLIdentifier); >+ } >+ void deleteBuffer(PlatformGLObject arg0) final >+ { >+ send(Messages::RemoteGraphicsContextGL::DeleteBuffer(arg0), m_graphicsContextGLIdentifier); >+ } >+ void deleteFramebuffer(PlatformGLObject arg0) final >+ { >+ send(Messages::RemoteGraphicsContextGL::DeleteFramebuffer(arg0), m_graphicsContextGLIdentifier); >+ } >+ void deleteProgram(PlatformGLObject arg0) final >+ { >+ send(Messages::RemoteGraphicsContextGL::DeleteProgram(arg0), m_graphicsContextGLIdentifier); >+ } >+ void deleteRenderbuffer(PlatformGLObject arg0) final >+ { >+ send(Messages::RemoteGraphicsContextGL::DeleteRenderbuffer(arg0), m_graphicsContextGLIdentifier); >+ } >+ void deleteShader(PlatformGLObject arg0) final >+ { >+ send(Messages::RemoteGraphicsContextGL::DeleteShader(arg0), m_graphicsContextGLIdentifier); >+ } >+ void deleteTexture(PlatformGLObject arg0) final >+ { >+ send(Messages::RemoteGraphicsContextGL::DeleteTexture(arg0), m_graphicsContextGLIdentifier); >+ } >+ void depthFunc(GCGLenum func) final >+ { >+ send(Messages::RemoteGraphicsContextGL::DepthFunc(func), m_graphicsContextGLIdentifier); >+ } >+ void depthMask(GCGLboolean flag) final >+ { >+ send(Messages::RemoteGraphicsContextGL::DepthMask(static_cast<bool>(flag)), m_graphicsContextGLIdentifier); >+ } >+ void depthRange(GCGLclampf zNear, GCGLclampf zFar) final >+ { >+ send(Messages::RemoteGraphicsContextGL::DepthRange(zNear, zFar), m_graphicsContextGLIdentifier); >+ } >+ void detachShader(PlatformGLObject arg0, PlatformGLObject arg1) final >+ { >+ send(Messages::RemoteGraphicsContextGL::DetachShader(arg0, arg1), m_graphicsContextGLIdentifier); >+ } >+ void disable(GCGLenum cap) final >+ { >+ send(Messages::RemoteGraphicsContextGL::Disable(cap), m_graphicsContextGLIdentifier); >+ } >+ void disableVertexAttribArray(GCGLuint index) final >+ { >+ send(Messages::RemoteGraphicsContextGL::DisableVertexAttribArray(index), m_graphicsContextGLIdentifier); >+ } >+ void drawArrays(GCGLenum mode, GCGLint first, GCGLsizei count) final >+ { >+ send(Messages::RemoteGraphicsContextGL::DrawArrays(mode, first, count), m_graphicsContextGLIdentifier); >+ } >+ void drawElements(GCGLenum mode, GCGLsizei count, GCGLenum type, GCGLintptr offset) final >+ { >+ send(Messages::RemoteGraphicsContextGL::DrawElements(mode, count, type, static_cast<uint64_t>(offset)), m_graphicsContextGLIdentifier); >+ } >+ void enable(GCGLenum cap) final >+ { >+ send(Messages::RemoteGraphicsContextGL::Enable(cap), m_graphicsContextGLIdentifier); >+ } >+ void enableVertexAttribArray(GCGLuint index) final >+ { >+ send(Messages::RemoteGraphicsContextGL::EnableVertexAttribArray(index), m_graphicsContextGLIdentifier); >+ } >+ void finish() final >+ { >+ send(Messages::RemoteGraphicsContextGL::Finish(), m_graphicsContextGLIdentifier); >+ } >+ void flush() final >+ { >+ send(Messages::RemoteGraphicsContextGL::Flush(), m_graphicsContextGLIdentifier); >+ } >+ void framebufferRenderbuffer(GCGLenum target, GCGLenum attachment, GCGLenum renderbuffertarget, PlatformGLObject arg3) final >+ { >+ send(Messages::RemoteGraphicsContextGL::FramebufferRenderbuffer(target, attachment, renderbuffertarget, arg3), m_graphicsContextGLIdentifier); >+ } >+ void framebufferTexture2D(GCGLenum target, GCGLenum attachment, GCGLenum textarget, PlatformGLObject arg3, GCGLint level) final >+ { >+ send(Messages::RemoteGraphicsContextGL::FramebufferTexture2D(target, attachment, textarget, arg3, level), m_graphicsContextGLIdentifier); >+ } >+ void frontFace(GCGLenum mode) final >+ { >+ send(Messages::RemoteGraphicsContextGL::FrontFace(mode), m_graphicsContextGLIdentifier); >+ } >+ void generateMipmap(GCGLenum target) final >+ { >+ send(Messages::RemoteGraphicsContextGL::GenerateMipmap(target), m_graphicsContextGLIdentifier); >+ } >+ bool getActiveAttrib(PlatformGLObject program, GCGLuint index, ActiveInfo& arg2) final { return { }; } >+ bool getActiveUniform(PlatformGLObject program, GCGLuint index, ActiveInfo& arg2) final { return { }; } >+ void getAttachedShaders(PlatformGLObject program, GCGLsizei maxCount, GCGLsizei* count, PlatformGLObject* shaders) final { } >+ GCGLint getAttribLocation(PlatformGLObject arg0, const String& name) final >+ { >+ int32_t result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::GetAttribLocation(arg0, name), Messages::RemoteGraphicsContextGL::GetAttribLocation::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return result; >+ } >+ void getBufferParameteriv(GCGLenum target, GCGLenum pname, GCGLint* value) final { } >+ String getString(GCGLenum name) final >+ { >+ String result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::GetString(name), Messages::RemoteGraphicsContextGL::GetString::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return result; >+ } >+ void getFloatv(GCGLenum pname, GCGLfloat* value) final { } >+ void getIntegerv(GCGLenum pname, GCGLint* value) final { } >+ void getIntegeri_v(GCGLenum pname, GCGLuint index, GCGLint* value) final { } >+ void getInteger64v(GCGLenum pname, GCGLint64* value) final { } >+ void getInteger64i_v(GCGLenum pname, GCGLuint index, GCGLint64* value) final { } >+ void getProgramiv(PlatformGLObject program, GCGLenum pname, GCGLint* value) final { } >+ void getBooleanv(GCGLenum pname, GCGLboolean* value) final { } >+ GCGLenum getError() final >+ { >+ uint32_t result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::GetError(), Messages::RemoteGraphicsContextGL::GetError::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return result; >+ } >+ void getFramebufferAttachmentParameteriv(GCGLenum target, GCGLenum attachment, GCGLenum pname, GCGLint* value) final { } >+ String getProgramInfoLog(PlatformGLObject arg0) final >+ { >+ String result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::GetProgramInfoLog(arg0), Messages::RemoteGraphicsContextGL::GetProgramInfoLog::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return result; >+ } >+ void getRenderbufferParameteriv(GCGLenum target, GCGLenum pname, GCGLint* value) final { } >+ void getShaderiv(PlatformGLObject arg0, GCGLenum pname, GCGLint* value) final { } >+ String getShaderInfoLog(PlatformGLObject arg0) final >+ { >+ String result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::GetShaderInfoLog(arg0), Messages::RemoteGraphicsContextGL::GetShaderInfoLog::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return result; >+ } >+ void getShaderPrecisionFormat(GCGLenum shaderType, GCGLenum precisionType, GCGLint* range, GCGLint* precision) final { } >+ String getShaderSource(PlatformGLObject arg0) final >+ { >+ String result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::GetShaderSource(arg0), Messages::RemoteGraphicsContextGL::GetShaderSource::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return result; >+ } >+ void getTexParameterfv(GCGLenum target, GCGLenum pname, GCGLfloat* value) final { } >+ void getTexParameteriv(GCGLenum target, GCGLenum pname, GCGLint* value) final { } >+ void getUniformfv(PlatformGLObject program, GCGLint location, GCGLfloat* value) final { } >+ void getUniformiv(PlatformGLObject program, GCGLint location, GCGLint* value) final { } >+ void getUniformuiv(PlatformGLObject program, GCGLint location, GCGLuint* value) final { } >+ GCGLint getUniformLocation(PlatformGLObject arg0, const String& name) final >+ { >+ int32_t result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::GetUniformLocation(arg0, name), Messages::RemoteGraphicsContextGL::GetUniformLocation::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return result; >+ } >+ void getVertexAttribfv(GCGLuint index, GCGLenum pname, GCGLfloat* value) final { } >+ void getVertexAttribiv(GCGLuint index, GCGLenum pname, GCGLint* value) final { } >+ GCGLsizeiptr getVertexAttribOffset(GCGLuint index, GCGLenum pname) final >+ { >+ uint64_t result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::GetVertexAttribOffset(index, pname), Messages::RemoteGraphicsContextGL::GetVertexAttribOffset::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return static_cast<GCGLsizeiptr>(result); >+ } >+ void hint(GCGLenum target, GCGLenum mode) final >+ { >+ send(Messages::RemoteGraphicsContextGL::Hint(target, mode), m_graphicsContextGLIdentifier); >+ } >+ GCGLboolean isBuffer(PlatformGLObject arg0) final >+ { >+ bool result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::IsBuffer(arg0), Messages::RemoteGraphicsContextGL::IsBuffer::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return static_cast<GCGLboolean>(result); >+ } >+ GCGLboolean isEnabled(GCGLenum cap) final >+ { >+ bool result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::IsEnabled(cap), Messages::RemoteGraphicsContextGL::IsEnabled::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return static_cast<GCGLboolean>(result); >+ } >+ GCGLboolean isFramebuffer(PlatformGLObject arg0) final >+ { >+ bool result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::IsFramebuffer(arg0), Messages::RemoteGraphicsContextGL::IsFramebuffer::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return static_cast<GCGLboolean>(result); >+ } >+ GCGLboolean isProgram(PlatformGLObject arg0) final >+ { >+ bool result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::IsProgram(arg0), Messages::RemoteGraphicsContextGL::IsProgram::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return static_cast<GCGLboolean>(result); >+ } >+ GCGLboolean isRenderbuffer(PlatformGLObject arg0) final >+ { >+ bool result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::IsRenderbuffer(arg0), Messages::RemoteGraphicsContextGL::IsRenderbuffer::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return static_cast<GCGLboolean>(result); >+ } >+ GCGLboolean isShader(PlatformGLObject arg0) final >+ { >+ bool result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::IsShader(arg0), Messages::RemoteGraphicsContextGL::IsShader::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return static_cast<GCGLboolean>(result); >+ } >+ GCGLboolean isTexture(PlatformGLObject arg0) final >+ { >+ bool result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::IsTexture(arg0), Messages::RemoteGraphicsContextGL::IsTexture::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return static_cast<GCGLboolean>(result); >+ } >+ void lineWidth(GCGLfloat arg0) final >+ { >+ send(Messages::RemoteGraphicsContextGL::LineWidth(arg0), m_graphicsContextGLIdentifier); >+ } >+ void linkProgram(PlatformGLObject arg0) final >+ { >+ send(Messages::RemoteGraphicsContextGL::LinkProgram(arg0), m_graphicsContextGLIdentifier); >+ } >+ void pixelStorei(GCGLenum pname, GCGLint param) final >+ { >+ send(Messages::RemoteGraphicsContextGL::PixelStorei(pname, param), m_graphicsContextGLIdentifier); >+ } >+ void polygonOffset(GCGLfloat factor, GCGLfloat units) final >+ { >+ send(Messages::RemoteGraphicsContextGL::PolygonOffset(factor, units), m_graphicsContextGLIdentifier); >+ } >+ void renderbufferStorage(GCGLenum target, GCGLenum internalformat, GCGLsizei width, GCGLsizei height) final >+ { >+ send(Messages::RemoteGraphicsContextGL::RenderbufferStorage(target, internalformat, width, height), m_graphicsContextGLIdentifier); >+ } >+ void sampleCoverage(GCGLclampf value, GCGLboolean invert) final >+ { >+ send(Messages::RemoteGraphicsContextGL::SampleCoverage(value, static_cast<bool>(invert)), m_graphicsContextGLIdentifier); >+ } >+ void scissor(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height) final >+ { >+ send(Messages::RemoteGraphicsContextGL::Scissor(x, y, width, height), m_graphicsContextGLIdentifier); >+ } >+ void shaderSource(PlatformGLObject arg0, const String& string) final >+ { >+ send(Messages::RemoteGraphicsContextGL::ShaderSource(arg0, string), m_graphicsContextGLIdentifier); >+ } >+ void stencilFunc(GCGLenum func, GCGLint ref, GCGLuint mask) final >+ { >+ send(Messages::RemoteGraphicsContextGL::StencilFunc(func, ref, mask), m_graphicsContextGLIdentifier); >+ } >+ void stencilFuncSeparate(GCGLenum face, GCGLenum func, GCGLint ref, GCGLuint mask) final >+ { >+ send(Messages::RemoteGraphicsContextGL::StencilFuncSeparate(face, func, ref, mask), m_graphicsContextGLIdentifier); >+ } >+ void stencilMask(GCGLuint mask) final >+ { >+ send(Messages::RemoteGraphicsContextGL::StencilMask(mask), m_graphicsContextGLIdentifier); >+ } >+ void stencilMaskSeparate(GCGLenum face, GCGLuint mask) final >+ { >+ send(Messages::RemoteGraphicsContextGL::StencilMaskSeparate(face, mask), m_graphicsContextGLIdentifier); >+ } >+ void stencilOp(GCGLenum fail, GCGLenum zfail, GCGLenum zpass) final >+ { >+ send(Messages::RemoteGraphicsContextGL::StencilOp(fail, zfail, zpass), m_graphicsContextGLIdentifier); >+ } >+ void stencilOpSeparate(GCGLenum face, GCGLenum fail, GCGLenum zfail, GCGLenum zpass) final >+ { >+ send(Messages::RemoteGraphicsContextGL::StencilOpSeparate(face, fail, zfail, zpass), m_graphicsContextGLIdentifier); >+ } >+ void texParameterf(GCGLenum target, GCGLenum pname, GCGLfloat param) final >+ { >+ send(Messages::RemoteGraphicsContextGL::TexParameterf(target, pname, param), m_graphicsContextGLIdentifier); >+ } >+ void texParameteri(GCGLenum target, GCGLenum pname, GCGLint param) final >+ { >+ send(Messages::RemoteGraphicsContextGL::TexParameteri(target, pname, param), m_graphicsContextGLIdentifier); >+ } >+ void uniform1f(GCGLint location, GCGLfloat x) final >+ { >+ send(Messages::RemoteGraphicsContextGL::Uniform1f(location, x), m_graphicsContextGLIdentifier); >+ } >+ void uniform1fv(GCGLint location, GCGLsizei arg1, const GCGLfloat* v) final { } >+ void uniform1i(GCGLint location, GCGLint x) final >+ { >+ send(Messages::RemoteGraphicsContextGL::Uniform1i(location, x), m_graphicsContextGLIdentifier); >+ } >+ void uniform1iv(GCGLint location, GCGLsizei arg1, const GCGLint* v) final { } >+ void uniform2f(GCGLint location, GCGLfloat x, GCGLfloat y) final >+ { >+ send(Messages::RemoteGraphicsContextGL::Uniform2f(location, x, y), m_graphicsContextGLIdentifier); >+ } >+ void uniform2fv(GCGLint location, GCGLsizei arg1, const GCGLfloat* v) final { } >+ void uniform2i(GCGLint location, GCGLint x, GCGLint y) final >+ { >+ send(Messages::RemoteGraphicsContextGL::Uniform2i(location, x, y), m_graphicsContextGLIdentifier); >+ } >+ void uniform2iv(GCGLint location, GCGLsizei arg1, const GCGLint* v) final { } >+ void uniform3f(GCGLint location, GCGLfloat x, GCGLfloat y, GCGLfloat z) final >+ { >+ send(Messages::RemoteGraphicsContextGL::Uniform3f(location, x, y, z), m_graphicsContextGLIdentifier); >+ } >+ void uniform3fv(GCGLint location, GCGLsizei arg1, const GCGLfloat* v) final { } >+ void uniform3i(GCGLint location, GCGLint x, GCGLint y, GCGLint z) final >+ { >+ send(Messages::RemoteGraphicsContextGL::Uniform3i(location, x, y, z), m_graphicsContextGLIdentifier); >+ } >+ void uniform3iv(GCGLint location, GCGLsizei arg1, const GCGLint* v) final { } >+ void uniform4f(GCGLint location, GCGLfloat x, GCGLfloat y, GCGLfloat z, GCGLfloat w) final >+ { >+ send(Messages::RemoteGraphicsContextGL::Uniform4f(location, x, y, z, w), m_graphicsContextGLIdentifier); >+ } >+ void uniform4fv(GCGLint location, GCGLsizei arg1, const GCGLfloat* v) final { } >+ void uniform4i(GCGLint location, GCGLint x, GCGLint y, GCGLint z, GCGLint w) final >+ { >+ send(Messages::RemoteGraphicsContextGL::Uniform4i(location, x, y, z, w), m_graphicsContextGLIdentifier); >+ } >+ void uniform4iv(GCGLint location, GCGLsizei arg1, const GCGLint* v) final { } >+ void uniformMatrix2fv(GCGLint location, GCGLsizei arg1, GCGLboolean transpose, const GCGLfloat* value) final { } >+ void uniformMatrix3fv(GCGLint location, GCGLsizei arg1, GCGLboolean transpose, const GCGLfloat* value) final { } >+ void uniformMatrix4fv(GCGLint location, GCGLsizei arg1, GCGLboolean transpose, const GCGLfloat* value) final { } >+ void useProgram(PlatformGLObject arg0) final >+ { >+ send(Messages::RemoteGraphicsContextGL::UseProgram(arg0), m_graphicsContextGLIdentifier); >+ } >+ void validateProgram(PlatformGLObject arg0) final >+ { >+ send(Messages::RemoteGraphicsContextGL::ValidateProgram(arg0), m_graphicsContextGLIdentifier); >+ } >+ void vertexAttrib1f(GCGLuint index, GCGLfloat x) final >+ { >+ send(Messages::RemoteGraphicsContextGL::VertexAttrib1f(index, x), m_graphicsContextGLIdentifier); >+ } >+ void vertexAttrib1fv(GCGLuint index, const GCGLfloat* values) final { } >+ void vertexAttrib2f(GCGLuint index, GCGLfloat x, GCGLfloat y) final >+ { >+ send(Messages::RemoteGraphicsContextGL::VertexAttrib2f(index, x, y), m_graphicsContextGLIdentifier); >+ } >+ void vertexAttrib2fv(GCGLuint index, const GCGLfloat* values) final { } >+ void vertexAttrib3f(GCGLuint index, GCGLfloat x, GCGLfloat y, GCGLfloat z) final >+ { >+ send(Messages::RemoteGraphicsContextGL::VertexAttrib3f(index, x, y, z), m_graphicsContextGLIdentifier); >+ } >+ void vertexAttrib3fv(GCGLuint index, const GCGLfloat* values) final { } >+ void vertexAttrib4f(GCGLuint index, GCGLfloat x, GCGLfloat y, GCGLfloat z, GCGLfloat w) final >+ { >+ send(Messages::RemoteGraphicsContextGL::VertexAttrib4f(index, x, y, z, w), m_graphicsContextGLIdentifier); >+ } >+ void vertexAttrib4fv(GCGLuint index, const GCGLfloat* values) final { } >+ void vertexAttribPointer(GCGLuint index, GCGLint size, GCGLenum type, GCGLboolean normalized, GCGLsizei stride, GCGLintptr offset) final >+ { >+ send(Messages::RemoteGraphicsContextGL::VertexAttribPointer(index, size, type, static_cast<bool>(normalized), stride, static_cast<uint64_t>(offset)), m_graphicsContextGLIdentifier); >+ } >+ void viewport(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height) final >+ { >+ send(Messages::RemoteGraphicsContextGL::Viewport(x, y, width, height), m_graphicsContextGLIdentifier); >+ } >+ void bufferData(GCGLenum target, GCGLsizeiptr size, GCGLenum usage) final >+ { >+ send(Messages::RemoteGraphicsContextGL::BufferData(target, static_cast<uint64_t>(size), usage), m_graphicsContextGLIdentifier); >+ } >+ void bufferData(GCGLenum target, GCGLsizeiptr size, const void* data, GCGLenum usage) final { } >+ void bufferSubData(GCGLenum target, GCGLintptr offset, GCGLsizeiptr size, const void* data) final { } >+ void readPixels(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, void* data) final { } >+ bool texImage2D(GCGLenum target, GCGLint level, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, GCGLint border, GCGLenum format, GCGLenum type, const void* pixels) final { return { }; } >+ void texSubImage2D(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, const void* pixels) final { } >+ void drawArraysInstanced(GCGLenum mode, GCGLint first, GCGLsizei count, GCGLsizei primcount) final >+ { >+ send(Messages::RemoteGraphicsContextGL::DrawArraysInstanced(mode, first, count, primcount), m_graphicsContextGLIdentifier); >+ } >+ void drawElementsInstanced(GCGLenum mode, GCGLsizei count, GCGLenum type, GCGLintptr offset, GCGLsizei primcount) final >+ { >+ send(Messages::RemoteGraphicsContextGL::DrawElementsInstanced(mode, count, type, static_cast<uint64_t>(offset), primcount), m_graphicsContextGLIdentifier); >+ } >+ void vertexAttribDivisor(GCGLuint index, GCGLuint divisor) final >+ { >+ send(Messages::RemoteGraphicsContextGL::VertexAttribDivisor(index, divisor), m_graphicsContextGLIdentifier); >+ } >+ PlatformGLObject createVertexArray() final >+ { >+ uint32_t result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::CreateVertexArray(), Messages::RemoteGraphicsContextGL::CreateVertexArray::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return result; >+ } >+ void deleteVertexArray(PlatformGLObject arg0) final >+ { >+ send(Messages::RemoteGraphicsContextGL::DeleteVertexArray(arg0), m_graphicsContextGLIdentifier); >+ } >+ GCGLboolean isVertexArray(PlatformGLObject arg0) final >+ { >+ bool result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::IsVertexArray(arg0), Messages::RemoteGraphicsContextGL::IsVertexArray::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return static_cast<GCGLboolean>(result); >+ } >+ void bindVertexArray(PlatformGLObject arg0) final >+ { >+ send(Messages::RemoteGraphicsContextGL::BindVertexArray(arg0), m_graphicsContextGLIdentifier); >+ } >+ void copyBufferSubData(GCGLenum readTarget, GCGLenum writeTarget, GCGLintptr readOffset, GCGLintptr writeOffset, GCGLsizeiptr size) final >+ { >+ send(Messages::RemoteGraphicsContextGL::CopyBufferSubData(readTarget, writeTarget, static_cast<uint64_t>(readOffset), static_cast<uint64_t>(writeOffset), static_cast<uint64_t>(size)), m_graphicsContextGLIdentifier); >+ } >+ void* mapBufferRange(GCGLenum target, GCGLintptr offset, GCGLsizeiptr length, GCGLbitfield access) final { return { }; } >+ GCGLboolean unmapBuffer(GCGLenum target) final >+ { >+ bool result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::UnmapBuffer(target), Messages::RemoteGraphicsContextGL::UnmapBuffer::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return static_cast<GCGLboolean>(result); >+ } >+ void blitFramebuffer(GCGLint srcX0, GCGLint srcY0, GCGLint srcX1, GCGLint srcY1, GCGLint dstX0, GCGLint dstY0, GCGLint dstX1, GCGLint dstY1, GCGLbitfield mask, GCGLenum filter) final >+ { >+ send(Messages::RemoteGraphicsContextGL::BlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter), m_graphicsContextGLIdentifier); >+ } >+ void framebufferTextureLayer(GCGLenum target, GCGLenum attachment, PlatformGLObject texture, GCGLint level, GCGLint layer) final >+ { >+ send(Messages::RemoteGraphicsContextGL::FramebufferTextureLayer(target, attachment, texture, level, layer), m_graphicsContextGLIdentifier); >+ } >+ void invalidateFramebuffer(GCGLenum target, GCGLsizei numAttachments, const GCGLenum* attachments) final { } >+ void invalidateSubFramebuffer(GCGLenum target, GCGLsizei numAttachments, const GCGLenum* attachments, GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height) final { } >+ void readBuffer(GCGLenum src) final >+ { >+ send(Messages::RemoteGraphicsContextGL::ReadBuffer(src), m_graphicsContextGLIdentifier); >+ } >+ void getInternalformativ(GCGLenum target, GCGLenum internalformat, GCGLenum pname, GCGLsizei bufSize, GCGLint* params) final { } >+ void renderbufferStorageMultisample(GCGLenum target, GCGLsizei samples, GCGLenum internalformat, GCGLsizei width, GCGLsizei height) final >+ { >+ send(Messages::RemoteGraphicsContextGL::RenderbufferStorageMultisample(target, samples, internalformat, width, height), m_graphicsContextGLIdentifier); >+ } >+ void texStorage2D(GCGLenum target, GCGLsizei levels, GCGLenum internalformat, GCGLsizei width, GCGLsizei height) final >+ { >+ send(Messages::RemoteGraphicsContextGL::TexStorage2D(target, levels, internalformat, width, height), m_graphicsContextGLIdentifier); >+ } >+ void texStorage3D(GCGLenum target, GCGLsizei levels, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, GCGLsizei depth) final >+ { >+ send(Messages::RemoteGraphicsContextGL::TexStorage3D(target, levels, internalformat, width, height, depth), m_graphicsContextGLIdentifier); >+ } >+ void copyTexSubImage3D(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLint zoffset, GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height) final >+ { >+ send(Messages::RemoteGraphicsContextGL::CopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height), m_graphicsContextGLIdentifier); >+ } >+ GCGLint getFragDataLocation(PlatformGLObject program, const String& name) final >+ { >+ int32_t result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::GetFragDataLocation(program, name), Messages::RemoteGraphicsContextGL::GetFragDataLocation::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return result; >+ } >+ void uniform1ui(GCGLint location, GCGLuint v0) final >+ { >+ send(Messages::RemoteGraphicsContextGL::Uniform1ui(location, v0), m_graphicsContextGLIdentifier); >+ } >+ void uniform2ui(GCGLint location, GCGLuint v0, GCGLuint v1) final >+ { >+ send(Messages::RemoteGraphicsContextGL::Uniform2ui(location, v0, v1), m_graphicsContextGLIdentifier); >+ } >+ void uniform3ui(GCGLint location, GCGLuint v0, GCGLuint v1, GCGLuint v2) final >+ { >+ send(Messages::RemoteGraphicsContextGL::Uniform3ui(location, v0, v1, v2), m_graphicsContextGLIdentifier); >+ } >+ void uniform4ui(GCGLint location, GCGLuint v0, GCGLuint v1, GCGLuint v2, GCGLuint v3) final >+ { >+ send(Messages::RemoteGraphicsContextGL::Uniform4ui(location, v0, v1, v2, v3), m_graphicsContextGLIdentifier); >+ } >+ void uniform1uiv(GCGLint location, const GCGLuint* data, GCGLuint srcOffset, GCGLuint srcLength) final { } >+ void uniform2uiv(GCGLint location, const GCGLuint* data, GCGLuint srcOffset, GCGLuint srcLength) final { } >+ void uniform3uiv(GCGLint location, const GCGLuint* data, GCGLuint srcOffset, GCGLuint srcLength) final { } >+ void uniform4uiv(GCGLint location, const GCGLuint* data, GCGLuint srcOffset, GCGLuint srcLength) final { } >+ void uniformMatrix2x3fv(GCGLint location, GCGLboolean transpose, const GCGLfloat* data, GCGLuint srcOffset, GCGLuint srcLength) final { } >+ void uniformMatrix3x2fv(GCGLint location, GCGLboolean transpose, const GCGLfloat* data, GCGLuint srcOffset, GCGLuint srcLength) final { } >+ void uniformMatrix2x4fv(GCGLint location, GCGLboolean transpose, const GCGLfloat* data, GCGLuint srcOffset, GCGLuint srcLength) final { } >+ void uniformMatrix4x2fv(GCGLint location, GCGLboolean transpose, const GCGLfloat* data, GCGLuint srcOffset, GCGLuint srcLength) final { } >+ void uniformMatrix3x4fv(GCGLint location, GCGLboolean transpose, const GCGLfloat* data, GCGLuint srcOffset, GCGLuint srcLength) final { } >+ void uniformMatrix4x3fv(GCGLint location, GCGLboolean transpose, const GCGLfloat* data, GCGLuint srcOffset, GCGLuint srcLength) final { } >+ void vertexAttribI4i(GCGLuint index, GCGLint x, GCGLint y, GCGLint z, GCGLint w) final >+ { >+ send(Messages::RemoteGraphicsContextGL::VertexAttribI4i(index, x, y, z, w), m_graphicsContextGLIdentifier); >+ } >+ void vertexAttribI4iv(GCGLuint index, const GCGLint* values) final { } >+ void vertexAttribI4ui(GCGLuint index, GCGLuint x, GCGLuint y, GCGLuint z, GCGLuint w) final >+ { >+ send(Messages::RemoteGraphicsContextGL::VertexAttribI4ui(index, x, y, z, w), m_graphicsContextGLIdentifier); >+ } >+ void vertexAttribI4uiv(GCGLuint index, const GCGLuint* values) final { } >+ void vertexAttribIPointer(GCGLuint index, GCGLint size, GCGLenum type, GCGLsizei stride, GCGLintptr offset) final >+ { >+ send(Messages::RemoteGraphicsContextGL::VertexAttribIPointer(index, size, type, stride, static_cast<uint64_t>(offset)), m_graphicsContextGLIdentifier); >+ } >+ void drawRangeElements(GCGLenum mode, GCGLuint start, GCGLuint end, GCGLsizei count, GCGLenum type, GCGLintptr offset) final >+ { >+ send(Messages::RemoteGraphicsContextGL::DrawRangeElements(mode, start, end, count, type, static_cast<uint64_t>(offset)), m_graphicsContextGLIdentifier); >+ } >+ void drawBuffers(GCGLsizei n, const GCGLenum* bufs) final { } >+ void clearBufferiv(GCGLenum buffer, GCGLint drawbuffer, const GCGLint* values, GCGLuint srcOffset) final { } >+ void clearBufferuiv(GCGLenum buffer, GCGLint drawbuffer, const GCGLuint* values, GCGLuint srcOffset) final { } >+ void clearBufferfv(GCGLenum buffer, GCGLint drawbuffer, const GCGLfloat* values, GCGLuint srcOffset) final { } >+ void clearBufferfi(GCGLenum buffer, GCGLint drawbuffer, GCGLfloat depth, GCGLint stencil) final >+ { >+ send(Messages::RemoteGraphicsContextGL::ClearBufferfi(buffer, drawbuffer, depth, stencil), m_graphicsContextGLIdentifier); >+ } >+ PlatformGLObject createQuery() final >+ { >+ uint32_t result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::CreateQuery(), Messages::RemoteGraphicsContextGL::CreateQuery::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return result; >+ } >+ void deleteQuery(PlatformGLObject query) final >+ { >+ send(Messages::RemoteGraphicsContextGL::DeleteQuery(query), m_graphicsContextGLIdentifier); >+ } >+ GCGLboolean isQuery(PlatformGLObject query) final >+ { >+ bool result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::IsQuery(query), Messages::RemoteGraphicsContextGL::IsQuery::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return static_cast<GCGLboolean>(result); >+ } >+ void beginQuery(GCGLenum target, PlatformGLObject query) final >+ { >+ send(Messages::RemoteGraphicsContextGL::BeginQuery(target, query), m_graphicsContextGLIdentifier); >+ } >+ void endQuery(GCGLenum target) final >+ { >+ send(Messages::RemoteGraphicsContextGL::EndQuery(target), m_graphicsContextGLIdentifier); >+ } >+ PlatformGLObject getQuery(GCGLenum target, GCGLenum pname) final >+ { >+ uint32_t result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::GetQuery(target, pname), Messages::RemoteGraphicsContextGL::GetQuery::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return result; >+ } >+ void getQueryObjectuiv(PlatformGLObject query, GCGLenum pname, GCGLuint* value) final { } >+ PlatformGLObject createSampler() final >+ { >+ uint32_t result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::CreateSampler(), Messages::RemoteGraphicsContextGL::CreateSampler::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return result; >+ } >+ void deleteSampler(PlatformGLObject sampler) final >+ { >+ send(Messages::RemoteGraphicsContextGL::DeleteSampler(sampler), m_graphicsContextGLIdentifier); >+ } >+ GCGLboolean isSampler(PlatformGLObject sampler) final >+ { >+ bool result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::IsSampler(sampler), Messages::RemoteGraphicsContextGL::IsSampler::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return static_cast<GCGLboolean>(result); >+ } >+ void bindSampler(GCGLuint unit, PlatformGLObject sampler) final >+ { >+ send(Messages::RemoteGraphicsContextGL::BindSampler(unit, sampler), m_graphicsContextGLIdentifier); >+ } >+ void samplerParameteri(PlatformGLObject sampler, GCGLenum pname, GCGLint param) final >+ { >+ send(Messages::RemoteGraphicsContextGL::SamplerParameteri(sampler, pname, param), m_graphicsContextGLIdentifier); >+ } >+ void samplerParameterf(PlatformGLObject sampler, GCGLenum pname, GCGLfloat param) final >+ { >+ send(Messages::RemoteGraphicsContextGL::SamplerParameterf(sampler, pname, param), m_graphicsContextGLIdentifier); >+ } >+ void getSamplerParameterfv(PlatformGLObject sampler, GCGLenum pname, GCGLfloat* value) final { } >+ void getSamplerParameteriv(PlatformGLObject sampler, GCGLenum pname, GCGLint* value) final { } >+ GCGLsync fenceSync(GCGLenum condition, GCGLbitfield flags) final { return { }; } >+ GCGLboolean isSync(GCGLsync arg0) final { return { }; } >+ void deleteSync(GCGLsync arg0) final { } >+ GCGLenum clientWaitSync(GCGLsync arg0, GCGLbitfield flags, GCGLuint64 timeout) final { return { }; } >+ void waitSync(GCGLsync arg0, GCGLbitfield flags, GCGLint64 timeout) final { } >+ void getSynciv(GCGLsync arg0, GCGLenum pname, GCGLsizei bufSize, GCGLint* value) final { } >+ PlatformGLObject createTransformFeedback() final >+ { >+ uint32_t result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::CreateTransformFeedback(), Messages::RemoteGraphicsContextGL::CreateTransformFeedback::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return result; >+ } >+ void deleteTransformFeedback(PlatformGLObject id) final >+ { >+ send(Messages::RemoteGraphicsContextGL::DeleteTransformFeedback(id), m_graphicsContextGLIdentifier); >+ } >+ GCGLboolean isTransformFeedback(PlatformGLObject id) final >+ { >+ bool result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::IsTransformFeedback(id), Messages::RemoteGraphicsContextGL::IsTransformFeedback::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return static_cast<GCGLboolean>(result); >+ } >+ void bindTransformFeedback(GCGLenum target, PlatformGLObject id) final >+ { >+ send(Messages::RemoteGraphicsContextGL::BindTransformFeedback(target, id), m_graphicsContextGLIdentifier); >+ } >+ void beginTransformFeedback(GCGLenum primitiveMode) final >+ { >+ send(Messages::RemoteGraphicsContextGL::BeginTransformFeedback(primitiveMode), m_graphicsContextGLIdentifier); >+ } >+ void endTransformFeedback() final >+ { >+ send(Messages::RemoteGraphicsContextGL::EndTransformFeedback(), m_graphicsContextGLIdentifier); >+ } >+ void transformFeedbackVaryings(PlatformGLObject program, const Vector<String>& varyings, GCGLenum bufferMode) final { } >+ void getTransformFeedbackVarying(PlatformGLObject program, GCGLuint index, ActiveInfo& arg2) final { } >+ void pauseTransformFeedback() final >+ { >+ send(Messages::RemoteGraphicsContextGL::PauseTransformFeedback(), m_graphicsContextGLIdentifier); >+ } >+ void resumeTransformFeedback() final >+ { >+ send(Messages::RemoteGraphicsContextGL::ResumeTransformFeedback(), m_graphicsContextGLIdentifier); >+ } >+ void bindBufferBase(GCGLenum target, GCGLuint index, PlatformGLObject buffer) final >+ { >+ send(Messages::RemoteGraphicsContextGL::BindBufferBase(target, index, buffer), m_graphicsContextGLIdentifier); >+ } >+ void bindBufferRange(GCGLenum target, GCGLuint index, PlatformGLObject buffer, GCGLintptr offset, GCGLsizeiptr size) final >+ { >+ send(Messages::RemoteGraphicsContextGL::BindBufferRange(target, index, buffer, static_cast<uint64_t>(offset), static_cast<uint64_t>(size)), m_graphicsContextGLIdentifier); >+ } >+ Vector<GCGLuint> getUniformIndices(PlatformGLObject program, const Vector<String>& uniformNames) final { return { }; } >+ void getActiveUniforms(PlatformGLObject program, const Vector<GCGLuint>& uniformIndices, GCGLenum pname, Vector<GCGLint>& params) final { } >+ GCGLuint getUniformBlockIndex(PlatformGLObject program, const String& uniformBlockName) final >+ { >+ uint32_t result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::GetUniformBlockIndex(program, uniformBlockName), Messages::RemoteGraphicsContextGL::GetUniformBlockIndex::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return result; >+ } >+ String getActiveUniformBlockName(PlatformGLObject program, GCGLuint uniformBlockIndex) final >+ { >+ String result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::GetActiveUniformBlockName(program, uniformBlockIndex), Messages::RemoteGraphicsContextGL::GetActiveUniformBlockName::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return result; >+ } >+ void uniformBlockBinding(PlatformGLObject program, GCGLuint uniformBlockIndex, GCGLuint uniformBlockBinding) final >+ { >+ send(Messages::RemoteGraphicsContextGL::UniformBlockBinding(program, uniformBlockIndex, uniformBlockBinding), m_graphicsContextGLIdentifier); >+ } >+ void uniform1fv(GCGLint location, const GCGLfloat* data, GCGLuint srcOffset, GCGLuint srcLength) final { } >+ void uniform2fv(GCGLint location, const GCGLfloat* data, GCGLuint srcOffset, GCGLuint srcLength) final { } >+ void uniform3fv(GCGLint location, const GCGLfloat* data, GCGLuint srcOffset, GCGLuint srcLength) final { } >+ void uniform4fv(GCGLint location, const GCGLfloat* data, GCGLuint srcOffset, GCGLuint srcLength) final { } >+ void uniform1iv(GCGLint location, const GCGLint* data, GCGLuint srcOffset, GCGLuint srcLength) final { } >+ void uniform2iv(GCGLint location, const GCGLint* data, GCGLuint srcOffset, GCGLuint srcLength) final { } >+ void uniform3iv(GCGLint location, const GCGLint* data, GCGLuint srcOffset, GCGLuint srcLength) final { } >+ void uniform4iv(GCGLint location, const GCGLint* data, GCGLuint srcOffset, GCGLuint srcLength) final { } >+ void uniformMatrix2fv(GCGLint location, GCGLboolean transpose, const GCGLfloat* data, GCGLuint srcOffset, GCGLuint srcLength) final { } >+ void uniformMatrix3fv(GCGLint location, GCGLboolean transpose, const GCGLfloat* data, GCGLuint srcOffset, GCGLuint srcLength) final { } >+ void uniformMatrix4fv(GCGLint location, GCGLboolean transpose, const GCGLfloat* data, GCGLuint srcOffset, GCGLuint srcLength) final { } >+ GCGLint getGraphicsResetStatusARB() final >+ { >+ int32_t result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::GetGraphicsResetStatusARB(), Messages::RemoteGraphicsContextGL::GetGraphicsResetStatusARB::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return result; >+ } >+ void blitFramebufferANGLE(GCGLint srcX0, GCGLint srcY0, GCGLint srcX1, GCGLint srcY1, GCGLint dstX0, GCGLint dstY0, GCGLint dstX1, GCGLint dstY1, GCGLbitfield mask, GCGLenum filter) final >+ { >+ send(Messages::RemoteGraphicsContextGL::BlitFramebufferANGLE(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter), m_graphicsContextGLIdentifier); >+ } >+ void renderbufferStorageMultisampleANGLE(GCGLenum target, GCGLsizei samples, GCGLenum internalformat, GCGLsizei width, GCGLsizei height) final >+ { >+ send(Messages::RemoteGraphicsContextGL::RenderbufferStorageMultisampleANGLE(target, samples, internalformat, width, height), m_graphicsContextGLIdentifier); >+ } >+ PlatformGLObject createVertexArrayOES() final >+ { >+ uint32_t result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::CreateVertexArrayOES(), Messages::RemoteGraphicsContextGL::CreateVertexArrayOES::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return result; >+ } >+ void deleteVertexArrayOES(PlatformGLObject arg0) final >+ { >+ send(Messages::RemoteGraphicsContextGL::DeleteVertexArrayOES(arg0), m_graphicsContextGLIdentifier); >+ } >+ GCGLboolean isVertexArrayOES(PlatformGLObject arg0) final >+ { >+ bool result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::IsVertexArrayOES(arg0), Messages::RemoteGraphicsContextGL::IsVertexArrayOES::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return static_cast<GCGLboolean>(result); >+ } >+ void bindVertexArrayOES(PlatformGLObject arg0) final >+ { >+ send(Messages::RemoteGraphicsContextGL::BindVertexArrayOES(arg0), m_graphicsContextGLIdentifier); >+ } >+ String getTranslatedShaderSourceANGLE(PlatformGLObject arg0) final >+ { >+ String result = { }; >+ sendSync(Messages::RemoteGraphicsContextGL::GetTranslatedShaderSourceANGLE(arg0), Messages::RemoteGraphicsContextGL::GetTranslatedShaderSourceANGLE::Reply(result), m_graphicsContextGLIdentifier, 1_s); >+ return result; >+ } >+ void insertEventMarkerEXT(const String& arg0) final >+ { >+ send(Messages::RemoteGraphicsContextGL::InsertEventMarkerEXT(arg0), m_graphicsContextGLIdentifier); >+ } >+ void pushGroupMarkerEXT(const String& arg0) final >+ { >+ send(Messages::RemoteGraphicsContextGL::PushGroupMarkerEXT(arg0), m_graphicsContextGLIdentifier); >+ } >+ void popGroupMarkerEXT() final >+ { >+ send(Messages::RemoteGraphicsContextGL::PopGroupMarkerEXT(), m_graphicsContextGLIdentifier); >+ } >+ void drawBuffersEXT(GCGLsizei n, const GCGLenum* bufs) final { } >+ void drawArraysInstancedANGLE(GCGLenum mode, GCGLint first, GCGLsizei count, GCGLsizei primcount) final >+ { >+ send(Messages::RemoteGraphicsContextGL::DrawArraysInstancedANGLE(mode, first, count, primcount), m_graphicsContextGLIdentifier); >+ } >+ void drawElementsInstancedANGLE(GCGLenum mode, GCGLsizei count, GCGLenum type, GCGLvoidptr offset, GCGLsizei primcount) final >+ { >+ send(Messages::RemoteGraphicsContextGL::DrawElementsInstancedANGLE(mode, count, type, static_cast<uint64_t>(offset), primcount), m_graphicsContextGLIdentifier); >+ } >+ void vertexAttribDivisorANGLE(GCGLuint index, GCGLuint divisor) final >+ { >+ send(Messages::RemoteGraphicsContextGL::VertexAttribDivisorANGLE(index, divisor), m_graphicsContextGLIdentifier); >+ } >+ void getBooleanvRobustANGLE(GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLboolean* data) final { } >+ void getBufferParameterivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) final { } >+ void getFloatvRobustANGLE(GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLfloat* data) final { } >+ void getFramebufferAttachmentParameterivRobustANGLE(GCGLenum target, GCGLenum attachment, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) final { } >+ void getIntegervRobustANGLE(GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* data) final { } >+ void getProgramivRobustANGLE(GCGLuint program, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) final { } >+ void getRenderbufferParameterivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) final { } >+ void getShaderivRobustANGLE(GCGLuint shader, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) final { } >+ void getTexParameterfvRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLfloat* params) final { } >+ void getTexParameterivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) final { } >+ void getUniformfvRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei* length, GCGLfloat* params) final { } >+ void getUniformivRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) final { } >+ void getVertexAttribfvRobustANGLE(GCGLuint index, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLfloat* params) final { } >+ void getVertexAttribivRobustANGLE(GCGLuint index, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) final { } >+ void getVertexAttribPointervRobustANGLE(GCGLuint index, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, void** pointer) final { } >+ void readPixelsRobustANGLE(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, GCGLsizei* length, GCGLsizei* columns, GCGLsizei* rows, void* pixels) final { } >+ void texImage2DRobustANGLE(GCGLenum target, GCGLint level, GCGLint internalformat, GCGLsizei width, GCGLsizei height, GCGLint border, GCGLenum format, GCGLenum type, GCGLsizei bufSize, const void* pixels) final { } >+ void texParameterfvRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, const GCGLfloat* params) final { } >+ void texParameterivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, const GCGLint* params) final { } >+ void texSubImage2DRobustANGLE(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, const void* pixels) final { } >+ void compressedTexImage2DRobustANGLE(GCGLenum target, GCGLint level, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, GCGLint border, GCGLsizei imageSize, GCGLsizei bufSize, const void* data) final { } >+ void compressedTexSubImage2DRobustANGLE(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLsizei imageSize, GCGLsizei bufSize, const void* data) final { } >+ void compressedTexImage3DRobustANGLE(GCGLenum target, GCGLint level, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLint border, GCGLsizei imageSize, GCGLsizei bufSize, const void* data) final { } >+ void compressedTexSubImage3DRobustANGLE(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLint zoffset, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLenum format, GCGLsizei imageSize, GCGLsizei bufSize, const void* data) final { } >+ void texImage3DRobustANGLE(GCGLenum target, GCGLint level, GCGLint internalformat, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLint border, GCGLenum format, GCGLenum type, GCGLsizei bufSize, const void* pixels) final { } >+ void texSubImage3DRobustANGLE(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLint zoffset, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLenum format, GCGLenum type, GCGLsizei bufSize, const void* pixels) final { } >+ void getQueryivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) final { } >+ void getQueryObjectuivRobustANGLE(GCGLuint id, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLuint* params) final { } >+ void getBufferPointervRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, void** params) final { } >+ void getIntegeri_vRobustANGLE(GCGLenum target, GCGLuint index, GCGLsizei bufSize, GCGLsizei* length, int* data) final { } >+ void getInternalformativRobustANGLE(GCGLenum target, GCGLenum internalformat, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) final { } >+ void getVertexAttribIivRobustANGLE(GCGLuint index, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) final { } >+ void getVertexAttribIuivRobustANGLE(GCGLuint index, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLuint* params) final { } >+ void getUniformuivRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei* length, GCGLuint* params) final { } >+ void getActiveUniformBlockivRobustANGLE(GCGLuint program, GCGLuint uniformBlockIndex, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) final { } >+ void getInteger64vRobustANGLE(GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint64* data) final { } >+ void getInteger64i_vRobustANGLE(GCGLenum target, GCGLuint index, GCGLsizei bufSize, GCGLsizei* length, GCGLint64* data) final { } >+ void getBufferParameteri64vRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint64* params) final { } >+ void samplerParameterivRobustANGLE(GCGLuint sampler, GCGLenum pname, GCGLsizei bufSize, const GCGLint* param) final { } >+ void samplerParameterfvRobustANGLE(GCGLuint sampler, GCGLenum pname, GCGLsizei bufSize, const GCGLfloat* param) final { } >+ void getSamplerParameterivRobustANGLE(GCGLuint sampler, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) final { } >+ void getSamplerParameterfvRobustANGLE(GCGLuint sampler, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLfloat* params) final { } >+ void getFramebufferParameterivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) final { } >+ void getProgramInterfaceivRobustANGLE(GCGLuint program, GCGLenum programInterface, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) final { } >+ void getBooleani_vRobustANGLE(GCGLenum target, GCGLuint index, GCGLsizei bufSize, GCGLsizei* length, GCGLboolean* data) final { } >+ void getMultisamplefvRobustANGLE(GCGLenum pname, GCGLuint index, GCGLsizei bufSize, GCGLsizei* length, GCGLfloat* val) final { } >+ void getTexLevelParameterivRobustANGLE(GCGLenum target, GCGLint level, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) final { } >+ void getTexLevelParameterfvRobustANGLE(GCGLenum target, GCGLint level, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLfloat* params) final { } >+ void getPointervRobustANGLERobustANGLE(GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, void** params) final { } >+ void readnPixelsRobustANGLE(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, GCGLsizei* length, GCGLsizei* columns, GCGLsizei* rows, void* data, bool readingToPixelBufferObject) final { } >+ void getnUniformfvRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei* length, GCGLfloat* params) final { } >+ void getnUniformivRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) final { } >+ void getnUniformuivRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei* length, GCGLuint* params) final { } >+ void texParameterIivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, const GCGLint* params) final { } >+ void texParameterIuivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, const GCGLuint* params) final { } >+ void getTexParameterIivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) final { } >+ void getTexParameterIuivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLuint* params) final { } >+ void samplerParameterIivRobustANGLE(GCGLuint sampler, GCGLenum pname, GCGLsizei bufSize, const GCGLint* param) final { } >+ void samplerParameterIuivRobustANGLE(GCGLuint sampler, GCGLenum pname, GCGLsizei bufSize, const GCGLuint* param) final { } >+ void getSamplerParameterIivRobustANGLE(GCGLuint sampler, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) final { } >+ void getSamplerParameterIuivRobustANGLE(GCGLuint sampler, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLuint* params) final { } >+ void getQueryObjectivRobustANGLE(GCGLuint id, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) final { } >+ void getQueryObjecti64vRobustANGLE(GCGLuint id, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint64* params) final { } >+ void getQueryObjectui64vRobustANGLE(GCGLuint id, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLuint64* params) final { } >diff --git a/Source/WebKit/WebProcess/GPU/webrtc/MediaRecorderPrivate.h b/Source/WebKit/WebProcess/GPU/webrtc/MediaRecorderPrivate.h >index 42a585b23ffb5adb18e5060556f6a80999da4d29..29fedc7d07fd453e0f93aeeb3ebfaece0482dc95 100644 >--- a/Source/WebKit/WebProcess/GPU/webrtc/MediaRecorderPrivate.h >+++ b/Source/WebKit/WebProcess/GPU/webrtc/MediaRecorderPrivate.h >@@ -68,7 +68,7 @@ private: > void storageChanged(SharedMemory*); > > MediaRecorderIdentifier m_identifier; >- Ref<MediaStreamPrivate> m_stream; >+ Ref<WebCore::MediaStreamPrivate> m_stream; > Ref<IPC::Connection> m_connection; > > std::unique_ptr<WebCore::CARingBuffer> m_ringBuffer; >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp >index 1cd7ad7960f3e5f2e53ccbbcf9f7ff43407142fa..42a9c9998d9086f93704f804b668444bd4d93e09 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp >@@ -105,6 +105,10 @@ > #include <WebCore/MockWebAuthenticationConfiguration.h> > #endif > >+#if PLATFORM(COCOA) >+#include "RemoteGraphicsContextGLProxy.h" >+#endif >+ > namespace WebKit { > using namespace WebCore; > using namespace HTMLNames; >@@ -214,7 +218,7 @@ void WebChromeClient::assistiveTechnologyMakeFirstResponder() > m_page.send(Messages::WebPageProxy::AssistiveTechnologyMakeFirstResponder()); > } > >-#endif >+#endif > > bool WebChromeClient::canTakeFocus(FocusDirection) > { >@@ -325,7 +329,7 @@ bool WebChromeClient::toolbarsVisible() > API::InjectedBundle::PageUIClient::UIElementVisibility toolbarsVisibility = m_page.injectedBundleUIClient().toolbarsAreVisible(&m_page); > if (toolbarsVisibility != API::InjectedBundle::PageUIClient::UIElementVisibility::Unknown) > return toolbarsVisibility == API::InjectedBundle::PageUIClient::UIElementVisibility::Visible; >- >+ > bool toolbarsAreVisible = true; > if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::GetToolbarsAreVisible(), Messages::WebPageProxy::GetToolbarsAreVisible::Reply(toolbarsAreVisible), m_page.identifier())) > return true; >@@ -372,7 +376,7 @@ bool WebChromeClient::menubarVisible() > API::InjectedBundle::PageUIClient::UIElementVisibility menubarVisibility = m_page.injectedBundleUIClient().menuBarIsVisible(&m_page); > if (menubarVisibility != API::InjectedBundle::PageUIClient::UIElementVisibility::Unknown) > return menubarVisibility == API::InjectedBundle::PageUIClient::UIElementVisibility::Visible; >- >+ > bool menuBarIsVisible = true; > if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::GetMenuBarIsVisible(), Messages::WebPageProxy::GetMenuBarIsVisible::Reply(menuBarIsVisible), m_page.identifier())) > return true; >@@ -590,7 +594,7 @@ IntRect WebChromeClient::rootViewToScreen(const IntRect& rect) const > { > return m_page.rootViewToScreen(rect); > } >- >+ > IntPoint WebChromeClient::accessibilityScreenToRootView(const IntPoint& point) const > { > return m_page.accessibilityScreenToRootView(point); >@@ -666,7 +670,7 @@ bool WebChromeClient::shouldUnavailablePluginMessageBeButton(RenderEmbeddedObjec > ASSERT_NOT_REACHED(); > return false; > } >- >+ > void WebChromeClient::unavailablePluginButtonClicked(Element& element, RenderEmbeddedObject::PluginUnavailabilityReason pluginUnavailabilityReason) const > { > #if ENABLE(NETSCAPE_PLUGIN_API) >@@ -732,7 +736,7 @@ void WebChromeClient::exceededDatabaseQuota(Frame& frame, const String& database > { > WebFrame* webFrame = WebFrame::fromCoreFrame(frame); > ASSERT(webFrame); >- >+ > auto& origin = frame.document()->securityOrigin(); > auto& originData = origin.data(); > auto& tracker = DatabaseTracker::singleton(); >@@ -915,6 +919,22 @@ std::unique_ptr<ImageBuffer> WebChromeClient::createImageBuffer(const FloatSize& > return ensureRemoteRenderingBackendProxy().createImageBuffer(size, renderingMode, resolutionScale, colorSpace); > } > >+#if ENABLE(WEBGL) >+ >+RefPtr<GraphicsContextGL> WebChromeClient::createGraphicsContextGL(const GraphicsContextGLAttributes& attributes, PlatformDisplayID hostWindowDisplayID) const >+{ >+ if (!m_page.shouldUseRemoteWebGL()) >+ return nullptr; >+ UNUSED_VARIABLE(hostWindowDisplayID); >+#if PLATFORM(COCOA) >+ return RemoteGraphicsContextGLProxy::create(attributes); >+#else >+ return nullptr; >+#endif >+} >+ >+#endif >+ > #endif // ENABLE(GPU_PROCESS) > > void WebChromeClient::attachRootGraphicsLayer(Frame&, GraphicsLayer* layer) >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h >index f54794a6236b5e0d57bf77396c367da670ed7ced..caef91ed48e3e3601952a4a97275c359f584f261 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h >@@ -38,6 +38,7 @@ enum class StorageAccessWasGranted : bool; > namespace WebKit { > > class RemoteRenderingBackendProxy; >+class RemoteGraphicsContextGLProxy; > class WebFrame; > class WebPage; > >@@ -57,15 +58,15 @@ private: > void didRemoveMenuItemElement(WebCore::HTMLMenuItemElement&) final; > > void chromeDestroyed() final; >- >+ > void setWindowRect(const WebCore::FloatRect&) final; > WebCore::FloatRect windowRect() final; >- >+ > WebCore::FloatRect pageRect() final; >- >+ > void focus() final; > void unfocus() final; >- >+ > bool canTakeFocus(WebCore::FocusDirection) final; > void takeFocus(WebCore::FocusDirection) final; > >@@ -83,28 +84,28 @@ private: > void runModal() final; > > void reportProcessCPUTime(Seconds, WebCore::ActivityStateForCPUSampling) final; >- >+ > void setToolbarsVisible(bool) final; > bool toolbarsVisible() final; >- >+ > void setStatusbarVisible(bool) final; > bool statusbarVisible() final; >- >+ > void setScrollbarsVisible(bool) final; > bool scrollbarsVisible() final; >- >+ > void setMenubarVisible(bool) final; > bool menubarVisible() final; >- >+ > void setResizable(bool) final; >- >+ > void addMessageToConsole(JSC::MessageSource, JSC::MessageLevel, const String& message, unsigned lineNumber, unsigned columnNumber, const String& sourceID) final; >- >+ > bool canRunBeforeUnloadConfirmPanel() final; > bool runBeforeUnloadConfirmPanel(const String& message, WebCore::Frame&) final; >- >+ > void closeWindowSoon() final; >- >+ > void runJavaScriptAlert(WebCore::Frame&, const String&) final; > bool runJavaScriptConfirm(WebCore::Frame&, const String&) final; > bool runJavaScriptPrompt(WebCore::Frame&, const String& message, const String& defaultValue, String& result) final; >@@ -147,7 +148,7 @@ private: > > void reachedMaxAppCacheSize(int64_t spaceNeeded) final; > void reachedApplicationCacheOriginQuota(WebCore::SecurityOrigin&, int64_t spaceNeeded) final; >- >+ > #if ENABLE(INPUT_TYPE_COLOR) > std::unique_ptr<WebCore::ColorChooser> createColorChooser(WebCore::ColorChooserClient&, const WebCore::Color&) final; > #endif >@@ -245,8 +246,12 @@ private: > #if ENABLE(GPU_PROCESS) > RemoteRenderingBackendProxy& ensureRemoteRenderingBackendProxy() const; > std::unique_ptr<WebCore::ImageBuffer> createImageBuffer(const WebCore::FloatSize&, WebCore::RenderingMode, WebCore::RenderingPurpose, float resolutionScale, WebCore::ColorSpace) const final; >+#if ENABLE(WEBGL) >+ RefPtr<WebCore::GraphicsContextGL> createGraphicsContextGL(const WebCore::GraphicsContextGLAttributes&, WebCore::PlatformDisplayID hostWindowDisplayID) const final; >+#endif > #endif > >+ > CompositingTriggerFlags allowedCompositingTriggers() const final > { > return static_cast<CompositingTriggerFlags>( >@@ -327,7 +332,7 @@ private: > WebCore::Color underlayColor() const final; > > void pageExtendedBackgroundColorDidChange(WebCore::Color) const final; >- >+ > void wheelEventHandlersChanged(bool) final; > > String plugInStartLabelTitle(const String& mimeType) const final; >@@ -407,6 +412,9 @@ private: > mutable bool m_cachedMainFrameHasVerticalScrollbar { false }; > #if ENABLE(GPU_PROCESS) > mutable std::unique_ptr<RemoteRenderingBackendProxy> m_remoteRenderingBackendProxy; >+#if ENABLE(WEBGL) >+ mutable std::unique_ptr<RemoteGraphicsContextGLProxy> m_RemoteGraphicsContextGLProxy; >+#endif > #endif > WebPage& m_page; > }; >diff --git a/Source/WebKit/WebProcess/WebPage/IPCTestingAPI.cpp b/Source/WebKit/WebProcess/WebPage/IPCTestingAPI.cpp >index 95fcbe7c734613a749b6e7c7cc627184e6b19adc..03cb710f0596bd6631ce2cd1ad7635b87f4eccb5 100644 >--- a/Source/WebKit/WebProcess/WebPage/IPCTestingAPI.cpp >+++ b/Source/WebKit/WebProcess/WebPage/IPCTestingAPI.cpp >@@ -48,6 +48,7 @@ > #include <JavaScriptCore/OpaqueJSString.h> > #include <WebCore/DOMWrapperWorld.h> > #include <WebCore/Frame.h> >+#include <WebCore/RegistrableDomain.h> > #include <WebCore/ScriptController.h> > > namespace WebKit { >@@ -524,13 +525,13 @@ static bool encodeArgument(IPC::Encoder& encoder, JSIPC& jsIPC, JSContextRef con > > if (type == "RegistrableDomain") { > if (jsValue.isUndefinedOrNull()) { >- encoder << RegistrableDomain { }; >+ encoder << WebCore::RegistrableDomain { }; > return true; > } > auto string = jsValue.toWTFString(globalObject); > if (scope.exception()) > return false; >- encoder << RegistrableDomain { URL { URL { }, string } }; >+ encoder << WebCore::RegistrableDomain { URL { URL { }, string } }; > return true; > } > >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >index 15c6ff7f974fd700ef8c37ab5330f19376fc45d5..2f3e6cc19f9067e5dbf582275236e55f0d3844c5 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >@@ -420,6 +420,9 @@ WebPage::WebPage(PageIdentifier pageID, WebPageCreationParameters&& parameters) > , m_alwaysShowsHorizontalScroller { parameters.alwaysShowsHorizontalScroller } > , m_alwaysShowsVerticalScroller { parameters.alwaysShowsVerticalScroller } > , m_shouldRenderCanvasInGPUProcess { parameters.shouldRenderCanvasInGPUProcess } >+#if ENABLE(WEBGL) >+ , m_shouldRenderWebGLInGPUProcess { parameters.shouldRenderWebGLInGPUProcess} >+#endif > #if ENABLE(APP_BOUND_DOMAINS) > , m_needsInAppBrowserPrivacyQuirks { parameters.needsInAppBrowserPrivacyQuirks } > #endif >@@ -553,7 +556,7 @@ WebPage::WebPage(PageIdentifier pageID, WebPageCreationParameters&& parameters) > #if ENABLE(APPLICATION_MANIFEST) > pageConfiguration.applicationManifest = parameters.applicationManifest; > #endif >- >+ > #if PLATFORM(IOS_FAMILY) && ENABLE(DEVICE_ORIENTATION) > pageConfiguration.deviceOrientationUpdateProvider = WebDeviceOrientationUpdateProvider::create(*this); > #endif >@@ -672,7 +675,7 @@ WebPage::WebPage(PageIdentifier pageID, WebPageCreationParameters&& parameters) > setSizeToContentAutoSizeMaximumSize(parameters.sizeToContentAutoSizeMaximumSize); > setAutoSizingShouldExpandToViewHeight(parameters.autoSizingShouldExpandToViewHeight); > setViewportSizeForCSSViewportUnits(parameters.viewportSizeForCSSViewportUnits); >- >+ > setScrollPinningBehavior(parameters.scrollPinningBehavior); > if (parameters.scrollbarOverlayStyle) > m_scrollbarOverlayStyle = static_cast<ScrollbarOverlayStyle>(parameters.scrollbarOverlayStyle.value()); >@@ -682,12 +685,12 @@ WebPage::WebPage(PageIdentifier pageID, WebPageCreationParameters&& parameters) > setTopContentInset(parameters.topContentInset); > > m_userAgent = parameters.userAgent; >- >+ > if (!parameters.itemStates.isEmpty()) > restoreSessionInternal(parameters.itemStates, parameters.itemStatesWereRestoredByAPIRequest ? WasRestoredByAPIRequest::Yes : WasRestoredByAPIRequest::No, WebBackForwardListProxy::OverwriteExistingItem::Yes); > > m_drawingArea->enablePainting(); >- >+ > setMediaVolume(parameters.mediaVolume); > > setMuted(parameters.muted); >@@ -724,7 +727,7 @@ WebPage::WebPage(PageIdentifier pageID, WebPageCreationParameters&& parameters) > m_page->settings().setMediaKeysStorageDirectory(manager->mediaKeyStorageDirectory()); > #endif > m_page->settings().setAppleMailPaginationQuirkEnabled(parameters.appleMailPaginationQuirkEnabled); >- >+ > if (parameters.viewScaleFactor != 1) > scaleView(parameters.viewScaleFactor); > >@@ -917,7 +920,7 @@ WebPage::~WebPage() > } > > platformDetach(); >- >+ > m_sandboxExtensionTracker.invalidate(); > > for (auto* pluginView : m_pluginViews) >@@ -933,7 +936,7 @@ WebPage::~WebPage() > #ifndef NDEBUG > webPageCounter.decrement(); > #endif >- >+ > #if ENABLE(VIDEO_PRESENTATION_MODE) > if (m_playbackSessionManager) > m_playbackSessionManager->invalidate(); >@@ -1338,7 +1341,7 @@ void WebPage::executeEditingCommand(const String& commandName, const String& arg > pluginView->handleEditingCommand(commandName, argument); > return; > } >- >+ > frame.editor().command(commandName).execute(argument); > } > >@@ -1381,11 +1384,11 @@ bool WebPage::isEditingCommandEnabled(const String& commandName) > > if (PluginView* pluginView = focusedPluginViewForFrame(frame)) > return pluginView->isEditingCommandEnabled(commandName); >- >+ > Editor::Command command = frame.editor().command(commandName); > return command.isSupported() && command.isEnabled(); > } >- >+ > void WebPage::clearMainFrameName() > { > if (Frame* frame = mainFrame()) >@@ -1674,7 +1677,7 @@ void WebPage::loadAlternateHTML(LoadParameters&& loadParameters) > URL unreachableURL = loadParameters.unreachableURLString.isEmpty() ? URL() : URL(URL(), loadParameters.unreachableURLString); > URL provisionalLoadErrorURL = loadParameters.provisionalLoadErrorURLString.isEmpty() ? URL() : URL(URL(), loadParameters.provisionalLoadErrorURLString); > auto sharedBuffer = SharedBuffer::create(reinterpret_cast<const char*>(loadParameters.data.data()), loadParameters.data.size()); >- m_mainFrame->coreFrame()->loader().setProvisionalLoadErrorBeingHandledURL(provisionalLoadErrorURL); >+ m_mainFrame->coreFrame()->loader().setProvisionalLoadErrorBeingHandledURL(provisionalLoadErrorURL); > loadDataImpl(loadParameters.navigationID, loadParameters.shouldTreatAsContinuingLoad, WTFMove(loadParameters.websitePolicies), WTFMove(sharedBuffer), loadParameters.MIMEType, loadParameters.encodingName, baseURL, unreachableURL, loadParameters.userData, loadParameters.isNavigatingToAppBoundDomain); > m_mainFrame->coreFrame()->loader().setProvisionalLoadErrorBeingHandledURL({ }); > } >@@ -1857,7 +1860,7 @@ void WebPage::scrollMainFrameIfNotAtMaxScrollPosition(const IntSize& scrollOffse > ScrollPosition scrollPosition = frameView->scrollPosition(); > ScrollPosition maximumScrollPosition = frameView->maximumScrollPosition(); > >- // If the current scroll position in a direction is the max scroll position >+ // If the current scroll position in a direction is the max scroll position > // we don't want to scroll at all. > IntSize newScrollOffset; > if (scrollPosition.x() < maximumScrollPosition.x()) >@@ -1976,19 +1979,19 @@ static void dumpHistoryItem(HistoryItem& item, size_t indent, bool isCurrentItem > stringBuilder.append(url.string().substring(start)); > } else > stringBuilder.append(url.string()); >- >+ > auto& target = item.target(); > if (target.length()) { > stringBuilder.appendLiteral(" (in frame \""); > stringBuilder.append(target); > stringBuilder.appendLiteral("\")"); > } >- >+ > if (item.isTargetItem()) > stringBuilder.appendLiteral(" **nav target**"); >- >+ > stringBuilder.append('\n'); >- >+ > Vector<Ref<HistoryItem>> children; > children.reserveInitialCapacity(item.children().size()); > for (auto& child : item.children()) >@@ -2006,7 +2009,7 @@ String WebPage::dumpHistoryForTesting(const String& directory) > return { }; > > auto& list = m_page->backForward(); >- >+ > StringBuilder builder; > int begin = -list.backCount(); > if (list.itemAtIndex(begin)->url() == aboutBlankURL()) >@@ -2275,12 +2278,12 @@ void WebPage::setSuppressScrollbarAnimations(bool suppressAnimations) > { > m_page->setShouldSuppressScrollbarAnimations(suppressAnimations); > } >- >+ > void WebPage::setEnableVerticalRubberBanding(bool enableVerticalRubberBanding) > { > m_page->setVerticalScrollElasticity(enableVerticalRubberBanding ? ScrollElasticityAllowed : ScrollElasticityNone); > } >- >+ > void WebPage::setEnableHorizontalRubberBanding(bool enableHorizontalRubberBanding) > { > m_page->setHorizontalScrollElasticity(enableHorizontalRubberBanding ? ScrollElasticityAllowed : ScrollElasticityNone); >@@ -2603,7 +2606,7 @@ WebContextMenu* WebPage::contextMenuAtPointInWindow(const IntPoint& point) > } > #endif > >-// Events >+// Events > > static const WebEvent* g_currentEvent = 0; > >@@ -3269,7 +3272,7 @@ void WebPage::updateIsInWindow(bool isInitialState) > if (!isInWindow) { > m_setCanStartMediaTimer.stop(); > m_page->setCanStartMedia(false); >- >+ > // The WebProcess does not yet know about this page; no need to tell it we're leaving the window. > if (!isInitialState) > WebProcess::singleton().pageWillLeaveWindow(m_identifier); >@@ -3313,7 +3316,7 @@ void WebPage::setActivityState(OptionSet<ActivityState::Flag> activityState, Act > SetForScope<OptionSet<ActivityState::Flag>> currentlyChangingActivityState { m_lastActivityStateChanges, changed }; > m_page->setActivityState(activityState); > } >- >+ > for (auto* pluginView : m_pluginViews) > pluginView->activityStateDidChange(changed); > >@@ -3454,14 +3457,14 @@ IntPoint WebPage::screenToRootView(const IntPoint& point) > sendSync(Messages::WebPageProxy::ScreenToRootView(point), Messages::WebPageProxy::ScreenToRootView::Reply(windowPoint)); > return windowPoint; > } >- >+ > IntRect WebPage::rootViewToScreen(const IntRect& rect) > { > IntRect screenRect; > sendSync(Messages::WebPageProxy::RootViewToScreen(rect), Messages::WebPageProxy::RootViewToScreen::Reply(screenRect)); > return screenRect; > } >- >+ > IntPoint WebPage::accessibilityScreenToRootView(const IntPoint& point) > { > IntPoint windowPoint; >@@ -3910,7 +3913,7 @@ void WebPage::layoutIfNeeded() > { > m_page->layoutIfNeeded(); > } >- >+ > void WebPage::updateRendering() > { > m_page->updateRendering(); >@@ -4086,7 +4089,7 @@ void WebPage::performDragControllerAction(DragControllerAction action, const Web > m_page->dragController().dragExited(dragData); > send(Messages::WebPageProxy::DidPerformDragControllerAction(WTF::nullopt, DragHandlingMethod::None, false, 0, { }, { })); > return; >- >+ > case DragControllerAction::PerformDragOperation: { > ASSERT(!m_pendingDropSandboxExtension); > >@@ -4152,7 +4155,7 @@ void WebPage::dragCancelled() > m_isStartingDrag = false; > m_page->mainFrame().eventHandler().dragCancelled(); > } >- >+ > #endif // ENABLE(DRAG_SUPPORT) > > WebUndoStep* WebPage::webUndoStep(WebUndoStepID stepID) >@@ -4505,7 +4508,7 @@ void WebPage::capitalizeWord() > m_page->focusController().focusedOrMainFrame().editor().capitalizeWord(); > } > #endif >- >+ > void WebPage::setTextForActivePopupMenu(int32_t index) > { > if (!m_activePopupMenu) >@@ -4586,7 +4589,7 @@ void WebPage::updateMainFrameScrollOffsetPinning() > > if (isPinnedToLeftSide != m_cachedMainFrameIsPinnedToLeftSide || isPinnedToRightSide != m_cachedMainFrameIsPinnedToRightSide || isPinnedToTopSide != m_cachedMainFrameIsPinnedToTopSide || isPinnedToBottomSide != m_cachedMainFrameIsPinnedToBottomSide) { > send(Messages::WebPageProxy::DidChangeScrollOffsetPinningForMainFrame(isPinnedToLeftSide, isPinnedToRightSide, isPinnedToTopSide, isPinnedToBottomSide)); >- >+ > m_cachedMainFrameIsPinnedToLeftSide = isPinnedToLeftSide; > m_cachedMainFrameIsPinnedToRightSide = isPinnedToRightSide; > m_cachedMainFrameIsPinnedToTopSide = isPinnedToTopSide; >@@ -4654,7 +4657,7 @@ void WebPage::windowAndViewFramesChanged(const FloatRect& windowFrameInScreenCoo > m_windowFrameInUnflippedScreenCoordinates = windowFrameInUnflippedScreenCoordinates; > m_viewFrameInWindowCoordinates = viewFrameInWindowCoordinates; > m_accessibilityPosition = accessibilityViewCoordinates; >- >+ > // Tell all our plug-in views that the window and view frames have changed. > for (auto* pluginView : m_pluginViews) > pluginView->windowAndViewFramesChanged(enclosingIntRect(windowFrameInScreenCoordinates), enclosingIntRect(viewFrameInWindowCoordinates)); >@@ -4718,7 +4721,7 @@ void WebPage::didReceiveMessage(IPC::Connection& connection, IPC::Decoder& decod > } > > void WebPage::didReceiveSyncMessage(IPC::Connection& connection, IPC::Decoder& decoder, std::unique_ptr<IPC::Encoder>& replyEncoder) >-{ >+{ > didReceiveSyncWebPageMessage(connection, decoder, replyEncoder); > } > >@@ -5380,7 +5383,7 @@ FrameView* WebPage::mainFrameView() const > { > if (Frame* frame = mainFrame()) > return frame->view(); >- >+ > return nullptr; > } > >@@ -5469,7 +5472,7 @@ void WebPage::insertTextAsync(const String& text, const EditingRange& replacemen > replacesText = replacementEditingRange.length; > } > } >- >+ > if (options.registerUndoGroup) > send(Messages::WebPageProxy::RegisterInsertionUndoGrouping()); > >@@ -6012,7 +6015,7 @@ void WebPage::didCommitLoad(WebFrame* frame) > #if ENABLE(RESOURCE_LOAD_STATISTICS) > clearLoadedSubresourceDomains(); > #endif >- >+ > // If previous URL is invalid, then it's not a real page that's being navigated away from. > // Most likely, this is actually the first load to be committed in this page. > if (frame->coreFrame()->loader().previousURL().isValid()) >@@ -6057,7 +6060,7 @@ void WebPage::didCommitLoad(WebFrame* frame) > #if ENABLE(META_VIEWPORT) > resetViewportDefaultConfiguration(frame); > const Frame* coreFrame = frame->coreFrame(); >- >+ > bool viewportChanged = false; > > LOG_WITH_STREAM(VisibleRects, stream << "WebPage " << m_identifier.toUInt64() << " didCommitLoad setting content size to " << coreFrame->view()->contentsSize()); >@@ -6178,7 +6181,7 @@ void WebPage::determinePrimarySnapshottedPlugInTimerFired() > { > if (!m_page) > return; >- >+ > Settings& settings = m_page->settings(); > if (!settings.snapshotAllPlugIns() && settings.primaryPlugInSnapshotDetectionEnabled()) > determinePrimarySnapshottedPlugIn(); >@@ -6443,7 +6446,7 @@ void WebPage::updateWebsitePolicies(WebsitePoliciesData&& websitePolicies) > > m_allowsContentJavaScriptFromMostRecentNavigation = websitePolicies.allowsContentJavaScript; > WebsitePoliciesData::applyToDocumentLoader(WTFMove(websitePolicies), *documentLoader); >- >+ > #if ENABLE(VIDEO) > m_page->updateMediaElementRateChangeRestrictions(); > #endif >@@ -6478,7 +6481,7 @@ void WebPage::stopExtendingIncrementalRenderingSuppression(unsigned token) > > m_page->mainFrame().view()->setVisualUpdatesAllowedByClient(!shouldExtendIncrementalRenderingSuppression()); > } >- >+ > void WebPage::setScrollPinningBehavior(uint32_t pinning) > { > m_scrollPinningBehavior = static_cast<ScrollPinningBehavior>(pinning); >@@ -6666,7 +6669,7 @@ void WebPage::dispatchDidReachLayoutMilestone(OptionSet<WebCore::LayoutMilestone > > // The drawing area might want to defer dispatch of didLayout to the UI process. > if (m_drawingArea) { >- static auto paintMilestones = OptionSet<WebCore::LayoutMilestone> { DidHitRelevantRepaintedObjectsAreaThreshold, DidFirstFlushForHeaderLayer, DidFirstPaintAfterSuppressedIncrementalRendering, DidRenderSignificantAmountOfText, DidFirstMeaningfulPaint }; >+ static auto paintMilestones = OptionSet<WebCore::LayoutMilestone> { DidHitRelevantRepaintedObjectsAreaThreshold, DidFirstFlushForHeaderLayer, DidFirstPaintAfterSuppressedIncrementalRendering, DidRenderSignificantAmountOfText, DidFirstMeaningfulPaint }; > auto drawingAreaRelatedMilestones = milestones & paintMilestones; > if (drawingAreaRelatedMilestones && m_drawingArea->addMilestonesToDispatch(drawingAreaRelatedMilestones)) > milestones.remove(drawingAreaRelatedMilestones); >@@ -6753,10 +6756,10 @@ void WebPage::urlSchemeTaskDidPerformRedirection(uint64_t handlerIdentifier, uin > { > auto* handler = m_identifierToURLSchemeHandlerProxyMap.get(handlerIdentifier); > ASSERT(handler); >- >+ > handler->taskDidPerformRedirection(taskIdentifier, WTFMove(response), WTFMove(request)); > } >- >+ > void WebPage::urlSchemeTaskDidReceiveResponse(uint64_t handlerIdentifier, uint64_t taskIdentifier, const ResourceResponse& response) > { > auto* handler = m_identifierToURLSchemeHandlerProxyMap.get(handlerIdentifier); >@@ -6911,7 +6914,7 @@ void WebPage::shouldAllowDeviceOrientationAndMotionAccess(FrameIdentifier frameI > sendWithAsyncReply(Messages::WebPageProxy::ShouldAllowDeviceOrientationAndMotionAccess(frameID, WTFMove(frameInfo), mayPrompt), WTFMove(completionHandler)); > } > #endif >- >+ > void WebPage::showShareSheet(ShareDataWithParsedURL& shareData, WTF::CompletionHandler<void(bool)>&& callback) > { > sendWithAsyncReply(Messages::WebPageProxy::ShowShareSheet(WTFMove(shareData)), WTFMove(callback)); >@@ -7235,6 +7238,13 @@ bool WebPage::shouldUseRemoteRenderingFor(RenderingPurpose purpose) > return false; > } > >+#if ENABLE(WEBGL) >+bool WebPage::shouldUseRemoteWebGL() >+{ >+ return m_shouldRenderWebGLInGPUProcess; >+} >+#endif >+ > #if ENABLE(MEDIA_USAGE) > void WebPage::addMediaUsageManagerSession(MediaSessionIdentifier identifier, const String& bundleIdentifier, const URL& pageURL) > { >@@ -7264,7 +7274,7 @@ void WebPage::animationDidFinishForElement(const WebCore::Element&) > void WebPage::setIsNavigatingToAppBoundDomain(Optional<NavigatingToAppBoundDomain> isNavigatingToAppBoundDomain, WebFrame* frame) > { > frame->setIsNavigatingToAppBoundDomain(isNavigatingToAppBoundDomain); >- >+ > m_navigationHasOccured = true; > } > >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.h b/Source/WebKit/WebProcess/WebPage/WebPage.h >index b450544560d95adaf810496f08bbda974251d409..add1be1e37b1a22bb4e71aacfa9159c6ae3ebc95 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.h >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.h >@@ -518,7 +518,7 @@ public: > WebCore::WebGLLoadPolicy webGLPolicyForURL(WebFrame*, const URL&); > WebCore::WebGLLoadPolicy resolveWebGLPolicyForURL(WebFrame*, const URL&); > #endif >- >+ > enum class ShouldPerformLayout { Default, Yes }; > EditorState editorState(ShouldPerformLayout = ShouldPerformLayout::Default) const; > void updateEditorStateAfterLayoutIfEditabilityChanged(); >@@ -569,10 +569,10 @@ public: > void listenForLayoutMilestones(OptionSet<WebCore::LayoutMilestone>); > > void setSuppressScrollbarAnimations(bool); >- >+ > void setEnableVerticalRubberBanding(bool); > void setEnableHorizontalRubberBanding(bool); >- >+ > void setBackgroundExtendsBeyondPage(bool); > > void setPaginationMode(uint32_t /* WebCore::Pagination::Mode */); >@@ -580,7 +580,7 @@ public: > void setPageLength(double); > void setGapBetweenPages(double); > void setPaginationLineGridEnabled(bool); >- >+ > void postInjectedBundleMessage(const String& messageName, const UserData&); > > void setUnderlayColor(const WebCore::Color& color) { m_underlayColor = color; } >@@ -617,7 +617,7 @@ public: > #if PLATFORM(MAC) > void setTopOverhangImage(WebImage*); > void setBottomOverhangImage(WebImage*); >- >+ > void setUseSystemAppearance(bool); > > void didEndMagnificationGesture(); >@@ -636,7 +636,7 @@ public: > > void hidePageBanners(); > void showPageBanners(); >- >+ > void setHeaderBannerHeightForTesting(int); > void setFooterBannerHeightForTesting(int); > #endif >@@ -645,7 +645,7 @@ public: > WebCore::IntRect rootViewToScreen(const WebCore::IntRect&); > WebCore::IntPoint accessibilityScreenToRootView(const WebCore::IntPoint&); > WebCore::IntRect rootViewToAccessibilityScreen(const WebCore::IntRect&); >- >+ > RefPtr<WebImage> scaledSnapshotWithOptions(const WebCore::IntRect&, double additionalScaleFactor, SnapshotOptions); > > static const WebEvent* currentEvent(); >@@ -695,7 +695,7 @@ public: > WebCore::FloatSize overrideScreenSize() const; > int32_t deviceOrientation() const { return m_deviceOrientation; } > void didReceiveMobileDocType(bool); >- >+ > bool screenIsBeingCaptured() const { return m_screenIsBeingCaptured; } > void setScreenIsBeingCaptured(bool); > >@@ -873,7 +873,7 @@ public: > WKAccessibilityWebPageObject* accessibilityRemoteObject(); > NSObject *accessibilityObjectForMainFramePlugin(); > const WebCore::FloatPoint& accessibilityPosition() const { return m_accessibilityPosition; } >- >+ > void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput); > > void setTextAsync(const String&); >@@ -1045,7 +1045,7 @@ public: > bool hardwareKeyboardIsAttached() const { return m_keyboardIsAttached; } > > void updateStringForFind(const String&); >- >+ > bool canShowWhileLocked() const { return m_canShowWhileLocked; } > #endif > >@@ -1149,7 +1149,7 @@ public: > > void getBytecodeProfile(CallbackID); > void getSamplingProfilerOutput(CallbackID); >- >+ > #if ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION) > void handleTelephoneNumberClick(const String& number, const WebCore::IntPoint&); > void handleSelectionServiceClick(WebCore::FrameSelection&, const Vector<String>& telephoneNumbers, const WebCore::IntPoint&); >@@ -1198,7 +1198,7 @@ public: > #if ENABLE(GAMEPAD) > void gamepadActivity(const Vector<GamepadData>&, WebCore::EventMakesGamepadsVisible); > #endif >- >+ > #if ENABLE(POINTER_LOCK) > void didAcquirePointerLock(); > void didNotAcquirePointerLock(); >@@ -1243,7 +1243,7 @@ public: > > void showShareSheet(WebCore::ShareDataWithParsedURL&, CompletionHandler<void(bool)>&& callback); > void showContactPicker(const WebCore::ContactsRequestData&, CompletionHandler<void(Optional<Vector<WebCore::ContactInfo>>&&)>&&); >- >+ > #if ENABLE(ATTACHMENT_ELEMENT) > void insertAttachment(const String& identifier, Optional<uint64_t>&& fileSize, const String& fileName, const String& contentType, CallbackID); > void updateAttachmentAttributes(const String& identifier, Optional<uint64_t>&& fileSize, const String& contentType, const String& fileName, const IPC::DataReference& enclosingImageData, CallbackID); >@@ -1328,7 +1328,7 @@ public: > static WebCore::IntRect rootViewInteractionBoundsForElement(const WebCore::Element&); > > InteractionInformationAtPosition positionInformation(const InteractionInformationRequest&); >- >+ > #endif // PLATFORM(IOS_FAMILY) > > #if USE(QUICK_LOOK) >@@ -1362,7 +1362,9 @@ public: > #endif > > bool shouldUseRemoteRenderingFor(WebCore::RenderingPurpose); >- >+#if ENABLE(WEBGL) >+ bool shouldUseRemoteWebGL(); >+#endif > #if ENABLE(MEDIA_USAGE) > void addMediaUsageManagerSession(WebCore::MediaSessionIdentifier, const String&, const URL&); > void updateMediaUsageManagerSessionState(WebCore::MediaSessionIdentifier, const WebCore::MediaUsageInfo&); >@@ -1675,7 +1677,7 @@ private: > > bool shouldDispatchSyntheticMouseEventsWhenModifyingSelection() const; > void platformDidSelectAll(); >- >+ > void setHasResourceLoadClient(bool); > void setCanUseCredentialStorage(bool); > >@@ -1822,7 +1824,7 @@ private: > bool m_isInRedo { false }; > bool m_isClosed { false }; > bool m_tabToLinks { false }; >- >+ > bool m_asynchronousPluginInitializationEnabled { false }; > bool m_asynchronousPluginInitializationEnabledForAllPlugins { false }; > bool m_artificialPluginInitializationDelayEnabled { false }; >@@ -1833,6 +1835,9 @@ private: > bool m_alwaysShowsVerticalScroller { false }; > > bool m_shouldRenderCanvasInGPUProcess { false }; >+#if ENABLE(WEBGL) >+ bool m_shouldRenderWebGLInGPUProcess { false }; >+#endif > #if ENABLE(APP_BOUND_DOMAINS) > bool m_needsInAppBrowserPrivacyQuirks { false }; > #endif >@@ -1864,7 +1869,7 @@ private: > > // The accessibility position of the view. > WebCore::FloatPoint m_accessibilityPosition; >- >+ > RetainPtr<WKAccessibilityWebPageObject> m_mockAccessibilityElement; > #endif > >@@ -2041,7 +2046,7 @@ private: > > bool m_isShowingInputViewForFocusedElement { false }; > bool m_hasHandledSyntheticClick { false }; >- >+ > enum SelectionAnchor { Start, End }; > SelectionAnchor m_selectionAnchor { Start }; > >@@ -2094,7 +2099,7 @@ private: > > HashSet<unsigned> m_activeRenderingSuppressionTokens; > unsigned m_maximumRenderingSuppressionToken { 0 }; >- >+ > WebCore::ScrollPinningBehavior m_scrollPinningBehavior { WebCore::DoNotPin }; > Optional<WebCore::ScrollbarOverlayStyle> m_scrollbarOverlayStyle; > >@@ -2174,7 +2179,7 @@ private: > #if PLATFORM(GTK) > String m_themeName; > #endif >- >+ > #if ENABLE(APP_BOUND_DOMAINS) > bool m_limitsNavigationsToAppBoundDomains { false }; > bool m_navigationHasOccured { false }; >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index e7ba4b28b4f381aae6b5b7950bf8429737e78956..1eafe4242b3349b7bae48a845da87f70c7f3376a 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,18 @@ >+2020-11-03 Kimmo Kinnunen <kkinnunen@apple.com> >+ >+ Implement RemoteGraphicsContextGL >+ https://bugs.webkit.org/show_bug.cgi?id=217216 >+ <rdar://problem/69876258> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Implements a remote version of GraphicsContextGL for GPU process. >+ Current implementation is using WebKit IPC and is incomplete. >+ >+ Add the code generator to generate the implementation. >+ >+ * Scripts/generate-gpup-webgl: Added. >+ > 2020-10-28 Aakash Jain <aakash_jain@apple.com> > > [build.webkit.org] loadConfig unittest fail depending on locally installed version of buildbot >diff --git a/Tools/Scripts/generate-gpup-webgl b/Tools/Scripts/generate-gpup-webgl >new file mode 100755 >index 0000000000000000000000000000000000000000..0bfeea7f0339ca8eade3f46244aedd8f2352e114 >--- /dev/null >+++ b/Tools/Scripts/generate-gpup-webgl >@@ -0,0 +1,361 @@ >+#!/usr/bin/env python3 >+# -*- coding: utf-8 -*- >+# >+# Copyright (C) 2020 Apple Inc. All rights reserved. >+# >+# Redistribution and use in source and binary forms, with or without >+# modification, are permitted provided that the following conditions >+# are met: >+# >+# 1. Redistributions of source code must retain the above copyright >+# notice, this list of conditions and the following disclaimer. >+# 2. Redistributions in binary form must reproduce the above copyright >+# notice, this list of conditions and the following disclaimer in the >+# documentation and/or other materials provided with the distribution. >+# >+# THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ >+ >+# This script generates the source files for WebGL GPU process IPC. >+import argparse >+import pathlib >+import re >+import sys >+ >+from typing import List, Dict >+ >+root_dir = (pathlib.Path(__file__).parent / ".." / "..").resolve() >+functions_input_fns = [ >+ root_dir / 'Source' / 'WebCore' / 'platform' / 'graphics' / 'GraphicsContextGL.h', >+ root_dir / 'Source' / 'WebCore' / 'platform' / 'graphics' / 'ExtensionsGL.h', >+] >+types_input_fn = root_dir / 'Source' / 'WebCore' / 'platform' / 'graphics' / 'GraphicsTypesGL.h' >+ >+template_preamble = """ >+/* Copyright (C) 2020 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND >+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR >+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL >+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR >+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER >+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, >+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+// This file is generated by generate-gpup-webgl. Do not edit. >+""" >+context_functions_fn = root_dir / 'Source' / 'WebKit' / 'GPUProcess' / 'graphics' / 'RemoteGraphicsContextGLFunctionsGenerated.h' >+context_functions_template = template_preamble + """ >+// This file should be included in the private section of the >+// RemoteGraphicsContextGL implementations. >+#pragma once >+{} >+ >+""" >+context_messages_fn = root_dir / 'Source' / 'WebKit' / 'GPUProcess' / 'graphics' / 'RemoteGraphicsContextGL.messages.in' >+context_messages_template = template_preamble + """ >+#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL) >+ >+messages -> RemoteGraphicsContextGL NotRefCounted {{{} >+}} >+ >+#endif >+ >+""" >+ >+context_proxy_functions_fn = root_dir / 'Source' / 'WebKit' / 'WebProcess' / 'GPU' / 'graphics' / 'RemoteGraphicsContextGLProxyFunctionsGenerated.h' >+context_proxy_functions_template = template_preamble + """ >+// This file should be included in the public section of the >+// RemoteGraphicsContextGLProxy implementations. >+#pragma once >+{} >+""" >+ >+def write_file(fn, new_contents): >+ old_contents = "" >+ with open(fn) as f: >+ old_contents = f.read() >+ if old_contents == new_contents: >+ return >+ with open(fn, "w") as f: >+ f.write(new_contents) >+ >+class cmd_type(object): >+ type_name : str >+ def __init__(self, type_name_spec : str): >+ self.type_name = type_name_spec.strip() >+ def __str__(self): >+ return "{}".format(self.type_name) >+ >+class cmd_arg(object): >+ name : str >+ type : cmd_type >+ def __init__(self, arg_spec : str, arg_index : int): >+ r = arg_spec.rsplit(' ', 1) >+ if len(r) > 1 and r[0] != 'const': >+ self.name = r[1].strip() >+ self.type = cmd_type(r[0]) >+ else: >+ self.name = 'arg{}'.format(arg_index) >+ self.type = cmd_type(arg_spec) >+ def __str__(self): >+ return "{}-{}".format(self.type, self.name) >+ >+class cmd(object): >+ name: str >+ args: List[cmd_arg] >+ return_type: cmd_type >+ def __init__(self, name: str, return_spec: str, args_specs : str, is_extension : bool): >+ self.name = name >+ self.return_type = cmd_type(return_spec) >+ self.args = [cmd_arg(arg_spec=e, arg_index=i) for i, e in enumerate(args_specs)] >+ self.is_extension = is_extension >+ def __str__(self): >+ return '{} {} {}'.format(self.return_type, self.name, ' '.join(str(a) for a in self.args)) >+ >+class webkit_ipc_conversion(object): >+ type_name : str >+ def __init__(self, type_name): >+ self.type_name = type_name >+ def get_type_conversion(self, arg : cmd_arg, name : str): >+ return name >+ def get_message_type_name(self, type : cmd_type): >+ return self.type_name >+ def get_message_type_conversion(self, type : cmd_type, name : str): >+ return name >+ >+class webkit_ipc_implicit_conversion(webkit_ipc_conversion): >+ """Conversion for interface has type which implicitly maps to correct sized >+ IPC type. Like: GCGLint -> int32_t >+ """ >+ pass >+class webkit_ipc_static_conversion(webkit_ipc_conversion): >+ """Conversion for interface type which has the same size as the preferred >+ sized IPC type, but conversion needs a cast. Like: `GCGLintptr` is a >+ `intptr_t` which is a `long`. Nothing in cstdint sized types match `long. >+ Preferred type is uint64_t which is a `unsigned long long`.""" >+ def get_type_conversion(self, type : cmd_type, name : str): >+ if type.type_name == "GCGLsync": >+ return f"static_cast<{type.type_name}>(reinterpret_cast<intptr_t>({name}))" >+ return f"static_cast<{type.type_name}>({name})" >+ def get_message_type_conversion(self, type : cmd_type, name : str): >+ if type.type_name == "GCGLsync": >+ return f"static_cast<{self.type_name}>(reinterpret_cast<intptr_t>({name}))" >+ return f"static_cast<{self.type_name}>({name})" >+class webkit_ipc_value_conversion(webkit_ipc_conversion): >+ """Conversion for interface type which has is a reference type >+ that maps to a value type in IPC definition. Like: >+ `const String&` -> `String`.""" >+ def get_message_type_name(self, type : cmd_type): >+ # Convert "const Type&" to "Type". >+ return self.type_name.split(" ")[1][:-1] >+ >+webkit_ipc_primitive_types_predefined = { >+ 'const String&' : webkit_ipc_value_conversion('const String&'), >+} >+ >+class webkit_ipc_generator(object): >+ cmds : List[cmd] >+ ipc_primitive_types : Dict[str, webkit_ipc_conversion] >+ def __init__(self, cmds : List[cmd], ipc_primitive_types : Dict[str, str]): >+ self.cmds = cmds >+ self.ipc_primitive_types = {**ipc_primitive_types, **webkit_ipc_primitive_types_predefined} >+ def is_implemented_type(self, type : cmd_type): >+ if '*' in type.type_name or '&' in type.type_name: >+ if type.type_name == 'const String&': >+ return True >+ return False >+ if type.type_name == 'GCGLsync': >+ return False >+ return True >+ def is_implemented(self, cmd : cmd): >+ if any(not self.is_implemented_type(a.type) for a in cmd.args): >+ return False >+ if not self.is_implemented_type(cmd.return_type): >+ return False >+ return True >+ def get_function_name(self, cmd : cmd): >+ return cmd.name >+ def get_arg_decls(self, cmd : cmd): >+ return ', '.join([f"{a.type.type_name} {a.name}" for a in cmd.args]) >+ def get_arg_types(self, cmd : cmd): >+ return ', '.join([a.type.type_name for a in cmd.args]) >+ def get_arg_names(self, cmd : cmd): >+ return ', '.join([a.name for a in cmd.args]) >+ def get_type_conversion(self, type : cmd_type, name : str): >+ type_name = type.type_name >+ if type_name in self.ipc_primitive_types: >+ return self.ipc_primitive_types[type_name].get_type_conversion(type, name) >+ return name >+ def get_message_name(self, cmd : cmd): >+ return cmd.name[0].capitalize() + cmd.name[1:] >+ def get_message_type_name(self, type : cmd_type): >+ type_name = type.type_name >+ if type_name in self.ipc_primitive_types: >+ return self.ipc_primitive_types[type_name].get_message_type_name(type) >+ return type_name >+ def get_message_type_conversion(self, type : cmd_type, name : str): >+ type_name = type.type_name >+ if type_name in self.ipc_primitive_types: >+ return self.ipc_primitive_types[type_name].get_message_type_conversion(type, name) >+ return name >+ def get_message_arg_decls(self, cmd : cmd): >+ return [f"{self.get_message_type_name(a.type)} {a.name}" for a in cmd.args] >+ >+class context_proxy_webkit_ipc_generator(webkit_ipc_generator): >+ def get_args_for_send(self, cmd : cmd): >+ return ', '.join([self.get_message_type_conversion(a.type, a.name) for a in cmd.args]) >+ def get_function(self, cmd : cmd): >+ send_name = self.get_message_name(cmd) >+ send_args = self.get_args_for_send(cmd) >+ send_body = [] >+ if cmd.return_type.type_name == "void": >+ send_body = [ f"send(Messages::RemoteGraphicsContextGL::{send_name}({send_args}), m_graphicsContextGLIdentifier);" ] >+ else: >+ send_body = [ >+ f"{self.get_message_type_name(cmd.return_type)} result = {{ }};", >+ f"sendSync(Messages::RemoteGraphicsContextGL::{send_name}({send_args}), Messages::RemoteGraphicsContextGL::{send_name}::Reply(result), m_graphicsContextGLIdentifier, 1_s);", >+ f"return {self.get_type_conversion(cmd.return_type, 'result')};" >+ ] >+ return_type = cmd.return_type >+ body = ''.join(f"\n {b}" for b in send_body) >+ args = self.get_arg_decls(cmd) >+ return f"""\n {return_type} {cmd.name}({args}) final >+ {{{body} >+ }}""" >+ def get_placeholder_function(self, cmd : cmd): >+ body = "" >+ if cmd.return_type.type_name != "void": >+ body = "return { };" >+ return_type = cmd.return_type >+ args = self.get_arg_decls(cmd) >+ return f"\n {return_type} {cmd.name}({args}) final {{ {body} }}" >+ def get_functions(self): >+ r = [] >+ for cmd in self.cmds: >+ if self.is_implemented(cmd): >+ r += [self.get_function(cmd)] >+ else: >+ r += [self.get_placeholder_function(cmd)] >+ return ''.join(r) >+ def generate(self): >+ write_file(context_proxy_functions_fn, context_proxy_functions_template.format(self.get_functions())) >+ >+ >+class context_webkit_ipc_generator(webkit_ipc_generator): >+ def get_function(self, cmd : cmd): >+ call_body = [] >+ ext = "getExtensions()." if cmd.is_extension else "" >+ if cmd.return_type.type_name == "void": >+ call_body = [ f"m_context->{ext}{cmd.name}({self.get_arg_names(cmd)});" ] >+ else: >+ call_body = [ f"completionHandler(m_context->{ext}{cmd.name}({self.get_arg_names(cmd)}));" ] >+ return_type = cmd.return_type >+ arg_decls = self.get_message_arg_decls(cmd) >+ if cmd.return_type.type_name != "void": >+ arg_decls += [f"CompletionHandler<void({self.get_message_type_name(cmd.return_type)})>&& completionHandler"] >+ body = ''.join(f"\n {b}" for b in call_body) >+ return f""" void {self.get_function_name(cmd)}({", ".join(arg_decls)}) >+ {{{body} >+ }}""" >+ def get_functions(self): >+ r = [] >+ for cmd in self.cmds: >+ if self.is_implemented(cmd): >+ r += [self.get_function(cmd)] >+ return '\n'.join(r) >+ def get_message(self, cmd : cmd): >+ arg_decls = ', '.join(self.get_message_arg_decls(cmd)) >+ name = self.get_message_name(cmd) >+ if cmd.return_type.type_name != "void": >+ return f"\n void {name}({arg_decls}) -> ({self.get_message_type_name(cmd.return_type)} result) Synchronous" >+ return f"\n void {name}({arg_decls})" >+ def get_messages(self): >+ r = [] >+ for cmd in self.cmds: >+ if self.is_implemented(cmd): >+ r += [self.get_message(cmd)] >+ return ''.join(r) >+ def generate(self): >+ write_file(context_functions_fn, context_functions_template.format(self.get_functions())) >+ write_file(context_messages_fn, context_messages_template.format(self.get_messages())) >+ >+def main(): >+ parser = argparse.ArgumentParser('usage: %prog [options]') >+ _options = parser.parse_args() >+ cmds = [] >+ for fn in functions_input_fns: >+ is_extension = 'Extension' in str(fn) >+ with open(fn) as f: >+ lines = iter(f.readlines()) >+ for line in lines: >+ if re.match("// WebGL functions. This list is used by generate-gpup-webgl script.", line.strip()): >+ break >+ >+ for line in lines: >+ if re.match("// Other functions.", line.strip()): >+ break >+ m = re.match(r".*virtual (\S+)\s+(\w+)\((.*)\) = 0;", line) >+ if m: >+ args_specs = filter(None, [a.strip() for a in m[3].strip().split(',')]) >+ cmds.append(cmd(name=m[2], return_spec=m[1], args_specs=args_specs, is_extension=is_extension)) >+ ipc_primitive_types = {} >+ with open(types_input_fn) as f: >+ for line in f.readlines(): >+ print(line) >+ m = re.match(r".*static_assert\(std::is_same_v<(\w+), (\w+)>\);", line) >+ if m: >+ ipc_primitive_types[m[1]] = webkit_ipc_implicit_conversion(m[2]) >+ continue >+ m = re.match(r".*static_assert\(sizeof\((\w+)\) == sizeof\((\w+)\)\);", line) >+ if m: >+ ipc_primitive_types[m[1]] = webkit_ipc_static_conversion(m[2]) >+ >+ generators = [ >+ context_proxy_webkit_ipc_generator(cmds, ipc_primitive_types), >+ context_webkit_ipc_generator(cmds, ipc_primitive_types) >+ ] >+ for g in generators: >+ g.generate() >+ >+ implemented = [] >+ unimplemented = [] >+ for c in cmds: >+ if all(g.is_implemented(c) for g in generators): >+ implemented.append(c) >+ else: >+ unimplemented.append(c) >+ print("Implemented:") >+ print(''.join(f" {str(i)}\n" for i in implemented)) >+ print("Unimplemented:") >+ print(''.join(f" {str(u)}\n" for u in unimplemented)) >+ print (f"Implemented: {len(implemented)}, unimplemented: {len(unimplemented)}, total: {len(cmds)}") >+ >+ return 0 >+ >+ >+if __name__ == '__main__': >+ sys.exit(main())
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 217216
:
413049
|
414787
|
414797
|
415024
|
415117
|
415121
|
415122
|
415123
|
415124
|
415125
|
415126
|
415127
|
415128
|
415129
|
415131
|
415135
|
415202
|
415216
|
415218
|
415219
|
415220
|
415221
|
415223
|
415285
|
415297
|
415394
|
415724
|
415727
|
415729
|
415739