Source/WebCore/ChangeLog

 12020-11-03 Kimmo Kinnunen <kkinnunen@apple.com>
 2
 3 Implement RemoteGraphicsContextGL
 4 https://bugs.webkit.org/show_bug.cgi?id=217216
 5 <rdar://problem/69876258>
 6
 7 Reviewed by NOBODY (OOPS!).
 8
 9 Implements a beginning of a remote version of GraphicsContextGL for GPU process.
 10 Current implementation is using WebKit IPC.
 11
 12 Implemented with a generator script implementing the IPC to pass
 13 the GraphicsContextGL member function calls from web process to
 14 the GPU process. The script is run during development time and the
 15 results are committed to the repo for ease of review.
 16
 17 Changes GraphicsContextGL and ExtensionsGL to not have duplicate names
 18 and have the correct function signatures.
 19
 20 Changes few remaining GraphicsContextGL getters to use GCGLSpan form.
 21
 22 Missing:
 23 - Simulated context loss
 24 - Simulated context change
 25 - Paint WebGL contents to 2D canvas
 26 - Upload video to WebGL
 27 - Upload canvas to WebGL
 28
 29 No new tests, tested by existing webgl tests once the implementation works.
 30
 31 * Modules/mediarecorder/MediaRecorderProvider.h:
 32 * SourcesCocoa.txt:
 33 * WebCore.xcodeproj/project.pbxproj:
 34 * html/canvas/WebGLRenderingContextBase.cpp:
 35 (WebCore::WebGLRenderingContextBase::create):
 36 * page/Chrome.cpp:
 37 (WebCore::Chrome::createGraphicsContextGL const):
 38 (WebCore::Chrome::windowScreenDidChange):
 39 * page/Chrome.h:
 40 * page/ChromeClient.h:
 41 (WebCore::ChromeClient::createGraphicsContextGL const):
 42 * platform/HostWindow.h:
 43 * platform/graphics/ExtensionsGL.h:
 44 * platform/graphics/GraphicsContextGL.cpp:
 45 (WebCore::GraphicsContextGL::create):
 46 * platform/graphics/GraphicsContextGL.h:
 47 * platform/graphics/GraphicsTypesGL.h:
 48 * platform/graphics/ImageBuffer.h:
 49 * platform/graphics/PlatformRemoteGraphicsContextGLProxyBase.h: Copied from Source/WebCore/platform/graphics/GraphicsTypesGL.h.
 50 * platform/graphics/RemoteGraphicsContextGLBase.h: Added.
 51 * platform/graphics/angle/ExtensionsGLANGLE.cpp:
 52 (WebCore::ExtensionsGLANGLE::getGraphicsResetStatusARB):
 53 (WebCore::ExtensionsGLANGLE::getTranslatedShaderSourceANGLE):
 54 (WebCore::ExtensionsGLANGLE::blitFramebufferANGLE):
 55 (WebCore::ExtensionsGLANGLE::renderbufferStorageMultisampleANGLE):
 56 (WebCore::ExtensionsGLANGLE::drawArraysInstancedANGLE):
 57 (WebCore::ExtensionsGLANGLE::drawElementsInstancedANGLE):
 58 (WebCore::ExtensionsGLANGLE::vertexAttribDivisorANGLE):
 59 (WebCore::ExtensionsGLANGLE::getUniformfvRobustANGLE):
 60 (WebCore::ExtensionsGLANGLE::getUniformivRobustANGLE):
 61 (WebCore::ExtensionsGLANGLE::readPixelsRobustANGLE):
 62 (WebCore::ExtensionsGLANGLE::texImage2DRobustANGLE):
 63 (WebCore::ExtensionsGLANGLE::texSubImage2DRobustANGLE):
 64 (WebCore::ExtensionsGLANGLE::compressedTexImage2DRobustANGLE):
 65 (WebCore::ExtensionsGLANGLE::compressedTexSubImage2DRobustANGLE):
 66 (WebCore::ExtensionsGLANGLE::compressedTexImage3DRobustANGLE):
 67 (WebCore::ExtensionsGLANGLE::compressedTexSubImage3DRobustANGLE):
 68 (WebCore::ExtensionsGLANGLE::texImage3DRobustANGLE):
 69 (WebCore::ExtensionsGLANGLE::texSubImage3DRobustANGLE):
 70 (WebCore::ExtensionsGLANGLE::getUniformuivRobustANGLE):
 71 (WebCore::ExtensionsGLANGLE::getTexLevelParameterivRobustANGLE):
 72 (WebCore::ExtensionsGLANGLE::getTexLevelParameterfvRobustANGLE):
 73 (WebCore::wipeAlphaChannelFromPixels):
 74 (WebCore::ExtensionsGLANGLE::readnPixelsRobustANGLE):
 75 (WebCore::ExtensionsGLANGLE::getnUniformfvRobustANGLE):
 76 (WebCore::ExtensionsGLANGLE::getnUniformivRobustANGLE):
 77 (WebCore::ExtensionsGLANGLE::getnUniformuivRobustANGLE):
 78 * platform/graphics/angle/ExtensionsGLANGLE.h:
 79 * platform/graphics/cocoa/RemoteGraphicsContextGLProxyBaseCocoa.h: Added.
 80 * platform/graphics/cocoa/RemoteGraphicsContextGLProxyBaseCocoa.mm: Added.
 81 (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::RemoteGraphicsContextGLProxyBaseCocoa):
 82 (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::~RemoteGraphicsContextGLProxyBaseCocoa):
 83 (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::platformGraphicsContextGL const):
 84 (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::platformTexture const):
 85 (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::platformLayer const):
 86 (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::enablePreserveDrawingBuffer):
 87 (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::reshape):
 88 (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::setContextVisibility):
 89 (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::powerPreferenceUsedForCreation const):
 90 (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::isGLES2Compliant const):
 91 (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::synthesizeGLError):
 92 (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::moveErrorsToSyntheticErrorList):
 93 (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::setFailNextGPUStatusCheck):
 94 (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::prepareForDisplay):
 95 (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::markContextChanged):
 96 (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::layerComposited const):
 97 (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::setBuffersToAutoClear):
 98 (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::getBuffersToAutoClear const):
 99 (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::paintRenderingResultsToCanvas):
 100 (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::paintRenderingResultsToImageData):
 101 (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::paintCompositedResultsToCanvas):
 102 (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::markLayerComposited):
 103 (WebCore::RemoteGraphicsContextGLProxyBaseCocoa::simulateContextChanged):
 104 * platform/graphics/coreimage/FilterEffectRendererCoreImage.mm:
 105 * platform/graphics/opengl/ExtensionsGLOpenGL.cpp:
 106 (WebCore::ExtensionsGLOpenGL::drawArraysInstancedANGLE):
 107 * platform/graphics/opengl/ExtensionsGLOpenGLES.cpp:
 108 (WebCore::ExtensionsGLOpenGLES::drawArraysInstancedANGLE):
 109 (WebCore::ExtensionsGLOpenGLES::drawElementsInstancedANGLE):
 110 (WebCore::ExtensionsGLOpenGLES::vertexAttribDivisorANGLE):
 111 * platform/graphics/opengl/GraphicsContextGLOpenGL.h:
 112 * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:
 113 (WebCore::GraphicsContextGLOpenGL::drawArraysInstanced):
 114 (WebCore::GraphicsContextGLOpenGL::drawElementsInstanced):
 115 (WebCore::GraphicsContextGLOpenGL::vertexAttribDivisor):
 116
11172020-11-30 Kimmo Kinnunen <kkinnunen@apple.com>
2118
3119 REGRESSION(r270185) [GTK] Some webgl failures after multivalue setter refactor

Source/WebKit/ChangeLog

 12020-11-03 Kimmo Kinnunen <kkinnunen@apple.com>
 2
 3 Implement RemoteWebGLBackend
 4 https://bugs.webkit.org/show_bug.cgi?id=217216
 5 <rdar://problem/69876258>
 6
 7 Reviewed by NOBODY (OOPS!).
 8
 9 Implements a beginning of a remote version of GraphicsContextGL for GPU process.
 10 Current implementation is using WebKit IPC.
 11
 12 Implemented with a generator script implementing the IPC to pass
 13 the GraphicsContextGL member function calls from web process to
 14 the GPU process. The script is run during development time and the
 15 results are committed to the repo for ease of review.
 16
 17 Changes GraphicsContextGL and ExtensionsGL to not have duplicate names
 18 and have the correct function signatures.
 19
 20 Changes few remaining GraphicsContextGL getters to use GCGLSpan form.
 21
 22 Implements simple getters, multi-value getters, simple calls.
 23 Missing multi-value setters.
 24 Missing readPixels.
 25
 26 Implemented: 190, unimplemented: 103, total: 293
 27
 28 No new tests, tested by existing webgl tests once the implementation works.
 29
 30 * CMakeLists.txt:
 31 * DerivedSources-input.xcfilelist:
 32 * DerivedSources-output.xcfilelist:
 33 * DerivedSources.make:
 34 * GPUProcess/GPUConnectionToWebProcess.cpp:
 35 (WebKit::GPUConnectionToWebProcess::createGraphicsContextGL):
 36 (WebKit::GPUConnectionToWebProcess::releaseGraphicsContextGL):
 37 * GPUProcess/GPUConnectionToWebProcess.h:
 38 * GPUProcess/GPUConnectionToWebProcess.messages.in:
 39 * GPUProcess/graphics/RemoteGraphicsContextGL.cpp: Added.
 40 (WebKit::RemoteGraphicsContextGL::create):
 41 (WebKit::RemoteGraphicsContextGL::RemoteGraphicsContextGL):
 42 (WebKit::RemoteGraphicsContextGL::~RemoteGraphicsContextGL):
 43 (WebKit::RemoteGraphicsContextGL::gpuConnectionToWebProcess const):
 44 (WebKit::RemoteGraphicsContextGL::messageSenderConnection const):
 45 (WebKit::RemoteGraphicsContextGL::messageSenderDestinationID const):
 46 * GPUProcess/graphics/RemoteGraphicsContextGL.h: Added.
 47 * GPUProcess/graphics/RemoteGraphicsContextGL.messages.in: Added.
 48 * GPUProcess/graphics/RemoteGraphicsContextGLFunctionsGenerated.h: Added.
 49 (activeTexture):
 50 (attachShader):
 51 (bindAttribLocation):
 52 (bindBuffer):
 53 (bindFramebuffer):
 54 (bindRenderbuffer):
 55 (bindTexture):
 56 (blendColor):
 57 (blendEquation):
 58 (blendEquationSeparate):
 59 (blendFunc):
 60 (blendFuncSeparate):
 61 (checkFramebufferStatus):
 62 (clear):
 63 (clearColor):
 64 (clearDepth):
 65 (clearStencil):
 66 (colorMask):
 67 (compileShader):
 68 (copyTexImage2D):
 69 (copyTexSubImage2D):
 70 (createBuffer):
 71 (createFramebuffer):
 72 (createProgram):
 73 (createRenderbuffer):
 74 (createShader):
 75 (createTexture):
 76 (cullFace):
 77 (deleteBuffer):
 78 (deleteFramebuffer):
 79 (deleteProgram):
 80 (deleteRenderbuffer):
 81 (deleteShader):
 82 (deleteTexture):
 83 (depthFunc):
 84 (depthMask):
 85 (depthRange):
 86 (detachShader):
 87 (disable):
 88 (disableVertexAttribArray):
 89 (drawArrays):
 90 (drawElements):
 91 (enable):
 92 (enableVertexAttribArray):
 93 (finish):
 94 (flush):
 95 (framebufferRenderbuffer):
 96 (framebufferTexture2D):
 97 (frontFace):
 98 (generateMipmap):
 99 (getAttribLocation):
 100 (getString):
 101 (getError):
 102 (getProgramInfoLog):
 103 (getShaderInfoLog):
 104 (getShaderSource):
 105 (getUniformLocation):
 106 (getVertexAttribOffset):
 107 (hint):
 108 (isBuffer):
 109 (isEnabled):
 110 (isFramebuffer):
 111 (isProgram):
 112 (isRenderbuffer):
 113 (isShader):
 114 (isTexture):
 115 (lineWidth):
 116 (linkProgram):
 117 (pixelStorei):
 118 (polygonOffset):
 119 (renderbufferStorage):
 120 (sampleCoverage):
 121 (scissor):
 122 (shaderSource):
 123 (stencilFunc):
 124 (stencilFuncSeparate):
 125 (stencilMask):
 126 (stencilMaskSeparate):
 127 (stencilOp):
 128 (stencilOpSeparate):
 129 (texParameterf):
 130 (texParameteri):
 131 (uniform1f):
 132 (uniform1i):
 133 (uniform2f):
 134 (uniform2i):
 135 (uniform3f):
 136 (uniform3i):
 137 (uniform4f):
 138 (uniform4i):
 139 (useProgram):
 140 (validateProgram):
 141 (vertexAttrib1f):
 142 (vertexAttrib2f):
 143 (vertexAttrib3f):
 144 (vertexAttrib4f):
 145 (vertexAttribPointer):
 146 (viewport):
 147 (bufferData):
 148 (drawArraysInstanced):
 149 (drawElementsInstanced):
 150 (vertexAttribDivisor):
 151 (createVertexArray):
 152 (deleteVertexArray):
 153 (isVertexArray):
 154 (bindVertexArray):
 155 (copyBufferSubData):
 156 (unmapBuffer):
 157 (blitFramebuffer):
 158 (framebufferTextureLayer):
 159 (readBuffer):
 160 (renderbufferStorageMultisample):
 161 (texStorage2D):
 162 (texStorage3D):
 163 (copyTexSubImage3D):
 164 (getFragDataLocation):
 165 (uniform1ui):
 166 (uniform2ui):
 167 (uniform3ui):
 168 (uniform4ui):
 169 (vertexAttribI4i):
 170 (vertexAttribI4ui):
 171 (vertexAttribIPointer):
 172 (drawRangeElements):
 173 (clearBufferfi):
 174 (createQuery):
 175 (deleteQuery):
 176 (isQuery):
 177 (beginQuery):
 178 (endQuery):
 179 (getQuery):
 180 (createSampler):
 181 (deleteSampler):
 182 (isSampler):
 183 (bindSampler):
 184 (samplerParameteri):
 185 (samplerParameterf):
 186 (createTransformFeedback):
 187 (deleteTransformFeedback):
 188 (isTransformFeedback):
 189 (bindTransformFeedback):
 190 (beginTransformFeedback):
 191 (endTransformFeedback):
 192 (pauseTransformFeedback):
 193 (resumeTransformFeedback):
 194 (bindBufferBase):
 195 (bindBufferRange):
 196 (getUniformBlockIndex):
 197 (getActiveUniformBlockName):
 198 (uniformBlockBinding):
 199 (getGraphicsResetStatusARB):
 200 (blitFramebufferANGLE):
 201 (renderbufferStorageMultisampleANGLE):
 202 (createVertexArrayOES):
 203 (deleteVertexArrayOES):
 204 (isVertexArrayOES):
 205 (bindVertexArrayOES):
 206 (getTranslatedShaderSourceANGLE):
 207 (insertEventMarkerEXT):
 208 (pushGroupMarkerEXT):
 209 (popGroupMarkerEXT):
 210 (drawArraysInstancedANGLE):
 211 (drawElementsInstancedANGLE):
 212 (vertexAttribDivisorANGLE):
 213 * Scripts/webkit/messages.py:
 214 * Shared/WebCoreArgumentCoders.cpp:
 215 (IPC::ArgumentCoder<WebCore::GraphicsContextGLAttributes>::encode):
 216 (IPC::ArgumentCoder<WebCore::GraphicsContextGLAttributes>::decode):
 217 * Shared/WebCoreArgumentCoders.h:
 218 * Shared/WebPageCreationParameters.cpp:
 219 (WebKit::WebPageCreationParameters::encode const):
 220 (WebKit::WebPageCreationParameters::decode):
 221 * Shared/WebPageCreationParameters.h:
 222 * Sources.txt:
 223 * SourcesCocoa.txt:
 224 * UIProcess/WebPageProxy.cpp:
 225 (WebKit::m_limitsNavigationsToAppBoundDomains):
 226 (WebKit::WebPageProxy::setFindClient):
 227 (WebKit::WebPageProxy::launchProcessForReload):
 228 (WebKit::WebPageProxy::reload):
 229 (WebKit::WebPageProxy::handleKeyboardEvent):
 230 (WebKit::WebPageProxy::receivedPolicyDecision):
 231 (WebKit::WebPageProxy::listenForLayoutMilestones):
 232 (WebKit::WebPageProxy::setPaginationLineGridEnabled):
 233 (WebKit::WebPageProxy::getRenderTreeExternalRepresentation):
 234 (WebKit::WebPageProxy::getSourceForFrame):
 235 (WebKit::WebPageProxy::getBytecodeProfile):
 236 (WebKit::WebPageProxy::getSamplingProfilerOutput):
 237 (WebKit::WebPageProxy::getSelectionOrContentsAsString):
 238 (WebKit::WebPageProxy::getSelectionAsWebArchiveData):
 239 (WebKit::WebPageProxy::getMainResourceDataOfFrame):
 240 (WebKit::WebPageProxy::getResourceDataFromFrame):
 241 (WebKit::WebPageProxy::getWebArchiveOfFrame):
 242 (WebKit::WebPageProxy::forceRepaint):
 243 (WebKit::WebPageProxy::didCreateSubframe):
 244 (WebKit::WebPageProxy::didReceiveTitleForFrame):
 245 (WebKit::WebPageProxy::didReachLayoutMilestone):
 246 (WebKit::WebPageProxy::decidePolicyForNavigationAction):
 247 (WebKit::WebPageProxy::nonEphemeralWebPageProxy):
 248 (WebKit::WebPageProxy::logFrameNavigation):
 249 (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
 250 (WebKit::WebPageProxy::decidePolicyForResponseShared):
 251 (WebKit::WebPageProxy::didPerformClientRedirectShared):
 252 (WebKit::WebPageProxy::didPerformServerRedirectShared):
 253 (WebKit::WebPageProxy::setMediaVolume):
 254 (WebKit::WebPageProxy::currentlyProcessedMouseDownEvent):
 255 (WebKit::WebPageProxy::contextMenuItemSelected):
 256 (WebKit::WebPageProxy::didCancelForOpenPanel):
 257 (WebKit::WebPageProxy::processDidBecomeResponsive):
 258 (WebKit::WebPageProxy::resetState):
 259 (WebKit::WebPageProxy::creationParameters):
 260 (WebKit::WebPageProxy::requestNotificationPermission):
 261 (WebKit::WebPageProxy::drawRectToImage):
 262 (WebKit::WebPageProxy::drawPagesToPDF):
 263 (WebKit::WebPageProxy::setScrollPinningBehavior):
 264 (WebKit::WebPageProxy::signedPublicKeyAndChallengeString):
 265 (WebKit::WebPageProxy::setUseSystemAppearance):
 266 (WebKit::WebPageProxy::clearWheelEventTestMonitor):
 267 (WebKit::WebPageProxy::updateAttachmentIcon):
 268 (WebKit::WebPageProxy::resetSpeechSynthesizer):
 269 * WebKit.xcodeproj/project.pbxproj:
 270 * WebProcess/GPU/graphics/GraphicsContextGLIdentifier.h: Copied from Source/WebCore/Modules/mediarecorder/MediaRecorderProvider.h.
 271 * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp: Added.
 272 (WebKit::RemoteGraphicsContextGLProxy::create):
 273 (WebKit::RemoteGraphicsContextGLProxy::RemoteGraphicsContextGLProxy):
 274 (WebKit::RemoteGraphicsContextGLProxy::~RemoteGraphicsContextGLProxy):
 275 (WebKit::RemoteGraphicsContextGLProxy::messageSenderConnection const):
 276 (WebKit::RemoteGraphicsContextGLProxy::messageSenderDestinationID const):
 277 (WebKit::RemoteGraphicsContextGLProxy::waitForWasCreated):
 278 (WebKit::RemoteGraphicsContextGLProxy::wasCreated):
 279 * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.h: Added.
 280 * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.messages.in: Copied from Source/WebKit/GPUProcess/GPUConnectionToWebProcess.messages.in.
 281 * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxyFunctionsGenerated.h: Added.
 282 * WebProcess/GPU/webrtc/MediaRecorderPrivate.h:
 283 * WebProcess/WebCoreSupport/WebChromeClient.cpp:
 284 (WebKit::WebChromeClient::toolbarsVisible):
 285 (WebKit::WebChromeClient::menubarVisible):
 286 (WebKit::WebChromeClient::exceededDatabaseQuota):
 287 (WebKit::WebChromeClient::createGraphicsContextGL const):
 288 * WebProcess/WebCoreSupport/WebChromeClient.h:
 289 * WebProcess/WebPage/IPCTestingAPI.cpp:
 290 (WebKit::IPCTestingAPI::encodeArgument):
 291 * WebProcess/WebPage/WebPage.cpp:
 292 (WebKit::m_limitsNavigationsToAppBoundDomains):
 293 (WebKit::WebPage::~WebPage):
 294 (WebKit::WebPage::executeEditingCommand):
 295 (WebKit::WebPage::isEditingCommandEnabled):
 296 (WebKit::WebPage::loadAlternateHTML):
 297 (WebKit::WebPage::scrollMainFrameIfNotAtMaxScrollPosition):
 298 (WebKit::dumpHistoryItem):
 299 (WebKit::WebPage::dumpHistoryForTesting):
 300 (WebKit::WebPage::updateIsInWindow):
 301 (WebKit::WebPage::setActivityState):
 302 (WebKit::WebPage::performDragControllerAction):
 303 (WebKit::WebPage::updateMainFrameScrollOffsetPinning):
 304 (WebKit::WebPage::windowAndViewFramesChanged):
 305 (WebKit::WebPage::didReceiveSyncMessage):
 306 (WebKit::WebPage::mainFrameView const):
 307 (WebKit::WebPage::insertTextAsync):
 308 (WebKit::WebPage::didCommitLoad):
 309 (WebKit::WebPage::determinePrimarySnapshottedPlugInTimerFired):
 310 (WebKit::WebPage::updateWebsitePolicies):
 311 (WebKit::WebPage::dispatchDidReachLayoutMilestone):
 312 (WebKit::WebPage::urlSchemeTaskDidPerformRedirection):
 313 (WebKit::WebPage::shouldUseRemoteWebGL):
 314 (WebKit::WebPage::setIsNavigatingToAppBoundDomain):
 315 * WebProcess/WebPage/WebPage.h:
 316
13172020-11-29 Adam Mazander <mazander@apple.com>
2318
3319 Deny logs for benign fontservicesd daemon

Source/WebCore/PlatformMac.cmake

@@list(APPEND WebCore_SOURCES
311311 platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp
312312 platform/graphics/cocoa/FontPlatformDataCocoa.mm
313313 platform/graphics/cocoa/GraphicsContextCocoa.mm
 314 platform/graphics/cocoa/GraphicsContextGLIOSurfaceSwapChain.cpp
314315 platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm
 316 platform/graphics/cocoa/IntRectCocoa.mm
315317 platform/graphics/cocoa/IOSurface.mm
316318 platform/graphics/cocoa/IOSurfacePoolCocoa.mm
317  platform/graphics/cocoa/IntRectCocoa.mm
318319 platform/graphics/cocoa/WebActionDisablingCALayerDelegate.mm
319320 platform/graphics/cocoa/WebCoreCALayerExtras.mm
320321 platform/graphics/cocoa/WebCoreDecompressionSession.mm

Source/WebCore/SourcesCocoa.txt

@@platform/graphics/cocoa/FontDescriptionCocoa.cpp
357357platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp
358358platform/graphics/cocoa/FontPlatformDataCocoa.mm
359359platform/graphics/cocoa/GraphicsContextCocoa.mm
 360platform/graphics/cocoa/GraphicsContextGLIOSurfaceSwapChain.cpp
360361platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm
361362platform/graphics/cocoa/HEVCUtilitiesCocoa.mm
362363platform/graphics/cocoa/IOSurface.mm
363364platform/graphics/cocoa/IOSurfacePoolCocoa.mm
364365platform/graphics/cocoa/IntRectCocoa.mm
365366platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp
 367platform/graphics/cocoa/RemoteGraphicsContextGLProxyBaseCocoa.mm
366368platform/graphics/cocoa/SourceBufferParser.cpp
367369platform/graphics/cocoa/SourceBufferParserWebM.cpp
368370platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp

Source/WebCore/WebCore.xcodeproj/project.pbxproj

20522052 6E47E66110B7944B00B186C8 /* WebGLAny.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E47E65F10B7944B00B186C8 /* WebGLAny.h */; settings = {ATTRIBUTES = (Private, ); }; };
20532053 6E4ABCD5138EA0B70071D291 /* JSHTMLUnknownElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E4ABCD3138EA0B70071D291 /* JSHTMLUnknownElement.h */; };
20542054 6E4E91AF10F7FB3100A2779C /* WebGLContextAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E4E91AA10F7FB3100A2779C /* WebGLContextAttributes.h */; settings = {ATTRIBUTES = (Private, ); }; };
2055  6E67D2A91280E8BD008758F7 /* ExtensionsGL.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E67D2A81280E8BD008758F7 /* ExtensionsGL.h */; };
 2055 6E67D2A91280E8BD008758F7 /* ExtensionsGL.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E67D2A81280E8BD008758F7 /* ExtensionsGL.h */; settings = {ATTRIBUTES = (Private, ); }; };
20562056 6E72F54C229DCD0C00B3E151 /* ExtensionsGLANGLE.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E27F243229C9F8400F1F632 /* ExtensionsGLANGLE.cpp */; };
20572057 6E72F54E229DCD1000B3E151 /* GraphicsContextGLANGLE.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E27F2422298CE4B00F1F632 /* GraphicsContextGLANGLE.cpp */; };
20582058 6E72F54F229DCD1300B3E151 /* TemporaryANGLESetting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E290861229DB950000986E2 /* TemporaryANGLESetting.cpp */; };

22462246 7AF9B20F18CFB5F400C64BEF /* JSVTTRegionList.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AF9B20B18CFB5F300C64BEF /* JSVTTRegionList.h */; };
22472247 7B10339E2549721700C8C1AC /* GraphicsContextGLCV.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B10339D2549720100C8C1AC /* GraphicsContextGLCV.h */; settings = {ATTRIBUTES = (Private, ); }; };
22482248 7B10339F2549721E00C8C1AC /* GraphicsContextGLCVANGLE.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B10339C2549720100C8C1AC /* GraphicsContextGLCVANGLE.h */; settings = {ATTRIBUTES = (Private, ); }; };
 2249 7B64C0AE254C16F90006B4AF /* RemoteGraphicsContextGLProxyBaseCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B64C0AC254C16EE0006B4AF /* RemoteGraphicsContextGLProxyBaseCocoa.h */; settings = {ATTRIBUTES = (Private, ); }; };
 2250 7B6DC81925712E9200380C70 /* GraphicsContextGLIOSurfaceSwapChain.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B6DC81725712E9200380C70 /* GraphicsContextGLIOSurfaceSwapChain.h */; settings = {ATTRIBUTES = (Private, ); }; };
 2251 7B90417025501142006EEB8C /* PlatformRemoteGraphicsContextGLProxyBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B90416E25501109006EEB8C /* PlatformRemoteGraphicsContextGLProxyBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
22492252 7BB34A1725345CB200029D08 /* GraphicsContextGLANGLEUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 7BB34A1625345CB200029D08 /* GraphicsContextGLANGLEUtilities.h */; };
22502253 7BB34A48253776CA00029D08 /* GraphicsContextGLImageExtractor.h in Headers */ = {isa = PBXBuildFile; fileRef = 7BB34A45253776C600029D08 /* GraphicsContextGLImageExtractor.h */; settings = {ATTRIBUTES = (Private, ); }; };
22512254 7BE7427381FA906FBB4F0F2C /* JSSVGGraphicsElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 950C4C02BED8936F818E2F99 /* JSSVGGraphicsElement.h */; };

1022210225 7B10339A2549720000C8C1AC /* GraphicsContextGLCVANGLE.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContextGLCVANGLE.cpp; sourceTree = "<group>"; };
1022310226 7B10339C2549720100C8C1AC /* GraphicsContextGLCVANGLE.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GraphicsContextGLCVANGLE.h; sourceTree = "<group>"; };
1022410227 7B10339D2549720100C8C1AC /* GraphicsContextGLCV.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GraphicsContextGLCV.h; sourceTree = "<group>"; };
 10228 7B64C0AC254C16EE0006B4AF /* RemoteGraphicsContextGLProxyBaseCocoa.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RemoteGraphicsContextGLProxyBaseCocoa.h; sourceTree = "<group>"; };
 10229 7B64C0B4254C3B160006B4AF /* RemoteGraphicsContextGLProxyBaseCocoa.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteGraphicsContextGLProxyBaseCocoa.mm; sourceTree = "<group>"; };
 10230 7B6DC81525712E9100380C70 /* GraphicsContextGLIOSurfaceSwapChain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContextGLIOSurfaceSwapChain.cpp; sourceTree = "<group>"; };
 10231 7B6DC81725712E9200380C70 /* GraphicsContextGLIOSurfaceSwapChain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsContextGLIOSurfaceSwapChain.h; sourceTree = "<group>"; };
 10232 7B90416E25501109006EEB8C /* PlatformRemoteGraphicsContextGLProxyBase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlatformRemoteGraphicsContextGLProxyBase.h; sourceTree = "<group>"; };
1022510233 7BB34A1625345CB200029D08 /* GraphicsContextGLANGLEUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsContextGLANGLEUtilities.h; sourceTree = "<group>"; };
1022610234 7BB34A45253776C600029D08 /* GraphicsContextGLImageExtractor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GraphicsContextGLImageExtractor.h; sourceTree = "<group>"; };
1022710235 7BB34A47253776C700029D08 /* GraphicsContextGLImageExtractor.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContextGLImageExtractor.cpp; sourceTree = "<group>"; };

2660026608 550640AD240756DA00AAE045 /* PlatformImageBufferBackend.h */,
2660126609 0562F9601573F88F0031CA16 /* PlatformLayer.h */,
2660226610 CEEFCD7B19DB33DC003876D7 /* PlatformMediaResourceLoader.h */,
 26611 7B90416E25501109006EEB8C /* PlatformRemoteGraphicsContextGLProxyBase.h */,
2660326612 072847E216EBC5B00043CFA4 /* PlatformTextTrack.h */,
2660426613 074E82B818A69F0E007EF54C /* PlatformTimeRanges.cpp */,
2660526614 074E82B918A69F0E007EF54C /* PlatformTimeRanges.h */,

2675826767 isa = PBXGroup;
2675926768 children = (
2676026769 CDF9950124C28149002EA062 /* AudioTrackPrivateWebM.cpp */,
 26770 7B6DC81525712E9100380C70 /* GraphicsContextGLIOSurfaceSwapChain.cpp */,
 26771 7B6DC81725712E9200380C70 /* GraphicsContextGLIOSurfaceSwapChain.h */,
2676126772 CDF9950024C28149002EA062 /* AudioTrackPrivateWebM.h */,
2676226773 F48D2AA32159740D00C6752B /* ColorCocoa.h */,
2676326774 F48D2AA42159740D00C6752B /* ColorCocoa.mm */,

2678226793 CDC48AC72149CF2A0024FD59 /* MediaEngineConfigurationFactoryCocoa.h */,
2678326794 31647FA8251616BD0010F8FB /* OpenGLSoftLinkCocoa.h */,
2678426795 31647FA9251616BD0010F8FB /* OpenGLSoftLinkCocoa.mm */,
 26796 7B64C0AC254C16EE0006B4AF /* RemoteGraphicsContextGLProxyBaseCocoa.h */,
 26797 7B64C0B4254C3B160006B4AF /* RemoteGraphicsContextGLProxyBaseCocoa.mm */,
2678526798 CDEB3D7224C41A6E001FBEEF /* SourceBufferParser.cpp */,
2678626799 CDEB3D7324C41A6E001FBEEF /* SourceBufferParser.h */,
2678726800 CD8F667024C0F208000C421C /* SourceBufferParserWebM.cpp */,

3235632369 CA3A4AAF25416E40006CDAE2 /* ImageResolution.h in Headers */,
3235732370 CD27AE5022A9868700947FF9 /* ImageRotationSessionVT.h in Headers */,
3235832371 7C193BC11F5E0EED0088F3E6 /* ImageSmoothingQuality.h in Headers */,
 32372 7B6DC81925712E9200380C70 /* GraphicsContextGLIOSurfaceSwapChain.h in Headers */,
3235932373 5546757B1FD212A9003B10B0 /* ImageSource.h in Headers */,
3236032374 4B3480940EEF50D400AC1B41 /* ImageSourceCG.h in Headers */,
3236132375 078ED193216D079500775B33 /* ImageTransferSessionVT.h in Headers */,

3387833892 07F944161864D046005D31CB /* PlatformMediaSessionManager.h in Headers */,
3387933893 935C476909AC4D4300A6AAB4 /* PlatformMouseEvent.h in Headers */,
3388033894 C598905814E9C29900E8D18B /* PlatformPasteboard.h in Headers */,
 33895 7B90417025501142006EEB8C /* PlatformRemoteGraphicsContextGLProxyBase.h in Headers */,
3388133896 BCEC01D70C274EB4009F4EC9 /* PlatformScreen.h in Headers */,
3388233897 297BE3D516C03C08003316BD /* PlatformSpeechSynthesisUtterance.h in Headers */,
3388333898 297BE3D616C03C0B003316BD /* PlatformSpeechSynthesisVoice.h in Headers */,

3401634031 CD8ACA891D237AA200ECC59E /* RemoteCommandListenerMac.h in Headers */,
3401734032 46B95199207D634D00A7D2DD /* RemoteDOMWindow.h in Headers */,
3401834033 46B9519A207D635400A7D2DD /* RemoteFrame.h in Headers */,
 34034 7B64C0AE254C16F90006B4AF /* RemoteGraphicsContextGLProxyBaseCocoa.h in Headers */,
3401934035 CDC312E922FCD7C0001204EC /* RemotePlayback.h in Headers */,
3402034036 CDC312EB22FCD7C9001204EC /* RemotePlaybackAvailabilityCallback.h in Headers */,
3402134037 073A15542177A42600EA08F2 /* RemoteVideoSample.h in Headers */,

Source/WebCore/html/canvas/WebGL2RenderingContext.cpp

@@void WebGL2RenderingContext::getBufferSubData(GCGLenum target, long long srcByte
676676 synthesizeGLError(GraphicsContextGL::INVALID_VALUE, "getBufferSubData", "Parameters would read outside the bounds of the source buffer");
677677 return;
678678 }
679 
 679
680680 if (!copyLength)
681681 return;
682682
683  m_context->moveErrorsToSyntheticErrorList();
684 #if PLATFORM(COCOA)
685683 // FIXME: Coalesce multiple getBufferSubData() calls to use a single map() call
686  void* ptr = m_context->mapBufferRange(target, checkedSrcByteOffset.unsafeGet(), static_cast<GCGLsizeiptr>(checkedCopyLengthPtr.unsafeGet() * checkedElementSize.unsafeGet()), GraphicsContextGL::MAP_READ_BIT);
687  if (ptr)
688  memcpy(static_cast<char*>(dstData->baseAddress()) + dstData->byteOffset() + dstOffset * elementSize, ptr, copyLength * elementSize);
689 
690  if (!m_context->unmapBuffer(target))
691  synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "getBufferSubData", "Failed while unmapping buffer");
692 #endif
693  m_context->moveErrorsToSyntheticErrorList();
 684 m_context->getBufferSubData(target, srcByteOffset, makeGCGLSpan(static_cast<char*>(dstData->baseAddress()) + dstData->byteOffset() + dstOffset * elementSize, copyLength * elementSize));
694685}
695686
696687void WebGL2RenderingContext::bindFramebuffer(GCGLenum target, WebGLFramebuffer* buffer)

@@void WebGL2RenderingContext::vertexAttribI4uiv(GCGLuint index, Uint32List&& list
17011692 synthesizeGLError(GraphicsContextGL::INVALID_VALUE, "vertexAttribI4uiv", "no array");
17021693 return;
17031694 }
1704 
 1695
17051696 int size = list.length();
17061697 if (size < 4) {
17071698 synthesizeGLError(GraphicsContextGL::INVALID_VALUE, "vertexAttribI4uiv", "array too small");

@@WebGLAny WebGL2RenderingContext::getQueryParameter(WebGLQuery& query, GCGLenum p
19661957 return nullptr;
19671958 }
19681959
1969  unsigned result = 0;
1970  m_context->getQueryObjectuiv(query.object(), pname, &result);
1971  return result;
 1960 return static_cast<unsigned>(m_context->getQueryObjectui(query.object(), pname));
19721961}
19731962
19741963RefPtr<WebGLSampler> WebGL2RenderingContext::createSampler()

@@void WebGL2RenderingContext::bindSampler(GCGLuint unit, WebGLSampler* sampler)
20132002
20142003 if (isContextLostOrPending())
20152004 return;
2016 
 2005
20172006 if (unit >= m_boundSamplers.size()) {
20182007 synthesizeGLError(GraphicsContextGL::INVALID_VALUE, "bindSampler", "invalid texture unit");
20192008 return;

@@WebGLAny WebGL2RenderingContext::getSamplerParameter(WebGLSampler& sampler, GCGL
20582047 case GraphicsContextGL::TEXTURE_MIN_FILTER:
20592048 case GraphicsContextGL::TEXTURE_WRAP_R:
20602049 case GraphicsContextGL::TEXTURE_WRAP_S:
2061  case GraphicsContextGL::TEXTURE_WRAP_T: {
2062  int value = 0;
2063  m_context->getSamplerParameteriv(sampler.object(), pname, &value);
2064  return value;
2065  }
 2050 case GraphicsContextGL::TEXTURE_WRAP_T:
 2051 return m_context->getSamplerParameteri(sampler.object(), pname);
20662052 case GraphicsContextGL::TEXTURE_MAX_LOD:
2067  case GraphicsContextGL::TEXTURE_MIN_LOD: {
2068  float value = 0;
2069  m_context->getSamplerParameterfv(sampler.object(), pname, &value);
2070  return value;
2071  }
 2053 case GraphicsContextGL::TEXTURE_MIN_LOD:
 2054 return m_context->getSamplerParameterf(sampler.object(), pname);
20722055 default:
20732056 synthesizeGLError(GraphicsContextGL::INVALID_ENUM, "getSamplerParameter", "Invalid pname");
20742057 return nullptr;

@@GCGLenum WebGL2RenderingContext::clientWaitSync(WebGLSync& sync, GCGLbitfield fl
21172100 synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "clientWaitSync", "timeout > MAX_CLIENT_WAIT_TIMEOUT_WEBGL");
21182101 return GraphicsContextGL::WAIT_FAILED_WEBGL;
21192102 }
2120 
 2103
21212104 if (flags && flags != GraphicsContextGL::SYNC_FLUSH_COMMANDS_BIT) {
21222105 synthesizeGLError(GraphicsContextGL::INVALID_VALUE, "clientWaitSync", "invalid flags");
21232106 return GraphicsContextGL::WAIT_FAILED_WEBGL;

@@void WebGL2RenderingContext::deleteTransformFeedback(WebGLTransformFeedback* fee
21782161
21792162 if (isContextLostOrPending() || !feedbackObject || feedbackObject->isDeleted() || !validateWebGLObject("deleteTransformFeedback", feedbackObject))
21802163 return;
2181 
 2164
21822165 ASSERT(feedbackObject != m_defaultTransformFeedback);
2183 
 2166
21842167 if (feedbackObject->isActive()) {
21852168 synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "deleteTransformFeedback", "attempt to delete an active transform feedback object");
21862169 return;

@@void WebGL2RenderingContext::beginTransformFeedback(GCGLenum primitiveMode)
22472230{
22482231 if (isContextLostOrPending())
22492232 return;
2250 
 2233
22512234 if (!ValidateTransformFeedbackPrimitiveMode(primitiveMode)) {
22522235 synthesizeGLError(GraphicsContextGL::INVALID_ENUM, "beginTransformFeedback", "invalid transform feedback primitive mode");
22532236 return;

@@void WebGL2RenderingContext::endTransformFeedback()
22872270 synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "endTransformFeedback", "transform feedback is not active");
22882271 return;
22892272 }
2290 
 2273
22912274 m_context->endTransformFeedback();
22922275
22932276 m_boundTransformFeedback->setPaused(false);

@@void WebGL2RenderingContext::transformFeedbackVaryings(WebGLProgram& program, co
22982281{
22992282 if (isContextLostOrPending() || !validateWebGLProgramOrShader("transformFeedbackVaryings", &program))
23002283 return;
2301 
 2284
23022285 switch (bufferMode) {
23032286 case GraphicsContextGL::SEPARATE_ATTRIBS:
23042287 if (varyings.size() > m_maxTransformFeedbackSeparateAttribs) {

@@WebGLAny WebGL2RenderingContext::getActiveUniforms(WebGLProgram& program, const
24842467 if (isContextLostOrPending() || !validateWebGLProgramOrShader("getActiveUniforms", &program))
24852468 return nullptr;
24862469
2487  Vector<GCGLint> result(uniformIndices.size(), 0);
2488 
24892470 switch (pname) {
2490  case GraphicsContextGL::UNIFORM_TYPE:
2491  m_context->getActiveUniforms(program.object(), uniformIndices, pname, result);
 2471 case GraphicsContextGL::UNIFORM_TYPE: {
 2472 auto result = m_context->getActiveUniforms(program.object(), uniformIndices, pname);
24922473 return result.map([](auto x) { return static_cast<GCGLenum>(x); });
2493  case GraphicsContextGL::UNIFORM_SIZE:
2494  m_context->getActiveUniforms(program.object(), uniformIndices, pname, result);
 2474 }
 2475 case GraphicsContextGL::UNIFORM_SIZE: {
 2476 auto result = m_context->getActiveUniforms(program.object(), uniformIndices, pname);
24952477 return result.map([](auto x) { return static_cast<GCGLuint>(x); });
 2478 }
24962479 case GraphicsContextGL::UNIFORM_BLOCK_INDEX:
24972480 case GraphicsContextGL::UNIFORM_OFFSET:
24982481 case GraphicsContextGL::UNIFORM_ARRAY_STRIDE:
24992482 case GraphicsContextGL::UNIFORM_MATRIX_STRIDE:
2500  m_context->getActiveUniforms(program.object(), uniformIndices, pname, result);
2501  return WTFMove(result);
2502  case GraphicsContextGL::UNIFORM_IS_ROW_MAJOR:
2503  m_context->getActiveUniforms(program.object(), uniformIndices, pname, result);
 2483 return m_context->getActiveUniforms(program.object(), uniformIndices, pname);
 2484 case GraphicsContextGL::UNIFORM_IS_ROW_MAJOR: {
 2485 auto result = m_context->getActiveUniforms(program.object(), uniformIndices, pname);
25042486 return result.map([](auto x) { return static_cast<bool>(x); });
 2487 }
25052488 default:
25062489 synthesizeGLError(GraphicsContextGL::INVALID_ENUM, "getActiveUniforms", "invalid parameter name");
25072490 return nullptr;

@@void WebGL2RenderingContext::readPixels(GCGLint x, GCGLint y, GCGLsizei width, G
35683551
35693552 clearIfComposited();
35703553
3571  GCGLsizei length, columns, rows;
3572  m_context->getExtensions().readnPixelsRobustANGLE(x, y, width, height, format, type, 0, &length, &columns, &rows, reinterpret_cast<uint8_t*>(offset), true);
 3554 m_context->readnPixels(x, y, width, height, format, type, offset);
35733555}
35743556
35753557void WebGL2RenderingContext::readPixels(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, ArrayBufferView& dstData, GCGLuint dstOffset)

Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp

@@std::unique_ptr<WebGLRenderingContextBase> WebGLRenderingContextBase::create(Can
710710 renderingContext->suspendIfNeeded();
711711 return renderingContext;
712712 }
713 
714  auto context = GraphicsContextGLOpenGL::create(attributes, hostWindow);
 713 auto context = GraphicsContextGL::create(attributes, hostWindow);
715714 if (!context) {
716715 if (canvasElement) {
717716 canvasElement->dispatchEvent(WebGLContextEvent::create(eventNames().webglcontextcreationerrorEvent,

@@void WebGLRenderingContextBase::readPixels(GCGLint x, GCGLint y, GCGLsizei width
43384337 void* data = pixels.baseAddress();
43394338
43404339#if USE(ANGLE)
4341  GCGLsizei length = 0;
4342  GCGLsizei columns = 0;
4343  GCGLsizei rows = 0;
4344  m_context->getExtensions().readnPixelsRobustANGLE(x, y, width, height, format, type, pixels.byteLength(), &length, &columns, &rows, data, false);
 4340 m_context->readnPixels(x, y, width, height, format, type, makeGCGLSpan(data, pixels.byteLength()));
43454341#else
43464342 if (m_isRobustnessEXTSupported)
43474343 m_context->getExtensions().readnPixelsEXT(x, y, width, height, format, type, pixels.byteLength(), data);

Source/WebCore/html/canvas/WebGLSync.cpp

@@void WebGLSync::updateCache(WebGLRenderingContextBase& context)
7171 return;
7272
7373 m_allowCacheUpdate = false;
74  context.graphicsContextGL()->getSynciv(m_sync, GraphicsContextGL::SYNC_STATUS, sizeof(m_syncStatus), &m_syncStatus);
 74 m_syncStatus = context.graphicsContextGL()->getSynci(m_sync, GraphicsContextGL::SYNC_STATUS);
7575 if (m_syncStatus == GraphicsContextGL::UNSIGNALED)
7676 scheduleAllowCacheUpdate(context);
7777}

Source/WebCore/page/Chrome.cpp

@@RefPtr<ImageBuffer> Chrome::createImageBuffer(const FloatSize& size, RenderingMo
528528 return m_client.createImageBuffer(size, renderingMode, purpose, resolutionScale, colorSpace, pixelFormat);
529529}
530530
 531#if ENABLE(WEBGL)
 532RefPtr<GraphicsContextGL> Chrome::createGraphicsContextGL(const GraphicsContextGLAttributes& attributes) const
 533{
 534 return m_client.createGraphicsContextGL(attributes, displayID());
 535}
 536#endif
 537
531538PlatformDisplayID Chrome::displayID() const
532539{
533540 return m_page.displayID();

@@void Chrome::windowScreenDidChange(PlatformDisplayID displayID, Optional<unsigne
541548 m_page.windowScreenDidChange(displayID, nominalFrameInterval);
542549
543550#if PLATFORM(MAC) && ENABLE(GRAPHICS_CONTEXT_GL)
 551 // TODO: GPU process. Change to GCGLManager, make it work, return null for others.
544552 GraphicsContextGLOpenGLManager::sharedManager().screenDidChange(displayID, this);
545553#endif
546554}

Source/WebCore/page/Chrome.h

@@public:
8686
8787 RefPtr<ImageBuffer> createImageBuffer(const FloatSize&, RenderingMode, RenderingPurpose, float resolutionScale, ColorSpace, PixelFormat) const override;
8888
 89#if ENABLE(WEBGL)
 90 RefPtr<GraphicsContextGL> createGraphicsContextGL(const GraphicsContextGLAttributes&) const override;
 91#endif
 92
8993 PlatformDisplayID displayID() const override;
9094 void windowScreenDidChange(PlatformDisplayID, Optional<unsigned>) override;
9195

Source/WebCore/page/ChromeClient.h

@@public:
325325
326326 virtual RefPtr<ImageBuffer> createImageBuffer(const FloatSize&, RenderingMode, RenderingPurpose, float, ColorSpace, PixelFormat) const { return nullptr; }
327327
 328#if ENABLE(WEBGL)
 329 virtual RefPtr<GraphicsContextGL> createGraphicsContextGL(const GraphicsContextGLAttributes&, WebCore::PlatformDisplayID) const { return nullptr; }
 330#endif
 331
328332 // Pass nullptr as the GraphicsLayer to detatch the root layer.
329333 virtual void attachRootGraphicsLayer(Frame&, GraphicsLayer*) = 0;
330334 virtual void attachViewOverlayGraphicsLayer(GraphicsLayer*) = 0;

Source/WebCore/platform/HostWindow.h

2525
2626#pragma once
2727
 28#include "GraphicsContextGL.h"
2829#include "Widget.h"
2930
3031namespace WebCore {

@@public:
6364
6465 virtual RefPtr<ImageBuffer> createImageBuffer(const FloatSize&, RenderingMode, RenderingPurpose, float resolutionScale, ColorSpace, PixelFormat) const = 0;
6566
 67#if ENABLE(WEBGL)
 68 virtual RefPtr<GraphicsContextGL> createGraphicsContextGL(const GraphicsContextGLAttributes&) const = 0;
 69#endif
 70
6671 // Method for retrieving the native client of the page.
6772 virtual PlatformPageClient platformPageClient() const = 0;
6873

Source/WebCore/platform/RuntimeApplicationChecks.h

@@WEBCORE_EXPORT int presentingApplicationPID();
3434
3535#if PLATFORM(WIN)
3636inline bool isInWebProcess() { return false; }
 37inline bool isInGPUProcess() { return false; }
3738#elif !PLATFORM(COCOA)
3839inline bool isInWebProcess() { return true; }
 40inline bool isInGPUProcess() { return false; }
3941#endif
4042
4143#if PLATFORM(COCOA)
4244
4345bool isInWebProcess();
 46bool isInGPUProcess();
4447bool isInNetworkProcess();
4548
4649WEBCORE_EXPORT void setApplicationBundleIdentifier(const String&);

Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm

@@bool isInWebProcess()
9696 return mainBundleIsWebProcess;
9797}
9898
 99bool isInGPUProcess()
 100{
 101 static bool mainBundleIsGPUProcess = [[[NSBundle mainBundle] bundleIdentifier] hasPrefix:@"com.apple.WebKit.GPU"];
 102 return mainBundleIsGPUProcess;
 103}
 104
99105bool isInNetworkProcess()
100106{
101107 static bool mainBundleIsNetworkProcess = [[[NSBundle mainBundle] bundleIdentifier] hasPrefix:@"com.apple.WebKit.Networking"];

Source/WebCore/platform/graphics/ExtensionsGL.h

@@public:
264264 static constexpr GCGLenum COLOR_ATTACHMENT14_EXT = 0x8CEE;
265265 static constexpr GCGLenum COLOR_ATTACHMENT15_EXT = 0x8CEF;
266266
267  // WebGL functions in format generate-gpup-webgl understands.
 267 // WebGL functions.
268268
269269 // GL_ARB_robustness
270270 // Note: This method's behavior differs from the GL_ARB_robustness

@@public:
276276 virtual GCGLint getGraphicsResetStatusARB() = 0;
277277
278278 // GL_ANGLE_framebuffer_blit
279  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;
 279 virtual void blitFramebufferANGLE(GCGLint srcX0, GCGLint srcY0, GCGLint srcX1, GCGLint srcY1, GCGLint dstX0, GCGLint dstY0, GCGLint dstX1, GCGLint dstY1, GCGLbitfield mask, GCGLenum filter) = 0;
280280
281281 // GL_ANGLE_framebuffer_multisample
282  virtual void renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height) = 0;
 282 virtual void renderbufferStorageMultisampleANGLE(GCGLenum target, GCGLsizei samples, GCGLenum internalformat, GCGLsizei width, GCGLsizei height) = 0;
283283
284284 // GL_OES_vertex_array_object
285285 virtual PlatformGLObject createVertexArrayOES() = 0;

@@public:
293293 // GL_EXT_debug_marker
294294 virtual void insertEventMarkerEXT(const String&) = 0;
295295 virtual void pushGroupMarkerEXT(const String&) = 0;
296  virtual void popGroupMarkerEXT(void) = 0;
 296 virtual void popGroupMarkerEXT() = 0;
297297
298298 // GL_ARB_draw_buffers / GL_EXT_draw_buffers
299299 virtual void drawBuffersEXT(GCGLSpan<const GCGLenum> bufs) = 0;
300300
301301 // GL_ANGLE_instanced_arrays
302  virtual void drawArraysInstanced(GCGLenum mode, GCGLint first, GCGLsizei count, GCGLsizei primcount) = 0;
303  virtual void drawElementsInstanced(GCGLenum mode, GCGLsizei count, GCGLenum type, long long offset, GCGLsizei primcount) = 0;
304  virtual void vertexAttribDivisor(GCGLuint index, GCGLuint divisor) = 0;
 302 virtual void drawArraysInstancedANGLE(GCGLenum mode, GCGLint first, GCGLsizei count, GCGLsizei primcount) = 0;
 303 virtual void drawElementsInstancedANGLE(GCGLenum mode, GCGLsizei count, GCGLenum type, GCGLvoidptr offset, GCGLsizei primcount) = 0;
 304 virtual void vertexAttribDivisorANGLE(GCGLuint index, GCGLuint divisor) = 0;
305305
306306 // GL_ANGLE_robust_client_memory
307307 virtual void readPixelsRobustANGLE(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, GCGLsizei* length, GCGLsizei* columns, GCGLsizei* rows, GCGLvoid* pixels) = 0;

@@public:
329329 virtual void getTexLevelParameterfvRobustANGLE(GCGLenum target, GCGLint level, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLfloat* params) = 0;
330330
331331 virtual void getPointervRobustANGLERobustANGLE(GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLvoid** params) = 0;
332  virtual void readnPixelsRobustANGLE(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, GCGLsizei* length, GCGLsizei* columns, GCGLsizei* rows, GCGLvoid* data, bool readingToPixelBufferObject) = 0;
333332 virtual void getnUniformfvRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei* length, GCGLfloat* params) = 0;
334333 virtual void getnUniformivRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) = 0;
335334 virtual void getnUniformuivRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei* length, GCGLuint* params) = 0;

@@public:
352351 virtual void readnPixelsEXT(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, GCGLvoid* data) = 0;
353352 virtual void getnUniformfvEXT(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLfloat* params) = 0;
354353 virtual void getnUniformivEXT(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLint* params) = 0;
355 #endif
356354
357355 virtual bool isNVIDIA() = 0;
358356 virtual bool isAMD() = 0;

@@public:
364362 // that must be avoided. Ports should implement these flags on such configurations.
365363 virtual bool requiresBuiltInFunctionEmulation() = 0;
366364 virtual bool requiresRestrictedMaximumTextureSize() = 0;
 365#endif
367366
368367};
369368

Source/WebCore/platform/graphics/GraphicsContextGL.cpp

2727
2828#include "config.h"
2929#include "GraphicsContextGL.h"
 30#include "GraphicsContextGLOpenGL.h"
3031
3132#if ENABLE(GRAPHICS_CONTEXT_GL)
3233
3334#include "ExtensionsGL.h"
3435#include "FormatConverter.h"
 36#include "HostWindow.h"
3537#include "Image.h"
3638#include "ImageData.h"
3739#include "ImageObserver.h"

@@static bool packPixels(const uint8_t* sourceData, GraphicsContextGL::DataFormat
403405 return true;
404406}
405407
 408RefPtr<GraphicsContextGL> GraphicsContextGL::create(const GraphicsContextGLAttributes& attributes, HostWindow* hostWindow)
 409{
 410 RefPtr<GraphicsContextGL> result;
 411 if (hostWindow)
 412 result = hostWindow->createGraphicsContextGL(attributes);
 413 if (!result)
 414 result = GraphicsContextGLOpenGL::create(attributes, hostWindow);
 415 return result;
 416}
406417
407418GraphicsContextGL::GraphicsContextGL(GraphicsContextGLAttributes attrs, Destination destination, GraphicsContextGL*)
408419 : m_attrs(attrs)

Source/WebCore/platform/graphics/GraphicsContextGL.h

@@class ImageData;
5959class GraphicsContextGLCV;
6060#endif
6161
 62
 63// Base class for graphics context for implementing WebGL rendering model.
6264class GraphicsContextGL : public RefCounted<GraphicsContextGL> {
6365public:
6466 // WebGL 1 constants.

@@public:
669671 static constexpr GCGLenum TEXTURE_RECTANGLE_ARB = 0x84F5;
670672 static constexpr GCGLenum TEXTURE_BINDING_RECTANGLE_ARB = 0x84F6;
671673
 674 static constexpr GCGLenum REQUESTABLE_EXTENSIONS_ANGLE = 0x93A8;
 675
 676
672677 // Attempt to enumerate all possible native image formats to
673678 // reduce the amount of temporary allocations during texture
674679 // uploading. This enum must be public because it is accessed

@@public:
911916 GCGLint size;
912917 };
913918
 919 // Creates a GraphicsContextGL instance to render into offscreen destination in context of HostWindow.
 920 // HostWindow might affect the decision which backend is to be used.
 921 static RefPtr<GraphicsContextGL> create(const GraphicsContextGLAttributes&, HostWindow*);
 922
914923 GraphicsContextGL(GraphicsContextGLAttributes, Destination = Destination::Offscreen, GraphicsContextGL* sharedContext = nullptr);
915924 virtual ~GraphicsContextGL() = default;
916925
917926 void addClient(Client& client) { m_clients.add(&client); }
918927 void removeClient(Client& client) { m_clients.remove(&client); }
919928
920  // WebGL functions in format generate-gpup-webgl understands.
921 
 929 // WebGL functions.
922930 virtual void activeTexture(GCGLenum texture) = 0;
923931 virtual void attachShader(PlatformGLObject program, PlatformGLObject shader) = 0;
924932 virtual void bindAttribLocation(PlatformGLObject, GCGLuint index, const String& name) = 0;

@@public:
980988
981989 virtual bool getActiveAttrib(PlatformGLObject program, GCGLuint index, ActiveInfo&) = 0;
982990 virtual bool getActiveUniform(PlatformGLObject program, GCGLuint index, ActiveInfo&) = 0;
983  virtual void getAttachedShaders(PlatformGLObject program, GCGLsizei maxCount, GCGLsizei* count, PlatformGLObject* shaders) = 0;
984991
985992 virtual GCGLint getAttribLocation(PlatformGLObject, const String& name) = 0;
986993

@@public:
10251032
10261033 virtual GCGLint getUniformLocation(PlatformGLObject, const String& name) = 0;
10271034
1028  // getVertexAttrib
1029  virtual void getVertexAttribfv(GCGLuint index, GCGLenum pname, GCGLSpan<GCGLfloat> value) = 0;
1030  virtual void getVertexAttribiv(GCGLuint index, GCGLenum pname, GCGLSpan<GCGLint> value) = 0;
1031 
10321035 virtual GCGLsizeiptr getVertexAttribOffset(GCGLuint index, GCGLenum pname) = 0;
10331036
10341037 virtual void hint(GCGLenum target, GCGLenum mode) = 0;

@@public:
11001103 virtual void bufferData(GCGLenum target, GCGLSpan<const GCGLvoid> data, GCGLenum usage) = 0;
11011104 virtual void bufferSubData(GCGLenum target, GCGLintptr offset, GCGLSpan<const GCGLvoid> data) = 0;
11021105
1103  virtual void readPixels(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLvoid* data) = 0;
 1106 virtual void readnPixels(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLSpan<GCGLvoid> data) = 0;
 1107 virtual void readnPixels(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLintptr offset) = 0;
11041108
11051109 virtual void texImage2D(GCGLenum target, GCGLint level, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, GCGLint border, GCGLenum format, GCGLenum type, GCGLSpan<const GCGLvoid> pixels) = 0;
11061110 virtual void texImage2D(GCGLenum target, GCGLint level, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, GCGLint border, GCGLenum format, GCGLenum type, GCGLintptr offset) = 0;

@@public:
11241128 // ========== WebGL 2 entry points.
11251129
11261130 virtual void copyBufferSubData(GCGLenum readTarget, GCGLenum writeTarget, GCGLintptr readOffset, GCGLintptr writeOffset, GCGLsizeiptr size) = 0;
1127  virtual GCGLvoid* mapBufferRange(GCGLenum target, GCGLintptr offset, GCGLsizeiptr length, GCGLbitfield access) = 0;
1128  virtual GCGLboolean unmapBuffer(GCGLenum target) = 0;
 1131 virtual void getBufferSubData(GCGLenum target, GCGLintptr offset, GCGLSpan<GCGLvoid> data) = 0;
11291132
11301133 virtual void blitFramebuffer(GCGLint srcX0, GCGLint srcY0, GCGLint srcX1, GCGLint srcY1, GCGLint dstX0, GCGLint dstY0, GCGLint dstX1, GCGLint dstY1, GCGLbitfield mask, GCGLenum filter) = 0;
11311134 virtual void framebufferTextureLayer(GCGLenum target, GCGLenum attachment, PlatformGLObject texture, GCGLint level, GCGLint layer) = 0;

@@public:
11871190 virtual void endQuery(GCGLenum target) = 0;
11881191 virtual PlatformGLObject getQuery(GCGLenum target, GCGLenum pname) = 0;
11891192 // getQueryParameter
1190  virtual void getQueryObjectuiv(PlatformGLObject query, GCGLenum pname, GCGLuint* value) = 0;
 1193 virtual GCGLuint getQueryObjectui(PlatformGLObject query, GCGLenum pname) = 0;
11911194
11921195 virtual PlatformGLObject createSampler() = 0;
11931196 virtual void deleteSampler(PlatformGLObject sampler) = 0;

@@public:
11961199 virtual void samplerParameteri(PlatformGLObject sampler, GCGLenum pname, GCGLint param) = 0;
11971200 virtual void samplerParameterf(PlatformGLObject sampler, GCGLenum pname, GCGLfloat param) = 0;
11981201 // getSamplerParameter
1199  virtual void getSamplerParameterfv(PlatformGLObject sampler, GCGLenum pname, GCGLfloat* value) = 0;
1200  virtual void getSamplerParameteriv(PlatformGLObject sampler, GCGLenum pname, GCGLint* value) = 0;
 1202 virtual GCGLfloat getSamplerParameterf(PlatformGLObject sampler, GCGLenum pname) = 0;
 1203 virtual GCGLint getSamplerParameteri(PlatformGLObject sampler, GCGLenum pname) = 0;
12011204
12021205 virtual GCGLsync fenceSync(GCGLenum condition, GCGLbitfield flags) = 0;
12031206 virtual GCGLboolean isSync(GCGLsync) = 0;

@@public:
12051208 virtual GCGLenum clientWaitSync(GCGLsync, GCGLbitfield flags, GCGLuint64 timeout) = 0;
12061209 virtual void waitSync(GCGLsync, GCGLbitfield flags, GCGLint64 timeout) = 0;
12071210 // getSyncParameter
1208  virtual void getSynciv(GCGLsync, GCGLenum pname, GCGLsizei bufSize, GCGLint* value) = 0;
 1211 virtual GCGLint getSynci(GCGLsync, GCGLenum pname) = 0;
12091212
12101213 virtual PlatformGLObject createTransformFeedback() = 0;
12111214 virtual void deleteTransformFeedback(PlatformGLObject id) = 0;

@@public:
12221225 virtual void bindBufferRange(GCGLenum target, GCGLuint index, PlatformGLObject buffer, GCGLintptr offset, GCGLsizeiptr size) = 0;
12231226 // getIndexedParameter -> use getParameter calls above.
12241227 virtual Vector<GCGLuint> getUniformIndices(PlatformGLObject program, const Vector<String>& uniformNames) = 0;
1225  virtual void getActiveUniforms(PlatformGLObject program, const Vector<GCGLuint>& uniformIndices, GCGLenum pname, Vector<GCGLint>& params) = 0;
 1228 virtual Vector<GCGLint> getActiveUniforms(PlatformGLObject program, const Vector<GCGLuint>& uniformIndices, GCGLenum pname) = 0;
12261229
12271230 virtual GCGLuint getUniformBlockIndex(PlatformGLObject program, const String& uniformBlockName) = 0;
12281231 // getActiveUniformBlockParameter

@@public:
12301233 virtual void uniformBlockBinding(PlatformGLObject program, GCGLuint uniformBlockIndex, GCGLuint uniformBlockBinding) = 0;
12311234
12321235 virtual void getActiveUniformBlockiv(GCGLuint program, GCGLuint uniformBlockIndex, GCGLenum pname, GCGLSpan<GCGLint> params) = 0;
1233 
 1236
12341237 // Other functions.
12351238 GCGLfloat getFloat(GCGLenum pname);
12361239 GCGLboolean getBoolean(GCGLenum pname);

@@inline GCGLint GraphicsContextGL::getActiveUniformBlocki(GCGLuint program, GCGLu
13941397 return value[0];
13951398}
13961399
1397 
13981400} // namespace WebCore
13991401
14001402#endif

Source/WebCore/platform/graphics/GraphicsTypesGL.h

2525
2626#pragma once
2727
 28#include <cstdint>
2829#include <limits>
 30#include <type_traits>
2931#include <wtf/Forward.h>
3032#include <wtf/Vector.h>
3133

@@typedef unsigned GCGLuint;
4446typedef float GCGLfloat;
4547typedef unsigned short GCGLhalffloat;
4648typedef float GCGLclampf;
 49typedef char GCGLchar;
 50typedef struct __GLsync* GCGLsync;
 51typedef void GCGLvoid;
 52
 53// These GCGL types do not strictly match the GL types as defined in OpenGL ES 2.0
 54// header file for all platforms.
4755typedef intptr_t GCGLintptr;
4856typedef intptr_t GCGLsizeiptr;
49 typedef char GCGLchar;
 57typedef intptr_t GCGLvoidptr;
5058typedef long long GCGLint64;
5159typedef unsigned long long GCGLuint64;
52 typedef struct __GLsync* GCGLsync;
53 typedef void GCGLvoid;
5460
5561typedef GCGLuint PlatformGLObject;
5662

@@typedef GCGLuint PlatformGLObject;
5864typedef unsigned GLuint;
5965#endif
6066
61 template<typename T, size_t Extent = std::numeric_limits<size_t>::max()>
 67inline constexpr size_t gcGLSpanDynamicExtent = std::numeric_limits<size_t>::max();
 68
 69template<typename T, size_t Extent = gcGLSpanDynamicExtent>
6270struct GCGLSpan;
6371template<typename T, size_t Extent>
6472struct GCGLSpan {
65  explicit GCGLSpan(T* array)
 73 explicit GCGLSpan(T* array, size_t size = Extent)
6674 : data(array)
67  { }
 75 {
 76 ASSERT_UNUSED(size, size == Extent);
 77 }
6878 GCGLSpan(T (&array)[Extent])
6979 : data(array)
7080 { }

@@struct GCGLSpan {
7282 GCGLSpan(const GCGLSpan<U, Extent>& other, std::enable_if_t<std::is_convertible_v<U(*)[], T(*)[]>, std::nullptr_t> = nullptr)
7383 : data(other.data)
7484 { }
 85 GCGLSpan(std::array<T, Extent>& array)
 86 : data(array.data())
 87 { }
 88 GCGLSpan(const std::array<T, Extent>& array)
 89 : data(array.data())
 90 { }
7591 T& operator[](size_t i) { RELEASE_ASSERT(data && i < bufSize); return data[i]; }
7692 T& operator*() { RELEASE_ASSERT(data && bufSize); return *data; }
7793 T* data;

@@struct GCGLSpan {
7995};
8096
8197template<typename T>
82 struct GCGLSpan<T, std::numeric_limits<size_t>::max()> {
 98struct GCGLSpan<T, gcGLSpanDynamicExtent> {
8399 GCGLSpan(T* array, size_t bufSize_)
84100 : data(array)
85101 , bufSize(bufSize_)

@@struct GCGLSpan<GCGLvoid> {
121137 : data(other.data)
122138 , bufSize(other.bufSize * sizeof(U))
123139 { }
 140 template<typename U, size_t inlineCapacity>
 141 GCGLSpan(WTF::Vector<U, inlineCapacity>& array)
 142 : data(array.data())
 143 , bufSize(array.size() * sizeof(U))
 144 { }
124145 GCGLvoid* data;
125146 const size_t bufSize;
126147};

@@struct GCGLSpan<const GCGLvoid> {
152173template<typename T, size_t N>
153174GCGLSpan(T (&)[N]) -> GCGLSpan<T, N>;
154175
155 template<typename T>
156 GCGLSpan(WTF::Vector<T>&) -> GCGLSpan<T>;
 176template<typename T, size_t N>
 177GCGLSpan(std::array<T, N>&) -> GCGLSpan<T, N>;
 178
 179template<typename T, size_t inlineCapacity>
 180GCGLSpan(WTF::Vector<T, inlineCapacity>&) -> GCGLSpan<T>;
157181
158182template<typename T>
159183GCGLSpan<T> makeGCGLSpan(T* data, size_t count)

Source/WebCore/platform/graphics/PlatformRemoteGraphicsContextGLProxyBase.h

 1/*
 2 * Copyright (C) 2020 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#pragma once
 27
 28#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL)
 29
 30#if PLATFORM(COCOA)
 31#include "RemoteGraphicsContextGLProxyBaseCocoa.h"
 32#endif
 33
 34namespace WebCore {
 35// Name for the platform specific base class of RemoteGraphicsContextGL proxy.
 36// Due to the lack of abstractions, we currently need to inherit the
 37// platform dependent implementation in the middle of the inheritance chain
 38// of RemoteGraphicsContextGLProxy.
 39// This means we cannot have a real platform independent RemoteGraphicsContextGLProxy base class.
 40// For this reason we must refer to the concrete class for the time being.
 41#if PLATFORM(COCOA)
 42using PlatformRemoteGraphicsContextGLProxyBase = RemoteGraphicsContextGLProxyBaseCocoa;
 43#endif
 44}
 45
 46#endif

Source/WebCore/platform/graphics/RemoteGraphicsContextGLBase.h

 1/*
 2 * Copyright (C) 2020 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#pragma once
 27
 28#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL) && PLATFORM(COCOA)
 29
 30#include "ExtensionsGL.h"
 31#include "GraphicsContextGL.h"
 32
 33namespace WebCore {
 34
 35// A base class for remote GraphicsContextGL implementations.
 36// This implements the parts that are using WebCore internal functionality:
 37// - Drawing buffer tracking management.
 38// - Compositing support.
 39// The parts were needed to be implemented due to lack of abstractions and
 40// small pending fixes at the time of writing.
 41WEBCORE_EXPORT class RemoteGraphicsContextGLProxyBaseCocoa : public GraphicsContextGL, public ExtensionsGL {
 42public:
 43 RemoteGraphicsContextGLBase(const GraphicsContextGLAttributes&);
 44 ~RemoteGraphicsContextGLBase() override;
 45
 46 // Other WebCore::GraphicsContextGL overrides.
 47 PlatformGraphicsContextGL platformGraphicsContextGL() const final;
 48 PlatformGLObject platformTexture() const final;
 49 PlatformLayer* platformLayer() const final;
 50 void enablePreserveDrawingBuffer() final;
 51 ExtensionsGL& getExtensions() final { return *this; }
 52 void reshape(int width, int height) final;
 53 void setContextVisibility(bool) final;
 54 GraphicsContextGLPowerPreference powerPreferenceUsedForCreation() const final;
 55 bool isGLES2Compliant() const final;
 56 void synthesizeGLError(GCGLenum error) final;
 57 bool moveErrorsToSyntheticErrorList() final;
 58 void setFailNextGPUStatusCheck() final;
 59 void prepareForDisplay() final;
 60 void markContextChanged() final;
 61 bool layerComposited() const final;
 62 void setBuffersToAutoClear(GCGLbitfield) final;
 63 GCGLbitfield getBuffersToAutoClear() const final;
 64 void paintRenderingResultsToCanvas(ImageBuffer*) final;
 65 RefPtr<ImageData> paintRenderingResultsToImageData() final;
 66 bool paintCompositedResultsToCanvas(ImageBuffer*) final;
 67 void markLayerComposited() final;
 68 void simulateContextChanged() final;
 69
 70#if ENABLE(VIDEO) && USE(AVFOUNDATION)
 71 GraphicsContextGLCV* asCV() final { return nullptr };
 72#endif
 73 RetainPtr<WebGLLayer> m_webGLLayer;
 74
 75};
 76
 77#endif

Source/WebCore/platform/graphics/angle/ExtensionsGLANGLE.cpp

@@namespace WebCore {
4646ExtensionsGLANGLE::ExtensionsGLANGLE(GraphicsContextGLOpenGL* context, bool useIndexedGetString)
4747 : m_initializedAvailableExtensions(false)
4848 , m_context(context)
49  , m_isNVIDIA(false)
50  , m_isAMD(false)
51  , m_isIntel(false)
52  , m_isImagination(false)
53  , m_requiresBuiltInFunctionEmulation(false)
54  , m_requiresRestrictedMaximumTextureSize(false)
5549 , m_useIndexedGetString(useIndexedGetString)
5650{
57  // FIXME: ideally, remove this initialization altogether. ANGLE
58  // subsumes the responsibility for graphics driver workarounds.
59  m_vendor = String(reinterpret_cast<const char*>(gl::GetString(GL_VENDOR)));
60  m_renderer = String(reinterpret_cast<const char*>(gl::GetString(GL_RENDERER)));
61 
62  Vector<String> vendorComponents = m_vendor.convertToASCIILowercase().split(' ');
63  if (vendorComponents.contains("nvidia"))
64  m_isNVIDIA = true;
65  if (vendorComponents.contains("ati") || vendorComponents.contains("amd"))
66  m_isAMD = true;
67  if (vendorComponents.contains("intel"))
68  m_isIntel = true;
69  if (vendorComponents.contains("imagination"))
70  m_isImagination = true;
7151}
7252
7353ExtensionsGLANGLE::~ExtensionsGLANGLE() = default;

@@bool ExtensionsGLANGLE::isEnabled(const String& name)
10383 return m_availableExtensions.contains(name) || m_enabledExtensions.contains(name);
10484}
10585
106 int ExtensionsGLANGLE::getGraphicsResetStatusARB()
 86GLint ExtensionsGLANGLE::getGraphicsResetStatusARB()
10787{
10888 return GraphicsContextGL::NO_ERROR;
10989}

@@String ExtensionsGLANGLE::getTranslatedShaderSourceANGLE(PlatformGLObject shader
11494 return String();
11595
11696 int sourceLength = m_context->getShaderi(shader, GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE);
 97
11798 if (!sourceLength)
11899 return emptyString();
119100 Vector<GLchar> name(sourceLength); // GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE includes null termination.
120  int returnedLength = 0;
 101 GCGLint returnedLength = 0;
121102 gl::GetTranslatedShaderSourceANGLE(shader, sourceLength, &returnedLength, name.data());
122103 if (!returnedLength)
123104 return emptyString();

@@void ExtensionsGLANGLE::initializeAvailableExtensions()
147128 m_initializedAvailableExtensions = true;
148129}
149130
150 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)
 131void ExtensionsGLANGLE::blitFramebufferANGLE(GCGLint srcX0, GCGLint srcY0, GCGLint srcX1, GCGLint srcY1, GCGLint dstX0, GCGLint dstY0, GCGLint dstX1, GCGLint dstY1, GCGLbitfield mask, GCGLenum filter)
151132{
152133 // FIXME: consider adding support for APPLE_framebuffer_multisample.
153134 if (!m_context->makeContextCurrent())

@@void ExtensionsGLANGLE::blitFramebuffer(long srcX0, long srcY0, long srcX1, long
156137 gl::BlitFramebufferANGLE(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
157138}
158139
159 void ExtensionsGLANGLE::renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height)
 140void ExtensionsGLANGLE::renderbufferStorageMultisampleANGLE(GCGLenum target, GCGLsizei samples, GCGLenum internalformat, GCGLsizei width, GCGLsizei height)
160141{
161142 if (!m_context->makeContextCurrent())
162143 return;

@@void ExtensionsGLANGLE::drawBuffersEXT(GCGLSpan<const GCGLenum> bufs)
235216 gl::DrawBuffersEXT(bufs.bufSize, bufs.data);
236217}
237218
238 void ExtensionsGLANGLE::drawArraysInstanced(GCGLenum mode, GCGLint first, GCGLsizei count, GCGLsizei primcount)
 219void ExtensionsGLANGLE::drawArraysInstancedANGLE(GCGLenum mode, GCGLint first, GCGLsizei count, GCGLsizei primcount)
239220{
240221 if (!m_context->makeContextCurrent())
241222 return;

@@void ExtensionsGLANGLE::drawArraysInstanced(GCGLenum mode, GCGLint first, GCGLsi
243224 gl::DrawArraysInstancedANGLE(mode, first, count, primcount);
244225}
245226
246 void ExtensionsGLANGLE::drawElementsInstanced(GCGLenum mode, GCGLsizei count, GCGLenum type, long long offset, GCGLsizei primcount)
 227void ExtensionsGLANGLE::drawElementsInstancedANGLE(GCGLenum mode, GCGLsizei count, GCGLenum type, GCGLvoidptr offset, GCGLsizei primcount)
247228{
248229 if (!m_context->makeContextCurrent())
249230 return;
250231
251  gl::DrawElementsInstancedANGLE(mode, count, type, reinterpret_cast<GLvoid*>(static_cast<intptr_t>(offset)), primcount);
 232 gl::DrawElementsInstancedANGLE(mode, count, type, reinterpret_cast<GLvoid*>(offset), primcount);
252233}
253234
254 void ExtensionsGLANGLE::vertexAttribDivisor(GCGLuint index, GCGLuint divisor)
 235void ExtensionsGLANGLE::vertexAttribDivisorANGLE(GCGLuint index, GCGLuint divisor)
255236{
256237 if (!m_context->makeContextCurrent())
257238 return;

@@void ExtensionsGLANGLE::getVertexAttribIuivRobustANGLE(GCGLuint index, GCGLenum
350331 gl::GetVertexAttribIuivRobustANGLE(index, pname, bufSize, length, params);
351332}
352333
353 void ExtensionsGLANGLE::getUniformuivRobustANGLE(GCGLuint program, int location, GCGLsizei bufSize, GCGLsizei *length, GCGLuint *params)
 334void ExtensionsGLANGLE::getUniformuivRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei *length, GCGLuint *params)
354335{
355336 if (!m_context->makeContextCurrent())
356337 return;

@@void ExtensionsGLANGLE::getMultisamplefvRobustANGLE(GCGLenum pname, GCGLuint ind
431412 gl::GetMultisamplefvRobustANGLE(pname, index, bufSize, length, val);
432413}
433414
434 void ExtensionsGLANGLE::getTexLevelParameterivRobustANGLE(GCGLenum target, int level, GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, GCGLint *params)
 415void ExtensionsGLANGLE::getTexLevelParameterivRobustANGLE(GCGLenum target, GCGLint level, GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, GCGLint *params)
435416{
436417 if (!m_context->makeContextCurrent())
437418 return;

@@void ExtensionsGLANGLE::getTexLevelParameterivRobustANGLE(GCGLenum target, int l
439420 gl::GetTexLevelParameterivRobustANGLE(target, level, pname, bufSize, length, params);
440421}
441422
442 void ExtensionsGLANGLE::getTexLevelParameterfvRobustANGLE(GCGLenum target, int level, GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, GCGLfloat *params)
 423void ExtensionsGLANGLE::getTexLevelParameterfvRobustANGLE(GCGLenum target, GCGLint level, GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, GCGLfloat *params)
443424{
444425 if (!m_context->makeContextCurrent())
445426 return;

@@void ExtensionsGLANGLE::getPointervRobustANGLERobustANGLE(GCGLenum pname, GCGLsi
456437 gl::GetPointervRobustANGLERobustANGLE(pname, bufSize, length, params);
457438}
458439
459 #if PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
460 static void wipeAlphaChannelFromPixels(int width, int height, unsigned char* pixels)
461 {
462  // We can assume this doesn't overflow because the calling functions
463  // use checked arithmetic.
464  int totalBytes = width * height * 4;
465  for (int i = 0; i < totalBytes; i += 4)
466  pixels[i + 3] = 255;
467 }
468 #endif
469 
470 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)
471 {
472  if (!m_context->makeContextCurrent())
473  return;
474 
475  // FIXME: remove the two glFlush calls when the driver bug is fixed, i.e.,
476  // all previous rendering calls should be done before reading pixels.
477  gl::Flush();
478  auto attrs = m_context->contextAttributes();
479  GCGLenum framebufferTarget = m_context->m_isForWebGL2 ? GraphicsContextGL::READ_FRAMEBUFFER : GraphicsContextGL::FRAMEBUFFER;
480  const GraphicsContextGLOpenGL::GraphicsContextGLState& state = m_context->m_state;
481  if (attrs.antialias && state.boundReadFBO == m_context->m_multisampleFBO) {
482  m_context->resolveMultisamplingIfNecessary(IntRect(x, y, width, height));
483  gl::BindFramebuffer(framebufferTarget, m_context->m_fbo);
484  gl::Flush();
485  }
486  (void) m_context->moveErrorsToSyntheticErrorList();
487  gl::ReadnPixelsRobustANGLE(x, y, width, height, format, type, bufSize, length, columns, rows, data);
488  GLenum error = gl::GetError();
489  if (attrs.antialias && state.boundReadFBO == m_context->m_multisampleFBO)
490  gl::BindFramebuffer(framebufferTarget, m_context->m_multisampleFBO);
491 
492  if (error) {
493  // ANGLE detected a failure during the ReadnPixelsRobustANGLE operation. Surface this in the
494  // synthetic error list, and skip the alpha channel fixup below.
495  m_context->synthesizeGLError(error);
496  return;
497  }
498 
499 #if PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
500  if (!readingToPixelBufferObject && !attrs.alpha && (format == GraphicsContextGL::RGBA || format == GraphicsContextGL::BGRA) && (type == GraphicsContextGL::UNSIGNED_BYTE) && (state.boundReadFBO == m_context->m_fbo || (attrs.antialias && state.boundReadFBO == m_context->m_multisampleFBO)))
501  wipeAlphaChannelFromPixels(width, height, static_cast<unsigned char*>(data));
502 #else
503  UNUSED_PARAM(readingToPixelBufferObject);
504 #endif
505 }
506 
507 void ExtensionsGLANGLE::getnUniformfvRobustANGLE(GCGLuint program, int location, GCGLsizei bufSize, GCGLsizei *length, GCGLfloat *params)
 440void ExtensionsGLANGLE::getnUniformfvRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei *length, GCGLfloat *params)
508441{
509442 if (!m_context->makeContextCurrent())
510443 return;

@@void ExtensionsGLANGLE::getnUniformfvRobustANGLE(GCGLuint program, int location,
512445 gl::GetnUniformfvRobustANGLE(program, location, bufSize, length, params);
513446}
514447
515 void ExtensionsGLANGLE::getnUniformivRobustANGLE(GCGLuint program, int location, GCGLsizei bufSize, GCGLsizei *length, GCGLint *params)
 448void ExtensionsGLANGLE::getnUniformivRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei *length, GCGLint *params)
516449{
517450 if (!m_context->makeContextCurrent())
518451 return;

@@void ExtensionsGLANGLE::getnUniformivRobustANGLE(GCGLuint program, int location,
520453 gl::GetnUniformivRobustANGLE(program, location, bufSize, length, params);
521454}
522455
523 void ExtensionsGLANGLE::getnUniformuivRobustANGLE(GCGLuint program, int location, GCGLsizei bufSize, GCGLsizei *length, GCGLuint *params)
 456void ExtensionsGLANGLE::getnUniformuivRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei *length, GCGLuint *params)
524457{
525458 if (!m_context->makeContextCurrent())
526459 return;

Source/WebCore/platform/graphics/angle/ExtensionsGLANGLE.h

@@public:
5656
5757 String getTranslatedShaderSourceANGLE(PlatformGLObject) override;
5858
59  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;
60  void renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height) override;
 59 void blitFramebufferANGLE(GCGLint srcX0, GCGLint srcY0, GCGLint srcX1, GCGLint srcY1, GCGLint dstX0, GCGLint dstY0, GCGLint dstX1, GCGLint dstY1, GCGLbitfield mask, GCGLenum filter) override;
 60 void renderbufferStorageMultisampleANGLE(GCGLenum target, GCGLsizei samples, GCGLenum internalformat, GCGLsizei width, GCGLsizei height) override;
6161
62  void drawArraysInstanced(GCGLenum mode, GCGLint first, GCGLsizei count, GCGLsizei primcount) override;
63  void drawElementsInstanced(GCGLenum mode, GCGLsizei count, GCGLenum type, long long offset, GCGLsizei primcount) override;
64  void vertexAttribDivisor(GCGLuint index, GCGLuint divisor) override;
65 
66  bool isNVIDIA() override { return m_isNVIDIA; }
67  bool isAMD() override { return m_isAMD; }
68  bool isIntel() override { return m_isIntel; }
69  bool isImagination() override { return m_isImagination; }
70  String vendor() override { return m_vendor; }
71 
72  bool requiresBuiltInFunctionEmulation() override { return m_requiresBuiltInFunctionEmulation; }
73  bool requiresRestrictedMaximumTextureSize() override { return m_requiresRestrictedMaximumTextureSize; }
 62 void drawArraysInstancedANGLE(GCGLenum mode, GCGLint first, GCGLsizei count, GCGLsizei primcount) override;
 63 void drawElementsInstancedANGLE(GCGLenum mode, GCGLsizei count, GCGLenum type, GCGLvoidptr offset, GCGLsizei primcount) override;
 64 void vertexAttribDivisorANGLE(GCGLuint index, GCGLuint divisor) override;
7465
7566 // GL_ANGLE_robust_client_memory
7667 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;

@@public:
9788 void getTexLevelParameterfvRobustANGLE(GCGLenum target, GCGLint level, GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, GCGLfloat *params) override;
9889
9990 void getPointervRobustANGLERobustANGLE(GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, void **params) override;
100  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;
10191 void getnUniformfvRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei *length, GCGLfloat *params) override;
10292 void getnUniformivRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei *length, GCGLint *params) override;
10393 void getnUniformuivRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei *length, GCGLuint *params) override;

@@private:
130120 // Weak pointer back to GraphicsContextGLOpenGL.
131121 GraphicsContextGLOpenGL* m_context;
132122
133  bool m_isNVIDIA;
134  bool m_isAMD;
135  bool m_isIntel;
136  bool m_isImagination;
137  bool m_requiresBuiltInFunctionEmulation;
138  bool m_requiresRestrictedMaximumTextureSize;
139 
140123 bool m_useIndexedGetString { false };
141124
142  String m_vendor;
143  String m_renderer;
144 
145125 // Whether the WebGL 1.0-related floating-point renderability extensions have been enabled.
146126 bool m_webglColorBufferFloatRGB { false };
147127 bool m_webglColorBufferFloatRGBA { false };

Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp

@@ExtensionsGL& GraphicsContextGLOpenGL::getExtensions()
443443 return *m_extensions;
444444}
445445
446 void GraphicsContextGLOpenGL::readPixels(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, void* data)
 446void GraphicsContextGLOpenGL::readnPixels(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLSpan<GCGLvoid> data)
 447{
 448 readnPixelsImpl(x, y, width, height, format, type, data.bufSize, nullptr, nullptr, nullptr, data.data, false);
 449}
 450
 451void GraphicsContextGLOpenGL::readnPixels(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLintptr offset)
 452{
 453 readnPixelsImpl(x, y, width, height, format, type, 0, nullptr, nullptr, nullptr, reinterpret_cast<GCGLvoid*>(offset), true);
 454}
 455
 456void GraphicsContextGLOpenGL::readnPixelsImpl(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, GCGLsizei* length, GCGLsizei* columns, GCGLsizei* rows, GCGLvoid* data, bool readingToPixelBufferObject)
447457{
448  // FIXME: remove the two glFlush calls when the driver bug is fixed, i.e.,
449  // all previous rendering calls should be done before reading pixels.
450458 if (!makeContextCurrent())
451459 return;
452460
 461 // FIXME: remove the two glFlush calls when the driver bug is fixed, i.e.,
 462 // all previous rendering calls should be done before reading pixels.
453463 gl::Flush();
454464 auto attrs = contextAttributes();
455465 GCGLenum framebufferTarget = m_isForWebGL2 ? GraphicsContextGL::READ_FRAMEBUFFER : GraphicsContextGL::FRAMEBUFFER;
456  if (attrs.antialias && m_state.boundReadFBO == m_multisampleFBO) {
 466 const GraphicsContextGLOpenGL::GraphicsContextGLState& state = m_state;
 467 if (attrs.antialias && state.boundReadFBO == m_multisampleFBO) {
457468 resolveMultisamplingIfNecessary(IntRect(x, y, width, height));
458469 gl::BindFramebuffer(framebufferTarget, m_fbo);
459470 gl::Flush();
460471 }
461  gl::ReadPixels(x, y, width, height, format, type, data);
462  if (attrs.antialias && m_state.boundReadFBO == m_multisampleFBO)
 472 moveErrorsToSyntheticErrorList();
 473 gl::ReadnPixelsRobustANGLE(x, y, width, height, format, type, bufSize, length, columns, rows, data);
 474 GLenum error = gl::GetError();
 475 if (attrs.antialias && state.boundReadFBO == m_multisampleFBO)
463476 gl::BindFramebuffer(framebufferTarget, m_multisampleFBO);
464477
 478 if (error) {
 479 // ANGLE detected a failure during the ReadnPixelsRobustANGLE operation. Surface this in the
 480 // synthetic error list, and skip the alpha channel fixup below.
 481 synthesizeGLError(error);
 482 return;
 483 }
 484
465485#if PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
466  if (!attrs.alpha && (format == GraphicsContextGL::RGBA || format == GraphicsContextGL::BGRA) && (type == GraphicsContextGL::UNSIGNED_BYTE) && (m_state.boundReadFBO == m_fbo || (attrs.antialias && m_state.boundReadFBO == m_multisampleFBO)))
 486 if (!readingToPixelBufferObject && !attrs.alpha && (format == GraphicsContextGL::RGBA || format == GraphicsContextGL::BGRA) && (type == GraphicsContextGL::UNSIGNED_BYTE) && (state.boundReadFBO == m_fbo || (attrs.antialias && state.boundReadFBO == m_multisampleFBO)))
467487 wipeAlphaChannelFromPixels(width, height, static_cast<unsigned char*>(data));
 488#else
 489 UNUSED_PARAM(readingToPixelBufferObject);
468490#endif
469491}
470492
471 
472493// The contents of GraphicsContextGLOpenGLCommon follow, ported to use ANGLE.
473494
474495void GraphicsContextGLOpenGL::validateDepthStencil(const char* packedDepthStencilExtension)

@@void GraphicsContextGLOpenGL::bufferSubData(GCGLenum target, GCGLintptr offset,
898919 gl::BufferSubData(target, offset, data.bufSize, data.data);
899920}
900921
901 void* GraphicsContextGLOpenGL::mapBufferRange(GCGLenum target, GCGLintptr offset, GCGLsizeiptr length, GCGLbitfield access)
 922void GraphicsContextGLOpenGL::getBufferSubData(GCGLenum target, GCGLintptr offset, GCGLSpan<GCGLvoid> data)
902923{
903924 if (!makeContextCurrent())
904  return nullptr;
905 
906  return gl::MapBufferRange(target, offset, length, access);
907 }
908 
909 GCGLboolean GraphicsContextGLOpenGL::unmapBuffer(GCGLenum target)
910 {
911  if (!makeContextCurrent())
912  return GL_FALSE;
913 
914  return gl::UnmapBuffer(target);
 925 return;
 926 GCGLvoid* ptr = gl::MapBufferRange(target, offset, data.bufSize, GraphicsContextGL::MAP_READ_BIT);
 927 if (!ptr)
 928 return;
 929 memcpy(data.data, ptr, data.bufSize);
 930 if (!gl::UnmapBuffer(target))
 931 synthesizeGLError(GraphicsContextGL::INVALID_OPERATION);
915932}
916933
917934void GraphicsContextGLOpenGL::copyBufferSubData(GCGLenum readTarget, GCGLenum writeTarget, GCGLintptr readOffset, GCGLintptr writeOffset, GCGLsizeiptr size)

@@void GraphicsContextGLOpenGL::compressedTexSubImage3D(GCGLenum target, int level
10081025 compressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, makeGCGLSpan(reinterpret_cast<const GCGLvoid*>(offset), 0));
10091026}
10101027
1011 void GraphicsContextGLOpenGL::getActiveUniforms(PlatformGLObject program, const Vector<GCGLuint>& uniformIndices, GCGLenum pname, Vector<GCGLint>& params)
 1028Vector<GCGLint> GraphicsContextGLOpenGL::getActiveUniforms(PlatformGLObject program, const Vector<GCGLuint>& uniformIndices, GCGLenum pname)
10121029{
 1030 Vector<GCGLint> result(uniformIndices.size(), 0);
10131031 ASSERT(program);
10141032 if (!makeContextCurrent())
1015  return;
1016 
 1033 return result;
10171034
1018  gl::GetActiveUniformsiv(program, uniformIndices.size(), uniformIndices.data(), pname, params.data());
 1035 gl::GetActiveUniformsiv(program, uniformIndices.size(), uniformIndices.data(), pname, result.data());
 1036 return result;
10191037}
10201038
10211039GCGLenum GraphicsContextGLOpenGL::checkFramebufferStatus(GCGLenum target)

@@GCGLint GraphicsContextGLOpenGL::getUniformLocation(PlatformGLObject program, co
21012119 return gl::GetUniformLocation(program, name.utf8().data());
21022120}
21032121
2104 void GraphicsContextGLOpenGL::getVertexAttribfv(GCGLuint index, GCGLenum pname, GCGLSpan<GCGLfloat> value)
2105 {
2106  if (!makeContextCurrent())
2107  return;
2108 
2109  gl::GetVertexAttribfvRobustANGLE(index, pname, value.bufSize, nullptr, value.data);
2110 }
2111 
2112 void GraphicsContextGLOpenGL::getVertexAttribiv(GCGLuint index, GCGLenum pname, GCGLSpan<GCGLint> value)
2113 {
2114  if (!makeContextCurrent())
2115  return;
2116 
2117  gl::GetVertexAttribivRobustANGLE(index, pname, value.bufSize, nullptr, value.data);
2118 }
2119 
21202122GCGLsizeiptr GraphicsContextGLOpenGL::getVertexAttribOffset(GCGLuint index, GCGLenum pname)
21212123{
21222124 if (!makeContextCurrent())

@@void GraphicsContextGLOpenGL::endQuery(GCGLenum target)
23922394 gl::EndQuery(target);
23932395}
23942396
2395 void GraphicsContextGLOpenGL::getQueryObjectuiv(GCGLuint id, GCGLenum pname, GCGLuint* params)
 2397GCGLuint GraphicsContextGLOpenGL::getQueryObjectui(GCGLuint id, GCGLenum pname)
23962398{
 2399 GCGLuint value = 0;
23972400 if (!makeContextCurrent())
2398  return;
2399 
2400  gl::GetQueryObjectuiv(id, pname, params);
 2401 return value;
 2402 gl::GetQueryObjectuivRobustANGLE(id, pname, 1, nullptr, &value);
 2403 return value;
24012404}
24022405
24032406// Transform Feedback Functions

@@void GraphicsContextGLOpenGL::samplerParameterf(PlatformGLObject sampler, GCGLen
28392842 gl::SamplerParameterf(sampler, pname, param);
28402843}
28412844
2842 void GraphicsContextGLOpenGL::getSamplerParameterfv(PlatformGLObject sampler, GCGLenum pname, GCGLfloat* value)
 2845GCGLfloat GraphicsContextGLOpenGL::getSamplerParameterf(PlatformGLObject sampler, GCGLenum pname)
28432846{
 2847 GCGLfloat value = 0.f;
28442848 if (!makeContextCurrent())
2845  return;
 2849 return value;
28462850
2847  gl::GetSamplerParameterfv(sampler, pname, value);
 2851 gl::GetSamplerParameterfvRobustANGLE(sampler, pname, 1, nullptr, &value);
 2852 return value;
28482853}
28492854
2850 void GraphicsContextGLOpenGL::getSamplerParameteriv(PlatformGLObject sampler, GCGLenum pname, GCGLint* value)
 2855GCGLint GraphicsContextGLOpenGL::getSamplerParameteri(PlatformGLObject sampler, GCGLenum pname)
28512856{
 2857 GCGLint value = 0;
28522858 if (!makeContextCurrent())
2853  return;
 2859 return value;
28542860
2855  gl::GetSamplerParameteriv(sampler, pname, value);
 2861 gl::GetSamplerParameterivRobustANGLE(sampler, pname, 1, nullptr, &value);
 2862 return value;
28562863}
28572864
28582865GCGLsync GraphicsContextGLOpenGL::fenceSync(GCGLenum condition, GCGLbitfield flags)

@@void GraphicsContextGLOpenGL::waitSync(GCGLsync sync, GCGLbitfield flags, GCGLin
28952902 gl::WaitSync(sync, flags, timeout);
28962903}
28972904
2898 void GraphicsContextGLOpenGL::getSynciv(GCGLsync sync, GCGLenum pname, GCGLsizei bufSize, GCGLint *value)
 2905GCGLint GraphicsContextGLOpenGL::getSynci(GCGLsync sync, GCGLenum pname)
28992906{
 2907 GCGLint value = 0;
29002908 if (!makeContextCurrent())
2901  return;
 2909 return value;
29022910
2903  gl::GetSynciv(sync, pname, bufSize, nullptr, value);
 2911 gl::GetSynciv(sync, pname, 1, nullptr, &value);
 2912 return value;
29042913}
29052914
29062915void GraphicsContextGLOpenGL::pauseTransformFeedback()

Source/WebCore/platform/graphics/cocoa/GraphicsContextGLIOSurfaceSwapChain.cpp

 1/*
 2 * Copyright (C) 2009, 2014-2019 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#include "config.h"
 27#include "GraphicsContextGLIOSurfaceSwapChain.h"
 28
 29#if ENABLE(GRAPHICS_CONTEXT_GL) && PLATFORM(COCOA)
 30
 31namespace WebCore {
 32
 33GraphicsContextGLIOSurfaceSwapChain::~GraphicsContextGLIOSurfaceSwapChain() = default;
 34
 35}
 36
 37#endif

Source/WebCore/platform/graphics/cocoa/GraphicsContextGLIOSurfaceSwapChain.h

 1/*
 2 * Copyright (C) 2009, 2014-2019 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#pragma once
 27
 28#if ENABLE(GRAPHICS_CONTEXT_GL) && PLATFORM(COCOA)
 29
 30#include "IOSurface.h"
 31#include <memory>
 32
 33namespace WebCore {
 34
 35// An interface for implementing front buffer management of a 3-buffering swap
 36// chain of IOSurfaces.
 37// The implementor will own the IOSurfaces it uses for display.
 38// The client may attach metadata to each IOSurface and will receive the metadata
 39// back once the IOSurface has been displayed. However, the client may not neccessarily
 40// be able to obtain the IOSurface itself for reuse.
 41// Example use of the metadata is to use EGLSurface binding as the metadata. This way
 42// when the display client is done with the IOSurface display, the client can continue using
 43// the existing binding obtained through the buffer recycle logic.
 44class WEBCORE_EXPORT GraphicsContextGLIOSurfaceSwapChain {
 45public:
 46 virtual ~GraphicsContextGLIOSurfaceSwapChain();
 47 struct Buffer {
 48 std::unique_ptr<WebCore::IOSurface> surface; // The actual contents.
 49 void* handle { nullptr }; // Producer specific metadata handle (such as EGLSurface).
 50 };
 51 // Returns the metadata handle of last unused contents buffer.
 52 // Client may recieve back also the ownership of the contents surface, in case it is available at the
 53 // time of the call.
 54 // Returns either:
 55 // - Empty buffer if no buffer has been submitted.
 56 // - Buffer with empty surface and non-empty metadata handle if the recycled buffer was available
 57 // but the surface is still in use.
 58 // - Surface and handle.
 59 virtual Buffer recycleBuffer() = 0;
 60
 61 // Prepares the target for display with a contents buffer.
 62 // Client transfers the ownership of the IOSurface surface in the `buffer`.
 63 virtual void present(Buffer) = 0;
 64
 65 // Detaches the client and returns the current contents buffer metadata handle.
 66 // The if multiple buffers have been submitted, recycleBuffer must have been called before calling
 67 // this.
 68 virtual void* detachClient() = 0;
 69};
 70
 71}
 72
 73#endif

Source/WebCore/platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm

2020 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
2121 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2222 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2424 */
2525
2626#import "config.h"

@@static EGLDisplay InitializeEGLDisplay()
8181 EGLint majorVersion = 0;
8282 EGLint minorVersion = 0;
8383 EGLDisplay display;
84  bool shouldInitializeWithVolatileContextSupport = !isInWebProcess();
 84 bool shouldInitializeWithVolatileContextSupport = !(isInWebProcess() || isInGPUProcess());
8585 if (shouldInitializeWithVolatileContextSupport) {
8686 // For WK1 type APIs we need to set "volatile platform context" for specific
8787 // APIs, since client code will be able to override the thread-global context

@@RefPtr<GraphicsContextGLOpenGL> GraphicsContextGLOpenGL::create(GraphicsContextG
134134 if (GraphicsContextGLOpenGLManager::sharedManager().hasTooManyContexts())
135135 return nullptr;
136136
137  RefPtr<GraphicsContextGLOpenGL> context = adoptRef(new GraphicsContextGLOpenGL(attrs, hostWindow, destination));
 137 RefPtr<GraphicsContextGLOpenGL> context = adoptRef(new GraphicsContextGLOpenGL(attrs, hostWindow, destination, nullptr, nullptr));
138138
139139 if (!context->m_contextObj)
140140 return nullptr;

@@RefPtr<GraphicsContextGLOpenGL> GraphicsContextGLOpenGL::create(GraphicsContextG
147147Ref<GraphicsContextGLOpenGL> GraphicsContextGLOpenGL::createShared(GraphicsContextGLOpenGL& sharedContext)
148148{
149149 auto hostWindow = GraphicsContextGLOpenGLManager::sharedManager().hostWindowForContext(&sharedContext);
150  auto context = adoptRef(*new GraphicsContextGLOpenGL(sharedContext.contextAttributes(), hostWindow, sharedContext.destination(), &sharedContext));
 150 auto context = adoptRef(*new GraphicsContextGLOpenGL(sharedContext.contextAttributes(), hostWindow, sharedContext.destination(), &sharedContext, nullptr));
151151
152152 GraphicsContextGLOpenGLManager::sharedManager().addContext(context.ptr(), hostWindow);
153153
154154 return context;
155155}
156156
 157Ref<GraphicsContextGLOpenGL> GraphicsContextGLOpenGL::createForGPUProcess(const GraphicsContextGLAttributes& attrs, GraphicsContextGLIOSurfaceSwapChain& swapChain)
 158{
 159 return adoptRef(*new GraphicsContextGLOpenGL(attrs, nullptr, GraphicsContextGL::Destination::Offscreen, nullptr, &swapChain));
 160}
 161
157162#if PLATFORM(MAC) // FIXME: This probably should be just enabled - see <rdar://53062794>.
158163
159164static void setGPUByRegistryID(CGLContextObj contextObj, CGLPixelFormatObj pixelFormatObj, IORegistryGPUID preferredGPUID)

@@static void setGPUByRegistryID(CGLContextObj contextObj, CGLPixelFormatObj pixel
204209
205210#endif // PLATFORM(MAC)
206211
207 GraphicsContextGLOpenGL::GraphicsContextGLOpenGL(GraphicsContextGLAttributes attrs, HostWindow* hostWindow, GraphicsContextGL::Destination destination, GraphicsContextGLOpenGL* sharedContext)
 212GraphicsContextGLOpenGL::GraphicsContextGLOpenGL(GraphicsContextGLAttributes attrs, HostWindow* hostWindow, GraphicsContextGL::Destination destination, GraphicsContextGLOpenGL* sharedContext, GraphicsContextGLIOSurfaceSwapChain* swapChain)
208213 : GraphicsContextGL(attrs, destination, sharedContext)
209214{
210215 m_isForWebGL2 = attrs.isWebGL2;

@@GraphicsContextGLOpenGL::GraphicsContextGLOpenGL(GraphicsContextGLAttributes att
331336 validateAttributes();
332337 attrs = contextAttributes(); // They may have changed during validation.
333338
334  // Create the WebGLLayer
335  BEGIN_BLOCK_OBJC_EXCEPTIONS
336  m_webGLLayer = adoptNS([[WebGLLayer alloc] initWithDevicePixelRatio:attrs.devicePixelRatio contentsOpaque:!attrs.alpha]);
 339 if (swapChain)
 340 m_swapChain = swapChain;
 341 else {
 342 BEGIN_BLOCK_OBJC_EXCEPTIONS
 343 m_webGLLayer = adoptNS([[WebGLLayer alloc] initWithDevicePixelRatio:attrs.devicePixelRatio contentsOpaque:!attrs.alpha]);
337344#ifndef NDEBUG
338  [m_webGLLayer setName:@"WebGL Layer"];
 345 [m_webGLLayer setName:@"WebGL Layer"];
339346#endif
340  END_BLOCK_OBJC_EXCEPTIONS
 347 END_BLOCK_OBJC_EXCEPTIONS
 348 m_swapChain = &[m_webGLLayer swapChain];
 349 }
341350
342351 // Create the texture that will be used for the framebuffer.
343352 GLenum textureTarget = IOSurfaceTextureTarget();

@@GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL()
406415 if (m_preserveDrawingBufferFBO)
407416 gl::DeleteFramebuffers(1, &m_preserveDrawingBufferFBO);
408417 }
409  if (m_displayBufferPbuffer)
 418 if (m_displayBufferPbuffer) {
410419 EGL_DestroySurface(m_displayObj, m_displayBufferPbuffer);
411  if (m_webGLLayer) {
412  auto recycledBuffer = [m_webGLLayer recycleBuffer];
 420 auto recycledBuffer = m_swapChain->recycleBuffer();
413421 if (recycledBuffer.handle)
414422 EGL_DestroySurface(m_displayObj, recycledBuffer.handle);
415  auto contentsHandle = [m_webGLLayer detachClient];
 423 auto contentsHandle = m_swapChain->detachClient();
416424 if (contentsHandle)
417425 EGL_DestroySurface(m_displayObj, contentsHandle);
418426 }

@@bool GraphicsContextGLOpenGL::reshapeDisplayBufferBacking()
575583 m_displayBufferPbuffer = EGL_NO_SURFACE;
576584 }
577585 // Reset the future recycled buffer now, because it most likely will not be reusable at the time it will be reused.
578  auto recycledBuffer = [m_webGLLayer recycleBuffer];
 586 auto recycledBuffer = m_swapChain->recycleBuffer();
579587 if (recycledBuffer.handle)
580588 EGL_DestroySurface(m_displayObj, recycledBuffer.handle);
581589 recycledBuffer.surface.reset();
 590 return allocateAndBindDisplayBufferBacking();
 591}
582592
 593bool GraphicsContextGLOpenGL::allocateAndBindDisplayBufferBacking()
 594{
 595 ASSERT(!getInternalFramebufferSize().isEmpty());
583596 auto backing = WebCore::IOSurface::create(getInternalFramebufferSize(), WebCore::sRGBColorSpaceRef());
584597 if (!backing)
585598 return false;

@@bool GraphicsContextGLOpenGL::allowOfflineRenderers() const
637650 // for OpenGL to decide which GPU is connected to a display (online/offline).
638651 // OpenGL will then consider all GPUs, or renderers, as offline, which means
639652 // all offline renderers need to be considered when finding a pixel format.
640  // In WebKit legacy, there will still be a WindowServer connection, and
 653 // In WebKit legacy, there will still be a WindwServer connection, and
641654 // m_displayMask will not be set in this case.
642655 if (primaryOpenGLDisplayMask())
643656 return true;

@@bool GraphicsContextGLOpenGL::allowOfflineRenderers() const
646659 // and MAC/MACCATALYST and OPENGL/OPENGLES.
647660 return true;
648661#endif
649 
 662
650663#if HAVE(APPLE_GRAPHICS_CONTROL)
651664 if (hasLowAndHighPowerGPUs())
652665 return true;
653666#endif
654 
 667
655668 return false;
656669}
657670

@@void GraphicsContextGLOpenGL::prepareForDisplay()
683696 // The IOSurface will be used from other graphics subsystem, so flush GL commands.
684697 gl::Flush();
685698
686  auto recycledBuffer = [m_webGLLayer recycleBuffer];
 699 auto recycledBuffer = m_swapChain->recycleBuffer();
687700
688701 EGL_ReleaseTexImage(m_displayObj, m_displayBufferPbuffer, EGL_BACK_BUFFER);
689  [m_webGLLayer prepareForDisplayWithContents: {WTFMove(m_displayBufferBacking), m_displayBufferPbuffer}];
 702 m_swapChain->present({ WTFMove(m_displayBufferBacking), m_displayBufferPbuffer });
690703 m_displayBufferPbuffer = EGL_NO_SURFACE;
691704
692705 bool hasNewBacking = false;

@@void GraphicsContextGLOpenGL::prepareForDisplay()
700713
701714 // Error will be handled by next call to makeContextCurrent() which will notice lack of display buffer.
702715 if (!hasNewBacking)
703  reshapeDisplayBufferBacking();
 716 allocateAndBindDisplayBufferBacking();
704717
705718 markLayerComposited();
706719}

Source/WebCore/platform/graphics/cocoa/RemoteGraphicsContextGLProxyBaseCocoa.h

 1/*
 2 * Copyright (C) 2020 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#pragma once
 27
 28#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL)
 29
 30#include "ExtensionsGL.h"
 31#include "GraphicsContextGL.h"
 32
 33#include <wtf/ListHashSet.h>
 34#include <wtf/RetainPtr.h>
 35#include <wtf/text/StringHash.h>
 36
 37OBJC_CLASS WebGLLayer;
 38
 39namespace WebCore {
 40
 41class GraphicsContextGLIOSurfaceSwapChain;
 42
 43// A base class for RemoteGraphicsContextGL proxy side implementation on Cocoa.
 44// This implements the parts that are using WebCore internal functionality:
 45// - Drawing buffer tracking management.
 46// - Compositing support.
 47// The parts were needed to be implemented due to lack of abstractions and
 48// small pending fixes at the time of writing.
 49class WEBCORE_EXPORT RemoteGraphicsContextGLProxyBaseCocoa : public GraphicsContextGL, public ExtensionsGL {
 50public:
 51 RemoteGraphicsContextGLProxyBaseCocoa(const GraphicsContextGLAttributes&);
 52 ~RemoteGraphicsContextGLProxyBaseCocoa() override;
 53
 54 // Other WebCore::GraphicsContextGL overrides.
 55 using GraphicsContextGL::isEnabled;
 56 PlatformGraphicsContextGL platformGraphicsContextGL() const final;
 57 PlatformGLObject platformTexture() const final;
 58 PlatformLayer* platformLayer() const final;
 59 ExtensionsGL& getExtensions() final;
 60 void setContextVisibility(bool) final;
 61 GraphicsContextGLPowerPreference powerPreferenceUsedForCreation() const final;
 62 bool isGLES2Compliant() const final;
 63 void markContextChanged() final;
 64 bool layerComposited() const final;
 65 void setBuffersToAutoClear(GCGLbitfield) final;
 66 GCGLbitfield getBuffersToAutoClear() const final;
 67 void paintRenderingResultsToCanvas(ImageBuffer*) final;
 68 RefPtr<ImageData> paintRenderingResultsToImageData() final;
 69 bool paintCompositedResultsToCanvas(ImageBuffer*) final;
 70 void markLayerComposited() final;
 71 void enablePreserveDrawingBuffer() final;
 72
 73#if ENABLE(VIDEO) && USE(AVFOUNDATION)
 74 GraphicsContextGLCV* asCV() final;
 75#endif
 76 // Other ExtensionGL overrides.
 77 using ExtensionsGL::isEnabled;
 78 bool supports(const String&) final;
 79 void ensureEnabled(const String&) final;
 80 bool isEnabled(const String&) final;
 81
 82protected:
 83 void initialize(const String& availableExtensions, const String& requestableExtensions);
 84 virtual void waitUntilInitialized() = 0;
 85 virtual void ensureExtensionEnabled(const String&) = 0;
 86 virtual void notifyMarkContextChanged() = 0;
 87 GraphicsContextGLIOSurfaceSwapChain& swapChain();
 88
 89private:
 90 RetainPtr<WebGLLayer> m_webGLLayer;
 91
 92 // Guarded by waitUntilInitialized().
 93 HashSet<String> m_availableExtensions;
 94 HashSet<String> m_requestableExtensions;
 95
 96 HashSet<String> m_enabledExtensions;
 97
 98 // FIXME: Drawing buffer clear tracking should be moved to the client.
 99 bool m_layerComposited = false;
 100 GCGLbitfield m_buffersToAutoClear = { 0 };
 101};
 102
 103}
 104#endif

Source/WebCore/platform/graphics/cocoa/RemoteGraphicsContextGLProxyBaseCocoa.mm

 1/*
 2 * Copyright (C) 2020 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#import "config.h"
 27#import "RemoteGraphicsContextGLProxyBaseCocoa.h"
 28
 29#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL)
 30
 31#import "GraphicsContextGLIOSurfaceSwapChain.h"
 32#import "ImageData.h"
 33#import "NotImplemented.h"
 34#import "WebGLLayer.h"
 35#import <wtf/BlockObjCExceptions.h>
 36
 37namespace WebCore {
 38
 39RemoteGraphicsContextGLProxyBaseCocoa::RemoteGraphicsContextGLProxyBaseCocoa(const GraphicsContextGLAttributes& attrs)
 40 : GraphicsContextGL(attrs)
 41{
 42 BEGIN_BLOCK_OBJC_EXCEPTIONS
 43 m_webGLLayer = adoptNS([[WebGLLayer alloc] initWithDevicePixelRatio:attrs.devicePixelRatio contentsOpaque:!attrs.alpha]);
 44#ifndef NDEBUG
 45 [m_webGLLayer setName:@"WebGL Layer"];
 46#endif
 47 END_BLOCK_OBJC_EXCEPTIONS
 48}
 49
 50RemoteGraphicsContextGLProxyBaseCocoa::~RemoteGraphicsContextGLProxyBaseCocoa()
 51{
 52}
 53
 54PlatformGraphicsContextGL RemoteGraphicsContextGLProxyBaseCocoa::platformGraphicsContextGL() const
 55{
 56 return 0;
 57}
 58
 59PlatformGLObject RemoteGraphicsContextGLProxyBaseCocoa::platformTexture() const
 60{
 61 return 0;
 62}
 63
 64PlatformLayer* RemoteGraphicsContextGLProxyBaseCocoa::platformLayer() const
 65{
 66 return m_webGLLayer.get();
 67}
 68
 69
 70ExtensionsGL& RemoteGraphicsContextGLProxyBaseCocoa::getExtensions()
 71{
 72 return *this;
 73}
 74
 75void RemoteGraphicsContextGLProxyBaseCocoa::setContextVisibility(bool)
 76{
 77}
 78
 79GraphicsContextGLPowerPreference RemoteGraphicsContextGLProxyBaseCocoa::powerPreferenceUsedForCreation() const
 80{
 81 return { };
 82}
 83
 84bool RemoteGraphicsContextGLProxyBaseCocoa::isGLES2Compliant() const
 85{
 86 return contextAttributes().isWebGL2;
 87}
 88
 89void RemoteGraphicsContextGLProxyBaseCocoa::markContextChanged()
 90{
 91 // FIXME: The caller should track this state.
 92 if (m_layerComposited)
 93 notifyMarkContextChanged();
 94 m_layerComposited = false;
 95}
 96
 97void RemoteGraphicsContextGLProxyBaseCocoa::markLayerComposited()
 98{
 99 m_layerComposited = true;
 100 auto attrs = contextAttributes();
 101 if (!attrs.preserveDrawingBuffer) {
 102 m_buffersToAutoClear = GraphicsContextGL::COLOR_BUFFER_BIT;
 103 if (attrs.depth)
 104 m_buffersToAutoClear |= GraphicsContextGL::DEPTH_BUFFER_BIT;
 105 if (attrs.stencil)
 106 m_buffersToAutoClear |= GraphicsContextGL::STENCIL_BUFFER_BIT;
 107 }
 108 for (auto* client : copyToVector(m_clients))
 109 client->didComposite();
 110}
 111
 112bool RemoteGraphicsContextGLProxyBaseCocoa::layerComposited() const
 113{
 114 return m_layerComposited;
 115}
 116
 117void RemoteGraphicsContextGLProxyBaseCocoa::setBuffersToAutoClear(GCGLbitfield buffers)
 118{
 119 if (!contextAttributes().preserveDrawingBuffer)
 120 m_buffersToAutoClear = buffers;
 121}
 122
 123GCGLbitfield RemoteGraphicsContextGLProxyBaseCocoa::getBuffersToAutoClear() const
 124{
 125 return m_buffersToAutoClear;
 126}
 127
 128void RemoteGraphicsContextGLProxyBaseCocoa::paintRenderingResultsToCanvas(ImageBuffer*)
 129{
 130}
 131
 132RefPtr<ImageData> RemoteGraphicsContextGLProxyBaseCocoa::paintRenderingResultsToImageData()
 133{
 134 return nullptr;
 135}
 136
 137bool RemoteGraphicsContextGLProxyBaseCocoa::paintCompositedResultsToCanvas(ImageBuffer*)
 138{
 139 return false;
 140}
 141
 142void RemoteGraphicsContextGLProxyBaseCocoa::enablePreserveDrawingBuffer()
 143{
 144 // Redeclared for export reasons.
 145 // FIXME: The whole function should be removed.
 146 GraphicsContextGL::enablePreserveDrawingBuffer();
 147}
 148
 149#if ENABLE(VIDEO) && USE(AVFOUNDATION)
 150GraphicsContextGLCV* RemoteGraphicsContextGLProxyBaseCocoa::asCV()
 151{
 152 return nullptr;
 153}
 154#endif
 155
 156bool RemoteGraphicsContextGLProxyBaseCocoa::supports(const String& name)
 157{
 158 waitUntilInitialized();
 159 return m_availableExtensions.contains(name) || m_requestableExtensions.contains(name);
 160}
 161
 162void RemoteGraphicsContextGLProxyBaseCocoa::ensureEnabled(const String& name)
 163{
 164 waitUntilInitialized();
 165 if (m_requestableExtensions.contains(name) && !m_enabledExtensions.contains(name)) {
 166 ensureExtensionEnabled(name);
 167 m_enabledExtensions.add(name);
 168 }
 169}
 170
 171bool RemoteGraphicsContextGLProxyBaseCocoa::isEnabled(const String& name)
 172{
 173 waitUntilInitialized();
 174 return m_availableExtensions.contains(name) || m_enabledExtensions.contains(name);
 175}
 176
 177void RemoteGraphicsContextGLProxyBaseCocoa::initialize(const String& availableExtensions, const String& requestableExtensions)
 178{
 179 for (auto& extension : availableExtensions.split(' '))
 180 m_availableExtensions.add(extension);
 181 for (auto& extension : requestableExtensions.split(' '))
 182 m_requestableExtensions.add(extension);
 183}
 184
 185GraphicsContextGLIOSurfaceSwapChain& RemoteGraphicsContextGLProxyBaseCocoa::swapChain()
 186{
 187 return [m_webGLLayer swapChain];
 188}
 189
 190}
 191#endif

Source/WebCore/platform/graphics/cocoa/WebGLLayer.h

2323 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2424 */
2525
26 #import "IOSurface.h"
 26#import "GraphicsContextGLIOSurfaceSwapChain.h"
2727#import <QuartzCore/QuartzCore.h>
 28#import <memory>
2829#import <wtf/NakedPtr.h>
2930
30 namespace WebCore {
31 struct WebGLLayerBuffer {
32  std::unique_ptr<WebCore::IOSurface> surface; // The actual contents.
33  void* handle { nullptr }; // Client specific metadata handle (such as EGLSurface).
34 };
35 }
36 
3731ALLOW_DEPRECATED_DECLARATIONS_BEGIN
3832
3933// A layer class implementing front buffer management of a 3-buffering swap
4034// chain of IOSurfaces.
41 // The layer will own the IOSurfaces it uses for display.
42 // The client may attach metadata to each IOSurface and will receive the metadata
43 // back once the IOSurface has been displayed. However, the client may not neccessarily
44 // be able to obtain the IOSurface itself for reuse.
45 // Example use of the metadata is to use EGLSurface binding as the metadata. This way
46 // when the WebGLLayer is done with the IOSurface display, the client can continue using
47 // the existing binding obtained through the buffer recycle logic.
4835@interface WebGLLayer : CALayer
4936
5037- (id)initWithDevicePixelRatio:(float)devicePixelRatio contentsOpaque:(bool)contentsOpaque;
5138
5239- (CGImageRef)copyImageSnapshotWithColorSpace:(CGColorSpaceRef)colorSpace;
5340
54 // Returns the metadata handle of last unused contents buffer.
55 // Client may recieve back also the ownership of the contents surface, in case it is available at the
56 // time of the call.
57 // Returns either:
58 // - Empty buffer if no buffer has been submitted.
59 // - Buffer with empty surface and non-empty metadata handle if the recycled buffer was available
60 // but the surface is still in use.
61 // - Surface and handle.
62 - (WebCore::WebGLLayerBuffer)recycleBuffer;
63 
64 // Prepares the layer for display with a contents buffer.
65 // Client transfers the ownership of the IOSurface surface in the `buffer`.
66 - (void)prepareForDisplayWithContents:(WebCore::WebGLLayerBuffer)buffer;
67 
68 // Detaches the client and returns the current contents buffer metadata handle.
69 // The if multiple buffers have been submitted, recycleBuffer must have been called before calling
70 // this.
71 - (void*)detachClient;
 41- (WebCore::GraphicsContextGLIOSurfaceSwapChain&) swapChain;
7242
7343@end
7444

Source/WebCore/platform/graphics/cocoa/WebGLLayer.mm

2020 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
2121 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2222 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2424 */
2525
2626#import "config.h"

3232#import "GraphicsLayerCA.h"
3333#import "PlatformCALayer.h"
3434#import <pal/spi/cocoa/QuartzCoreSPI.h>
35 #import <wtf/RetainPtr.h>
 35#import <wtf/Optional.h>
 36
 37class WebGLLayerSwapChain final : public WebCore::GraphicsContextGLIOSurfaceSwapChain {
 38public:
 39 explicit WebGLLayerSwapChain(WebGLLayer* layer) : m_layer(layer) { };
 40 ~WebGLLayerSwapChain() override = default;
 41 void present(Buffer) override;
 42 Buffer recycleBuffer() override
 43 {
 44 if (m_spareBuffer.surface) {
 45 if (m_spareBuffer.surface->isInUse())
 46 m_spareBuffer.surface.reset();
 47 return WTFMove(m_spareBuffer);
 48 }
 49 return { };
 50 }
 51 void* detachClient() override
 52 {
 53 ASSERT(!m_spareBuffer.surface);
 54 void* result = m_displayBuffer.handle;
 55 m_displayBuffer.handle = nullptr;
 56 return result;
 57 }
 58 WebCore::IOSurface* displaySurface() { return m_displayBuffer.surface.get(); }
 59private:
 60 Buffer m_displayBuffer;
 61 Buffer m_spareBuffer;
 62 WebGLLayer* const m_layer;
 63};
3664
3765@implementation WebGLLayer {
38  WebCore::WebGLLayerBuffer _contentsBuffer;
39  WebCore::WebGLLayerBuffer _spareBuffer;
40 
4166 BOOL _preparedForDisplay;
 67 Optional<WebGLLayerSwapChain> _swapChain;
4268}
4369
4470- (id)initWithDevicePixelRatio:(float)devicePixelRatio contentsOpaque:(bool)contentsOpaque

4773 self.transform = CATransform3DIdentity;
4874 self.contentsOpaque = contentsOpaque;
4975 self.contentsScale = devicePixelRatio;
 76 _swapChain.emplace(self);
5077 return self;
5178}
5279

73100 UNUSED_PARAM(colorSpace);
74101 return nullptr;
75102}
76 
77 - (WebCore::WebGLLayerBuffer) recycleBuffer
 103- (WebCore::GraphicsContextGLIOSurfaceSwapChain&) swapChain
78104{
79  if (_spareBuffer.surface) {
80  if (_spareBuffer.surface->isInUse())
81  _spareBuffer.surface.reset();
82  return WTFMove(_spareBuffer);
83  }
84  return { };
 105 return _swapChain.value();
85106}
86107
87 - (void)prepareForDisplayWithContents:(WebCore::WebGLLayerBuffer) buffer
 108- (void)prepareForDisplay
88109{
89  ASSERT(!_spareBuffer.surface);
90  _spareBuffer = WTFMove(_contentsBuffer);
91  _contentsBuffer = WTFMove(buffer);
92110 [self setNeedsDisplay];
93111 _preparedForDisplay = YES;
94112}
95113
96114- (void)display
97115{
98  if (_contentsBuffer.surface && _preparedForDisplay) {
99  self.contents = _contentsBuffer.surface->asLayerContents();
 116 if (_swapChain->displaySurface() && _preparedForDisplay) {
 117 self.contents = _swapChain->displaySurface()->asLayerContents();
100118 [self reloadValueForKeyPath:@"contents"];
101119 }
102120 auto layer = WebCore::PlatformCALayer::platformCALayerForLayer((__bridge void*)self);

106124 _preparedForDisplay = NO;
107125}
108126
109 - (void*) detachClient
 127@end
 128
 129void WebGLLayerSwapChain::present(Buffer buffer)
110130{
111  ASSERT(!_spareBuffer.surface);
112  void* result = _contentsBuffer.handle;
113  _contentsBuffer.handle = nullptr;
114  return result;
 131 ASSERT(!m_spareBuffer.surface);
 132 m_spareBuffer = WTFMove(m_displayBuffer);
 133 m_displayBuffer = WTFMove(buffer);
 134 [m_layer prepareForDisplay];
115135}
116 @end
117136
118137#endif // ENABLE(WEBGL)

Source/WebCore/platform/graphics/coreimage/FilterEffectRendererCoreImage.mm

3636#import "FloatConversion.h"
3737#import "GraphicsContextCG.h"
3838#import "ImageBuffer.h"
 39#import "Logging.h"
3940#import "PlatformImageBuffer.h"
4041#import "SourceGraphic.h"
4142#import <CoreImage/CIContext.h>

Source/WebCore/platform/graphics/opengl/ExtensionsGLOpenGL.cpp

@@void ExtensionsGLOpenGL::drawBuffersEXT(GCGLSpan<const GCGLenum> bufs)
222222#endif
223223}
224224
225 void ExtensionsGLOpenGL::drawArraysInstanced(GCGLenum mode, GCGLint first, GCGLsizei count, GCGLsizei primcount)
 225void ExtensionsGLOpenGL::drawArraysInstancedANGLE(GCGLenum mode, GCGLint first, GCGLsizei count, GCGLsizei primcount)
226226{
227227 if (!m_context->makeContextCurrent())
228228 return;

@@void ExtensionsGLOpenGL::drawArraysInstanced(GCGLenum mode, GCGLint first, GCGLs
237237#endif
238238}
239239
240 void ExtensionsGLOpenGL::drawElementsInstanced(GCGLenum mode, GCGLsizei count, GCGLenum type, long long offset, GCGLsizei primcount)
 240void ExtensionsGLOpenGL::drawElementsInstancedANGLE(GCGLenum mode, GCGLsizei count, GCGLenum type, long long offset, GCGLsizei primcount)
241241{
242242 if (!m_context->makeContextCurrent())
243243 return;

@@void ExtensionsGLOpenGL::drawElementsInstanced(GCGLenum mode, GCGLsizei count, G
253253#endif
254254}
255255
256 void ExtensionsGLOpenGL::vertexAttribDivisor(GCGLuint index, GCGLuint divisor)
 256void ExtensionsGLOpenGL::vertexAttribDivisorANGLE(GCGLuint index, GCGLuint divisor)
257257{
258258 if (!m_context->makeContextCurrent())
259259 return;

Source/WebCore/platform/graphics/opengl/ExtensionsGLOpenGLCommon.cpp

@@void ExtensionsGLOpenGLCommon::getPointervRobustANGLERobustANGLE(GCGLenum, GCGLs
366366 m_context->synthesizeGLError(GL_INVALID_OPERATION);
367367}
368368
369 void ExtensionsGLOpenGLCommon::readnPixelsRobustANGLE(int, int, GCGLsizei, GCGLsizei, GCGLenum, GCGLenum, GCGLsizei, GCGLsizei *, GCGLsizei *, GCGLsizei *, void *, bool)
 369void ExtensionsGLOpenGLCommon::readnPixelsRobustANGLE(int, int, GCGLsizei, GCGLsizei, GCGLenum, GCGLenum, GCGLsizei *, GCGLsizei *, GCGLsizei *, GCGLSpan<GCGLvoid>, bool)
370370{
371371 m_context->synthesizeGLError(GL_INVALID_OPERATION);
372372}

Source/WebCore/platform/graphics/opengl/ExtensionsGLOpenGLCommon.h

@@public:
9393 void getTexLevelParameterfvRobustANGLE(GCGLenum target, int level, GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, GCGLfloat *params) override;
9494
9595 void getPointervRobustANGLERobustANGLE(GCGLenum pname, GCGLsizei bufSize, GCGLsizei *length, void **params) override;
96  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;
 96 void readnPixelsRobustANGLE(int x, int y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, GCGLsizei* length, GCGLsizei* columns, GCGLsizei* rows, GCGLSpan<GCGLvoid> data, bool readingToPixelBufferObject) override;
9797 void getnUniformfvRobustANGLE(GCGLuint program, int location, GCGLsizei bufSize, GCGLsizei *length, GCGLfloat *params) override;
9898 void getnUniformivRobustANGLE(GCGLuint program, int location, GCGLsizei bufSize, GCGLsizei *length, GCGLint *params) override;
9999 void getnUniformuivRobustANGLE(GCGLuint program, int location, GCGLsizei bufSize, GCGLsizei *length, GCGLuint *params) override;

Source/WebCore/platform/graphics/opengl/ExtensionsGLOpenGLES.cpp

@@void ExtensionsGLOpenGLES::getnUniformivEXT(GCGLuint program, int location, GCGL
251251 m_context->synthesizeGLError(GL_INVALID_OPERATION);
252252}
253253
254 void ExtensionsGLOpenGLES::drawArraysInstanced(GCGLenum mode, GCGLint first, GCGLsizei count, GCGLsizei primcount)
 254void ExtensionsGLOpenGLES::drawArraysInstancedANGLE(GCGLenum mode, GCGLint first, GCGLsizei count, GCGLsizei primcount)
255255{
256256 if (!m_glDrawArraysInstancedANGLE) {
257257 m_context->synthesizeGLError(GL_INVALID_OPERATION);

@@void ExtensionsGLOpenGLES::drawArraysInstanced(GCGLenum mode, GCGLint first, GCG
264264 m_glDrawArraysInstancedANGLE(mode, first, count, primcount);
265265}
266266
267 void ExtensionsGLOpenGLES::drawElementsInstanced(GCGLenum mode, GCGLsizei count, GCGLenum type, long long offset, GCGLsizei primcount)
 267void ExtensionsGLOpenGLES::drawElementsInstancedANGLE(GCGLenum mode, GCGLsizei count, GCGLenum type, long long offset, GCGLsizei primcount)
268268{
269269 if (!m_glDrawElementsInstancedANGLE) {
270270 m_context->synthesizeGLError(GL_INVALID_OPERATION);

@@void ExtensionsGLOpenGLES::drawElementsInstanced(GCGLenum mode, GCGLsizei count,
277277 m_glDrawElementsInstancedANGLE(mode, count, type, reinterpret_cast<GLvoid*>(static_cast<intptr_t>(offset)), primcount);
278278}
279279
280 void ExtensionsGLOpenGLES::vertexAttribDivisor(GCGLuint index, GCGLuint divisor)
 280void ExtensionsGLOpenGLES::vertexAttribDivisorANGLE(GCGLuint index, GCGLuint divisor)
281281{
282282 if (!m_glVertexAttribDivisorANGLE) {
283283 m_context->synthesizeGLError(GL_INVALID_OPERATION);

Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.h

3636#include <wtf/UniqueArray.h>
3737
3838#if PLATFORM(COCOA)
 39#include "GraphicsContextGLIOSurfaceSwapChain.h"
3940#include "IOSurface.h"
4041#endif
4142

@@typedef WTF::HashMap<CString, uint64_t> ShaderNameHash;
8687
8788class GraphicsContextGLOpenGLPrivate;
8889
89 class GraphicsContextGLOpenGL final : public GraphicsContextGL
 90class WEBCORE_EXPORT GraphicsContextGLOpenGL final : public GraphicsContextGL
9091{
9192public:
9293 static RefPtr<GraphicsContextGLOpenGL> create(GraphicsContextGLAttributes, HostWindow*, Destination = Destination::Offscreen);

@@public:
9495
9596#if PLATFORM(COCOA)
9697 static Ref<GraphicsContextGLOpenGL> createShared(GraphicsContextGLOpenGL& sharedContext);
 98 static Ref<GraphicsContextGLOpenGL> createForGPUProcess(const GraphicsContextGLAttributes&, GraphicsContextGLIOSurfaceSwapChain&);
 99
97100 PlatformGraphicsContextGL platformGraphicsContextGL() const final { return m_contextObj; }
98101 PlatformGLObject platformTexture() const final { return m_texture; }
99102 CALayer* platformLayer() const final { return reinterpret_cast<CALayer*>(m_webGLLayer.get()); }

@@public:
191194 bool getActiveAttribImpl(PlatformGLObject program, GCGLuint index, ActiveInfo&);
192195 bool getActiveUniform(PlatformGLObject program, GCGLuint index, ActiveInfo&) final;
193196 bool getActiveUniformImpl(PlatformGLObject program, GCGLuint index, ActiveInfo&);
194  void getAttachedShaders(PlatformGLObject program, GCGLsizei maxCount, GCGLsizei* count, PlatformGLObject* shaders) final;
 197 void getAttachedShaders(PlatformGLObject program, GCGLsizei maxCount, GCGLsizei* count, PlatformGLObject* shaders);
195198 GCGLint getAttribLocation(PlatformGLObject, const String& name) final;
196199 void getBooleanv(GCGLenum pname, GCGLSpan<GCGLboolean> value) final;
197200 GCGLint getBufferParameteri(GCGLenum target, GCGLenum pname) final;

@@public:
219222 void getUniformiv(PlatformGLObject program, GCGLint location, GCGLSpan<GCGLint> value) final;
220223 void getUniformuiv(PlatformGLObject program, GCGLint location, GCGLSpan<GCGLuint> value) final;
221224 GCGLint getUniformLocation(PlatformGLObject, const String& name) final;
222  void getVertexAttribfv(GCGLuint index, GCGLenum pname, GCGLSpan<GCGLfloat> value) final;
223  void getVertexAttribiv(GCGLuint index, GCGLenum pname, GCGLSpan<GCGLint> value) final;
224225 GCGLsizeiptr getVertexAttribOffset(GCGLuint index, GCGLenum pname) final;
225226
226227 void hint(GCGLenum target, GCGLenum mode) final;

@@public:
236237 void pixelStorei(GCGLenum pname, GCGLint param) final;
237238 void polygonOffset(GCGLfloat factor, GCGLfloat units) final;
238239
239  void readPixels(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, void* data) final;
 240 void readnPixels(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLSpan<GCGLvoid> data) final;
 241 void readnPixels(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLintptr offset) final;
240242
241243 void renderbufferStorage(GCGLenum target, GCGLenum internalformat, GCGLsizei width, GCGLsizei height) final;
242244 void sampleCoverage(GCGLclampf value, GCGLboolean invert) final;

@@public:
254256 void texSubImage2D(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLSpan<const GCGLvoid> pixels) final;
255257 void texSubImage2D(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLintptr offset) final;
256258 void compressedTexImage2D(GCGLenum target, GCGLint level, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, GCGLint border, GCGLsizei imageSize, GCGLSpan<const GCGLvoid> data) final;
257  void compressedTexImage2D(GCGLenum target, GCGLint level, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, GCGLint border, GCGLsizei imageSize, GCGLintptr offset) final;
 259 void compressedTexImage2D(GCGLenum target, GCGLint level, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, GCGLint border, GCGLsizei imageSize, GCGLintptr offset) final;
258260 void compressedTexSubImage2D(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLsizei imageSize, GCGLSpan<const GCGLvoid> data) final;
259261 void compressedTexSubImage2D(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLsizei imageSize, GCGLintptr offset) final;
260262

@@public:
317319#if !USE(ANGLE)
318320 void bufferData(GCGLenum target, const void* data, GCGLenum usage, GCGLuint srcOffset, GCGLuint length);
319321 void bufferSubData(GCGLenum target, GCGLintptr dstByteOffset, const void* srcData, GCGLuint srcOffset, GCGLuint length);
320  void getBufferSubData(GCGLenum target, GCGLintptr srcByteOffset, const void* dstData, GCGLuint dstOffset, GCGLuint length);
321322#endif
322323 void copyBufferSubData(GCGLenum readTarget, GCGLenum writeTarget, GCGLintptr readOffset, GCGLintptr writeOffset, GCGLsizeiptr size) final;
323324
324  void* mapBufferRange(GCGLenum target, GCGLintptr offset, GCGLsizeiptr length, GCGLbitfield access) final;
325  GCGLboolean unmapBuffer(GCGLenum target) final;
 325 void getBufferSubData(GCGLenum target, GCGLintptr offset, GCGLSpan<GCGLvoid> data) final;
326326
327327 void blitFramebuffer(GCGLint srcX0, GCGLint srcY0, GCGLint srcX1, GCGLint srcY1, GCGLint dstX0, GCGLint dstY0, GCGLint dstX1, GCGLint dstY1, GCGLbitfield mask, GCGLenum filter) final;
328328 void framebufferTextureLayer(GCGLenum target, GCGLenum attachment, PlatformGLObject texture, GCGLint level, GCGLint layer) final;

@@public:
384384 void endQuery(GCGLenum target) final;
385385 PlatformGLObject getQuery(GCGLenum target, GCGLenum pname) final;
386386 // getQueryParameter
387  void getQueryObjectuiv(PlatformGLObject query, GCGLenum pname, GCGLuint* value) final;
 387 GCGLuint getQueryObjectui(PlatformGLObject query, GCGLenum pname) final;
388388
389389 PlatformGLObject createSampler() final;
390390 void deleteSampler(PlatformGLObject sampler) final;

@@public:
393393 void samplerParameteri(PlatformGLObject sampler, GCGLenum pname, GCGLint param) final;
394394 void samplerParameterf(PlatformGLObject sampler, GCGLenum pname, GCGLfloat param) final;
395395 // getSamplerParameter
396  void getSamplerParameterfv(PlatformGLObject sampler, GCGLenum pname, GCGLfloat* value) final;
397  void getSamplerParameteriv(PlatformGLObject sampler, GCGLenum pname, GCGLint* value) final;
 396 GCGLfloat getSamplerParameterf(PlatformGLObject sampler, GCGLenum pname) final;
 397 GCGLint getSamplerParameteri(PlatformGLObject sampler, GCGLenum pname) final;
398398
399399 GCGLsync fenceSync(GCGLenum condition, GCGLbitfield flags) final;
400400 GCGLboolean isSync(GCGLsync) final;

@@public:
403403 void waitSync(GCGLsync, GCGLbitfield flags, GCGLint64 timeout) final;
404404 // getSyncParameter
405405 // FIXME - this can be implemented at the WebGL level if we signal the WebGLSync object.
406  void getSynciv(GCGLsync, GCGLenum pname, GCGLsizei bufSize, GCGLint *value) final;
 406 GCGLint getSynci(GCGLsync, GCGLenum pname) final;
407407
408408 PlatformGLObject createTransformFeedback() final;
409409 void deleteTransformFeedback(PlatformGLObject id) final;

@@public:
420420 void bindBufferRange(GCGLenum target, GCGLuint index, PlatformGLObject buffer, GCGLintptr offset, GCGLsizeiptr size) final;
421421 // getIndexedParameter -> use getParameter calls above.
422422 Vector<GCGLuint> getUniformIndices(PlatformGLObject program, const Vector<String>& uniformNames) final;
423  void getActiveUniforms(PlatformGLObject program, const Vector<GCGLuint>& uniformIndices, GCGLenum pname, Vector<GCGLint>& params) final;
 423 Vector<GCGLint> getActiveUniforms(PlatformGLObject program, const Vector<GCGLuint>& uniformIndices, GCGLenum pname) final;
424424
425425 GCGLuint getUniformBlockIndex(PlatformGLObject program, const String& uniformBlockName) final;
426426 // getActiveUniformBlockParameter

@@public:
429429
430430 void getActiveUniformBlockiv(GCGLuint program, GCGLuint uniformBlockIndex, GCGLenum pname, GCGLSpan<GCGLint> params) final;
431431
432 #if !USE(ANGLE)
433  void readPixels(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLintptr offset);
434  void readPixels(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, const void* dstData, GCGLuint dstOffset);
435 #endif
436 
437432 // Helper methods.
438433
439434 void paintToCanvas(const unsigned char* imagePixels, const IntSize& imageSize, const IntSize& canvasSize, GraphicsContext&);

@@public:
515510#endif // !USE(ANGLE)
516511
517512private:
518  GraphicsContextGLOpenGL(GraphicsContextGLAttributes, HostWindow*, Destination = Destination::Offscreen, GraphicsContextGLOpenGL* sharedContext = nullptr);
 513 GraphicsContextGLOpenGL(GraphicsContextGLAttributes, HostWindow*, Destination = Destination::Offscreen, GraphicsContextGLOpenGL* sharedContext = nullptr, GraphicsContextGLIOSurfaceSwapChain* = nullptr);
519514
520515 // Called once by all the public entry points that eventually call OpenGL.
521516 // Called once by all the public entry points of ExtensionsGL that eventually call OpenGL.

@@private:
527522 // implementation.
528523 void validateDepthStencil(const char* packedDepthStencilExtension);
529524 void validateAttributes();
530 
 525
 526 void readnPixelsImpl(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, GCGLsizei* length, GCGLsizei* columns, GCGLsizei* rows, GCGLvoid* data, bool readingToPixelBufferObject);
 527
531528 // Did the most recent drawing operation leave the GPU in an acceptable state?
532529 void checkGPUStatus();
533530

@@private:
548545#if PLATFORM(COCOA)
549546 bool allowOfflineRenderers() const;
550547 bool reshapeDisplayBufferBacking();
 548 bool allocateAndBindDisplayBufferBacking();
551549 bool bindDisplayBufferBacking(std::unique_ptr<IOSurface> backing, void* pbuffer);
552550#endif
553551
554552#if PLATFORM(COCOA)
 553 GraphicsContextGLIOSurfaceSwapChain* m_swapChain { nullptr };
 554 // TODO: this should be removed once the context draws to image buffer. See https://bugs.webkit.org/show_bug.cgi?id=218179 .
555555 RetainPtr<WebGLLayer> m_webGLLayer;
556556 PlatformGraphicsContextGL m_contextObj { nullptr };
557557 PlatformGraphicsContextGLDisplay m_displayObj { nullptr };

@@private:
579579 , isValid(false)
580580 {
581581 }
582 
 582
583583 ShaderSymbolMap& symbolMap(enum ANGLEShaderSymbolType symbolType)
584584 {
585585 ASSERT(symbolType == SHADER_SYMBOL_TYPE_ATTRIBUTE || symbolType == SHADER_SYMBOL_TYPE_UNIFORM || symbolType == SHADER_SYMBOL_TYPE_VARYING);

@@private:
672672
673673 using BoundTextureMap = HashMap<GCGLenum,
674674 std::pair<GCGLuint, GCGLenum>,
675  WTF::IntHash<GCGLenum>,
 675 WTF::IntHash<GCGLenum>,
676676 WTF::UnsignedWithZeroKeyHashTraits<GCGLuint>,
677677 WTF::PairHashTraits<WTF::UnsignedWithZeroKeyHashTraits<GCGLuint>, WTF::UnsignedWithZeroKeyHashTraits<GCGLuint>>
678678 >;

Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp

@@void GraphicsContextGLOpenGL::texImage2DDirect(GCGLenum target, GCGLint level, G
22782278
22792279void GraphicsContextGLOpenGL::drawArraysInstanced(GCGLenum mode, GCGLint first, GCGLsizei count, GCGLsizei primcount)
22802280{
2281  getExtensions().drawArraysInstanced(mode, first, count, primcount);
 2281 getExtensions().drawArraysInstancedANGLE(mode, first, count, primcount);
22822282 checkGPUStatus();
22832283}
22842284
22852285void GraphicsContextGLOpenGL::drawElementsInstanced(GCGLenum mode, GCGLsizei count, GCGLenum type, GCGLintptr offset, GCGLsizei primcount)
22862286{
2287  getExtensions().drawElementsInstanced(mode, count, type, offset, primcount);
 2287 getExtensions().drawElementsInstancedANGLE(mode, count, type, offset, primcount);
22882288 checkGPUStatus();
22892289}
22902290
22912291void GraphicsContextGLOpenGL::vertexAttribDivisor(GCGLuint index, GCGLuint divisor)
22922292{
2293  getExtensions().vertexAttribDivisor(index, divisor);
 2293 getExtensions().vertexAttribDivisorANGLE(index, divisor);
22942294}
22952295
22962296#if HAVE(OPENGL_4) && ENABLE(WEBGL2)

@@void GraphicsContextGLOpenGL::copyBufferSubData(GCGLenum, GCGLenum, GCGLintptr,
23352335}
23362336#endif
23372337
2338 void GraphicsContextGLOpenGL::getBufferSubData(GCGLenum target, GCGLintptr srcByteOffset, const void* dstData, GCGLuint dstOffset, GCGLuint length)
 2338void GraphicsContextGLOpenGL::getBufferSubData(GCGLenum, GCGLintptr, GCGLSpan<GLvoid>)
23392339{
2340  UNUSED_PARAM(target);
2341  UNUSED_PARAM(srcByteOffset);
2342  UNUSED_PARAM(dstData);
2343  UNUSED_PARAM(dstOffset);
2344  UNUSED_PARAM(length);
23452340}
23462341
23472342#if HAVE(OPENGL_4) || HAVE(OPENGL_ES_3)

@@PlatformGLObject GraphicsContextGLOpenGL::getQuery(GCGLenum target, GCGLenum pna
27122707 return 0;
27132708}
27142709
2715 void GraphicsContextGLOpenGL::getQueryObjectuiv(PlatformGLObject query, GCGLenum pname, GCGLuint* value)
 2710void GraphicsContextGLOpenGL::getQueryObjectui(PlatformGLObject query, GCGLenum pname)
27162711{
27172712 UNUSED_PARAM(query);
27182713 UNUSED_PARAM(pname);

@@void GraphicsContextGLOpenGL::samplerParameterf(PlatformGLObject sampler, GCGLen
27562751 UNUSED_PARAM(param);
27572752}
27582753
2759 void GraphicsContextGLOpenGL::getSamplerParameterfv(PlatformGLObject sampler, GCGLenum pname, GCGLfloat* value)
 2754GCGLfloat GraphicsContextGLOpenGL::getSamplerParameterf(PlatformGLObject sampler, GCGLenum pname)
27602755{
27612756 UNUSED_PARAM(sampler);
27622757 UNUSED_PARAM(pname);
2763  UNUSED_PARAM(value);
 2758 return 0.f;
27642759}
27652760
2766 void GraphicsContextGLOpenGL::getSamplerParameteriv(PlatformGLObject sampler, GCGLenum pname, GCGLint* value)
 2761GCGLint GraphicsContextGLOpenGL::getSamplerParameteri(PlatformGLObject sampler, GCGLenum pname)
 2762
27672763{
27682764 UNUSED_PARAM(sampler);
27692765 UNUSED_PARAM(pname);
2770  UNUSED_PARAM(value);
 2766 return 0;
27712767}
27722768
27732769GCGLsync GraphicsContextGLOpenGL::fenceSync(GCGLenum condition, GCGLbitfield flags)

@@void GraphicsContextGLOpenGL::waitSync(GCGLsync sync, GCGLbitfield flags, GCGLin
28062802 UNUSED_PARAM(timeout);
28072803}
28082804
2809 void GraphicsContextGLOpenGL::getSynciv(GCGLsync sync, GCGLenum pname, GCGLsizei bufSize, GCGLint *value)
 2805GCGLint GraphicsContextGLOpenGL::getSynci(GCGLsync sync, GCGLenum pname)
28102806{
28112807 UNUSED_PARAM(sync);
28122808 UNUSED_PARAM(pname);
28132809 UNUSED_PARAM(bufSize);
2814  UNUSED_PARAM(value);
 2810 return 0;
28152811}
28162812
28172813PlatformGLObject GraphicsContextGLOpenGL::createTransformFeedback()

@@Vector<GCGLuint> GraphicsContextGLOpenGL::getUniformIndices(PlatformGLObject pro
28942890#if HAVE(OPENGL_4) || HAVE(OPENGL_ES_3)
28952891void GraphicsContextGLOpenGL::getActiveUniforms(PlatformGLObject program, const Vector<GCGLuint>& uniformIndices, GCGLenum pname, Vector<GCGLint>& params)
28962892{
 2893 Vector<GCGLint> result(uniformIndices.size(), 0);
28972894 ASSERT(program);
28982895 if (!makeContextCurrent())
2899  return;
 2896 return result;
29002897
2901  ::glGetActiveUniformsiv(program, uniformIndices.size(), uniformIndices.data(), pname, params.data());
 2898 ::glGetActiveUniformsiv(program, uniformIndices.size(), uniformIndices.data(), pname, result.data());
 2899 return result;
29022900}
29032901
29042902GCGLuint GraphicsContextGLOpenGL::getUniformBlockIndex(PlatformGLObject program, const String& uniformBlockName)

Source/WebKit/CMakeLists.txt

@@set(WebKit_MESSAGES_IN_FILES
123123 GPUProcess/GPUConnectionToWebProcess
124124 GPUProcess/GPUProcess
125125
 126 GPUProcess/graphics/RemoteGraphicsContextGL
126127 GPUProcess/graphics/RemoteRenderingBackend
127128
128129 GPUProcess/media/RemoteAudioDestinationManager

@@set(WebKit_MESSAGES_IN_FILES
218219
219220 WebProcess/GPU/GPUProcessConnection
220221
 222 WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy
221223 WebProcess/GPU/graphics/RemoteRenderingBackendProxy
222224
223225 WebProcess/GPU/media/MediaPlayerPrivateRemote

Source/WebKit/DerivedSources-input.xcfilelist

@@$(JAVASCRIPTCORE_PRIVATE_HEADERS_DIR)/models.py
2020$(JAVASCRIPTCORE_PRIVATE_HEADERS_DIR)/xxd.pl
2121$(PROJECT_DIR)/GPUProcess/GPUConnectionToWebProcess.messages.in
2222$(PROJECT_DIR)/GPUProcess/GPUProcess.messages.in
 23$(PROJECT_DIR)/GPUProcess/graphics/RemoteGraphicsContextGL.messages.in
2324$(PROJECT_DIR)/GPUProcess/graphics/RemoteRenderingBackend.messages.in
2425$(PROJECT_DIR)/GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in
2526$(PROJECT_DIR)/GPUProcess/media/RemoteAudioDestinationManager.messages.in

@@$(PROJECT_DIR)/WebProcess/Cache/WebCacheStorageConnection.messages.in
131132$(PROJECT_DIR)/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in
132133$(PROJECT_DIR)/WebProcess/FullScreen/WebFullScreenManager.messages.in
133134$(PROJECT_DIR)/WebProcess/GPU/GPUProcessConnection.messages.in
 135$(PROJECT_DIR)/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.messages.in
134136$(PROJECT_DIR)/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.messages.in
135137$(PROJECT_DIR)/WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in
136138$(PROJECT_DIR)/WebProcess/GPU/media/RemoteAudioDestinationProxy.messages.in

Source/WebKit/DerivedSources-output.xcfilelist

@@$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteCDMProxyMessagesReplies.h
175175$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteCaptureSampleManagerMessageReceiver.cpp
176176$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteCaptureSampleManagerMessages.h
177177$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteCaptureSampleManagerMessagesReplies.h
 178$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteGraphicsContextGLMessageReceiver.cpp
 179$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteGraphicsContextGLMessages.h
 180$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteGraphicsContextGLMessagesReplies.h
 181$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteGraphicsContextGLProxyMessageReceiver.cpp
 182$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteGraphicsContextGLProxyMessages.h
 183$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteGraphicsContextGLProxyMessagesReplies.h
178184$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteLayerTreeDrawingAreaProxyMessageReceiver.cpp
179185$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteLayerTreeDrawingAreaProxyMessages.h
180186$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteLayerTreeDrawingAreaProxyMessagesReplies.h

Source/WebKit/DerivedSources.make

@@MESSAGE_RECEIVERS = \
171171 WebProcess/Databases/IndexedDB/WebIDBConnectionToServer \
172172 WebProcess/GPU/GPUProcessConnection \
173173 WebProcess/GPU/graphics/RemoteRenderingBackendProxy \
 174 WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy \
174175 WebProcess/GPU/webrtc/LibWebRTCCodecs \
175176 WebProcess/GPU/webrtc/SampleBufferDisplayLayer \
176177 WebProcess/GPU/media/MediaPlayerPrivateRemote \

@@MESSAGE_RECEIVERS = \
227228 PluginProcess/PluginProcess \
228229 GPUProcess/GPUConnectionToWebProcess \
229230 GPUProcess/graphics/RemoteRenderingBackend \
 231 GPUProcess/graphics/RemoteGraphicsContextGL \
230232 GPUProcess/webrtc/LibWebRTCCodecsProxy \
231233 GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager \
232234 GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererManager \

Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp

6464#include <WebCore/MediaSessionManagerIOS.h>
6565#endif
6666
 67#if ENABLE(WEBGL)
 68#include "RemoteGraphicsContextGL.h"
 69#endif
 70
6771#if ENABLE(ENCRYPTED_MEDIA)
6872#include "RemoteCDMFactoryProxy.h"
6973#include "RemoteCDMFactoryProxyMessages.h"

@@void GPUConnectionToWebProcess::releaseRenderingBackend(RenderingBackendIdentifi
290294 ASSERT_UNUSED(found, found);
291295}
292296
 297#if ENABLE(WEBGL)
 298void GPUConnectionToWebProcess::createGraphicsContextGL(WebCore::GraphicsContextGLAttributes attributes, GraphicsContextGLIdentifier graphicsContextGLIdentifier)
 299{
 300 auto addResult = m_remoteGraphicsContextGLMap.ensure(graphicsContextGLIdentifier, [&]() {
 301 return RemoteGraphicsContextGL::create(attributes, *this, graphicsContextGLIdentifier);
 302 });
 303 ASSERT_UNUSED(addResult, addResult.isNewEntry);
 304}
 305
 306void GPUConnectionToWebProcess::releaseGraphicsContextGL(GraphicsContextGLIdentifier graphicsContextGLIdentifier)
 307{
 308 bool found = m_remoteGraphicsContextGLMap.remove(graphicsContextGLIdentifier);
 309 ASSERT_UNUSED(found, found);
 310}
 311#endif
293312void GPUConnectionToWebProcess::clearNowPlayingInfo()
294313{
295314 gpuProcess().nowPlayingManager().clearNowPlayingInfoClient(*this);

Source/WebKit/GPUProcess/GPUConnectionToWebProcess.h

3232#include "MessageReceiverMap.h"
3333#include "RemoteAudioSessionIdentifier.h"
3434#include "RenderingBackendIdentifier.h"
 35
3536#include <WebCore/LibWebRTCEnumTraits.h>
3637#include <WebCore/NowPlayingManager.h>
3738#include <WebCore/ProcessIdentifier.h>

3940#include <wtf/Logger.h>
4041#include <wtf/RefCounted.h>
4142
 43#if ENABLE(WEBGL)
 44#include "GraphicsContextGLIdentifier.h"
 45#include <WebCore/GraphicsContextGLAttributes.h>
 46#endif
 47
4248namespace WebKit {
4349
4450class GPUProcess;

@@class RemoteMediaRecorderManager;
5460class RemoteMediaResourceManager;
5561class RemoteMediaSessionHelperProxy;
5662class RemoteRenderingBackend;
 63class RemoteGraphicsContextGL;
5764class RemoteSampleBufferDisplayLayerManager;
5865class UserMediaCaptureManagerProxy;
5966struct RemoteAudioSessionConfiguration;

@@private:
119126 void createRenderingBackend(RenderingBackendIdentifier);
120127 void releaseRenderingBackend(RenderingBackendIdentifier);
121128
 129#if ENABLE(WEBGL)
 130 void createGraphicsContextGL(WebCore::GraphicsContextGLAttributes, GraphicsContextGLIdentifier);
 131 void releaseGraphicsContextGL(GraphicsContextGLIdentifier);
 132#endif
 133
122134 void clearNowPlayingInfo();
123135 void setNowPlayingInfo(bool setAsNowPlayingApplication, WebCore::NowPlayingInfo&&);
124136

@@private:
180192
181193 using RemoteRenderingBackendMap = HashMap<RenderingBackendIdentifier, std::unique_ptr<RemoteRenderingBackend>>;
182194 RemoteRenderingBackendMap m_remoteRenderingBackendMap;
183 
 195#if ENABLE(WEBGL)
 196 using RemoteGraphicsContextGLMap = HashMap<GraphicsContextGLIdentifier, std::unique_ptr<RemoteGraphicsContextGL>>;
 197 RemoteGraphicsContextGLMap m_remoteGraphicsContextGLMap;
 198#endif
184199#if ENABLE(ENCRYPTED_MEDIA)
185200 std::unique_ptr<RemoteCDMFactoryProxy> m_cdmFactoryProxy;
186201#endif

Source/WebKit/GPUProcess/GPUConnectionToWebProcess.messages.in

2525messages -> GPUConnectionToWebProcess WantsDispatchMessage {
2626 void CreateRenderingBackend(WebKit::RenderingBackendIdentifier renderingBackendIdentifier)
2727 void ReleaseRenderingBackend(WebKit::RenderingBackendIdentifier renderingBackendIdentifier)
 28#if ENABLE(WEBGL)
 29 void CreateGraphicsContextGL(struct WebCore::GraphicsContextGLAttributes attributes, WebKit::GraphicsContextGLIdentifier graphicsContextGLIdentifier)
 30 void ReleaseGraphicsContextGL(WebKit::GraphicsContextGLIdentifier graphicsContextGLIdentifier)
 31#endif
2832 void ClearNowPlayingInfo()
2933 void SetNowPlayingInfo(bool setAsNowPlayingApplication, struct WebCore::NowPlayingInfo nowPlayingInfo)
3034#if USE(AUDIO_SESSION)

Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.cpp

 1/*
 2 * Copyright (C) 2020 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 23 * THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#include "config.h"
 27#include "RemoteGraphicsContextGL.h"
 28
 29#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL)
 30
 31#include "GPUConnectionToWebProcess.h"
 32#include "RemoteGraphicsContextGLMessages.h"
 33#include "RemoteGraphicsContextGLProxyMessages.h"
 34#include <WebCore/GraphicsContextGLOpenGL.h>
 35#include <wtf/MachSendRight.h>
 36
 37namespace WebKit {
 38using namespace WebCore;
 39
 40std::unique_ptr<RemoteGraphicsContextGL> RemoteGraphicsContextGL::create(const WebCore::GraphicsContextGLAttributes& attributes, GPUConnectionToWebProcess& gpuConnectionToWebProcess, GraphicsContextGLIdentifier graphicsContextGLIdentifier)
 41{
 42 return std::unique_ptr<RemoteGraphicsContextGL>(new RemoteGraphicsContextGL(attributes, gpuConnectionToWebProcess, graphicsContextGLIdentifier));
 43}
 44
 45RemoteGraphicsContextGL::RemoteGraphicsContextGL(const WebCore::GraphicsContextGLAttributes& attributes, GPUConnectionToWebProcess& gpuConnectionToWebProcess, GraphicsContextGLIdentifier graphicsContextGLIdentifier)
 46 : m_context(GraphicsContextGLOpenGL::createForGPUProcess(attributes, *this))
 47 , m_gpuConnectionToWebProcess(makeWeakPtr(gpuConnectionToWebProcess))
 48 , m_graphicsContextGLIdentifier(graphicsContextGLIdentifier)
 49{
 50 if (auto* gpuConnectionToWebProcess = m_gpuConnectionToWebProcess.get())
 51 gpuConnectionToWebProcess->messageReceiverMap().addMessageReceiver(Messages::RemoteGraphicsContextGL::messageReceiverName(), graphicsContextGLIdentifier.toUInt64(), *this);
 52 m_context->addClient(*this);
 53 String extensions = m_context->getString(GraphicsContextGL::EXTENSIONS);
 54 String requestableExtensions = m_context->getString(GraphicsContextGL::REQUESTABLE_EXTENSIONS_ANGLE);
 55 send(Messages::RemoteGraphicsContextGLProxy::WasCreated(extensions, requestableExtensions), m_graphicsContextGLIdentifier);
 56}
 57
 58RemoteGraphicsContextGL::~RemoteGraphicsContextGL()
 59{
 60 if (auto* gpuConnectionToWebProcess = m_gpuConnectionToWebProcess.get())
 61 gpuConnectionToWebProcess->messageReceiverMap().removeMessageReceiver(Messages::RemoteGraphicsContextGL::messageReceiverName(), m_graphicsContextGLIdentifier.toUInt64());
 62}
 63
 64GPUConnectionToWebProcess* RemoteGraphicsContextGL::gpuConnectionToWebProcess() const
 65{
 66 return m_gpuConnectionToWebProcess.get();
 67}
 68
 69IPC::Connection* RemoteGraphicsContextGL::messageSenderConnection() const
 70{
 71 if (auto* gpuConnectionToWebProcess = m_gpuConnectionToWebProcess.get())
 72 return &gpuConnectionToWebProcess->connection();
 73 return nullptr;
 74}
 75
 76uint64_t RemoteGraphicsContextGL::messageSenderDestinationID() const
 77{
 78 return m_graphicsContextGLIdentifier.toUInt64();
 79}
 80
 81void RemoteGraphicsContextGL::didComposite()
 82{
 83}
 84
 85void RemoteGraphicsContextGL::forceContextLost()
 86{
 87 send(Messages::RemoteGraphicsContextGLProxy::WasLost(), m_graphicsContextGLIdentifier);
 88}
 89
 90void RemoteGraphicsContextGL::recycleContext()
 91{
 92 ASSERT_NOT_REACHED();
 93}
 94
 95void RemoteGraphicsContextGL::dispatchContextChangedNotification()
 96{
 97 send(Messages::RemoteGraphicsContextGLProxy::WasChanged(), m_graphicsContextGLIdentifier);
 98}
 99
 100GraphicsContextGLIOSurfaceSwapChain::Buffer RemoteGraphicsContextGL::recycleBuffer()
 101{
 102 return WTFMove(m_displayBuffer);
 103}
 104
 105void RemoteGraphicsContextGL::present(Buffer buffer)
 106{
 107 ASSERT(!m_displayBuffer.surface);
 108 m_displayBuffer = WTFMove(buffer);
 109}
 110
 111void* RemoteGraphicsContextGL::detachClient()
 112{
 113 return std::exchange(m_displayBuffer.handle, nullptr);
 114}
 115
 116void RemoteGraphicsContextGL::reshape(int32_t width, int32_t height)
 117{
 118 if (width && height)
 119 m_context->reshape(width, height);
 120 else
 121 forceContextLost();
 122}
 123
 124void RemoteGraphicsContextGL::prepareForDisplay(CompletionHandler<void(WTF::MachSendRight&&)>&& completionHandler)
 125{
 126 m_context->prepareForDisplay();
 127 auto displayBuffer = WTFMove(m_displayBuffer.surface);
 128 MachSendRight sendRight;
 129 if (displayBuffer)
 130 sendRight = displayBuffer->createSendRight();
 131 completionHandler(WTFMove(sendRight));
 132}
 133
 134void RemoteGraphicsContextGL::ensureExtensionEnabled(String&& extension)
 135{
 136 m_context->getExtensions().ensureEnabled(extension);
 137}
 138
 139void RemoteGraphicsContextGL::notifyMarkContextChanged()
 140{
 141 m_context->markContextChanged();
 142}
 143
 144} // namespace WebKit
 145
 146#endif

Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.h

 1/*
 2 * Copyright (C) 2020 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 23 * THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#pragma once
 27
 28#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL)
 29
 30#include "Connection.h"
 31#include "GraphicsContextGLIdentifier.h"
 32#include "MessageReceiver.h"
 33#include "MessageSender.h"
 34
 35#include <WebCore/ExtensionsGL.h>
 36#include <WebCore/GraphicsContextGLOpenGL.h>
 37#include <WebCore/NotImplemented.h>
 38#include <wtf/WeakPtr.h>
 39
 40namespace WTF {
 41class MachSendRight;
 42}
 43
 44namespace WebKit {
 45
 46class GPUConnectionToWebProcess;
 47
 48// GPU process side implementation of that receives messages about GraphicsContextGL calls
 49// and issues real GraphicsContextGL calls based on the received messages.
 50// The implementation is largely generated by running Tools/Scripts/generate-gpup-webgl.
 51class RemoteGraphicsContextGL final
 52 : public IPC::MessageSender
 53 , private IPC::MessageReceiver
 54 , private WebCore::GraphicsContextGL::Client
 55 , private WebCore::GraphicsContextGLIOSurfaceSwapChain {
 56public:
 57 static std::unique_ptr<RemoteGraphicsContextGL> create(const WebCore::GraphicsContextGLAttributes&, GPUConnectionToWebProcess&, GraphicsContextGLIdentifier);
 58 ~RemoteGraphicsContextGL() final;
 59
 60 GPUConnectionToWebProcess* gpuConnectionToWebProcess() const;
 61
 62private:
 63 RemoteGraphicsContextGL(const WebCore::GraphicsContextGLAttributes&, GPUConnectionToWebProcess&, GraphicsContextGLIdentifier);
 64
 65 // IPC::MessageSender overrides.
 66 IPC::Connection* messageSenderConnection() const final;
 67 uint64_t messageSenderDestinationID() const final;
 68
 69 // IPC::MessageReceiver overrides.
 70 void didReceiveMessage(IPC::Connection&, IPC::Decoder&) final;
 71 void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) final;
 72
 73 // GraphicsContextGL::Client overrides.
 74 void didComposite() final;
 75 void forceContextLost() final;
 76 void recycleContext() final;
 77 void dispatchContextChangedNotification() final;
 78
 79 // GraphicsContextGLIOSurfaceSwapChain overrides.
 80 Buffer recycleBuffer() final;
 81 void present(Buffer) final;
 82 void* detachClient() final;
 83
 84 // Messages to be received.
 85 void reshape(int32_t width, int32_t height);
 86 void prepareForDisplay(CompletionHandler<void(WTF::MachSendRight&&)>&&);
 87 void ensureExtensionEnabled(String&&);
 88 void notifyMarkContextChanged();
 89
 90#include "RemoteGraphicsContextGLFunctionsGenerated.h" // NOLINT
 91
 92 Ref<WebCore::GraphicsContextGLOpenGL> m_context;
 93 WeakPtr<GPUConnectionToWebProcess> m_gpuConnectionToWebProcess;
 94 GraphicsContextGLIdentifier m_graphicsContextGLIdentifier;
 95 GraphicsContextGLIOSurfaceSwapChain::Buffer m_displayBuffer;
 96};
 97
 98} // namespace WebKit
 99
 100#endif

Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.messages.in

 1/* Copyright (C) 2020 Apple Inc. All rights reserved.
 2 *
 3 * Redistribution and use in source and binary forms, with or without
 4 * modification, are permitted provided that the following conditions
 5 * are met:
 6 * 1. Redistributions of source code must retain the above copyright
 7 * notice, this list of conditions and the following disclaimer.
 8 * 2. Redistributions in binary form must reproduce the above copyright
 9 * notice, this list of conditions and the following disclaimer in the
 10 * documentation and/or other materials provided with the distribution.
 11 *
 12 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
 13 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 14 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 15 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
 16 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 17 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 18 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 19 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 20 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 21 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 22 */
 23
 24// This file is generated by generate-gpup-webgl. Do not edit.
 25#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL) && PLATFORM(COCOA)
 26
 27messages -> RemoteGraphicsContextGL NotRefCounted {
 28 void Reshape(int32_t width, int32_t height)
 29 void PrepareForDisplay() -> (MachSendRight displayBuffer) Synchronous
 30 void EnsureExtensionEnabled(String extension)
 31 void NotifyMarkContextChanged()
 32
 33 void SetFailNextGPUStatusCheck()
 34 void SynthesizeGLError(uint32_t error)
 35 void MoveErrorsToSyntheticErrorList() -> (bool returnValue) Synchronous
 36 void ActiveTexture(uint32_t texture)
 37 void AttachShader(uint32_t program, uint32_t shader)
 38 void BindAttribLocation(uint32_t arg0, uint32_t index, String name)
 39 void BindBuffer(uint32_t target, uint32_t arg1)
 40 void BindFramebuffer(uint32_t target, uint32_t arg1)
 41 void BindRenderbuffer(uint32_t target, uint32_t arg1)
 42 void BindTexture(uint32_t target, uint32_t arg1)
 43 void BlendColor(float red, float green, float blue, float alpha)
 44 void BlendEquation(uint32_t mode)
 45 void BlendEquationSeparate(uint32_t modeRGB, uint32_t modeAlpha)
 46 void BlendFunc(uint32_t sfactor, uint32_t dfactor)
 47 void BlendFuncSeparate(uint32_t srcRGB, uint32_t dstRGB, uint32_t srcAlpha, uint32_t dstAlpha)
 48 void CheckFramebufferStatus(uint32_t target) -> (uint32_t returnValue) Synchronous
 49 void Clear(uint32_t mask)
 50 void ClearColor(float red, float green, float blue, float alpha)
 51 void ClearDepth(float depth)
 52 void ClearStencil(int32_t s)
 53 void ColorMask(bool red, bool green, bool blue, bool alpha)
 54 void CompileShader(uint32_t arg0)
 55 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)
 56 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)
 57 void CreateBuffer() -> (uint32_t returnValue) Synchronous
 58 void CreateFramebuffer() -> (uint32_t returnValue) Synchronous
 59 void CreateProgram() -> (uint32_t returnValue) Synchronous
 60 void CreateRenderbuffer() -> (uint32_t returnValue) Synchronous
 61 void CreateShader(uint32_t arg0) -> (uint32_t returnValue) Synchronous
 62 void CreateTexture() -> (uint32_t returnValue) Synchronous
 63 void CullFace(uint32_t mode)
 64 void DeleteBuffer(uint32_t arg0)
 65 void DeleteFramebuffer(uint32_t arg0)
 66 void DeleteProgram(uint32_t arg0)
 67 void DeleteRenderbuffer(uint32_t arg0)
 68 void DeleteShader(uint32_t arg0)
 69 void DeleteTexture(uint32_t arg0)
 70 void DepthFunc(uint32_t func)
 71 void DepthMask(bool flag)
 72 void DepthRange(float zNear, float zFar)
 73 void DetachShader(uint32_t arg0, uint32_t arg1)
 74 void Disable(uint32_t cap)
 75 void DisableVertexAttribArray(uint32_t index)
 76 void DrawArrays(uint32_t mode, int32_t first, int32_t count)
 77 void DrawElements(uint32_t mode, int32_t count, uint32_t type, uint64_t offset)
 78 void Enable(uint32_t cap)
 79 void EnableVertexAttribArray(uint32_t index)
 80 void Finish()
 81 void Flush()
 82 void FramebufferRenderbuffer(uint32_t target, uint32_t attachment, uint32_t renderbuffertarget, uint32_t arg3)
 83 void FramebufferTexture2D(uint32_t target, uint32_t attachment, uint32_t textarget, uint32_t arg3, int32_t level)
 84 void FrontFace(uint32_t mode)
 85 void GenerateMipmap(uint32_t target)
 86 void GetActiveAttrib(uint32_t program, uint32_t index) -> (bool returnValue, WebCore::GraphicsContextGL::ActiveInfo arg2) Synchronous
 87 void GetActiveUniform(uint32_t program, uint32_t index) -> (bool returnValue, WebCore::GraphicsContextGL::ActiveInfo arg2) Synchronous
 88 void GetAttribLocation(uint32_t arg0, String name) -> (int32_t returnValue) Synchronous
 89 void GetBufferParameteri(uint32_t target, uint32_t pname) -> (int32_t returnValue) Synchronous
 90 void GetString(uint32_t name) -> (String returnValue) Synchronous
 91 void GetFloatv(uint32_t pname, uint64_t valueSize) -> (IPC::ArrayReference<float> value) Synchronous
 92 void GetIntegerv(uint32_t pname, uint64_t valueSize) -> (IPC::ArrayReference<int32_t> value) Synchronous
 93 void GetInteger64(uint32_t pname) -> (int64_t returnValue) Synchronous
 94 void GetInteger64i(uint32_t pname, uint32_t index) -> (int64_t returnValue) Synchronous
 95 void GetProgrami(uint32_t program, uint32_t pname) -> (int32_t returnValue) Synchronous
 96 void GetBooleanv(uint32_t pname, uint64_t valueSize) -> (IPC::ArrayReference<bool> value) Synchronous
 97 void GetError() -> (uint32_t returnValue) Synchronous
 98 void GetFramebufferAttachmentParameteri(uint32_t target, uint32_t attachment, uint32_t pname) -> (int32_t returnValue) Synchronous
 99 void GetProgramInfoLog(uint32_t arg0) -> (String returnValue) Synchronous
 100 void GetRenderbufferParameteri(uint32_t target, uint32_t pname) -> (int32_t returnValue) Synchronous
 101 void GetShaderi(uint32_t arg0, uint32_t pname) -> (int32_t returnValue) Synchronous
 102 void GetShaderInfoLog(uint32_t arg0) -> (String returnValue) Synchronous
 103 void GetShaderPrecisionFormat(uint32_t shaderType, uint32_t precisionType) -> (IPC::ArrayReference<int32_t, 2> range, GCGLint precision) Synchronous
 104 void GetShaderSource(uint32_t arg0) -> (String returnValue) Synchronous
 105 void GetTexParameterf(uint32_t target, uint32_t pname) -> (float returnValue) Synchronous
 106 void GetTexParameteri(uint32_t target, uint32_t pname) -> (int32_t returnValue) Synchronous
 107 void GetUniformfv(uint32_t program, int32_t location, uint64_t valueSize) -> (IPC::ArrayReference<float> value) Synchronous
 108 void GetUniformiv(uint32_t program, int32_t location, uint64_t valueSize) -> (IPC::ArrayReference<int32_t> value) Synchronous
 109 void GetUniformuiv(uint32_t program, int32_t location, uint64_t valueSize) -> (IPC::ArrayReference<uint32_t> value) Synchronous
 110 void GetUniformLocation(uint32_t arg0, String name) -> (int32_t returnValue) Synchronous
 111 void GetVertexAttribOffset(uint32_t index, uint32_t pname) -> (uint64_t returnValue) Synchronous
 112 void Hint(uint32_t target, uint32_t mode)
 113 void IsBuffer(uint32_t arg0) -> (bool returnValue) Synchronous
 114 void IsEnabled(uint32_t cap) -> (bool returnValue) Synchronous
 115 void IsFramebuffer(uint32_t arg0) -> (bool returnValue) Synchronous
 116 void IsProgram(uint32_t arg0) -> (bool returnValue) Synchronous
 117 void IsRenderbuffer(uint32_t arg0) -> (bool returnValue) Synchronous
 118 void IsShader(uint32_t arg0) -> (bool returnValue) Synchronous
 119 void IsTexture(uint32_t arg0) -> (bool returnValue) Synchronous
 120 void LineWidth(float arg0)
 121 void LinkProgram(uint32_t arg0)
 122 void PixelStorei(uint32_t pname, int32_t param)
 123 void PolygonOffset(float factor, float units)
 124 void RenderbufferStorage(uint32_t target, uint32_t internalformat, int32_t width, int32_t height)
 125 void SampleCoverage(float value, bool invert)
 126 void Scissor(int32_t x, int32_t y, int32_t width, int32_t height)
 127 void ShaderSource(uint32_t arg0, String string)
 128 void StencilFunc(uint32_t func, int32_t ref, uint32_t mask)
 129 void StencilFuncSeparate(uint32_t face, uint32_t func, int32_t ref, uint32_t mask)
 130 void StencilMask(uint32_t mask)
 131 void StencilMaskSeparate(uint32_t face, uint32_t mask)
 132 void StencilOp(uint32_t fail, uint32_t zfail, uint32_t zpass)
 133 void StencilOpSeparate(uint32_t face, uint32_t fail, uint32_t zfail, uint32_t zpass)
 134 void TexParameterf(uint32_t target, uint32_t pname, float param)
 135 void TexParameteri(uint32_t target, uint32_t pname, int32_t param)
 136 void Uniform1f(int32_t location, float x)
 137 void Uniform1fv(int32_t location, IPC::ArrayReference<float> v)
 138 void Uniform1i(int32_t location, int32_t x)
 139 void Uniform1iv(int32_t location, IPC::ArrayReference<int32_t> v)
 140 void Uniform2f(int32_t location, float x, float y)
 141 void Uniform2fv(int32_t location, IPC::ArrayReference<float> v)
 142 void Uniform2i(int32_t location, int32_t x, int32_t y)
 143 void Uniform2iv(int32_t location, IPC::ArrayReference<int32_t> v)
 144 void Uniform3f(int32_t location, float x, float y, float z)
 145 void Uniform3fv(int32_t location, IPC::ArrayReference<float> v)
 146 void Uniform3i(int32_t location, int32_t x, int32_t y, int32_t z)
 147 void Uniform3iv(int32_t location, IPC::ArrayReference<int32_t> v)
 148 void Uniform4f(int32_t location, float x, float y, float z, float w)
 149 void Uniform4fv(int32_t location, IPC::ArrayReference<float> v)
 150 void Uniform4i(int32_t location, int32_t x, int32_t y, int32_t z, int32_t w)
 151 void Uniform4iv(int32_t location, IPC::ArrayReference<int32_t> v)
 152 void UniformMatrix2fv(int32_t location, bool transpose, IPC::ArrayReference<float> value)
 153 void UniformMatrix3fv(int32_t location, bool transpose, IPC::ArrayReference<float> value)
 154 void UniformMatrix4fv(int32_t location, bool transpose, IPC::ArrayReference<float> value)
 155 void UseProgram(uint32_t arg0)
 156 void ValidateProgram(uint32_t arg0)
 157 void VertexAttrib1f(uint32_t index, float x)
 158 void VertexAttrib1fv(uint32_t index, IPC::ArrayReference<float, 1> values)
 159 void VertexAttrib2f(uint32_t index, float x, float y)
 160 void VertexAttrib2fv(uint32_t index, IPC::ArrayReference<float, 2> values)
 161 void VertexAttrib3f(uint32_t index, float x, float y, float z)
 162 void VertexAttrib3fv(uint32_t index, IPC::ArrayReference<float, 3> values)
 163 void VertexAttrib4f(uint32_t index, float x, float y, float z, float w)
 164 void VertexAttrib4fv(uint32_t index, IPC::ArrayReference<float, 4> values)
 165 void VertexAttribPointer(uint32_t index, int32_t size, uint32_t type, bool normalized, int32_t stride, uint64_t offset)
 166 void Viewport(int32_t x, int32_t y, int32_t width, int32_t height)
 167 void BufferData0(uint32_t target, uint64_t arg1, uint32_t usage)
 168 void BufferData1(uint32_t target, IPC::ArrayReference<uint8_t> data, uint32_t usage)
 169 void BufferSubData(uint32_t target, uint64_t offset, IPC::ArrayReference<uint8_t> data)
 170 void ReadnPixels0(int32_t x, int32_t y, int32_t width, int32_t height, uint32_t format, uint32_t type, uint64_t dataSize) -> (IPC::ArrayReference<uint8_t> data) Synchronous
 171 void ReadnPixels1(int32_t x, int32_t y, int32_t width, int32_t height, uint32_t format, uint32_t type, uint64_t offset)
 172 void TexImage2D0(uint32_t target, int32_t level, uint32_t internalformat, int32_t width, int32_t height, int32_t border, uint32_t format, uint32_t type, IPC::ArrayReference<uint8_t> pixels)
 173 void TexImage2D1(uint32_t target, int32_t level, uint32_t internalformat, int32_t width, int32_t height, int32_t border, uint32_t format, uint32_t type, uint64_t offset)
 174 void TexSubImage2D0(uint32_t target, int32_t level, int32_t xoffset, int32_t yoffset, int32_t width, int32_t height, uint32_t format, uint32_t type, IPC::ArrayReference<uint8_t> pixels)
 175 void TexSubImage2D1(uint32_t target, int32_t level, int32_t xoffset, int32_t yoffset, int32_t width, int32_t height, uint32_t format, uint32_t type, uint64_t offset)
 176 void CompressedTexImage2D0(uint32_t target, int32_t level, uint32_t internalformat, int32_t width, int32_t height, int32_t border, int32_t imageSize, IPC::ArrayReference<uint8_t> data)
 177 void CompressedTexImage2D1(uint32_t target, int32_t level, uint32_t internalformat, int32_t width, int32_t height, int32_t border, int32_t imageSize, uint64_t offset)
 178 void CompressedTexSubImage2D0(uint32_t target, int32_t level, int32_t xoffset, int32_t yoffset, int32_t width, int32_t height, uint32_t format, int32_t imageSize, IPC::ArrayReference<uint8_t> data)
 179 void CompressedTexSubImage2D1(uint32_t target, int32_t level, int32_t xoffset, int32_t yoffset, int32_t width, int32_t height, uint32_t format, int32_t imageSize, uint64_t offset)
 180 void DrawArraysInstanced(uint32_t mode, int32_t first, int32_t count, int32_t primcount)
 181 void DrawElementsInstanced(uint32_t mode, int32_t count, uint32_t type, uint64_t offset, int32_t primcount)
 182 void VertexAttribDivisor(uint32_t index, uint32_t divisor)
 183 void CreateVertexArray() -> (uint32_t returnValue) Synchronous
 184 void DeleteVertexArray(uint32_t arg0)
 185 void IsVertexArray(uint32_t arg0) -> (bool returnValue) Synchronous
 186 void BindVertexArray(uint32_t arg0)
 187 void CopyBufferSubData(uint32_t readTarget, uint32_t writeTarget, uint64_t readOffset, uint64_t writeOffset, uint64_t size)
 188 void GetBufferSubData(uint32_t target, uint64_t offset, uint64_t dataSize) -> (IPC::ArrayReference<uint8_t> data) Synchronous
 189 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)
 190 void FramebufferTextureLayer(uint32_t target, uint32_t attachment, uint32_t texture, int32_t level, int32_t layer)
 191 void InvalidateFramebuffer(uint32_t target, IPC::ArrayReference<uint32_t> attachments)
 192 void InvalidateSubFramebuffer(uint32_t target, IPC::ArrayReference<uint32_t> attachments, int32_t x, int32_t y, int32_t width, int32_t height)
 193 void ReadBuffer(uint32_t src)
 194 void RenderbufferStorageMultisample(uint32_t target, int32_t samples, uint32_t internalformat, int32_t width, int32_t height)
 195 void TexStorage2D(uint32_t target, int32_t levels, uint32_t internalformat, int32_t width, int32_t height)
 196 void TexStorage3D(uint32_t target, int32_t levels, uint32_t internalformat, int32_t width, int32_t height, int32_t depth)
 197 void TexImage3D0(uint32_t target, int32_t level, int32_t internalformat, int32_t width, int32_t height, int32_t depth, int32_t border, uint32_t format, uint32_t type, IPC::ArrayReference<uint8_t> pixels)
 198 void TexImage3D1(uint32_t target, int32_t level, int32_t internalformat, int32_t width, int32_t height, int32_t depth, int32_t border, uint32_t format, uint32_t type, uint64_t offset)
 199 void TexSubImage3D0(uint32_t target, int32_t level, int32_t xoffset, int32_t yoffset, int32_t zoffset, int32_t width, int32_t height, int32_t depth, uint32_t format, uint32_t type, IPC::ArrayReference<uint8_t> pixels)
 200 void TexSubImage3D1(uint32_t target, int32_t level, int32_t xoffset, int32_t yoffset, int32_t zoffset, int32_t width, int32_t height, int32_t depth, uint32_t format, uint32_t type, uint64_t offset)
 201 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)
 202 void CompressedTexImage3D0(uint32_t target, int32_t level, uint32_t internalformat, int32_t width, int32_t height, int32_t depth, int32_t border, int32_t imageSize, IPC::ArrayReference<uint8_t> data)
 203 void CompressedTexImage3D1(uint32_t target, int32_t level, uint32_t internalformat, int32_t width, int32_t height, int32_t depth, int32_t border, int32_t imageSize, uint64_t offset)
 204 void CompressedTexSubImage3D0(uint32_t target, int32_t level, int32_t xoffset, int32_t yoffset, int32_t zoffset, int32_t width, int32_t height, int32_t depth, uint32_t format, int32_t imageSize, IPC::ArrayReference<uint8_t> data)
 205 void CompressedTexSubImage3D1(uint32_t target, int32_t level, int32_t xoffset, int32_t yoffset, int32_t zoffset, int32_t width, int32_t height, int32_t depth, uint32_t format, int32_t imageSize, uint64_t offset)
 206 void GetFragDataLocation(uint32_t program, String name) -> (int32_t returnValue) Synchronous
 207 void Uniform1ui(int32_t location, uint32_t v0)
 208 void Uniform2ui(int32_t location, uint32_t v0, uint32_t v1)
 209 void Uniform3ui(int32_t location, uint32_t v0, uint32_t v1, uint32_t v2)
 210 void Uniform4ui(int32_t location, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3)
 211 void Uniform1uiv(int32_t location, IPC::ArrayReference<uint32_t> data)
 212 void Uniform2uiv(int32_t location, IPC::ArrayReference<uint32_t> data)
 213 void Uniform3uiv(int32_t location, IPC::ArrayReference<uint32_t> data)
 214 void Uniform4uiv(int32_t location, IPC::ArrayReference<uint32_t> data)
 215 void UniformMatrix2x3fv(int32_t location, bool transpose, IPC::ArrayReference<float> data)
 216 void UniformMatrix3x2fv(int32_t location, bool transpose, IPC::ArrayReference<float> data)
 217 void UniformMatrix2x4fv(int32_t location, bool transpose, IPC::ArrayReference<float> data)
 218 void UniformMatrix4x2fv(int32_t location, bool transpose, IPC::ArrayReference<float> data)
 219 void UniformMatrix3x4fv(int32_t location, bool transpose, IPC::ArrayReference<float> data)
 220 void UniformMatrix4x3fv(int32_t location, bool transpose, IPC::ArrayReference<float> data)
 221 void VertexAttribI4i(uint32_t index, int32_t x, int32_t y, int32_t z, int32_t w)
 222 void VertexAttribI4iv(uint32_t index, IPC::ArrayReference<int32_t, 4> values)
 223 void VertexAttribI4ui(uint32_t index, uint32_t x, uint32_t y, uint32_t z, uint32_t w)
 224 void VertexAttribI4uiv(uint32_t index, IPC::ArrayReference<uint32_t, 4> values)
 225 void VertexAttribIPointer(uint32_t index, int32_t size, uint32_t type, int32_t stride, uint64_t offset)
 226 void DrawRangeElements(uint32_t mode, uint32_t start, uint32_t end, int32_t count, uint32_t type, uint64_t offset)
 227 void DrawBuffers(IPC::ArrayReference<uint32_t> bufs)
 228 void ClearBufferiv(uint32_t buffer, int32_t drawbuffer, IPC::ArrayReference<int32_t> values)
 229 void ClearBufferuiv(uint32_t buffer, int32_t drawbuffer, IPC::ArrayReference<uint32_t> values)
 230 void ClearBufferfv(uint32_t buffer, int32_t drawbuffer, IPC::ArrayReference<float> values)
 231 void ClearBufferfi(uint32_t buffer, int32_t drawbuffer, float depth, int32_t stencil)
 232 void CreateQuery() -> (uint32_t returnValue) Synchronous
 233 void DeleteQuery(uint32_t query)
 234 void IsQuery(uint32_t query) -> (bool returnValue) Synchronous
 235 void BeginQuery(uint32_t target, uint32_t query)
 236 void EndQuery(uint32_t target)
 237 void GetQuery(uint32_t target, uint32_t pname) -> (uint32_t returnValue) Synchronous
 238 void GetQueryObjectui(uint32_t query, uint32_t pname) -> (uint32_t returnValue) Synchronous
 239 void CreateSampler() -> (uint32_t returnValue) Synchronous
 240 void DeleteSampler(uint32_t sampler)
 241 void IsSampler(uint32_t sampler) -> (bool returnValue) Synchronous
 242 void BindSampler(uint32_t unit, uint32_t sampler)
 243 void SamplerParameteri(uint32_t sampler, uint32_t pname, int32_t param)
 244 void SamplerParameterf(uint32_t sampler, uint32_t pname, float param)
 245 void GetSamplerParameterf(uint32_t sampler, uint32_t pname) -> (float returnValue) Synchronous
 246 void GetSamplerParameteri(uint32_t sampler, uint32_t pname) -> (int32_t returnValue) Synchronous
 247 void FenceSync(uint32_t condition, uint32_t flags) -> (uint64_t returnValue) Synchronous
 248 void IsSync(uint64_t arg0) -> (bool returnValue) Synchronous
 249 void DeleteSync(uint64_t arg0)
 250 void ClientWaitSync(uint64_t arg0, uint32_t flags, uint64_t timeout) -> (uint32_t returnValue) Synchronous
 251 void WaitSync(uint64_t arg0, uint32_t flags, int64_t timeout)
 252 void GetSynci(uint64_t arg0, uint32_t pname) -> (int32_t returnValue) Synchronous
 253 void CreateTransformFeedback() -> (uint32_t returnValue) Synchronous
 254 void DeleteTransformFeedback(uint32_t id)
 255 void IsTransformFeedback(uint32_t id) -> (bool returnValue) Synchronous
 256 void BindTransformFeedback(uint32_t target, uint32_t id)
 257 void BeginTransformFeedback(uint32_t primitiveMode)
 258 void EndTransformFeedback()
 259 void TransformFeedbackVaryings(uint32_t program, Vector<String> varyings, uint32_t bufferMode)
 260 void GetTransformFeedbackVarying(uint32_t program, uint32_t index) -> (WebCore::GraphicsContextGL::ActiveInfo arg2) Synchronous
 261 void PauseTransformFeedback()
 262 void ResumeTransformFeedback()
 263 void BindBufferBase(uint32_t target, uint32_t index, uint32_t buffer)
 264 void BindBufferRange(uint32_t target, uint32_t index, uint32_t buffer, uint64_t offset, uint64_t size)
 265 void GetUniformIndices(uint32_t program, Vector<String> uniformNames) -> (Vector<uint32_t> returnValue) Synchronous
 266 void GetActiveUniforms(uint32_t program, Vector<uint32_t> uniformIndices, uint32_t pname) -> (Vector<int32_t> returnValue) Synchronous
 267 void GetUniformBlockIndex(uint32_t program, String uniformBlockName) -> (uint32_t returnValue) Synchronous
 268 void GetActiveUniformBlockName(uint32_t program, uint32_t uniformBlockIndex) -> (String returnValue) Synchronous
 269 void UniformBlockBinding(uint32_t program, uint32_t uniformBlockIndex, uint32_t uniformBlockBinding)
 270 void GetActiveUniformBlockiv(uint32_t program, uint32_t uniformBlockIndex, uint32_t pname, uint64_t paramsSize) -> (IPC::ArrayReference<int32_t> params) Synchronous
 271 void GetGraphicsResetStatusARB() -> (int32_t returnValue) Synchronous
 272 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)
 273 void RenderbufferStorageMultisampleANGLE(uint32_t target, int32_t samples, uint32_t internalformat, int32_t width, int32_t height)
 274 void CreateVertexArrayOES() -> (uint32_t returnValue) Synchronous
 275 void DeleteVertexArrayOES(uint32_t arg0)
 276 void IsVertexArrayOES(uint32_t arg0) -> (bool returnValue) Synchronous
 277 void BindVertexArrayOES(uint32_t arg0)
 278 void GetTranslatedShaderSourceANGLE(uint32_t arg0) -> (String returnValue) Synchronous
 279 void InsertEventMarkerEXT(String arg0)
 280 void PushGroupMarkerEXT(String arg0)
 281 void PopGroupMarkerEXT()
 282 void DrawBuffersEXT(IPC::ArrayReference<uint32_t> bufs)
 283 void DrawArraysInstancedANGLE(uint32_t mode, int32_t first, int32_t count, int32_t primcount)
 284 void DrawElementsInstancedANGLE(uint32_t mode, int32_t count, uint32_t type, uint64_t offset, int32_t primcount)
 285 void VertexAttribDivisorANGLE(uint32_t index, uint32_t divisor)
 286}
 287
 288#endif
 289

Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGLFunctionsGenerated.h

 1/* Copyright (C) 2020 Apple Inc. All rights reserved.
 2 *
 3 * Redistribution and use in source and binary forms, with or without
 4 * modification, are permitted provided that the following conditions
 5 * are met:
 6 * 1. Redistributions of source code must retain the above copyright
 7 * notice, this list of conditions and the following disclaimer.
 8 * 2. Redistributions in binary form must reproduce the above copyright
 9 * notice, this list of conditions and the following disclaimer in the
 10 * documentation and/or other materials provided with the distribution.
 11 *
 12 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
 13 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 14 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 15 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
 16 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 17 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 18 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 19 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 20 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 21 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 22 */
 23
 24// This file is generated by generate-gpup-webgl. Do not edit.
 25// This file should be included in the private section of the
 26// RemoteGraphicsContextGL implementations.
 27#pragma once
 28 void setFailNextGPUStatusCheck()
 29 {
 30 m_context->setFailNextGPUStatusCheck();
 31 }
 32 void synthesizeGLError(uint32_t error)
 33 {
 34 m_context->synthesizeGLError(error);
 35 }
 36 void moveErrorsToSyntheticErrorList(CompletionHandler<void(bool)>&& completionHandler)
 37 {
 38 bool returnValue = { };
 39 returnValue = m_context->moveErrorsToSyntheticErrorList();
 40 completionHandler(returnValue);
 41 }
 42 void activeTexture(uint32_t texture)
 43 {
 44 m_context->activeTexture(texture);
 45 }
 46 void attachShader(uint32_t program, uint32_t shader)
 47 {
 48 m_context->attachShader(program, shader);
 49 }
 50 void bindAttribLocation(uint32_t arg0, uint32_t index, String&& name)
 51 {
 52 m_context->bindAttribLocation(arg0, index, name);
 53 }
 54 void bindBuffer(uint32_t target, uint32_t arg1)
 55 {
 56 m_context->bindBuffer(target, arg1);
 57 }
 58 void bindFramebuffer(uint32_t target, uint32_t arg1)
 59 {
 60 m_context->bindFramebuffer(target, arg1);
 61 }
 62 void bindRenderbuffer(uint32_t target, uint32_t arg1)
 63 {
 64 m_context->bindRenderbuffer(target, arg1);
 65 }
 66 void bindTexture(uint32_t target, uint32_t arg1)
 67 {
 68 m_context->bindTexture(target, arg1);
 69 }
 70 void blendColor(float red, float green, float blue, float alpha)
 71 {
 72 m_context->blendColor(red, green, blue, alpha);
 73 }
 74 void blendEquation(uint32_t mode)
 75 {
 76 m_context->blendEquation(mode);
 77 }
 78 void blendEquationSeparate(uint32_t modeRGB, uint32_t modeAlpha)
 79 {
 80 m_context->blendEquationSeparate(modeRGB, modeAlpha);
 81 }
 82 void blendFunc(uint32_t sfactor, uint32_t dfactor)
 83 {
 84 m_context->blendFunc(sfactor, dfactor);
 85 }
 86 void blendFuncSeparate(uint32_t srcRGB, uint32_t dstRGB, uint32_t srcAlpha, uint32_t dstAlpha)
 87 {
 88 m_context->blendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
 89 }
 90 void checkFramebufferStatus(uint32_t target, CompletionHandler<void(uint32_t)>&& completionHandler)
 91 {
 92 GCGLenum returnValue = { };
 93 returnValue = m_context->checkFramebufferStatus(target);
 94 completionHandler(returnValue);
 95 }
 96 void clear(uint32_t mask)
 97 {
 98 m_context->clear(mask);
 99 }
 100 void clearColor(float red, float green, float blue, float alpha)
 101 {
 102 m_context->clearColor(red, green, blue, alpha);
 103 }
 104 void clearDepth(float depth)
 105 {
 106 m_context->clearDepth(depth);
 107 }
 108 void clearStencil(int32_t s)
 109 {
 110 m_context->clearStencil(s);
 111 }
 112 void colorMask(bool red, bool green, bool blue, bool alpha)
 113 {
 114 m_context->colorMask(static_cast<GCGLboolean>(red), static_cast<GCGLboolean>(green), static_cast<GCGLboolean>(blue), static_cast<GCGLboolean>(alpha));
 115 }
 116 void compileShader(uint32_t arg0)
 117 {
 118 m_context->compileShader(arg0);
 119 }
 120 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)
 121 {
 122 m_context->copyTexImage2D(target, level, internalformat, x, y, width, height, border);
 123 }
 124 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)
 125 {
 126 m_context->copyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
 127 }
 128 void createBuffer(CompletionHandler<void(uint32_t)>&& completionHandler)
 129 {
 130 PlatformGLObject returnValue = { };
 131 returnValue = m_context->createBuffer();
 132 completionHandler(returnValue);
 133 }
 134 void createFramebuffer(CompletionHandler<void(uint32_t)>&& completionHandler)
 135 {
 136 PlatformGLObject returnValue = { };
 137 returnValue = m_context->createFramebuffer();
 138 completionHandler(returnValue);
 139 }
 140 void createProgram(CompletionHandler<void(uint32_t)>&& completionHandler)
 141 {
 142 PlatformGLObject returnValue = { };
 143 returnValue = m_context->createProgram();
 144 completionHandler(returnValue);
 145 }
 146 void createRenderbuffer(CompletionHandler<void(uint32_t)>&& completionHandler)
 147 {
 148 PlatformGLObject returnValue = { };
 149 returnValue = m_context->createRenderbuffer();
 150 completionHandler(returnValue);
 151 }
 152 void createShader(uint32_t arg0, CompletionHandler<void(uint32_t)>&& completionHandler)
 153 {
 154 PlatformGLObject returnValue = { };
 155 returnValue = m_context->createShader(arg0);
 156 completionHandler(returnValue);
 157 }
 158 void createTexture(CompletionHandler<void(uint32_t)>&& completionHandler)
 159 {
 160 PlatformGLObject returnValue = { };
 161 returnValue = m_context->createTexture();
 162 completionHandler(returnValue);
 163 }
 164 void cullFace(uint32_t mode)
 165 {
 166 m_context->cullFace(mode);
 167 }
 168 void deleteBuffer(uint32_t arg0)
 169 {
 170 m_context->deleteBuffer(arg0);
 171 }
 172 void deleteFramebuffer(uint32_t arg0)
 173 {
 174 m_context->deleteFramebuffer(arg0);
 175 }
 176 void deleteProgram(uint32_t arg0)
 177 {
 178 m_context->deleteProgram(arg0);
 179 }
 180 void deleteRenderbuffer(uint32_t arg0)
 181 {
 182 m_context->deleteRenderbuffer(arg0);
 183 }
 184 void deleteShader(uint32_t arg0)
 185 {
 186 m_context->deleteShader(arg0);
 187 }
 188 void deleteTexture(uint32_t arg0)
 189 {
 190 m_context->deleteTexture(arg0);
 191 }
 192 void depthFunc(uint32_t func)
 193 {
 194 m_context->depthFunc(func);
 195 }
 196 void depthMask(bool flag)
 197 {
 198 m_context->depthMask(static_cast<GCGLboolean>(flag));
 199 }
 200 void depthRange(float zNear, float zFar)
 201 {
 202 m_context->depthRange(zNear, zFar);
 203 }
 204 void detachShader(uint32_t arg0, uint32_t arg1)
 205 {
 206 m_context->detachShader(arg0, arg1);
 207 }
 208 void disable(uint32_t cap)
 209 {
 210 m_context->disable(cap);
 211 }
 212 void disableVertexAttribArray(uint32_t index)
 213 {
 214 m_context->disableVertexAttribArray(index);
 215 }
 216 void drawArrays(uint32_t mode, int32_t first, int32_t count)
 217 {
 218 m_context->drawArrays(mode, first, count);
 219 }
 220 void drawElements(uint32_t mode, int32_t count, uint32_t type, uint64_t offset)
 221 {
 222 m_context->drawElements(mode, count, type, static_cast<GCGLintptr>(offset));
 223 }
 224 void enable(uint32_t cap)
 225 {
 226 m_context->enable(cap);
 227 }
 228 void enableVertexAttribArray(uint32_t index)
 229 {
 230 m_context->enableVertexAttribArray(index);
 231 }
 232 void finish()
 233 {
 234 m_context->finish();
 235 }
 236 void flush()
 237 {
 238 m_context->flush();
 239 }
 240 void framebufferRenderbuffer(uint32_t target, uint32_t attachment, uint32_t renderbuffertarget, uint32_t arg3)
 241 {
 242 m_context->framebufferRenderbuffer(target, attachment, renderbuffertarget, arg3);
 243 }
 244 void framebufferTexture2D(uint32_t target, uint32_t attachment, uint32_t textarget, uint32_t arg3, int32_t level)
 245 {
 246 m_context->framebufferTexture2D(target, attachment, textarget, arg3, level);
 247 }
 248 void frontFace(uint32_t mode)
 249 {
 250 m_context->frontFace(mode);
 251 }
 252 void generateMipmap(uint32_t target)
 253 {
 254 m_context->generateMipmap(target);
 255 }
 256 void getActiveAttrib(uint32_t program, uint32_t index, CompletionHandler<void(bool, WebCore::GraphicsContextGL::ActiveInfo&&)>&& completionHandler)
 257 {
 258 bool returnValue = { };
 259 WebCore::GraphicsContextGL::ActiveInfo arg2 { };
 260 returnValue = m_context->getActiveAttrib(program, index, arg2);
 261 completionHandler(returnValue, WTFMove(arg2));
 262 }
 263 void getActiveUniform(uint32_t program, uint32_t index, CompletionHandler<void(bool, WebCore::GraphicsContextGL::ActiveInfo&&)>&& completionHandler)
 264 {
 265 bool returnValue = { };
 266 WebCore::GraphicsContextGL::ActiveInfo arg2 { };
 267 returnValue = m_context->getActiveUniform(program, index, arg2);
 268 completionHandler(returnValue, WTFMove(arg2));
 269 }
 270 void getAttribLocation(uint32_t arg0, String&& name, CompletionHandler<void(int32_t)>&& completionHandler)
 271 {
 272 GCGLint returnValue = { };
 273 returnValue = m_context->getAttribLocation(arg0, name);
 274 completionHandler(returnValue);
 275 }
 276 void getBufferParameteri(uint32_t target, uint32_t pname, CompletionHandler<void(int32_t)>&& completionHandler)
 277 {
 278 GCGLint returnValue = { };
 279 returnValue = m_context->getBufferParameteri(target, pname);
 280 completionHandler(returnValue);
 281 }
 282 void getString(uint32_t name, CompletionHandler<void(String&&)>&& completionHandler)
 283 {
 284 String returnValue = { };
 285 returnValue = m_context->getString(name);
 286 completionHandler(WTFMove(returnValue));
 287 }
 288 void getFloatv(uint32_t pname, uint64_t valueSize, CompletionHandler<void(IPC::ArrayReference<float>)>&& completionHandler)
 289 {
 290 Vector<GCGLfloat, 16> value(static_cast<size_t>(valueSize), 0);
 291 m_context->getFloatv(pname, value);
 292 completionHandler(IPC::ArrayReference<float>(reinterpret_cast<float*>(value.data()), value.size()));
 293 }
 294 void getIntegerv(uint32_t pname, uint64_t valueSize, CompletionHandler<void(IPC::ArrayReference<int32_t>)>&& completionHandler)
 295 {
 296 Vector<GCGLint, 4> value(static_cast<size_t>(valueSize), 0);
 297 m_context->getIntegerv(pname, value);
 298 completionHandler(IPC::ArrayReference<int32_t>(reinterpret_cast<int32_t*>(value.data()), value.size()));
 299 }
 300 void getInteger64(uint32_t pname, CompletionHandler<void(int64_t)>&& completionHandler)
 301 {
 302 GCGLint64 returnValue = { };
 303 returnValue = m_context->getInteger64(pname);
 304 completionHandler(static_cast<int64_t>(returnValue));
 305 }
 306 void getInteger64i(uint32_t pname, uint32_t index, CompletionHandler<void(int64_t)>&& completionHandler)
 307 {
 308 GCGLint64 returnValue = { };
 309 returnValue = m_context->getInteger64i(pname, index);
 310 completionHandler(static_cast<int64_t>(returnValue));
 311 }
 312 void getProgrami(uint32_t program, uint32_t pname, CompletionHandler<void(int32_t)>&& completionHandler)
 313 {
 314 GCGLint returnValue = { };
 315 returnValue = m_context->getProgrami(program, pname);
 316 completionHandler(returnValue);
 317 }
 318 void getBooleanv(uint32_t pname, uint64_t valueSize, CompletionHandler<void(IPC::ArrayReference<bool>)>&& completionHandler)
 319 {
 320 Vector<GCGLboolean, 4> value(static_cast<size_t>(valueSize), 0);
 321 m_context->getBooleanv(pname, value);
 322 completionHandler(IPC::ArrayReference<bool>(reinterpret_cast<bool*>(value.data()), value.size()));
 323 }
 324 void getError(CompletionHandler<void(uint32_t)>&& completionHandler)
 325 {
 326 GCGLenum returnValue = { };
 327 returnValue = m_context->getError();
 328 completionHandler(returnValue);
 329 }
 330 void getFramebufferAttachmentParameteri(uint32_t target, uint32_t attachment, uint32_t pname, CompletionHandler<void(int32_t)>&& completionHandler)
 331 {
 332 GCGLint returnValue = { };
 333 returnValue = m_context->getFramebufferAttachmentParameteri(target, attachment, pname);
 334 completionHandler(returnValue);
 335 }
 336 void getProgramInfoLog(uint32_t arg0, CompletionHandler<void(String&&)>&& completionHandler)
 337 {
 338 String returnValue = { };
 339 returnValue = m_context->getProgramInfoLog(arg0);
 340 completionHandler(WTFMove(returnValue));
 341 }
 342 void getRenderbufferParameteri(uint32_t target, uint32_t pname, CompletionHandler<void(int32_t)>&& completionHandler)
 343 {
 344 GCGLint returnValue = { };
 345 returnValue = m_context->getRenderbufferParameteri(target, pname);
 346 completionHandler(returnValue);
 347 }
 348 void getShaderi(uint32_t arg0, uint32_t pname, CompletionHandler<void(int32_t)>&& completionHandler)
 349 {
 350 GCGLint returnValue = { };
 351 returnValue = m_context->getShaderi(arg0, pname);
 352 completionHandler(returnValue);
 353 }
 354 void getShaderInfoLog(uint32_t arg0, CompletionHandler<void(String&&)>&& completionHandler)
 355 {
 356 String returnValue = { };
 357 returnValue = m_context->getShaderInfoLog(arg0);
 358 completionHandler(WTFMove(returnValue));
 359 }
 360 void getShaderPrecisionFormat(uint32_t shaderType, uint32_t precisionType, CompletionHandler<void(IPC::ArrayReference<int32_t, 2>, int32_t)>&& completionHandler)
 361 {
 362 std::array<GCGLint, 2> range { };
 363 GCGLint precision = { };
 364 m_context->getShaderPrecisionFormat(shaderType, precisionType, range, &precision);
 365 completionHandler(IPC::ArrayReference<int32_t, 2>(reinterpret_cast<int32_t*>(range.data()), range.size()), precision);
 366 }
 367 void getShaderSource(uint32_t arg0, CompletionHandler<void(String&&)>&& completionHandler)
 368 {
 369 String returnValue = { };
 370 returnValue = m_context->getShaderSource(arg0);
 371 completionHandler(WTFMove(returnValue));
 372 }
 373 void getTexParameterf(uint32_t target, uint32_t pname, CompletionHandler<void(float)>&& completionHandler)
 374 {
 375 GCGLfloat returnValue = { };
 376 returnValue = m_context->getTexParameterf(target, pname);
 377 completionHandler(returnValue);
 378 }
 379 void getTexParameteri(uint32_t target, uint32_t pname, CompletionHandler<void(int32_t)>&& completionHandler)
 380 {
 381 GCGLint returnValue = { };
 382 returnValue = m_context->getTexParameteri(target, pname);
 383 completionHandler(returnValue);
 384 }
 385 void getUniformfv(uint32_t program, int32_t location, uint64_t valueSize, CompletionHandler<void(IPC::ArrayReference<float>)>&& completionHandler)
 386 {
 387 Vector<GCGLfloat, 16> value(static_cast<size_t>(valueSize), 0);
 388 m_context->getUniformfv(program, location, value);
 389 completionHandler(IPC::ArrayReference<float>(reinterpret_cast<float*>(value.data()), value.size()));
 390 }
 391 void getUniformiv(uint32_t program, int32_t location, uint64_t valueSize, CompletionHandler<void(IPC::ArrayReference<int32_t>)>&& completionHandler)
 392 {
 393 Vector<GCGLint, 4> value(static_cast<size_t>(valueSize), 0);
 394 m_context->getUniformiv(program, location, value);
 395 completionHandler(IPC::ArrayReference<int32_t>(reinterpret_cast<int32_t*>(value.data()), value.size()));
 396 }
 397 void getUniformuiv(uint32_t program, int32_t location, uint64_t valueSize, CompletionHandler<void(IPC::ArrayReference<uint32_t>)>&& completionHandler)
 398 {
 399 Vector<GCGLuint, 4> value(static_cast<size_t>(valueSize), 0);
 400 m_context->getUniformuiv(program, location, value);
 401 completionHandler(IPC::ArrayReference<uint32_t>(reinterpret_cast<uint32_t*>(value.data()), value.size()));
 402 }
 403 void getUniformLocation(uint32_t arg0, String&& name, CompletionHandler<void(int32_t)>&& completionHandler)
 404 {
 405 GCGLint returnValue = { };
 406 returnValue = m_context->getUniformLocation(arg0, name);
 407 completionHandler(returnValue);
 408 }
 409 void getVertexAttribOffset(uint32_t index, uint32_t pname, CompletionHandler<void(uint64_t)>&& completionHandler)
 410 {
 411 GCGLsizeiptr returnValue = { };
 412 returnValue = m_context->getVertexAttribOffset(index, pname);
 413 completionHandler(static_cast<uint64_t>(returnValue));
 414 }
 415 void hint(uint32_t target, uint32_t mode)
 416 {
 417 m_context->hint(target, mode);
 418 }
 419 void isBuffer(uint32_t arg0, CompletionHandler<void(bool)>&& completionHandler)
 420 {
 421 GCGLboolean returnValue = { };
 422 returnValue = m_context->isBuffer(arg0);
 423 completionHandler(static_cast<bool>(returnValue));
 424 }
 425 void isEnabled(uint32_t cap, CompletionHandler<void(bool)>&& completionHandler)
 426 {
 427 GCGLboolean returnValue = { };
 428 returnValue = m_context->isEnabled(cap);
 429 completionHandler(static_cast<bool>(returnValue));
 430 }
 431 void isFramebuffer(uint32_t arg0, CompletionHandler<void(bool)>&& completionHandler)
 432 {
 433 GCGLboolean returnValue = { };
 434 returnValue = m_context->isFramebuffer(arg0);
 435 completionHandler(static_cast<bool>(returnValue));
 436 }
 437 void isProgram(uint32_t arg0, CompletionHandler<void(bool)>&& completionHandler)
 438 {
 439 GCGLboolean returnValue = { };
 440 returnValue = m_context->isProgram(arg0);
 441 completionHandler(static_cast<bool>(returnValue));
 442 }
 443 void isRenderbuffer(uint32_t arg0, CompletionHandler<void(bool)>&& completionHandler)
 444 {
 445 GCGLboolean returnValue = { };
 446 returnValue = m_context->isRenderbuffer(arg0);
 447 completionHandler(static_cast<bool>(returnValue));
 448 }
 449 void isShader(uint32_t arg0, CompletionHandler<void(bool)>&& completionHandler)
 450 {
 451 GCGLboolean returnValue = { };
 452 returnValue = m_context->isShader(arg0);
 453 completionHandler(static_cast<bool>(returnValue));
 454 }
 455 void isTexture(uint32_t arg0, CompletionHandler<void(bool)>&& completionHandler)
 456 {
 457 GCGLboolean returnValue = { };
 458 returnValue = m_context->isTexture(arg0);
 459 completionHandler(static_cast<bool>(returnValue));
 460 }
 461 void lineWidth(float arg0)
 462 {
 463 m_context->lineWidth(arg0);
 464 }
 465 void linkProgram(uint32_t arg0)
 466 {
 467 m_context->linkProgram(arg0);
 468 }
 469 void pixelStorei(uint32_t pname, int32_t param)
 470 {
 471 m_context->pixelStorei(pname, param);
 472 }
 473 void polygonOffset(float factor, float units)
 474 {
 475 m_context->polygonOffset(factor, units);
 476 }
 477 void renderbufferStorage(uint32_t target, uint32_t internalformat, int32_t width, int32_t height)
 478 {
 479 m_context->renderbufferStorage(target, internalformat, width, height);
 480 }
 481 void sampleCoverage(float value, bool invert)
 482 {
 483 m_context->sampleCoverage(value, static_cast<GCGLboolean>(invert));
 484 }
 485 void scissor(int32_t x, int32_t y, int32_t width, int32_t height)
 486 {
 487 m_context->scissor(x, y, width, height);
 488 }
 489 void shaderSource(uint32_t arg0, String&& string)
 490 {
 491 m_context->shaderSource(arg0, string);
 492 }
 493 void stencilFunc(uint32_t func, int32_t ref, uint32_t mask)
 494 {
 495 m_context->stencilFunc(func, ref, mask);
 496 }
 497 void stencilFuncSeparate(uint32_t face, uint32_t func, int32_t ref, uint32_t mask)
 498 {
 499 m_context->stencilFuncSeparate(face, func, ref, mask);
 500 }
 501 void stencilMask(uint32_t mask)
 502 {
 503 m_context->stencilMask(mask);
 504 }
 505 void stencilMaskSeparate(uint32_t face, uint32_t mask)
 506 {
 507 m_context->stencilMaskSeparate(face, mask);
 508 }
 509 void stencilOp(uint32_t fail, uint32_t zfail, uint32_t zpass)
 510 {
 511 m_context->stencilOp(fail, zfail, zpass);
 512 }
 513 void stencilOpSeparate(uint32_t face, uint32_t fail, uint32_t zfail, uint32_t zpass)
 514 {
 515 m_context->stencilOpSeparate(face, fail, zfail, zpass);
 516 }
 517 void texParameterf(uint32_t target, uint32_t pname, float param)
 518 {
 519 m_context->texParameterf(target, pname, param);
 520 }
 521 void texParameteri(uint32_t target, uint32_t pname, int32_t param)
 522 {
 523 m_context->texParameteri(target, pname, param);
 524 }
 525 void uniform1f(int32_t location, float x)
 526 {
 527 m_context->uniform1f(location, x);
 528 }
 529 void uniform1fv(int32_t location, IPC::ArrayReference<float>&& v)
 530 {
 531 m_context->uniform1fv(location, makeGCGLSpan(reinterpret_cast<const GCGLfloat*>(v.data()), v.size()));
 532 }
 533 void uniform1i(int32_t location, int32_t x)
 534 {
 535 m_context->uniform1i(location, x);
 536 }
 537 void uniform1iv(int32_t location, IPC::ArrayReference<int32_t>&& v)
 538 {
 539 m_context->uniform1iv(location, makeGCGLSpan(reinterpret_cast<const GCGLint*>(v.data()), v.size()));
 540 }
 541 void uniform2f(int32_t location, float x, float y)
 542 {
 543 m_context->uniform2f(location, x, y);
 544 }
 545 void uniform2fv(int32_t location, IPC::ArrayReference<float>&& v)
 546 {
 547 m_context->uniform2fv(location, makeGCGLSpan(reinterpret_cast<const GCGLfloat*>(v.data()), v.size()));
 548 }
 549 void uniform2i(int32_t location, int32_t x, int32_t y)
 550 {
 551 m_context->uniform2i(location, x, y);
 552 }
 553 void uniform2iv(int32_t location, IPC::ArrayReference<int32_t>&& v)
 554 {
 555 m_context->uniform2iv(location, makeGCGLSpan(reinterpret_cast<const GCGLint*>(v.data()), v.size()));
 556 }
 557 void uniform3f(int32_t location, float x, float y, float z)
 558 {
 559 m_context->uniform3f(location, x, y, z);
 560 }
 561 void uniform3fv(int32_t location, IPC::ArrayReference<float>&& v)
 562 {
 563 m_context->uniform3fv(location, makeGCGLSpan(reinterpret_cast<const GCGLfloat*>(v.data()), v.size()));
 564 }
 565 void uniform3i(int32_t location, int32_t x, int32_t y, int32_t z)
 566 {
 567 m_context->uniform3i(location, x, y, z);
 568 }
 569 void uniform3iv(int32_t location, IPC::ArrayReference<int32_t>&& v)
 570 {
 571 m_context->uniform3iv(location, makeGCGLSpan(reinterpret_cast<const GCGLint*>(v.data()), v.size()));
 572 }
 573 void uniform4f(int32_t location, float x, float y, float z, float w)
 574 {
 575 m_context->uniform4f(location, x, y, z, w);
 576 }
 577 void uniform4fv(int32_t location, IPC::ArrayReference<float>&& v)
 578 {
 579 m_context->uniform4fv(location, makeGCGLSpan(reinterpret_cast<const GCGLfloat*>(v.data()), v.size()));
 580 }
 581 void uniform4i(int32_t location, int32_t x, int32_t y, int32_t z, int32_t w)
 582 {
 583 m_context->uniform4i(location, x, y, z, w);
 584 }
 585 void uniform4iv(int32_t location, IPC::ArrayReference<int32_t>&& v)
 586 {
 587 m_context->uniform4iv(location, makeGCGLSpan(reinterpret_cast<const GCGLint*>(v.data()), v.size()));
 588 }
 589 void uniformMatrix2fv(int32_t location, bool transpose, IPC::ArrayReference<float>&& value)
 590 {
 591 m_context->uniformMatrix2fv(location, static_cast<GCGLboolean>(transpose), makeGCGLSpan(reinterpret_cast<const GCGLfloat*>(value.data()), value.size()));
 592 }
 593 void uniformMatrix3fv(int32_t location, bool transpose, IPC::ArrayReference<float>&& value)
 594 {
 595 m_context->uniformMatrix3fv(location, static_cast<GCGLboolean>(transpose), makeGCGLSpan(reinterpret_cast<const GCGLfloat*>(value.data()), value.size()));
 596 }
 597 void uniformMatrix4fv(int32_t location, bool transpose, IPC::ArrayReference<float>&& value)
 598 {
 599 m_context->uniformMatrix4fv(location, static_cast<GCGLboolean>(transpose), makeGCGLSpan(reinterpret_cast<const GCGLfloat*>(value.data()), value.size()));
 600 }
 601 void useProgram(uint32_t arg0)
 602 {
 603 m_context->useProgram(arg0);
 604 }
 605 void validateProgram(uint32_t arg0)
 606 {
 607 m_context->validateProgram(arg0);
 608 }
 609 void vertexAttrib1f(uint32_t index, float x)
 610 {
 611 m_context->vertexAttrib1f(index, x);
 612 }
 613 void vertexAttrib1fv(uint32_t index, IPC::ArrayReference<float, 1>&& values)
 614 {
 615 m_context->vertexAttrib1fv(index, makeGCGLSpan<1>(reinterpret_cast<const GCGLfloat*>(values.data())));
 616 }
 617 void vertexAttrib2f(uint32_t index, float x, float y)
 618 {
 619 m_context->vertexAttrib2f(index, x, y);
 620 }
 621 void vertexAttrib2fv(uint32_t index, IPC::ArrayReference<float, 2>&& values)
 622 {
 623 m_context->vertexAttrib2fv(index, makeGCGLSpan<2>(reinterpret_cast<const GCGLfloat*>(values.data())));
 624 }
 625 void vertexAttrib3f(uint32_t index, float x, float y, float z)
 626 {
 627 m_context->vertexAttrib3f(index, x, y, z);
 628 }
 629 void vertexAttrib3fv(uint32_t index, IPC::ArrayReference<float, 3>&& values)
 630 {
 631 m_context->vertexAttrib3fv(index, makeGCGLSpan<3>(reinterpret_cast<const GCGLfloat*>(values.data())));
 632 }
 633 void vertexAttrib4f(uint32_t index, float x, float y, float z, float w)
 634 {
 635 m_context->vertexAttrib4f(index, x, y, z, w);
 636 }
 637 void vertexAttrib4fv(uint32_t index, IPC::ArrayReference<float, 4>&& values)
 638 {
 639 m_context->vertexAttrib4fv(index, makeGCGLSpan<4>(reinterpret_cast<const GCGLfloat*>(values.data())));
 640 }
 641 void vertexAttribPointer(uint32_t index, int32_t size, uint32_t type, bool normalized, int32_t stride, uint64_t offset)
 642 {
 643 m_context->vertexAttribPointer(index, size, type, static_cast<GCGLboolean>(normalized), stride, static_cast<GCGLintptr>(offset));
 644 }
 645 void viewport(int32_t x, int32_t y, int32_t width, int32_t height)
 646 {
 647 m_context->viewport(x, y, width, height);
 648 }
 649 void bufferData0(uint32_t target, uint64_t arg1, uint32_t usage)
 650 {
 651 m_context->bufferData(target, static_cast<GCGLsizeiptr>(arg1), usage);
 652 }
 653 void bufferData1(uint32_t target, IPC::ArrayReference<uint8_t>&& data, uint32_t usage)
 654 {
 655 m_context->bufferData(target, makeGCGLSpan(reinterpret_cast<const GCGLvoid*>(data.data()), data.size()), usage);
 656 }
 657 void bufferSubData(uint32_t target, uint64_t offset, IPC::ArrayReference<uint8_t>&& data)
 658 {
 659 m_context->bufferSubData(target, static_cast<GCGLintptr>(offset), makeGCGLSpan(reinterpret_cast<const GCGLvoid*>(data.data()), data.size()));
 660 }
 661 void readnPixels0(int32_t x, int32_t y, int32_t width, int32_t height, uint32_t format, uint32_t type, uint64_t dataSize, CompletionHandler<void(IPC::ArrayReference<uint8_t>)>&& completionHandler)
 662 {
 663 Vector<GCGLchar, 4> data(static_cast<size_t>(dataSize), 0);
 664 m_context->readnPixels(x, y, width, height, format, type, data);
 665 completionHandler(IPC::ArrayReference<uint8_t>(reinterpret_cast<uint8_t*>(data.data()), data.size()));
 666 }
 667 void readnPixels1(int32_t x, int32_t y, int32_t width, int32_t height, uint32_t format, uint32_t type, uint64_t offset)
 668 {
 669 m_context->readnPixels(x, y, width, height, format, type, static_cast<GCGLintptr>(offset));
 670 }
 671 void texImage2D0(uint32_t target, int32_t level, uint32_t internalformat, int32_t width, int32_t height, int32_t border, uint32_t format, uint32_t type, IPC::ArrayReference<uint8_t>&& pixels)
 672 {
 673 m_context->texImage2D(target, level, internalformat, width, height, border, format, type, makeGCGLSpan(reinterpret_cast<const GCGLvoid*>(pixels.data()), pixels.size()));
 674 }
 675 void texImage2D1(uint32_t target, int32_t level, uint32_t internalformat, int32_t width, int32_t height, int32_t border, uint32_t format, uint32_t type, uint64_t offset)
 676 {
 677 m_context->texImage2D(target, level, internalformat, width, height, border, format, type, static_cast<GCGLintptr>(offset));
 678 }
 679 void texSubImage2D0(uint32_t target, int32_t level, int32_t xoffset, int32_t yoffset, int32_t width, int32_t height, uint32_t format, uint32_t type, IPC::ArrayReference<uint8_t>&& pixels)
 680 {
 681 m_context->texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, makeGCGLSpan(reinterpret_cast<const GCGLvoid*>(pixels.data()), pixels.size()));
 682 }
 683 void texSubImage2D1(uint32_t target, int32_t level, int32_t xoffset, int32_t yoffset, int32_t width, int32_t height, uint32_t format, uint32_t type, uint64_t offset)
 684 {
 685 m_context->texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, static_cast<GCGLintptr>(offset));
 686 }
 687 void compressedTexImage2D0(uint32_t target, int32_t level, uint32_t internalformat, int32_t width, int32_t height, int32_t border, int32_t imageSize, IPC::ArrayReference<uint8_t>&& data)
 688 {
 689 m_context->compressedTexImage2D(target, level, internalformat, width, height, border, imageSize, makeGCGLSpan(reinterpret_cast<const GCGLvoid*>(data.data()), data.size()));
 690 }
 691 void compressedTexImage2D1(uint32_t target, int32_t level, uint32_t internalformat, int32_t width, int32_t height, int32_t border, int32_t imageSize, uint64_t offset)
 692 {
 693 m_context->compressedTexImage2D(target, level, internalformat, width, height, border, imageSize, static_cast<GCGLintptr>(offset));
 694 }
 695 void compressedTexSubImage2D0(uint32_t target, int32_t level, int32_t xoffset, int32_t yoffset, int32_t width, int32_t height, uint32_t format, int32_t imageSize, IPC::ArrayReference<uint8_t>&& data)
 696 {
 697 m_context->compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, makeGCGLSpan(reinterpret_cast<const GCGLvoid*>(data.data()), data.size()));
 698 }
 699 void compressedTexSubImage2D1(uint32_t target, int32_t level, int32_t xoffset, int32_t yoffset, int32_t width, int32_t height, uint32_t format, int32_t imageSize, uint64_t offset)
 700 {
 701 m_context->compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, static_cast<GCGLintptr>(offset));
 702 }
 703 void drawArraysInstanced(uint32_t mode, int32_t first, int32_t count, int32_t primcount)
 704 {
 705 m_context->drawArraysInstanced(mode, first, count, primcount);
 706 }
 707 void drawElementsInstanced(uint32_t mode, int32_t count, uint32_t type, uint64_t offset, int32_t primcount)
 708 {
 709 m_context->drawElementsInstanced(mode, count, type, static_cast<GCGLintptr>(offset), primcount);
 710 }
 711 void vertexAttribDivisor(uint32_t index, uint32_t divisor)
 712 {
 713 m_context->vertexAttribDivisor(index, divisor);
 714 }
 715 void createVertexArray(CompletionHandler<void(uint32_t)>&& completionHandler)
 716 {
 717 PlatformGLObject returnValue = { };
 718 returnValue = m_context->createVertexArray();
 719 completionHandler(returnValue);
 720 }
 721 void deleteVertexArray(uint32_t arg0)
 722 {
 723 m_context->deleteVertexArray(arg0);
 724 }
 725 void isVertexArray(uint32_t arg0, CompletionHandler<void(bool)>&& completionHandler)
 726 {
 727 GCGLboolean returnValue = { };
 728 returnValue = m_context->isVertexArray(arg0);
 729 completionHandler(static_cast<bool>(returnValue));
 730 }
 731 void bindVertexArray(uint32_t arg0)
 732 {
 733 m_context->bindVertexArray(arg0);
 734 }
 735 void copyBufferSubData(uint32_t readTarget, uint32_t writeTarget, uint64_t readOffset, uint64_t writeOffset, uint64_t size)
 736 {
 737 m_context->copyBufferSubData(readTarget, writeTarget, static_cast<GCGLintptr>(readOffset), static_cast<GCGLintptr>(writeOffset), static_cast<GCGLsizeiptr>(size));
 738 }
 739 void getBufferSubData(uint32_t target, uint64_t offset, uint64_t dataSize, CompletionHandler<void(IPC::ArrayReference<uint8_t>)>&& completionHandler)
 740 {
 741 Vector<GCGLchar, 4> data(static_cast<size_t>(dataSize), 0);
 742 m_context->getBufferSubData(target, static_cast<GCGLintptr>(offset), data);
 743 completionHandler(IPC::ArrayReference<uint8_t>(reinterpret_cast<uint8_t*>(data.data()), data.size()));
 744 }
 745 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)
 746 {
 747 m_context->blitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
 748 }
 749 void framebufferTextureLayer(uint32_t target, uint32_t attachment, uint32_t texture, int32_t level, int32_t layer)
 750 {
 751 m_context->framebufferTextureLayer(target, attachment, texture, level, layer);
 752 }
 753 void invalidateFramebuffer(uint32_t target, IPC::ArrayReference<uint32_t>&& attachments)
 754 {
 755 m_context->invalidateFramebuffer(target, makeGCGLSpan(reinterpret_cast<const GCGLenum*>(attachments.data()), attachments.size()));
 756 }
 757 void invalidateSubFramebuffer(uint32_t target, IPC::ArrayReference<uint32_t>&& attachments, int32_t x, int32_t y, int32_t width, int32_t height)
 758 {
 759 m_context->invalidateSubFramebuffer(target, makeGCGLSpan(reinterpret_cast<const GCGLenum*>(attachments.data()), attachments.size()), x, y, width, height);
 760 }
 761 void readBuffer(uint32_t src)
 762 {
 763 m_context->readBuffer(src);
 764 }
 765 void renderbufferStorageMultisample(uint32_t target, int32_t samples, uint32_t internalformat, int32_t width, int32_t height)
 766 {
 767 m_context->renderbufferStorageMultisample(target, samples, internalformat, width, height);
 768 }
 769 void texStorage2D(uint32_t target, int32_t levels, uint32_t internalformat, int32_t width, int32_t height)
 770 {
 771 m_context->texStorage2D(target, levels, internalformat, width, height);
 772 }
 773 void texStorage3D(uint32_t target, int32_t levels, uint32_t internalformat, int32_t width, int32_t height, int32_t depth)
 774 {
 775 m_context->texStorage3D(target, levels, internalformat, width, height, depth);
 776 }
 777 void texImage3D0(uint32_t target, int32_t level, int32_t internalformat, int32_t width, int32_t height, int32_t depth, int32_t border, uint32_t format, uint32_t type, IPC::ArrayReference<uint8_t>&& pixels)
 778 {
 779 m_context->texImage3D(target, level, internalformat, width, height, depth, border, format, type, makeGCGLSpan(reinterpret_cast<const GCGLvoid*>(pixels.data()), pixels.size()));
 780 }
 781 void texImage3D1(uint32_t target, int32_t level, int32_t internalformat, int32_t width, int32_t height, int32_t depth, int32_t border, uint32_t format, uint32_t type, uint64_t offset)
 782 {
 783 m_context->texImage3D(target, level, internalformat, width, height, depth, border, format, type, static_cast<GCGLintptr>(offset));
 784 }
 785 void texSubImage3D0(uint32_t target, int32_t level, int32_t xoffset, int32_t yoffset, int32_t zoffset, int32_t width, int32_t height, int32_t depth, uint32_t format, uint32_t type, IPC::ArrayReference<uint8_t>&& pixels)
 786 {
 787 m_context->texSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, makeGCGLSpan(reinterpret_cast<const GCGLvoid*>(pixels.data()), pixels.size()));
 788 }
 789 void texSubImage3D1(uint32_t target, int32_t level, int32_t xoffset, int32_t yoffset, int32_t zoffset, int32_t width, int32_t height, int32_t depth, uint32_t format, uint32_t type, uint64_t offset)
 790 {
 791 m_context->texSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, static_cast<GCGLintptr>(offset));
 792 }
 793 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)
 794 {
 795 m_context->copyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height);
 796 }
 797 void compressedTexImage3D0(uint32_t target, int32_t level, uint32_t internalformat, int32_t width, int32_t height, int32_t depth, int32_t border, int32_t imageSize, IPC::ArrayReference<uint8_t>&& data)
 798 {
 799 m_context->compressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, makeGCGLSpan(reinterpret_cast<const GCGLvoid*>(data.data()), data.size()));
 800 }
 801 void compressedTexImage3D1(uint32_t target, int32_t level, uint32_t internalformat, int32_t width, int32_t height, int32_t depth, int32_t border, int32_t imageSize, uint64_t offset)
 802 {
 803 m_context->compressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, static_cast<GCGLintptr>(offset));
 804 }
 805 void compressedTexSubImage3D0(uint32_t target, int32_t level, int32_t xoffset, int32_t yoffset, int32_t zoffset, int32_t width, int32_t height, int32_t depth, uint32_t format, int32_t imageSize, IPC::ArrayReference<uint8_t>&& data)
 806 {
 807 m_context->compressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, makeGCGLSpan(reinterpret_cast<const GCGLvoid*>(data.data()), data.size()));
 808 }
 809 void compressedTexSubImage3D1(uint32_t target, int32_t level, int32_t xoffset, int32_t yoffset, int32_t zoffset, int32_t width, int32_t height, int32_t depth, uint32_t format, int32_t imageSize, uint64_t offset)
 810 {
 811 m_context->compressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, static_cast<GCGLintptr>(offset));
 812 }
 813 void getFragDataLocation(uint32_t program, String&& name, CompletionHandler<void(int32_t)>&& completionHandler)
 814 {
 815 GCGLint returnValue = { };
 816 returnValue = m_context->getFragDataLocation(program, name);
 817 completionHandler(returnValue);
 818 }
 819 void uniform1ui(int32_t location, uint32_t v0)
 820 {
 821 m_context->uniform1ui(location, v0);
 822 }
 823 void uniform2ui(int32_t location, uint32_t v0, uint32_t v1)
 824 {
 825 m_context->uniform2ui(location, v0, v1);
 826 }
 827 void uniform3ui(int32_t location, uint32_t v0, uint32_t v1, uint32_t v2)
 828 {
 829 m_context->uniform3ui(location, v0, v1, v2);
 830 }
 831 void uniform4ui(int32_t location, uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3)
 832 {
 833 m_context->uniform4ui(location, v0, v1, v2, v3);
 834 }
 835 void uniform1uiv(int32_t location, IPC::ArrayReference<uint32_t>&& data)
 836 {
 837 m_context->uniform1uiv(location, makeGCGLSpan(reinterpret_cast<const GCGLuint*>(data.data()), data.size()));
 838 }
 839 void uniform2uiv(int32_t location, IPC::ArrayReference<uint32_t>&& data)
 840 {
 841 m_context->uniform2uiv(location, makeGCGLSpan(reinterpret_cast<const GCGLuint*>(data.data()), data.size()));
 842 }
 843 void uniform3uiv(int32_t location, IPC::ArrayReference<uint32_t>&& data)
 844 {
 845 m_context->uniform3uiv(location, makeGCGLSpan(reinterpret_cast<const GCGLuint*>(data.data()), data.size()));
 846 }
 847 void uniform4uiv(int32_t location, IPC::ArrayReference<uint32_t>&& data)
 848 {
 849 m_context->uniform4uiv(location, makeGCGLSpan(reinterpret_cast<const GCGLuint*>(data.data()), data.size()));
 850 }
 851 void uniformMatrix2x3fv(int32_t location, bool transpose, IPC::ArrayReference<float>&& data)
 852 {
 853 m_context->uniformMatrix2x3fv(location, static_cast<GCGLboolean>(transpose), makeGCGLSpan(reinterpret_cast<const GCGLfloat*>(data.data()), data.size()));
 854 }
 855 void uniformMatrix3x2fv(int32_t location, bool transpose, IPC::ArrayReference<float>&& data)
 856 {
 857 m_context->uniformMatrix3x2fv(location, static_cast<GCGLboolean>(transpose), makeGCGLSpan(reinterpret_cast<const GCGLfloat*>(data.data()), data.size()));
 858 }
 859 void uniformMatrix2x4fv(int32_t location, bool transpose, IPC::ArrayReference<float>&& data)
 860 {
 861 m_context->uniformMatrix2x4fv(location, static_cast<GCGLboolean>(transpose), makeGCGLSpan(reinterpret_cast<const GCGLfloat*>(data.data()), data.size()));
 862 }
 863 void uniformMatrix4x2fv(int32_t location, bool transpose, IPC::ArrayReference<float>&& data)
 864 {
 865 m_context->uniformMatrix4x2fv(location, static_cast<GCGLboolean>(transpose), makeGCGLSpan(reinterpret_cast<const GCGLfloat*>(data.data()), data.size()));
 866 }
 867 void uniformMatrix3x4fv(int32_t location, bool transpose, IPC::ArrayReference<float>&& data)
 868 {
 869 m_context->uniformMatrix3x4fv(location, static_cast<GCGLboolean>(transpose), makeGCGLSpan(reinterpret_cast<const GCGLfloat*>(data.data()), data.size()));
 870 }
 871 void uniformMatrix4x3fv(int32_t location, bool transpose, IPC::ArrayReference<float>&& data)
 872 {
 873 m_context->uniformMatrix4x3fv(location, static_cast<GCGLboolean>(transpose), makeGCGLSpan(reinterpret_cast<const GCGLfloat*>(data.data()), data.size()));
 874 }
 875 void vertexAttribI4i(uint32_t index, int32_t x, int32_t y, int32_t z, int32_t w)
 876 {
 877 m_context->vertexAttribI4i(index, x, y, z, w);
 878 }
 879 void vertexAttribI4iv(uint32_t index, IPC::ArrayReference<int32_t, 4>&& values)
 880 {
 881 m_context->vertexAttribI4iv(index, makeGCGLSpan<4>(reinterpret_cast<const GCGLint*>(values.data())));
 882 }
 883 void vertexAttribI4ui(uint32_t index, uint32_t x, uint32_t y, uint32_t z, uint32_t w)
 884 {
 885 m_context->vertexAttribI4ui(index, x, y, z, w);
 886 }
 887 void vertexAttribI4uiv(uint32_t index, IPC::ArrayReference<uint32_t, 4>&& values)
 888 {
 889 m_context->vertexAttribI4uiv(index, makeGCGLSpan<4>(reinterpret_cast<const GCGLuint*>(values.data())));
 890 }
 891 void vertexAttribIPointer(uint32_t index, int32_t size, uint32_t type, int32_t stride, uint64_t offset)
 892 {
 893 m_context->vertexAttribIPointer(index, size, type, stride, static_cast<GCGLintptr>(offset));
 894 }
 895 void drawRangeElements(uint32_t mode, uint32_t start, uint32_t end, int32_t count, uint32_t type, uint64_t offset)
 896 {
 897 m_context->drawRangeElements(mode, start, end, count, type, static_cast<GCGLintptr>(offset));
 898 }
 899 void drawBuffers(IPC::ArrayReference<uint32_t>&& bufs)
 900 {
 901 m_context->drawBuffers(makeGCGLSpan(reinterpret_cast<const GCGLenum*>(bufs.data()), bufs.size()));
 902 }
 903 void clearBufferiv(uint32_t buffer, int32_t drawbuffer, IPC::ArrayReference<int32_t>&& values)
 904 {
 905 m_context->clearBufferiv(buffer, drawbuffer, makeGCGLSpan(reinterpret_cast<const GCGLint*>(values.data()), values.size()));
 906 }
 907 void clearBufferuiv(uint32_t buffer, int32_t drawbuffer, IPC::ArrayReference<uint32_t>&& values)
 908 {
 909 m_context->clearBufferuiv(buffer, drawbuffer, makeGCGLSpan(reinterpret_cast<const GCGLuint*>(values.data()), values.size()));
 910 }
 911 void clearBufferfv(uint32_t buffer, int32_t drawbuffer, IPC::ArrayReference<float>&& values)
 912 {
 913 m_context->clearBufferfv(buffer, drawbuffer, makeGCGLSpan(reinterpret_cast<const GCGLfloat*>(values.data()), values.size()));
 914 }
 915 void clearBufferfi(uint32_t buffer, int32_t drawbuffer, float depth, int32_t stencil)
 916 {
 917 m_context->clearBufferfi(buffer, drawbuffer, depth, stencil);
 918 }
 919 void createQuery(CompletionHandler<void(uint32_t)>&& completionHandler)
 920 {
 921 PlatformGLObject returnValue = { };
 922 returnValue = m_context->createQuery();
 923 completionHandler(returnValue);
 924 }
 925 void deleteQuery(uint32_t query)
 926 {
 927 m_context->deleteQuery(query);
 928 }
 929 void isQuery(uint32_t query, CompletionHandler<void(bool)>&& completionHandler)
 930 {
 931 GCGLboolean returnValue = { };
 932 returnValue = m_context->isQuery(query);
 933 completionHandler(static_cast<bool>(returnValue));
 934 }
 935 void beginQuery(uint32_t target, uint32_t query)
 936 {
 937 m_context->beginQuery(target, query);
 938 }
 939 void endQuery(uint32_t target)
 940 {
 941 m_context->endQuery(target);
 942 }
 943 void getQuery(uint32_t target, uint32_t pname, CompletionHandler<void(uint32_t)>&& completionHandler)
 944 {
 945 PlatformGLObject returnValue = { };
 946 returnValue = m_context->getQuery(target, pname);
 947 completionHandler(returnValue);
 948 }
 949 void getQueryObjectui(uint32_t query, uint32_t pname, CompletionHandler<void(uint32_t)>&& completionHandler)
 950 {
 951 GCGLuint returnValue = { };
 952 returnValue = m_context->getQueryObjectui(query, pname);
 953 completionHandler(returnValue);
 954 }
 955 void createSampler(CompletionHandler<void(uint32_t)>&& completionHandler)
 956 {
 957 PlatformGLObject returnValue = { };
 958 returnValue = m_context->createSampler();
 959 completionHandler(returnValue);
 960 }
 961 void deleteSampler(uint32_t sampler)
 962 {
 963 m_context->deleteSampler(sampler);
 964 }
 965 void isSampler(uint32_t sampler, CompletionHandler<void(bool)>&& completionHandler)
 966 {
 967 GCGLboolean returnValue = { };
 968 returnValue = m_context->isSampler(sampler);
 969 completionHandler(static_cast<bool>(returnValue));
 970 }
 971 void bindSampler(uint32_t unit, uint32_t sampler)
 972 {
 973 m_context->bindSampler(unit, sampler);
 974 }
 975 void samplerParameteri(uint32_t sampler, uint32_t pname, int32_t param)
 976 {
 977 m_context->samplerParameteri(sampler, pname, param);
 978 }
 979 void samplerParameterf(uint32_t sampler, uint32_t pname, float param)
 980 {
 981 m_context->samplerParameterf(sampler, pname, param);
 982 }
 983 void getSamplerParameterf(uint32_t sampler, uint32_t pname, CompletionHandler<void(float)>&& completionHandler)
 984 {
 985 GCGLfloat returnValue = { };
 986 returnValue = m_context->getSamplerParameterf(sampler, pname);
 987 completionHandler(returnValue);
 988 }
 989 void getSamplerParameteri(uint32_t sampler, uint32_t pname, CompletionHandler<void(int32_t)>&& completionHandler)
 990 {
 991 GCGLint returnValue = { };
 992 returnValue = m_context->getSamplerParameteri(sampler, pname);
 993 completionHandler(returnValue);
 994 }
 995 void fenceSync(uint32_t condition, uint32_t flags, CompletionHandler<void(uint64_t)>&& completionHandler)
 996 {
 997 GCGLsync returnValue = { };
 998 returnValue = m_context->fenceSync(condition, flags);
 999 completionHandler(static_cast<uint64_t>(reinterpret_cast<intptr_t>(returnValue)));
 1000 }
 1001 void isSync(uint64_t arg0, CompletionHandler<void(bool)>&& completionHandler)
 1002 {
 1003 GCGLboolean returnValue = { };
 1004 returnValue = m_context->isSync(reinterpret_cast<GCGLsync>(static_cast<intptr_t>(arg0)));
 1005 completionHandler(static_cast<bool>(returnValue));
 1006 }
 1007 void deleteSync(uint64_t arg0)
 1008 {
 1009 m_context->deleteSync(reinterpret_cast<GCGLsync>(static_cast<intptr_t>(arg0)));
 1010 }
 1011 void clientWaitSync(uint64_t arg0, uint32_t flags, uint64_t timeout, CompletionHandler<void(uint32_t)>&& completionHandler)
 1012 {
 1013 GCGLenum returnValue = { };
 1014 returnValue = m_context->clientWaitSync(reinterpret_cast<GCGLsync>(static_cast<intptr_t>(arg0)), flags, static_cast<GCGLuint64>(timeout));
 1015 completionHandler(returnValue);
 1016 }
 1017 void waitSync(uint64_t arg0, uint32_t flags, int64_t timeout)
 1018 {
 1019 m_context->waitSync(reinterpret_cast<GCGLsync>(static_cast<intptr_t>(arg0)), flags, static_cast<GCGLint64>(timeout));
 1020 }
 1021 void getSynci(uint64_t arg0, uint32_t pname, CompletionHandler<void(int32_t)>&& completionHandler)
 1022 {
 1023 GCGLint returnValue = { };
 1024 returnValue = m_context->getSynci(reinterpret_cast<GCGLsync>(static_cast<intptr_t>(arg0)), pname);
 1025 completionHandler(returnValue);
 1026 }
 1027 void createTransformFeedback(CompletionHandler<void(uint32_t)>&& completionHandler)
 1028 {
 1029 PlatformGLObject returnValue = { };
 1030 returnValue = m_context->createTransformFeedback();
 1031 completionHandler(returnValue);
 1032 }
 1033 void deleteTransformFeedback(uint32_t id)
 1034 {
 1035 m_context->deleteTransformFeedback(id);
 1036 }
 1037 void isTransformFeedback(uint32_t id, CompletionHandler<void(bool)>&& completionHandler)
 1038 {
 1039 GCGLboolean returnValue = { };
 1040 returnValue = m_context->isTransformFeedback(id);
 1041 completionHandler(static_cast<bool>(returnValue));
 1042 }
 1043 void bindTransformFeedback(uint32_t target, uint32_t id)
 1044 {
 1045 m_context->bindTransformFeedback(target, id);
 1046 }
 1047 void beginTransformFeedback(uint32_t primitiveMode)
 1048 {
 1049 m_context->beginTransformFeedback(primitiveMode);
 1050 }
 1051 void endTransformFeedback()
 1052 {
 1053 m_context->endTransformFeedback();
 1054 }
 1055 void transformFeedbackVaryings(uint32_t program, Vector<String>&& varyings, uint32_t bufferMode)
 1056 {
 1057 m_context->transformFeedbackVaryings(program, varyings, bufferMode);
 1058 }
 1059 void getTransformFeedbackVarying(uint32_t program, uint32_t index, CompletionHandler<void(WebCore::GraphicsContextGL::ActiveInfo&&)>&& completionHandler)
 1060 {
 1061 WebCore::GraphicsContextGL::ActiveInfo arg2 { };
 1062 m_context->getTransformFeedbackVarying(program, index, arg2);
 1063 completionHandler(WTFMove(arg2));
 1064 }
 1065 void pauseTransformFeedback()
 1066 {
 1067 m_context->pauseTransformFeedback();
 1068 }
 1069 void resumeTransformFeedback()
 1070 {
 1071 m_context->resumeTransformFeedback();
 1072 }
 1073 void bindBufferBase(uint32_t target, uint32_t index, uint32_t buffer)
 1074 {
 1075 m_context->bindBufferBase(target, index, buffer);
 1076 }
 1077 void bindBufferRange(uint32_t target, uint32_t index, uint32_t buffer, uint64_t offset, uint64_t size)
 1078 {
 1079 m_context->bindBufferRange(target, index, buffer, static_cast<GCGLintptr>(offset), static_cast<GCGLsizeiptr>(size));
 1080 }
 1081 void getUniformIndices(uint32_t program, Vector<String>&& uniformNames, CompletionHandler<void(Vector<uint32_t>&&)>&& completionHandler)
 1082 {
 1083 Vector<GCGLuint> returnValue = { };
 1084 returnValue = m_context->getUniformIndices(program, uniformNames);
 1085 completionHandler(WTFMove(returnValue));
 1086 }
 1087 void getActiveUniforms(uint32_t program, Vector<uint32_t>&& uniformIndices, uint32_t pname, CompletionHandler<void(Vector<int32_t>&&)>&& completionHandler)
 1088 {
 1089 Vector<GCGLint> returnValue = { };
 1090 returnValue = m_context->getActiveUniforms(program, uniformIndices, pname);
 1091 completionHandler(WTFMove(returnValue));
 1092 }
 1093 void getUniformBlockIndex(uint32_t program, String&& uniformBlockName, CompletionHandler<void(uint32_t)>&& completionHandler)
 1094 {
 1095 GCGLuint returnValue = { };
 1096 returnValue = m_context->getUniformBlockIndex(program, uniformBlockName);
 1097 completionHandler(returnValue);
 1098 }
 1099 void getActiveUniformBlockName(uint32_t program, uint32_t uniformBlockIndex, CompletionHandler<void(String&&)>&& completionHandler)
 1100 {
 1101 String returnValue = { };
 1102 returnValue = m_context->getActiveUniformBlockName(program, uniformBlockIndex);
 1103 completionHandler(WTFMove(returnValue));
 1104 }
 1105 void uniformBlockBinding(uint32_t program, uint32_t uniformBlockIndex, uint32_t uniformBlockBinding)
 1106 {
 1107 m_context->uniformBlockBinding(program, uniformBlockIndex, uniformBlockBinding);
 1108 }
 1109 void getActiveUniformBlockiv(uint32_t program, uint32_t uniformBlockIndex, uint32_t pname, uint64_t paramsSize, CompletionHandler<void(IPC::ArrayReference<int32_t>)>&& completionHandler)
 1110 {
 1111 Vector<GCGLint, 4> params(static_cast<size_t>(paramsSize), 0);
 1112 m_context->getActiveUniformBlockiv(program, uniformBlockIndex, pname, params);
 1113 completionHandler(IPC::ArrayReference<int32_t>(reinterpret_cast<int32_t*>(params.data()), params.size()));
 1114 }
 1115 void getGraphicsResetStatusARB(CompletionHandler<void(int32_t)>&& completionHandler)
 1116 {
 1117 GCGLint returnValue = { };
 1118 returnValue = m_context->getExtensions().getGraphicsResetStatusARB();
 1119 completionHandler(returnValue);
 1120 }
 1121 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)
 1122 {
 1123 m_context->getExtensions().blitFramebufferANGLE(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
 1124 }
 1125 void renderbufferStorageMultisampleANGLE(uint32_t target, int32_t samples, uint32_t internalformat, int32_t width, int32_t height)
 1126 {
 1127 m_context->getExtensions().renderbufferStorageMultisampleANGLE(target, samples, internalformat, width, height);
 1128 }
 1129 void createVertexArrayOES(CompletionHandler<void(uint32_t)>&& completionHandler)
 1130 {
 1131 PlatformGLObject returnValue = { };
 1132 returnValue = m_context->getExtensions().createVertexArrayOES();
 1133 completionHandler(returnValue);
 1134 }
 1135 void deleteVertexArrayOES(uint32_t arg0)
 1136 {
 1137 m_context->getExtensions().deleteVertexArrayOES(arg0);
 1138 }
 1139 void isVertexArrayOES(uint32_t arg0, CompletionHandler<void(bool)>&& completionHandler)
 1140 {
 1141 GCGLboolean returnValue = { };
 1142 returnValue = m_context->getExtensions().isVertexArrayOES(arg0);
 1143 completionHandler(static_cast<bool>(returnValue));
 1144 }
 1145 void bindVertexArrayOES(uint32_t arg0)
 1146 {
 1147 m_context->getExtensions().bindVertexArrayOES(arg0);
 1148 }
 1149 void getTranslatedShaderSourceANGLE(uint32_t arg0, CompletionHandler<void(String&&)>&& completionHandler)
 1150 {
 1151 String returnValue = { };
 1152 returnValue = m_context->getExtensions().getTranslatedShaderSourceANGLE(arg0);
 1153 completionHandler(WTFMove(returnValue));
 1154 }
 1155 void insertEventMarkerEXT(String&& arg0)
 1156 {
 1157 m_context->getExtensions().insertEventMarkerEXT(arg0);
 1158 }
 1159 void pushGroupMarkerEXT(String&& arg0)
 1160 {
 1161 m_context->getExtensions().pushGroupMarkerEXT(arg0);
 1162 }
 1163 void popGroupMarkerEXT()
 1164 {
 1165 m_context->getExtensions().popGroupMarkerEXT();
 1166 }
 1167 void drawBuffersEXT(IPC::ArrayReference<uint32_t>&& bufs)
 1168 {
 1169 m_context->getExtensions().drawBuffersEXT(makeGCGLSpan(reinterpret_cast<const GCGLenum*>(bufs.data()), bufs.size()));
 1170 }
 1171 void drawArraysInstancedANGLE(uint32_t mode, int32_t first, int32_t count, int32_t primcount)
 1172 {
 1173 m_context->getExtensions().drawArraysInstancedANGLE(mode, first, count, primcount);
 1174 }
 1175 void drawElementsInstancedANGLE(uint32_t mode, int32_t count, uint32_t type, uint64_t offset, int32_t primcount)
 1176 {
 1177 m_context->getExtensions().drawElementsInstancedANGLE(mode, count, type, static_cast<GCGLvoidptr>(offset), primcount);
 1178 }
 1179 void vertexAttribDivisorANGLE(uint32_t index, uint32_t divisor)
 1180 {
 1181 m_context->getExtensions().vertexAttribDivisorANGLE(index, divisor);
 1182 }
 1183

Source/WebKit/GPUProcess/mac/GPUProcessMac.mm

3232#import "SandboxInitializationParameters.h"
3333#import "WKFoundation.h"
3434#import <WebCore/LocalizedStrings.h>
 35#import <pal/spi/cg/CoreGraphicsSPI.h>
3536#import <pal/spi/cocoa/LaunchServicesSPI.h>
36 #import <pal/spi/mac/HIServicesSPI.h>
3737#import <sysexits.h>
3838#import <wtf/MemoryPressureHandler.h>
3939#import <wtf/text/WTFString.h>

@@using namespace WebCore;
4444void GPUProcess::initializeProcess(const AuxiliaryProcessInitializationParameters&)
4545{
4646#if PLATFORM(MAC) && !PLATFORM(MACCATALYST)
 47#if 0
4748 // Having a window server connection in this process would result in spin logs (<rdar://problem/13239119>).
48  OSStatus error = SetApplicationIsDaemon(true);
49  ASSERT_UNUSED(error, error == noErr);
 49 auto retval = CGSSetDenyWindowServerConnections(true);
 50 RELEASE_ASSERT(retval == kCGErrorSuccess);
 51 CGSShutdownServerConnections();
 52#endif
5053#endif
5154
5255 launchServicesCheckIn();

Source/WebKit/GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in

207207 (iokit-property-regex #"^AAPL,(DisplayPipe|OpenCLdisabled|IOGraphics_LER(|_RegTag_1|_RegTag_0|_Busy_2)|alias-policy|boot-display|display-alias|mux-switch-state|ndrv-dev|primary-display|slot-name)")
208208 (iokit-property-regex #"^ATY,(cbits|fb_(linebytes|offset|size)|intrev)")
209209 (iokit-property "ATY,DeviceName") ;; Needed by Metal compilers
 210 (iokit-property "ATY,EFIDisplay")
210211 (iokit-property "ATY,FamilyName") ;; Ditto
211212 (iokit-property "AVCSupported")
212213 (iokit-property "BacklightHandle")

217218 (iokit-property "CapsLockDelay")
218219 (iokit-property "CaseSensitive")
219220 (iokit-property "ConfigState")
 221 (iokit-property "DPLanes")
 222 (iokit-property "DPLinkBit")
 223 (iokit-property "DPLinkRate")
220224 (iokit-property "Description")
221225 (iokit-property "Development")
222226 (iokit-property-regex #"^Device( Characteristics|EqID)")

229233 (iokit-property "Family ID")
230234 (iokit-property "ForceSupported")
231235 (iokit-property "Formats")
 236 (iokit-property "FramebufferEnabled")
 237 (iokit-property "FramebufferStarted")
232238 (iokit-property "GPUConfigurationVariable")
 239 (iokit-property "GPUDCCDisplayable")
 240 (iokit-property "GPUDebugNullClientMask")
233241 (iokit-property "GpuDebugPolicy")
 242 (iokit-property "GPURawCounterBundleName")
 243 (iokit-property "GPURawCounterPluginClassName")
234244 (iokit-property "HEVCSupported")
235245 (iokit-property "HIDPointerAccelerationType")
 246 (iokit-property "HwCtxCacheUpdate")
236247 (iokit-property-regex #"^IOAccel(DisplayPipeCapabilities|Index|Types|Revision)")
237248 (iokit-property-regex #"^IO(Class|MatchCategory|NameMatch)")
238249 (iokit-property-regex #"^IOAudioControl(ChannelID|ID|SubType|Usage|Value)")

282293 (iokit-property "IOParentMatch")
283294 (iokit-property-regex #"^IOPCI((Class|Primary|Property|)Match|Express(Capabilities|Link(Status|Capabilities))|MSIMode|Resourced|Tunnelled)")
284295 (iokit-property "IOPMIsPowerManaged")
 296 (iokit-property "IOPersonalityPublisher")
 297
285298 (iokit-property-regex #"^IOPlatform(SerialNumber|UUID)")
286299 (iokit-property "IOPowerManagement")
287300 (iokit-property "IOProbeScore")

317330 (iokit-property "Protocol Characteristics")
318331 (iokit-property "Removable")
319332 (iokit-property-regex #"^ResetOn(Lock|Unlock)Ms")
 333 (iokit-property "SWIP_properties")
320334 (iokit-property "SafeEjectRequested")
321335 (iokit-property "SampleRates")
322336 (iokit-property "Serial Number")

338352 (iokit-property "attached-gpu-control-path")
339353 (iokit-property-regex #"^audio-(codec-info|device-mvalue|device-nvalue|selector)")
340354 (iokit-property "av-signal-type")
 355 (iokit-property "backlight-PWM-freq")
341356 (iokit-property "bcdVersion")
342357 (iokit-property-regex #"^(board|device|revision|subsystem|vendor)-id")
343358 (iokit-property "boot-gamma-restored")

350365 (iokit-property "connector-type")
351366 (iokit-property-regex #"^(device|revision|subsystem-vendor|touch-size)-id")
352367 (iokit-property "device_type")
 368 (iokit-property "display-bpc")
 369 (iokit-property "display-connect-flags")
 370 (iokit-property "display-link-component-bits")
 371 (iokit-property "display-pixel-component-bits")
 372 (iokit-property "display-type")
353373 (iokit-property "dpm")
354374 (iokit-property "errordb") ;; Needed for OpenGL on older hardware
355375 (iokit-property "filevault-image") ;; Needed by LaunchServices

Source/WebKit/GPUProcess/media/RemoteLegacyCDMProxy.h

@@namespace WebCore {
3939class SharedBuffer;
4040}
4141
42 namespace IPC {
43 class DataReference;
44 }
45 
4642namespace WebKit {
4743
4844class RemoteLegacyCDMProxy

Source/WebKit/GPUProcess/media/RemoteLegacyCDMSessionProxy.cpp

3333#include "RemoteLegacyCDMSessionMessages.h"
3434#include "SharedBufferCopy.h"
3535#include <JavaScriptCore/GenericTypedArrayViewInlines.h>
 36#include <WebCore/LegacyCDM.h>
3637#include <WebCore/SharedBuffer.h>
3738
3839namespace WebKit {

Source/WebKit/GPUProcess/media/RemoteMediaResourceManager.cpp

2929#if ENABLE(GPU_PROCESS)
3030
3131#include "Connection.h"
32 #include "DataReference.h"
3332#include "RemoteMediaResource.h"
3433#include "RemoteMediaResourceIdentifier.h"
3534#include "WebCoreArgumentCoders.h"

Source/WebKit/GPUProcess/media/RemoteMediaResourceManager.h

2727
2828#if ENABLE(GPU_PROCESS)
2929
 30#include "DataReference.h"
3031#include "MessageReceiver.h"
3132#include "RemoteMediaResourceIdentifier.h"
 33
3234#include <WebCore/PolicyChecker.h>
3335#include <wtf/HashMap.h>
3436
3537namespace IPC {
3638class Connection;
3739class Decoder;
38 class DataReference;
3940}
4041
4142namespace WebCore {

Source/WebKit/GPUProcess/media/RemoteMediaSourceProxy.h

3838namespace IPC {
3939class Connection;
4040class Decoder;
41 class DataReference;
4241}
4342
4443namespace WebCore {

Source/WebKit/GPUProcess/media/RemoteSourceBufferProxy.cpp

2929#if ENABLE(GPU_PROCESS) && ENABLE(MEDIA_SOURCE)
3030
3131#include "Connection.h"
32 #include "DataReference.h"
3332#include "RemoteSourceBufferProxyMessages.h"
3433#include "SourceBufferPrivateRemoteMessages.h"
3534#include <WebCore/NotImplemented.h>

Source/WebKit/GPUProcess/media/RemoteSourceBufferProxy.h

2727
2828#if ENABLE(GPU_PROCESS) && ENABLE(MEDIA_SOURCE)
2929
 30#include "DataReference.h"
3031#include "GPUConnectionToWebProcess.h"
3132#include "MessageReceiver.h"
3233#include "RemoteSourceBufferIdentifier.h"
 34
3335#include <WebCore/SourceBufferPrivate.h>
3436#include <WebCore/SourceBufferPrivateClient.h>
3537#include <wtf/Ref.h>

3840namespace IPC {
3941class Connection;
4042class Decoder;
41 class DataReference;
4243}
4344
4445namespace WebCore {

Source/WebKit/GPUProcess/webrtc/LibWebRTCCodecsProxy.h

2828#if USE(LIBWEBRTC) && PLATFORM(COCOA) && ENABLE(GPU_PROCESS)
2929
3030#include "Connection.h"
 31#include "DataReference.h"
3132#include "RTCDecoderIdentifier.h"
3233#include "RTCEncoderIdentifier.h"
 34
3335#include <WebCore/ImageTransferSessionVT.h>
3436
3537namespace IPC {
3638class Connection;
3739class Decoder;
38 class DataReference;
3940}
4041
4142namespace WebCore {

Source/WebKit/GPUProcess/webrtc/LibWebRTCCodecsProxy.mm

2828
2929#if USE(LIBWEBRTC) && PLATFORM(COCOA) && ENABLE(GPU_PROCESS)
3030
31 #import "DataReference.h"
3231#import "GPUConnectionToWebProcess.h"
3332#import "LibWebRTCCodecsMessages.h"
3433#import "LibWebRTCCodecsProxyMessages.h"

Source/WebKit/GPUProcess/webrtc/RemoteMediaRecorder.h

2727
2828#if PLATFORM(COCOA) && ENABLE(GPU_PROCESS) && ENABLE(MEDIA_STREAM) && HAVE(AVASSETWRITERDELEGATE)
2929
 30#include "DataReference.h"
3031#include "MediaRecorderIdentifier.h"
3132#include "MessageReceiver.h"
3233#include "SharedMemory.h"

3637
3738namespace IPC {
3839class Connection;
39 class DataReference;
4040class Decoder;
4141}
4242

Source/WebKit/NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm

2626#import "config.h"
2727#import "LegacyCustomProtocolManager.h"
2828
29 #import "DataReference.h"
3029#import "LegacyCustomProtocolManagerMessages.h"
3130#import "NetworkProcess.h"
3231#import <Foundation/NSURLSession.h>

Source/WebKit/NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h

2525
2626#pragma once
2727
 28#include "DataReference.h"
2829#include "LegacyCustomProtocolID.h"
2930#include "MessageReceiver.h"
3031#include "NetworkProcessSupplement.h"

@@OBJC_CLASS NSURLSessionConfiguration;
3940OBJC_CLASS WKCustomProtocol;
4041#endif
4142
42 namespace IPC {
43 class DataReference;
44 } // namespace IPC
45 
4643namespace WebCore {
4744class ResourceError;
4845class ResourceRequest;

@@private:
112109};
113110
114111} // namespace WebKit
115 

Source/WebKit/NetworkProcess/Downloads/Download.cpp

2929#include "AuthenticationChallengeDisposition.h"
3030#include "AuthenticationManager.h"
3131#include "Connection.h"
32 #include "DataReference.h"
3332#include "DownloadManager.h"
3433#include "DownloadMonitor.h"
3534#include "DownloadProxyMessages.h"

Source/WebKit/NetworkProcess/Downloads/Download.h

2525
2626#pragma once
2727
 28#include "DataReference.h"
2829#include "DownloadID.h"
2930#include "DownloadManager.h"
3031#include "DownloadMonitor.h"

@@OBJC_CLASS NSProgress;
4445OBJC_CLASS NSURLSessionDownloadTask;
4546#endif
4647
47 namespace IPC {
48 class DataReference;
49 }
50 
5148namespace WebCore {
5249class AuthenticationChallenge;
5350class BlobDataFileReference;

Source/WebKit/NetworkProcess/Downloads/DownloadManager.cpp

2626#include "config.h"
2727#include "DownloadManager.h"
2828
29 #include "DataReference.h"
3029#include "Download.h"
3130#include "NetworkConnectionToWebProcess.h"
3231#include "NetworkLoad.h"

Source/WebKit/NetworkProcess/Downloads/DownloadManager.h

2525
2626#pragma once
2727
 28#include "DataReference.h"
2829#include "DownloadID.h"
2930#include "DownloadMap.h"
3031#include "NetworkDataTask.h"

@@class ResourceResponse;
4950
5051namespace IPC {
5152class Connection;
52 class DataReference;
5353}
5454
5555namespace WebKit {

Source/WebKit/NetworkProcess/NetworkSocketChannel.cpp

2626#include "config.h"
2727#include "NetworkSocketChannel.h"
2828
29 #include "DataReference.h"
3029#include "NetworkConnectionToWebProcess.h"
3130#include "NetworkProcess.h"
3231#include "NetworkSession.h"

Source/WebKit/NetworkProcess/NetworkSocketChannel.h

2525
2626#pragma once
2727
 28#include "DataReference.h"
2829#include "MessageReceiver.h"
2930#include "MessageSender.h"
3031#include <WebCore/Timer.h>

@@class ResourceRequest;
4041namespace IPC {
4142class Connection;
4243class Decoder;
43 class DataReference;
4444}
4545
4646namespace WebKit {

Source/WebKit/NetworkProcess/NetworkSocketStream.cpp

2626#include "config.h"
2727#include "NetworkSocketStream.h"
2828
29 #include "DataReference.h"
3029#include "NetworkStorageSessionProvider.h"
3130#include "WebSocketStreamMessages.h"
3231#include <WebCore/CookieRequestHeaderFieldProxy.h>

Source/WebKit/NetworkProcess/NetworkSocketStream.h

2525
2626#pragma once
2727
 28#include "DataReference.h"
2829#include "MessageReceiver.h"
2930#include "MessageSender.h"
3031#include <WebCore/SocketStreamError.h>

3738namespace IPC {
3839class Connection;
3940class Decoder;
40 class DataReference;
4141}
4242
4343namespace WebKit {

Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h

2727
2828#if ENABLE(SERVICE_WORKER)
2929
 30#include "DataReference.h"
3031#include <WebCore/FetchIdentifier.h>
3132#include <WebCore/ResourceRequest.h>
3233#include <WebCore/ServiceWorkerClientIdentifier.h>

@@class ResourceResponse;
4344
4445namespace IPC {
4546class Connection;
46 class DataReference;
4747class Decoder;
4848class FormDataReference;
4949}

Source/WebKit/NetworkProcess/WebSocketTask.h

3131#include "WebSocketTaskSoup.h"
3232#else
3333
34 namespace IPC {
35 class DataReference;
36 }
3734
3835namespace WebKit {
3936

Source/WebKit/NetworkProcess/cocoa/WebSocketTaskCocoa.h

2727
2828#if HAVE(NSURLSESSION_WEBSOCKET)
2929
 30#include "DataReference.h"
3031#include <wtf/RetainPtr.h>
3132#include <wtf/WeakPtr.h>
3233
3334OBJC_CLASS NSURLSessionWebSocketTask;
3435
35 namespace IPC {
36 class DataReference;
37 }
38 
3936namespace WebKit {
4037class NetworkSession;
4138class NetworkSessionCocoa;

Source/WebKit/NetworkProcess/cocoa/WebSocketTaskCocoa.mm

2828
2929#if HAVE(NSURLSESSION_WEBSOCKET)
3030
31 #import "DataReference.h"
3231#import "NetworkSessionCocoa.h"
3332#import "NetworkSocketChannel.h"
3433#import <Foundation/NSURLSession.h>

Source/WebKit/NetworkProcess/soup/WebSocketTaskSoup.cpp

2626#include "config.h"
2727#include "WebSocketTaskSoup.h"
2828
29 #include "DataReference.h"
3029#include "NetworkProcess.h"
3130#include "NetworkSocketChannel.h"
3231#include <WebCore/HTTPParsers.h>

Source/WebKit/NetworkProcess/soup/WebSocketTaskSoup.h

2525
2626#pragma once
2727
 28#include "DataReference.h"
2829#include <libsoup/soup.h>
2930#include <wtf/RunLoop.h>
3031#include <wtf/glib/GRefPtr.h>
3132
32 namespace IPC {
33 class DataReference;
34 }
35 
3633namespace WebKit {
3734class NetworkSocketChannel;
3835

Source/WebKit/Platform/IPC/ArgumentCoders.h

2525
2626#pragma once
2727
 28#include "ArrayReference.h"
2829#include "Decoder.h"
2930#include "Encoder.h"
3031#include <utility>

@@template<typename T> struct SimpleArgumentCoder {
5354 }
5455};
5556
 57template<typename T, size_t Extent> struct ArgumentCoder<ArrayReference<T, Extent>> {
 58 using ArrayReferenceType = ArrayReference<T, Extent>;
 59 static void encode(Encoder& encoder, const ArrayReferenceType& arrayReference)
 60 {
 61 if (!Extent)
 62 return;
 63 encoder.encodeFixedLengthData(reinterpret_cast<const uint8_t*>(arrayReference.data()), arrayReference.size() * sizeof(T), alignof(T));
 64 }
 65 static Optional<ArrayReferenceType> decode(Decoder& decoder)
 66 {
 67 if (!Extent)
 68 return ArrayReferenceType();
 69 const uint8_t* data = decoder.decodeFixedLengthReference(Extent * sizeof(T), alignof(T));
 70 if (!data)
 71 return WTF::nullopt;
 72 return ArrayReferenceType(reinterpret_cast<const T*>(data), Extent);
 73 }
 74};
 75
 76template<typename T> struct ArgumentCoder<ArrayReference<T, arrayReferenceDynamicExtent>> {
 77 using ArrayReferenceType = ArrayReference<T, arrayReferenceDynamicExtent>;
 78 static void encode(Encoder& encoder, const ArrayReferenceType& arrayReference)
 79 {
 80 encoder.encode(static_cast<uint64_t>(arrayReference.size()));
 81 if (!arrayReference.size())
 82 return;
 83 encoder.encodeFixedLengthData(reinterpret_cast<const uint8_t*>(arrayReference.data()), arrayReference.size() * sizeof(T), alignof(T));
 84 }
 85 static Optional<ArrayReferenceType> decode(Decoder& decoder)
 86 {
 87 uint64_t size;
 88 if (!decoder.decode(size))
 89 return WTF::nullopt;
 90 if (!size)
 91 return ArrayReferenceType();
 92 const uint8_t* data = decoder.decodeFixedLengthReference(size * sizeof(T), alignof(T));
 93 if (!data)
 94 return WTF::nullopt;
 95 return ArrayReferenceType(reinterpret_cast<const T*>(data), static_cast<size_t>(size));
 96 }
 97};
 98
5699template<typename T> struct ArgumentCoder<OptionSet<T>> {
57100 static void encode(Encoder& encoder, const OptionSet<T>& optionSet)
58101 {

Source/WebKit/Platform/IPC/ArrayReference.h

 1/*
 2 * Copyright (C) 2010 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 23 * THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#pragma once
 27
 28#include <limits>
 29#include <wtf/Vector.h>
 30
 31namespace IPC {
 32
 33inline constexpr size_t arrayReferenceDynamicExtent = std::numeric_limits<size_t>::max();
 34
 35template <typename T, size_t Extent = arrayReferenceDynamicExtent>
 36class ArrayReference;
 37
 38template <typename T>
 39class ArrayReference<T, arrayReferenceDynamicExtent> {
 40public:
 41 ArrayReference() = default;
 42
 43 ArrayReference(const T* data, size_t size)
 44 : m_data(data)
 45 , m_size(size)
 46 {
 47 }
 48
 49 template <size_t inlineCapacity>
 50 ArrayReference(const Vector<T, inlineCapacity>& vector)
 51 : m_data(vector.data())
 52 , m_size(vector.size())
 53 {
 54 }
 55
 56 bool isEmpty() const { return !m_size; }
 57
 58 size_t size() const { return m_size; }
 59 const T* data() const
 60 {
 61 if (isEmpty())
 62 return nullptr;
 63 return m_data;
 64 }
 65
 66 Vector<T> vector() const
 67 {
 68 Vector<T> result;
 69 result.append(m_data, m_size);
 70
 71 return result;
 72 }
 73
 74private:
 75 const T* m_data { };
 76 size_t m_size { };
 77};
 78
 79template <typename T, size_t Extent>
 80class ArrayReference {
 81public:
 82 ArrayReference() = default;
 83
 84 ArrayReference(const T* data, size_t size)
 85 : m_data(data)
 86 {
 87 ASSERT_UNUSED(size, size == Extent);
 88 }
 89
 90 template <size_t inlineCapacity>
 91 ArrayReference(const Vector<T, inlineCapacity>& vector)
 92 : m_data(vector.data())
 93 {
 94 ASSERT(vector.size() == Extent);
 95 }
 96
 97 constexpr bool isEmpty() const { return !Extent; }
 98
 99 constexpr size_t size() const { return Extent; }
 100
 101 const T* data() const
 102 {
 103 if (isEmpty())
 104 return nullptr;
 105 return m_data;
 106 }
 107
 108 Vector<T> vector() const
 109 {
 110 Vector<T> result;
 111 if (!isEmpty())
 112 result.append(m_data, Extent);
 113 return result;
 114 }
 115
 116private:
 117 const T* m_data { };
 118};
 119
 120template<typename T, size_t inlineCapacity>
 121ArrayReference(const WTF::Vector<T, inlineCapacity>&) -> ArrayReference<T>;
 122
 123} // namespace IPC

Source/WebKit/Platform/IPC/Connection.h

@@public:
227227 void markCurrentlyDispatchedMessageAsInvalid();
228228
229229 void postConnectionDidCloseOnConnectionWorkQueue();
230 
231230 template<typename T, typename C> void sendWithAsyncReply(T&& message, C&& completionHandler, uint64_t destinationID = 0, OptionSet<SendOption> = { }); // Thread-safe.
232231 template<typename T> bool send(T&& message, uint64_t destinationID, OptionSet<SendOption> sendOptions = { }); // Thread-safe.
233  template<typename T> bool sendSync(T&& message, typename T::Reply&& reply, uint64_t destinationID, Seconds timeout = Seconds::infinity(), OptionSet<SendSyncOption> sendSyncOptions = { }); // Main thread only.
 232 // Sync senders should check the SendSyncResult for true/false in case they need to know if the result was really received.
 233 // Sync senders should hold on to the SendSyncResult in case they reference the contents of the reply via DataRefererence / ArrayReference.
 234 using SendSyncResult = std::unique_ptr<Decoder>;
 235 template<typename T> SendSyncResult sendSync(T&& message, typename T::Reply&& reply, uint64_t destinationID, Seconds timeout = Seconds::infinity(), OptionSet<SendSyncOption> sendSyncOptions = { }); // Main thread only.
234236 template<typename T> bool waitForAndDispatchImmediately(uint64_t destinationID, Seconds timeout, OptionSet<WaitForOption> waitForOptions = { }); // Main thread only.
235237
236238 // Thread-safe.

@@public:
249251
250252 // Main thread only.
251253 template<typename T, typename U>
252  bool sendSync(T&& message, typename T::Reply&& reply, ObjectIdentifier<U> destinationID, Seconds timeout = Seconds::infinity(), OptionSet<SendSyncOption> sendSyncOptions = { })
 254 SendSyncResult sendSync(T&& message, typename T::Reply&& reply, ObjectIdentifier<U> destinationID, Seconds timeout = Seconds::infinity(), OptionSet<SendSyncOption> sendSyncOptions = { })
253255 {
254256 return sendSync<T>(WTFMove(message), WTFMove(reply), destinationID.toUInt64(), timeout, sendSyncOptions);
255257 }

@@void moveTuple(std::tuple<A...>&& a, std::tuple<B...>& b)
551553 TupleMover<sizeof...(A), std::tuple<A...>, std::tuple<B...>>::move(WTFMove(a), b);
552554}
553555
554 template<typename T> bool Connection::sendSync(T&& message, typename T::Reply&& reply, uint64_t destinationID, Seconds timeout, OptionSet<SendSyncOption> sendSyncOptions)
 556template<typename T> Connection::SendSyncResult Connection::sendSync(T&& message, typename T::Reply&& reply, uint64_t destinationID, Seconds timeout, OptionSet<SendSyncOption> sendSyncOptions)
555557{
556558 COMPILE_ASSERT(T::isSync, SyncMessageExpected);
557559 RELEASE_ASSERT(RunLoop::isMain());

@@template<typename T> bool Connection::sendSync(T&& message, typename T::Reply&&
570572 // Now send the message and wait for a reply.
571573 std::unique_ptr<Decoder> replyDecoder = sendSyncMessage(syncRequestID, WTFMove(encoder), timeout, sendSyncOptions);
572574 if (!replyDecoder)
573  return false;
 575 return { };
574576
575577 // Decode the reply.
576578 Optional<typename T::ReplyArguments> replyArguments;
577579 *replyDecoder >> replyArguments;
578580 if (!replyArguments)
579  return false;
 581 return { };
580582 moveTuple(WTFMove(*replyArguments), reply);
581  return true;
 583 return replyDecoder;
582584}
583585
584586template<typename T> bool Connection::waitForAndDispatchImmediately(uint64_t destinationID, Seconds timeout, OptionSet<WaitForOption> waitForOptions)

Source/WebKit/Platform/IPC/DataReference.cpp

1 /*
2  * Copyright (C) 2010 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23  * THE POSSIBILITY OF SUCH DAMAGE.
24  */
25 
26 #include "config.h"
27 #include "DataReference.h"
28 
29 #include "Decoder.h"
30 #include "Encoder.h"
31 
32 namespace IPC {
33 
34 void DataReference::encode(Encoder& encoder) const
35 {
36  encoder.encodeVariableLengthByteArray(*this);
37 }
38 
39 bool DataReference::decode(Decoder& decoder, DataReference& dataReference)
40 {
41  return decoder.decodeVariableLengthByteArray(dataReference);
42 }
43 
44 } // namespace IPC

Source/WebKit/Platform/IPC/DataReference.h

2525
2626#pragma once
2727
28 #include <wtf/Vector.h>
 28#include "ArrayReference.h"
2929
3030namespace IPC {
3131
32 class Decoder;
33 class Encoder;
34 
35 class DataReference {
36 public:
37  DataReference() = default;
38 
39  DataReference(const uint8_t* data, size_t size)
40  : m_data(data)
41  , m_size(size)
42  {
43  }
44 
45  template<size_t inlineCapacity>
46  DataReference(const Vector<uint8_t, inlineCapacity>& vector)
47  : m_data(vector.data())
48  , m_size(vector.size())
49  {
50  }
51 
52  bool isEmpty() const { return !m_size; }
53 
54  size_t size() const { return m_size; }
55  const uint8_t* data() const
56  {
57  if (isEmpty())
58  return nullptr;
59  return m_data;
60  }
61 
62  Vector<uint8_t> vector() const
63  {
64  Vector<uint8_t> result;
65  result.append(m_data, m_size);
66 
67  return result;
68  }
69 
70  void encode(Encoder&) const;
71  static WARN_UNUSED_RETURN bool decode(Decoder&, DataReference&);
72 
73 private:
74  const uint8_t* m_data { nullptr };
75  size_t m_size { 0 };
76 };
 32using DataReference = ArrayReference<uint8_t, arrayReferenceDynamicExtent>;
7733
7834} // namespace IPC

Source/WebKit/Platform/IPC/Decoder.cpp

@@bool Decoder::decodeFixedLengthData(uint8_t* data, size_t size, size_t alignment
186186 return true;
187187}
188188
189 bool Decoder::decodeVariableLengthByteArray(DataReference& dataReference)
 189const uint8_t* Decoder::decodeFixedLengthReference(size_t size, size_t alignment)
190190{
191  uint64_t size;
192  if (!decode(size))
193  return false;
194 
195  if (!alignBufferPosition(1, size))
196  return false;
 191 if (!alignBufferPosition(alignment, size))
 192 return nullptr;
197193
198194 const uint8_t* data = m_bufferPos;
199195 m_bufferPos += size;
200196
201  dataReference = DataReference(data, size);
202  return true;
 197 return data;
203198}
204199
205200bool Decoder::removeAttachment(Attachment& attachment)

Source/WebKit/Platform/IPC/Decoder.h

4040
4141namespace IPC {
4242
43 class DataReference;
4443class ImportanceAssertion;
4544enum class MessageFlags : uint8_t;
4645enum class ShouldDispatchWhenWaitingForSyncReply : uint8_t;

@@public:
7877
7978 WARN_UNUSED_RETURN bool decodeFixedLengthData(uint8_t* data, size_t, size_t alignment);
8079
81  // The data in the data reference here will only be valid for the lifetime of the ArgumentDecoder object.
82  WARN_UNUSED_RETURN bool decodeVariableLengthByteArray(DataReference&);
 80 // The data in the returned pointer here will only be valid for the lifetime of the ArgumentDecoder object.
 81 // Returns nullptr on failure.
 82 WARN_UNUSED_RETURN const uint8_t* decodeFixedLengthReference(size_t, size_t alignment);
8383
8484 template<typename T, std::enable_if_t<std::is_arithmetic<T>::value>* = nullptr>
8585 WARN_UNUSED_RETURN bool decode(T& value)

Source/WebKit/Platform/IPC/Encoder.cpp

2626#include "config.h"
2727#include "Encoder.h"
2828
 29#include "ArgumentCoders.h"
2930#include "DataReference.h"
3031#include "MessageFlags.h"
3132#include <algorithm>

@@void Encoder::wrapForTesting(std::unique_ptr<Encoder> original)
141142
142143 original->setShouldDispatchMessageWhenWaitingForSyncReply(ShouldDispatchWhenWaitingForSyncReply::Yes);
143144
144  encodeVariableLengthByteArray(DataReference(original->buffer(), original->bufferSize()));
 145 *this << DataReference(original->buffer(), original->bufferSize());
145146
146147 Vector<Attachment> attachments = original->releaseAttachments();
147148 reserve(attachments.size());

@@void Encoder::encodeFixedLengthData(const uint8_t* data, size_t size, size_t ali
216217 memcpy(buffer, data, size);
217218}
218219
219 void Encoder::encodeVariableLengthByteArray(const DataReference& dataReference)
220 {
221  encode(static_cast<uint64_t>(dataReference.size()));
222  encodeFixedLengthData(dataReference.data(), dataReference.size(), 1);
223 }
224 
225220void Encoder::addAttachment(Attachment&& attachment)
226221{
227222 m_attachments.append(WTFMove(attachment));

Source/WebKit/Platform/IPC/Encoder.h

3636
3737namespace IPC {
3838
39 class DataReference;
4039enum class MessageFlags : uint8_t;
4140enum class MessageName : uint16_t;
4241enum class ShouldDispatchWhenWaitingForSyncReply : uint8_t;

@@public:
6261 void wrapForTesting(std::unique_ptr<Encoder>);
6362
6463 void encodeFixedLengthData(const uint8_t* data, size_t, size_t alignment);
65  void encodeVariableLengthByteArray(const DataReference&);
6664
6765 template<typename T, std::enable_if_t<!std::is_enum<typename std::remove_const_t<std::remove_reference_t<T>>>::value && !std::is_arithmetic<typename std::remove_const_t<std::remove_reference_t<T>>>::value>* = nullptr>
6866 void encode(T&& t)

Source/WebKit/Platform/IPC/HandleMessage.h

2626#pragma once
2727
2828#include "ArgumentCoders.h"
 29#include "DataReference.h"
2930#include <wtf/CompletionHandler.h>
3031#include <wtf/StdLibExtras.h>
3132

@@struct CodingType {
9697 typedef std::remove_const_t<std::remove_reference_t<T>> Type;
9798};
9899
99 class DataReference;
100100class SharedBufferDataReference;
101101template<> struct CodingType<const SharedBufferDataReference&> {
102102 using Type = DataReference;

Source/WebKit/Platform/IPC/MessageSender.h

@@public:
5454 {
5555 return send<U>(message, destinationID.toUInt64(), sendOptions);
5656 }
 57 using SendSyncResult = Connection::SendSyncResult;
5758
5859 template<typename T>
59  bool sendSync(T&& message, typename T::Reply&& reply, Seconds timeout = Seconds::infinity(), OptionSet<SendSyncOption> sendSyncOptions = { })
 60 SendSyncResult sendSync(T&& message, typename T::Reply&& reply, Seconds timeout = Seconds::infinity(), OptionSet<SendSyncOption> sendSyncOptions = { })
6061 {
6162 static_assert(T::isSync, "Message is not sync!");
6263

@@public:
6465 }
6566
6667 template<typename T>
67  bool sendSync(T&& message, typename T::Reply&& reply, uint64_t destinationID, Seconds timeout = Seconds::infinity(), OptionSet<SendSyncOption> sendSyncOptions = { })
 68 SendSyncResult sendSync(T&& message, typename T::Reply&& reply, uint64_t destinationID, Seconds timeout = Seconds::infinity(), OptionSet<SendSyncOption> sendSyncOptions = { })
6869 {
6970 ASSERT(messageSenderConnection());
7071

@@public:
7273 }
7374
7475 template<typename U, typename T>
75  bool sendSync(U&& message, typename U::Reply&& reply, ObjectIdentifier<T> destinationID, Seconds timeout = Seconds::infinity(), OptionSet<SendSyncOption> sendSyncOptions = { })
 76 SendSyncResult sendSync(U&& message, typename U::Reply&& reply, ObjectIdentifier<T> destinationID, Seconds timeout = Seconds::infinity(), OptionSet<SendSyncOption> sendSyncOptions = { })
7677 {
7778 return sendSync<U>(std::forward<U>(message), WTFMove(reply), destinationID.toUInt64(), timeout, sendSyncOptions);
7879 }

Source/WebKit/Platform/IPC/SharedBufferCopy.cpp

2626#include "config.h"
2727#include "SharedBufferCopy.h"
2828
 29#include "ArgumentCoders.h"
2930#include "DataReference.h"
3031#include "Decoder.h"
3132#include "Encoder.h"

@@void SharedBufferCopy::encode(Encoder& encoder) const
4849Optional<SharedBufferCopy> SharedBufferCopy::decode(Decoder& decoder)
4950{
5051 IPC::DataReference data;
51  if (!decoder.decodeVariableLengthByteArray(data))
 52 if (!decoder.decode(data))
5253 return WTF::nullopt;
5354 RefPtr<SharedBuffer> buffer;
5455 if (data.size())

Source/WebKit/Platform/IPC/SharedBufferDataReference.cpp

2626#include "config.h"
2727#include "SharedBufferDataReference.h"
2828
 29#include "ArgumentCoders.h"
2930#include "Encoder.h"
3031
3132namespace IPC {

Source/WebKit/Platform/IPC/StringReference.cpp

2626#include "config.h"
2727#include "StringReference.h"
2828
 29#include "ArgumentCoders.h"
2930#include "DataReference.h"
3031#include "Decoder.h"
3132#include "Encoder.h"

Source/WebKit/PluginProcess/PluginControllerProxy.cpp

2828
2929#if ENABLE(NETSCAPE_PLUGIN_API)
3030
31 #include "DataReference.h"
3231#include "NPObjectProxy.h"
3332#include "NPRemoteObjectMap.h"
3433#include "NPRuntimeUtilities.h"

Source/WebKit/PluginProcess/PluginControllerProxy.h

2828#if ENABLE(NETSCAPE_PLUGIN_API)
2929
3030#include "Connection.h"
 31#include "DataReference.h"
3132#include "Plugin.h"
3233#include "PluginController.h"
3334#include "ShareableBitmap.h"

3738#include <wtf/Noncopyable.h>
3839#include <wtf/RunLoop.h>
3940
40 namespace IPC {
41  class DataReference;
42 }
43 
4441namespace WebKit {
4542
4643class LayerHostingContext;

Source/WebKit/Scripts/webkit/messages.py

@@def forward_declarations_for_namespace(namespace, kind_and_types):
203203
204204def types_that_cannot_be_forward_declared():
205205 return frozenset([
 206 'IPC::DataReference',
206207 'MachSendRight',
207208 'MediaTime',
208209 'String',

@@def types_that_cannot_be_forward_declared():
214215 'WebCore::DocumentOrWorkerIdentifier',
215216 'WebCore::FetchIdentifier',
216217 'WebCore::FrameIdentifier',
 218 'WebCore::GraphicsContextGLAttributes',
217219 'WebCore::LibWebRTCSocketIdentifier',
218220 'WebCore::PlaybackTargetClientContextIdentifier',
219221 'WebCore::MediaPlayerIdentifier',

@@def types_that_cannot_be_forward_declared():
243245 'WebCore::DisplayList::FlushIdentifier',
244246 'WebKit::DownloadID',
245247 'WebKit::GeolocationIdentifier',
 248 'WebKit::GraphicsContextGLIdentifier',
246249 'WebKit::ImageBufferBackendHandle',
247250 'WebKit::LayerHostingContextID',
248251 'WebKit::LegacyCustomProtocolID',

@@def class_template_headers(template_string):
530533 'OptionSet': {'headers': ['<wtf/OptionSet.h>'], 'argument_coder_headers': ['"ArgumentCoders.h"']},
531534 'Vector': {'headers': ['<wtf/Vector.h>'], 'argument_coder_headers': ['"ArgumentCoders.h"']},
532535 'std::pair': {'headers': ['<utility>'], 'argument_coder_headers': ['"ArgumentCoders.h"']},
 536 'IPC::ArrayReference': {'headers': ['"ArrayReference.h"'], 'argument_coder_headers': ['"ArgumentCoders.h"']},
533537 }
534538
535539 match = re.match('(?P<template_name>.+?)<(?P<parameter_string>.+)>', template_string)

Source/WebKit/Shared/API/APIData.cpp

2626#include "config.h"
2727#include "APIData.h"
2828
 29#include "ArgumentCoders.h"
2930#include "Decoder.h"
3031#include "Encoder.h"
3132

Source/WebKit/Shared/AuxiliaryProcess.h

@@public:
8484 void setProcessSuppressionEnabled(bool);
8585
8686#if PLATFORM(COCOA)
87  void setApplicationIsDaemon();
8887 void launchServicesCheckIn();
8988 void setQOS(int latencyQOS, int throughputQOS);
9089#endif

@@struct AuxiliaryProcessInitializationParameters {
184183};
185184
186185} // namespace WebKit
187 

Source/WebKit/Shared/WebCoreArgumentCoders.cpp

@@Optional<RefPtr<WebCore::ImageData>> ArgumentCoder<RefPtr<WebCore::ImageData>>::
32213221 return { WTFMove(*result) };
32223222}
32233223
 3224#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL)
 3225void ArgumentCoder<WebCore::GraphicsContextGLAttributes>::encode(Encoder& encoder, const WebCore::GraphicsContextGLAttributes& attributes)
 3226{
 3227 encoder << attributes.alpha;
 3228 encoder << attributes.depth;
 3229 encoder << attributes.stencil;
 3230 encoder << attributes.antialias;
 3231 encoder << attributes.premultipliedAlpha;
 3232 encoder << attributes.preserveDrawingBuffer;
 3233 encoder << attributes.failIfMajorPerformanceCaveat;
 3234 encoder << attributes.powerPreference;
 3235 encoder << attributes.shareResources;
 3236 encoder << attributes.isWebGL2;
 3237 encoder << attributes.noExtensions;
 3238 encoder << attributes.devicePixelRatio;
 3239 encoder << attributes.initialPowerPreference;
 3240#if ENABLE(WEBXR)
 3241 encoder << attributes.xrCompatible;
 3242#endif
 3243}
 3244
 3245Optional<WebCore::GraphicsContextGLAttributes> ArgumentCoder<WebCore::GraphicsContextGLAttributes>::decode(Decoder& decoder)
 3246{
 3247 GraphicsContextGLAttributes attributes;
 3248 if (!decoder.decode(attributes.alpha))
 3249 return WTF::nullopt;
 3250 if (!decoder.decode(attributes.depth))
 3251 return WTF::nullopt;
 3252 if (!decoder.decode(attributes.stencil))
 3253 return WTF::nullopt;
 3254 if (!decoder.decode(attributes.antialias))
 3255 return WTF::nullopt;
 3256 if (!decoder.decode(attributes.premultipliedAlpha))
 3257 return WTF::nullopt;
 3258 if (!decoder.decode(attributes.preserveDrawingBuffer))
 3259 return WTF::nullopt;
 3260 if (!decoder.decode(attributes.failIfMajorPerformanceCaveat))
 3261 return WTF::nullopt;
 3262 if (!decoder.decode(attributes.powerPreference))
 3263 return WTF::nullopt;
 3264 if (!decoder.decode(attributes.shareResources))
 3265 return WTF::nullopt;
 3266 if (!decoder.decode(attributes.isWebGL2))
 3267 return WTF::nullopt;
 3268 if (!decoder.decode(attributes.noExtensions))
 3269 return WTF::nullopt;
 3270 if (!decoder.decode(attributes.devicePixelRatio))
 3271 return WTF::nullopt;
 3272 if (!decoder.decode(attributes.initialPowerPreference))
 3273 return WTF::nullopt;
 3274#if ENABLE(WEBXR)
 3275 if (!decoder.decode(attributes.xrCompatible))
 3276 return WTF::nullopt;
 3277#endif
 3278 return attributes;
 3279}
 3280
 3281void ArgumentCoder<WebCore::GraphicsContextGL::ActiveInfo>::encode(Encoder& encoder, const WebCore::GraphicsContextGL::ActiveInfo& activeInfo)
 3282{
 3283 encoder << activeInfo.name;
 3284 encoder << activeInfo.type;
 3285 encoder << activeInfo.size;
 3286}
 3287
 3288Optional<WebCore::GraphicsContextGL::ActiveInfo> ArgumentCoder<WebCore::GraphicsContextGL::ActiveInfo>::decode(Decoder& decoder)
 3289{
 3290 WebCore::GraphicsContextGL::ActiveInfo activeInfo;
 3291 if (!decoder.decode(activeInfo.name))
 3292 return WTF::nullopt;
 3293 if (!decoder.decode(activeInfo.type))
 3294 return WTF::nullopt;
 3295 if (!decoder.decode(activeInfo.size))
 3296 return WTF::nullopt;
 3297 return activeInfo;
 3298}
 3299
 3300#endif
 3301
32243302} // namespace IPC

Source/WebKit/Shared/WebCoreArgumentCoders.h

7171#include "ArgumentCodersGtk.h"
7272#endif
7373
 74#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL)
 75#include "ArrayReference.h"
 76#include <WebCore/GraphicsContextGL.h>
 77#include <WebCore/GraphicsContextGLAttributes.h>
 78#include <WebCore/GraphicsTypesGL.h>
 79#endif
 80
7481#if PLATFORM(COCOA)
7582namespace WTF {
7683class MachSendRight;

@@struct SerializedAttachmentData;
203210using IDBKeyPath = Variant<String, Vector<String>>;
204211#endif
205212
 213#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL)
 214struct GraphicsContextGLAttributes;
 215#endif
 216
206217namespace DOMCacheEngine {
207218struct CacheInfo;
208219struct Record;

@@template<> struct ArgumentCoder<WebCore::PaymentInstallmentConfiguration> {
873884};
874885#endif
875886
 887#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL)
 888
 889template<> struct ArgumentCoder<WebCore::GraphicsContextGLAttributes> {
 890 static void encode(Encoder&, const WebCore::GraphicsContextGLAttributes&);
 891 static Optional<WebCore::GraphicsContextGLAttributes> decode(Decoder&);
 892};
 893
 894template<> struct ArgumentCoder<WebCore::GraphicsContextGL::ActiveInfo> {
 895 static void encode(Encoder&, const WebCore::GraphicsContextGL::ActiveInfo&);
 896 static Optional<WebCore::GraphicsContextGL::ActiveInfo> decode(Decoder&);
 897};
 898#endif
 899
876900} // namespace IPC
877901
878902namespace WTF {

@@template <> struct EnumTraits<WebCore::CDMInstance::HDCPStatus> {
10411065
10421066#endif
10431067
 1068#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL)
 1069
 1070template <> struct EnumTraits<WebCore::GraphicsContextGLPowerPreference> {
 1071 using values = EnumValues <
 1072 WebCore::GraphicsContextGLPowerPreference,
 1073 WebCore::GraphicsContextGLPowerPreference::Default,
 1074 WebCore::GraphicsContextGLPowerPreference::LowPower,
 1075 WebCore::GraphicsContextGLPowerPreference::HighPerformance
 1076 >;
 1077};
 1078#endif
 1079
10441080} // namespace WTF

Source/WebKit/Shared/WebPageCreationParameters.cpp

@@void WebPageCreationParameters::encode(IPC::Encoder& encoder) const
158158 encoder << shouldRenderCanvasInGPUProcess;
159159 encoder << shouldRenderDOMInGPUProcess;
160160 encoder << shouldPlayMediaInGPUProcess;
 161#if ENABLE(WEBGL)
 162 encoder << shouldRenderWebGLInGPUProcess;
 163#endif
161164 encoder << shouldEnableVP9Decoder;
162165 encoder << shouldEnableVP9SWDecoder;
163166#if ENABLE(APP_BOUND_DOMAINS)

@@Optional<WebPageCreationParameters> WebPageCreationParameters::decode(IPC::Decod
510513
511514 if (!decoder.decode(parameters.shouldPlayMediaInGPUProcess))
512515 return WTF::nullopt;
 516#if ENABLE(WEBGL)
 517 if (!decoder.decode(parameters.shouldRenderWebGLInGPUProcess))
 518 return WTF::nullopt;
 519#endif
513520
514521 if (!decoder.decode(parameters.shouldEnableVP9Decoder))
515522 return WTF::nullopt;

Source/WebKit/Shared/WebPageCreationParameters.h

@@struct WebPageCreationParameters {
229229 bool shouldRenderCanvasInGPUProcess { false };
230230 bool shouldRenderDOMInGPUProcess { false };
231231 bool shouldPlayMediaInGPUProcess { false };
 232#if ENABLE(WEBGL)
 233 bool shouldRenderWebGLInGPUProcess { false };
 234#endif
232235 bool shouldEnableVP9Decoder { false };
233236 bool shouldEnableVP9SWDecoder { false };
234237#if ENABLE(APP_BOUND_DOMAINS)

Source/WebKit/Shared/cf/ArgumentCodersCF.cpp

2828#include "config.h"
2929#include "ArgumentCodersCF.h"
3030
 31#include "ArgumentCoders.h"
3132#include "DataReference.h"
3233#include "Decoder.h"
3334#include "Encoder.h"

Source/WebKit/Shared/soup/WebCoreArgumentCodersSoup.cpp

@@void ArgumentCoder<CertificateInfo>::encode(Encoder& encoder, const CertificateI
8181 // Encode starting from the root certificate.
8282 for (size_t i = certificatesDataList.size(); i > 0; --i) {
8383 GByteArray* certificate = certificatesDataList[i - 1].get();
84  encoder.encodeVariableLengthByteArray(IPC::DataReference(certificate->data, certificate->len));
 84 encoder << IPC::DataReference(certificate->data, certificate->len);
8585 }
8686
8787 encoder << static_cast<uint32_t>(certificateInfo.tlsErrors());

@@bool ArgumentCoder<CertificateInfo>::decode(Decoder& decoder, CertificateInfo& c
100100 GRefPtr<GTlsCertificate> certificate;
101101 for (uint32_t i = 0; i < chainLength; i++) {
102102 IPC::DataReference certificateDataReference;
103  if (!decoder.decodeVariableLengthByteArray(certificateDataReference))
 103 if (!decoder.decode(certificateDataReference))
104104 return false;
105105
106106 GByteArray* certificateData = g_byte_array_sized_new(certificateDataReference.size());

@@Optional<SerializedPlatformDataCueValue> ArgumentCoder<SerializedPlatformDataCu
277277#endif
278278
279279}
280 

Source/WebKit/Sources.txt

@@GPUProcess/GPUConnectionToWebProcess.cpp
2626GPUProcess/GPUProcessCreationParameters.cpp
2727GPUProcess/graphics/DisplayListReaderHandle.cpp
2828GPUProcess/graphics/RemoteRenderingBackend.cpp
 29GPUProcess/graphics/RemoteGraphicsContextGL.cpp
2930GPUProcess/graphics/RemoteResourceCache.cpp
3031GPUProcess/media/RemoteAudioSessionProxy.cpp
3132GPUProcess/media/RemoteAudioSessionProxyManager.cpp

@@Platform/SharedMemory.cpp @no-unify
137138Platform/IPC/ArgumentCoders.cpp @no-unify
138139Platform/IPC/Attachment.cpp @no-unify
139140Platform/IPC/Connection.cpp @no-unify
140 Platform/IPC/DataReference.cpp @no-unify
141141Platform/IPC/Decoder.cpp @no-unify
142142Platform/IPC/Encoder.cpp @no-unify
143143Platform/IPC/JSIPCBinding.cpp @no-unify

@@WebProcess/WebStorage/StorageAreaImpl.cpp
693693WebProcess/WebStorage/StorageAreaMap.cpp
694694WebProcess/WebStorage/StorageNamespaceImpl.cpp
695695WebProcess/WebStorage/WebStorageNamespaceProvider.cpp
 696
 697RemoteGraphicsContextGLMessageReceiver.cpp

Source/WebKit/SourcesCocoa.txt

@@GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm
6363GPUProcess/media/ios/RemoteMediaSessionHelperProxy.cpp
6464GPUProcess/webrtc/LibWebRTCCodecsProxy.mm
6565
 66
6667Platform/cf/ModuleCF.cpp
6768
6869Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp

@@WebProcess/cocoa/WebProcessCocoa.mm
573574WebProcess/EntryPoint/Cocoa/XPCService/WebContentServiceEntryPoint.mm
574575
575576WebProcess/GPU/graphics/cocoa/ImageBufferShareableIOSurfaceBackend.cpp
 577WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp
 578WebProcess/GPU/graphics/RemoteGraphicsContextGLProxyFunctionsGenerated.cpp
576579WebProcess/GPU/media/RemoteAudioSourceProvider.cpp
577580WebProcess/GPU/media/RemoteAudioSourceProviderManager.cpp
578581WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm

@@RemoteMediaSessionHelperMessageReceiver.cpp
685688RemoteMediaSessionHelperProxyMessageReceiver.cpp
686689RemoteRenderingBackendMessageReceiver.cpp
687690RemoteRenderingBackendProxyMessageReceiver.cpp
 691RemoteGraphicsContextGLProxyMessageReceiver.cpp
688692RemoteSampleBufferDisplayLayerManagerMessageReceiver.cpp
689693RemoteSampleBufferDisplayLayerMessageReceiver.cpp
690694SampleBufferDisplayLayerMessageReceiver.cpp

Source/WebKit/UIProcess/API/APIIconLoadingClient.h

3030#include <wtf/CompletionHandler.h>
3131#include <wtf/Function.h>
3232
33 namespace IPC {
34 class DataReference;
35 }
36 
3733namespace API {
3834
3935class IconLoadingClient {

Source/WebKit/UIProcess/AuxiliaryProcessProxy.h

@@public:
5353 virtual ProcessThrottler& throttler() = 0;
5454
5555 template<typename T> bool send(T&& message, uint64_t destinationID, OptionSet<IPC::SendOption> sendOptions = { });
56  template<typename T> bool sendSync(T&& message, typename T::Reply&&, uint64_t destinationID, Seconds timeout = 1_s, OptionSet<IPC::SendSyncOption> sendSyncOptions = { });
 56 using SendSyncResult = IPC::Connection::SendSyncResult;
 57 template<typename T> SendSyncResult sendSync(T&& message, typename T::Reply&&, uint64_t destinationID, Seconds timeout = 1_s, OptionSet<IPC::SendSyncOption> sendSyncOptions = { });
5758
5859 enum class ShouldStartProcessThrottlerActivity : bool { No, Yes };
5960 template<typename T, typename C> void sendWithAsyncReply(T&&, C&&, uint64_t destinationID = 0, OptionSet<IPC::SendOption> = { }, ShouldStartProcessThrottlerActivity = ShouldStartProcessThrottlerActivity::Yes);

@@public:
6566 }
6667
6768 template<typename T, typename U>
68  bool sendSync(T&& message, typename T::Reply&& reply, ObjectIdentifier<U> destinationID, Seconds timeout = 1_s, OptionSet<IPC::SendSyncOption> sendSyncOptions = { })
 69 SendSyncResult sendSync(T&& message, typename T::Reply&& reply, ObjectIdentifier<U> destinationID, Seconds timeout = 1_s, OptionSet<IPC::SendSyncOption> sendSyncOptions = { })
6970 {
7071 return sendSync<T>(WTFMove(message), WTFMove(reply), destinationID.toUInt64(), timeout, sendSyncOptions);
7172 }

@@bool AuxiliaryProcessProxy::send(T&& message, uint64_t destinationID, OptionSet<
163164}
164165
165166template<typename U>
166 bool AuxiliaryProcessProxy::sendSync(U&& message, typename U::Reply&& reply, uint64_t destinationID, Seconds timeout, OptionSet<IPC::SendSyncOption> sendSyncOptions)
 167AuxiliaryProcessProxy::SendSyncResult AuxiliaryProcessProxy::sendSync(U&& message, typename U::Reply&& reply, uint64_t destinationID, Seconds timeout, OptionSet<IPC::SendSyncOption> sendSyncOptions)
167168{
168169 COMPILE_ASSERT(U::isSync, SyncMessageExpected);
169170
170171 if (!m_connection)
171  return false;
 172 return { };
172173
173174 TraceScope scope(SyncMessageStart, SyncMessageEnd);
174175

Source/WebKit/UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.h

3232#include <WebCore/FrameIdentifier.h>
3333#include <wtf/Deque.h>
3434
35 namespace IPC {
36 class DataReference;
37 }
38 
3935namespace WebKit {
4036
4137class SubFrameSOAuthorizationSession final : public NavigationSOAuthorizationSession, public FrameLoadState::Observer {

Source/WebKit/UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.h

2525
2626#pragma once
2727
 28#include "DataReference.h"
2829#include "LegacyCustomProtocolID.h"
2930#include "MessageReceiver.h"
3031#include <wtf/WeakPtr.h>

3536OBJC_CLASS WKCustomProtocolLoader;
3637#endif
3738
38 namespace IPC {
39 class DataReference;
40 }
41 
4239namespace WebCore {
4340class ResourceError;
4441class ResourceRequest;

Source/WebKit/UIProcess/PageClient.h

2525
2626#pragma once
2727
 28#include "DataReference.h"
2829#include "LayerTreeContext.h"
2930#include "PDFPluginIdentifier.h"
3031#include "SameDocumentNavigationType.h"

@@class OpenPanelParameters;
8081class SecurityOrigin;
8182}
8283
83 namespace IPC {
84 class DataReference;
85 }
86 
8784namespace WebCore {
8885class Color;
8986class Cursor;

Source/WebKit/UIProcess/UserContent/WebUserContentControllerProxy.cpp

3131#include "APISerializedScriptValue.h"
3232#include "APIUserScript.h"
3333#include "APIUserStyleSheet.h"
34 #include "DataReference.h"
3534#include "InjectUserScriptImmediately.h"
3635#include "NetworkContentRuleListManagerMessages.h"
3736#include "NetworkProcessProxy.h"

Source/WebKit/UIProcess/UserContent/WebUserContentControllerProxy.h

2727
2828#include "APIObject.h"
2929#include "ContentWorldShared.h"
 30#include "DataReference.h"
3031#include "MessageReceiver.h"
3132#include "UserContentControllerIdentifier.h"
3233#include "WebPageProxyIdentifier.h"

@@class UserScript;
4849class UserStyleSheet;
4950}
5051
51 namespace IPC {
52 class DataReference;
53 }
54 
5552namespace WebCore {
5653struct SecurityOriginData;
5754}

Source/WebKit/UIProcess/WebPageProxy.cpp

5858#include "AuthenticationDecisionListener.h"
5959#include "AuthenticationManager.h"
6060#include "AuthenticatorManager.h"
61 #include "DataReference.h"
6261#include "DownloadProxy.h"
6362#include "DrawingAreaMessages.h"
6463#include "DrawingAreaProxy.h"

@@WebPageCreationParameters WebPageProxy::creationParameters(WebProcessProxy& proc
79277926 parameters.shouldRenderCanvasInGPUProcess = preferences().useGPUProcessForCanvasRenderingEnabled();
79287927 parameters.shouldRenderDOMInGPUProcess = preferences().useGPUProcessForDOMRenderingEnabled();
79297928 parameters.shouldPlayMediaInGPUProcess = preferences().useGPUProcessForMediaEnabled();
 7929#if ENABLE(WEBGL)
 7930 parameters.shouldRenderWebGLInGPUProcess = preferences().useGPUProcessForWebGLEnabled();
 7931#endif
 7932
79307933 parameters.shouldEnableVP9Decoder = preferences().vp9DecoderEnabled();
79317934#if ENABLE(VP9) && PLATFORM(COCOA)
79327935 parameters.shouldEnableVP9SWDecoder = preferences().vp9DecoderEnabled() && (!WebCore::systemHasBattery() || preferences().vp9SWDecoderEnabledOnBattery());

Source/WebKit/UIProcess/WebPageProxy.h

2929#include "Connection.h"
3030#include "ContentAsStringIncludesChildFrames.h"
3131#include "ContextMenuContextData.h"
 32#include "DataReference.h"
3233#include "DownloadID.h"
3334#include "DragControllerAction.h"
3435#include "EditingRange.h"

@@enum class InspectorTargetType : uint8_t;
203204}
204205
205206namespace IPC {
206 class DataReference;
207207class Decoder;
208208class FormDataReference;
209209class SharedBufferCopy;

Source/WebKit/UIProcess/WebURLSchemeHandler.h

3131#include <wtf/RefCounted.h>
3232#include <wtf/RefPtr.h>
3333
34 namespace IPC {
35 class DataReference;
36 }
37 
3834namespace WebCore {
3935class ResourceRequest;
4036}

Source/WebKit/UIProcess/WebURLSchemeTask.h

@@namespace API {
3838class FrameInfo;
3939}
4040
41 namespace IPC {
42 class DataReference;
43 }
44 
4541namespace WebCore {
4642class ResourceError;
4743class ResourceResponse;

Source/WebKit/WebKit.xcodeproj/project.pbxproj

698698 2D92A77B212B6A7100F493FD /* ArgumentCoders.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3D610413A7F03A00F95D4E /* ArgumentCoders.cpp */; };
699699 2D92A77C212B6A7100F493FD /* Attachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEE966A112FAF57006BCC24 /* Attachment.cpp */; };
700700 2D92A77D212B6A7100F493FD /* Connection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC032DA210F437D10058C15A /* Connection.cpp */; };
701  2D92A77E212B6A7100F493FD /* DataReference.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC7537D183BE50F0072CB15 /* DataReference.cpp */; };
702701 2D92A77F212B6A7100F493FD /* Decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC032D9D10F437D10058C15A /* Decoder.cpp */; };
703702 2D92A780212B6A7100F493FD /* Encoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC032D9F10F437D10058C15A /* Encoder.cpp */; };
704703 2D92A781212B6A7100F493FD /* MessageReceiverMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3EED0C161A535300AEB4F5 /* MessageReceiverMap.cpp */; };

13031302 7AFBD36321E50F39005DBACB /* WebResourceLoadStatisticsStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AFBD36221E50F39005DBACB /* WebResourceLoadStatisticsStore.h */; };
13041303 7AFBD36721E51BAB005DBACB /* ResourceLoadStatisticsMemoryStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AFBD36521E51BAB005DBACB /* ResourceLoadStatisticsMemoryStore.h */; };
13051304 7AFBD36F21E546F8005DBACB /* PersistencyUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AFBD36D21E546E3005DBACB /* PersistencyUtils.h */; };
 1305 7B1DB26625668CE1000E26BC /* ArrayReference.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B1DB26525668CE0000E26BC /* ArrayReference.h */; };
13061306 7C065F2C1C8CD95F00C2D950 /* WebUserContentControllerDataTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C065F2A1C8CD95F00C2D950 /* WebUserContentControllerDataTypes.h */; };
13071307 7C135AA9173B0BCA00586AE2 /* WKPluginInformation.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C135AA7173B0BCA00586AE2 /* WKPluginInformation.h */; settings = {ATTRIBUTES = (Private, ); }; };
13081308 7C1BA33E1A4A0E600043E249 /* APIDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C1BA33C1A4A0E600043E249 /* APIDictionary.h */; };

27192719 1AC5FFC1174BFD1B0001483D /* PluginProcessAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginProcessAttributes.h; sourceTree = "<group>"; };
27202720 1AC75379183A9FDA0072CB15 /* PageLoadState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageLoadState.cpp; sourceTree = "<group>"; };
27212721 1AC7537A183A9FDB0072CB15 /* PageLoadState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageLoadState.h; sourceTree = "<group>"; };
2722  1AC7537D183BE50F0072CB15 /* DataReference.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DataReference.cpp; sourceTree = "<group>"; };
27232722 1AC7537E183BE50F0072CB15 /* DataReference.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataReference.h; sourceTree = "<group>"; };
27242723 1AC75A1A1B3368270056745B /* HangDetectionDisabler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HangDetectionDisabler.h; sourceTree = "<group>"; };
27252724 1AC75A1C1B33695E0056745B /* HangDetectionDisablerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HangDetectionDisablerMac.mm; sourceTree = "<group>"; };

43684367 7AFBD36521E51BAB005DBACB /* ResourceLoadStatisticsMemoryStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ResourceLoadStatisticsMemoryStore.h; path = Classifier/ResourceLoadStatisticsMemoryStore.h; sourceTree = "<group>"; };
43694368 7AFBD36D21E546E3005DBACB /* PersistencyUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PersistencyUtils.h; sourceTree = "<group>"; };
43704369 7AFBD36E21E546E3005DBACB /* PersistencyUtils.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PersistencyUtils.cpp; sourceTree = "<group>"; };
 4370 7B1DB26525668CE0000E26BC /* ArrayReference.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrayReference.h; sourceTree = "<group>"; };
 4371 7B64C0B6254C5C250006B4AF /* GraphicsContextGLIdentifier.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GraphicsContextGLIdentifier.h; sourceTree = "<group>"; };
 4372 7B904165254AFDEA006EEB8C /* RemoteGraphicsContextGLProxy.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RemoteGraphicsContextGLProxy.cpp; sourceTree = "<group>"; };
 4373 7B904166254AFDEB006EEB8C /* RemoteGraphicsContextGLProxy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RemoteGraphicsContextGLProxy.h; sourceTree = "<group>"; };
 4374 7B904167254AFE17006EEB8C /* RemoteGraphicsContextGLProxy.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = RemoteGraphicsContextGLProxy.messages.in; sourceTree = "<group>"; };
 4375 7B904168254AFEA7006EEB8C /* RemoteGraphicsContextGL.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = RemoteGraphicsContextGL.messages.in; sourceTree = "<group>"; };
 4376 7B904169254AFEA7006EEB8C /* RemoteGraphicsContextGL.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RemoteGraphicsContextGL.cpp; sourceTree = "<group>"; };
 4377 7B90416A254AFEA7006EEB8C /* RemoteGraphicsContextGL.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RemoteGraphicsContextGL.h; sourceTree = "<group>"; };
 4378 7B90416D2550108C006EEB8C /* RemoteGraphicsContextGLFunctionsGenerated.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RemoteGraphicsContextGLFunctionsGenerated.h; sourceTree = "<group>"; };
 4379 7BE726572574F67200E85D98 /* RemoteGraphicsContextGLProxyFunctionsGenerated.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RemoteGraphicsContextGLProxyFunctionsGenerated.cpp; sourceTree = "<group>"; };
43714380 7C065F291C8CD95F00C2D950 /* WebUserContentControllerDataTypes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebUserContentControllerDataTypes.cpp; sourceTree = "<group>"; };
43724381 7C065F2A1C8CD95F00C2D950 /* WebUserContentControllerDataTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebUserContentControllerDataTypes.h; sourceTree = "<group>"; };
43734382 7C135AA6173B0BCA00586AE2 /* WKPluginInformation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKPluginInformation.cpp; sourceTree = "<group>"; };

66516660 1AEFD27811D16C81008219D3 /* ArgumentCoder.h */,
66526661 1A3D610413A7F03A00F95D4E /* ArgumentCoders.cpp */,
66536662 1AEFD2F611D1807B008219D3 /* ArgumentCoders.h */,
 6663 7B1DB26525668CE0000E26BC /* ArrayReference.h */,
66546664 BCEE966A112FAF57006BCC24 /* Attachment.cpp */,
66556665 BCEE966B112FAF57006BCC24 /* Attachment.h */,
66566666 BC032DA210F437D10058C15A /* Connection.cpp */,
66576667 BC032DA310F437D10058C15A /* Connection.h */,
6658  1AC7537D183BE50F0072CB15 /* DataReference.cpp */,
66596668 1AC7537E183BE50F0072CB15 /* DataReference.h */,
66606669 BC032D9D10F437D10058C15A /* Decoder.cpp */,
66616670 BC032D9E10F437D10058C15A /* Decoder.h */,

83258334 727A7F3324078527004D2931 /* cocoa */,
83268335 F4094CBA2553047E003D73E3 /* DisplayListWriterHandle.cpp */,
83278336 F4094CB92553047E003D73E3 /* DisplayListWriterHandle.h */,
 8337 7B64C0B6254C5C250006B4AF /* GraphicsContextGLIdentifier.h */,
83288338 727A7F39240788F1004D2931 /* ImageBufferBackendHandle.h */,
83298339 727A7F37240788F0004D2931 /* ImageBufferShareableBitmapBackend.cpp */,
83308340 727A7F36240788F0004D2931 /* ImageBufferShareableBitmapBackend.h */,
83318341 727A7F38240788F0004D2931 /* PlatformImageBufferShareableBackend.h */,
83328342 7227800B2408BD7D007D376B /* PlatformRemoteImageBufferProxy.h */,
 8343 7B904165254AFDEA006EEB8C /* RemoteGraphicsContextGLProxy.cpp */,
 8344 7B904166254AFDEB006EEB8C /* RemoteGraphicsContextGLProxy.h */,
 8345 7B904167254AFE17006EEB8C /* RemoteGraphicsContextGLProxy.messages.in */,
 8346 7BE726572574F67200E85D98 /* RemoteGraphicsContextGLProxyFunctionsGenerated.cpp */,
83338347 727A7F492408AEE6004D2931 /* RemoteImageBufferProxy.h */,
83348348 5506409D2407160900AAE045 /* RemoteRenderingBackendProxy.cpp */,
83358349 5506409E2407160900AAE045 /* RemoteRenderingBackendProxy.h */,

83478361 F4094CBC255304AF003D73E3 /* DisplayListReaderHandle.cpp */,
83488362 F4094CBB255304AF003D73E3 /* DisplayListReaderHandle.h */,
83498363 55AD09432408A0E600DE4D2F /* PlatformRemoteImageBuffer.h */,
 8364 7B904169254AFEA7006EEB8C /* RemoteGraphicsContextGL.cpp */,
 8365 7B90416A254AFEA7006EEB8C /* RemoteGraphicsContextGL.h */,
 8366 7B904168254AFEA7006EEB8C /* RemoteGraphicsContextGL.messages.in */,
 8367 7B90416D2550108C006EEB8C /* RemoteGraphicsContextGLFunctionsGenerated.h */,
83508368 55AD09422408A02E00DE4D2F /* RemoteImageBuffer.h */,
83518369 550640A224071A6100AAE045 /* RemoteRenderingBackend.cpp */,
83528370 550640A324071A6100AAE045 /* RemoteRenderingBackend.h */,

1116311181 1AEFD2F711D1807B008219D3 /* ArgumentCoders.h in Headers */,
1116411182 1AAF0C4A12B16334008E49E2 /* ArgumentCodersCF.h in Headers */,
1116511183 A175C44A21AA3171000037D0 /* ArgumentCodersCocoa.h in Headers */,
 11184 7B1DB26625668CE1000E26BC /* ArrayReference.h in Headers */,
1116611185 515E7728183DD6F60007203F /* AsyncRequest.h in Headers */,
1116711186 AAFA634F234F7C6400FFA864 /* AsyncRevalidation.h in Headers */,
1116811187 BCEE966D112FAF57006BCC24 /* Attachment.h in Headers */,

1323113250 2D92A785212B6AB100F493FD /* BlobDataFileReferenceWithSandboxExtension.cpp in Sources */,
1323213251 517CF0E3163A486C00C2950F /* CacheStorageEngineConnectionMessageReceiver.cpp in Sources */,
1323313252 2D92A77D212B6A7100F493FD /* Connection.cpp in Sources */,
13234  2D92A77E212B6A7100F493FD /* DataReference.cpp in Sources */,
1323513253 2D92A77F212B6A7100F493FD /* Decoder.cpp in Sources */,
1323613254 49DAA38C24CBA1A800793D75 /* DefaultWebBrowserChecks.mm in Sources */,
1323713255 2D0C56FE229F1DEA00BD33E7 /* DeviceManagementSoftLink.mm in Sources */,

Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.h

3636#include <wtf/HashSet.h>
3737#include <wtf/text/StringHash.h>
3838
39 namespace IPC {
40 class DataReference;
41 }
42 
4339namespace WebCore {
4440class PaymentCoordinator;
4541class PaymentContact;

Source/WebKit/WebProcess/GPU/GPUProcessConnection.h

3535#include <wtf/WeakHashSet.h>
3636#include <wtf/text/WTFString.h>
3737
38 namespace IPC {
39 class DataReference;
40 }
41 
4238namespace WebKit {
4339
4440class RemoteAudioSourceProviderManager;

Source/WebKit/WebProcess/GPU/graphics/GraphicsContextGLIdentifier.h

 1/*
 2 * Copyright (C) 2020 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 23 * THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#pragma once
 27
 28#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL)
 29
 30#include <wtf/ObjectIdentifier.h>
 31
 32namespace WebKit {
 33
 34enum GraphicsContextGLIdentifierType { };
 35using GraphicsContextGLIdentifier = ObjectIdentifier<GraphicsContextGLIdentifierType>;
 36
 37} // namespace WebKit
 38
 39#endif

Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp

 1/*
 2 * Copyright (C) 2020 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 23 * THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#include "config.h"
 27#include "RemoteGraphicsContextGLProxy.h"
 28
 29#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL)
 30
 31#include "GPUConnectionToWebProcess.h"
 32#include "GPUProcessConnection.h"
 33#include "RemoteGraphicsContextGLMessages.h"
 34#include "RemoteGraphicsContextGLProxyMessages.h"
 35#include "WebProcess.h"
 36#include <WebCore/GraphicsContextCG.h>
 37#include <WebCore/GraphicsContextGLIOSurfaceSwapChain.h>
 38
 39namespace WebKit {
 40
 41using namespace WebCore;
 42
 43RefPtr<RemoteGraphicsContextGLProxy> RemoteGraphicsContextGLProxy::create(const GraphicsContextGLAttributes& attributes)
 44{
 45 return adoptRef(new RemoteGraphicsContextGLProxy(attributes));
 46}
 47
 48RemoteGraphicsContextGLProxy::RemoteGraphicsContextGLProxy(const GraphicsContextGLAttributes& attrs)
 49 : PlatformRemoteGraphicsContextGLProxyBase(attrs)
 50{
 51 IPC::MessageReceiverMap& messageReceiverMap = WebProcess::singleton().ensureGPUProcessConnection().messageReceiverMap();
 52 messageReceiverMap.addMessageReceiver(Messages::RemoteGraphicsContextGLProxy::messageReceiverName(), m_graphicsContextGLIdentifier.toUInt64(), *this);
 53 send(Messages::GPUConnectionToWebProcess::CreateGraphicsContextGL(attrs, m_graphicsContextGLIdentifier), 0);
 54}
 55
 56RemoteGraphicsContextGLProxy::~RemoteGraphicsContextGLProxy()
 57{
 58 IPC::MessageReceiverMap& messageReceiverMap = WebProcess::singleton().ensureGPUProcessConnection().messageReceiverMap();
 59 messageReceiverMap.removeMessageReceiver(*this);
 60 send(Messages::GPUConnectionToWebProcess::ReleaseGraphicsContextGL(m_graphicsContextGLIdentifier), 0);
 61 swapChain().recycleBuffer();
 62}
 63
 64IPC::Connection* RemoteGraphicsContextGLProxy::messageSenderConnection() const
 65{
 66 return &WebProcess::singleton().ensureGPUProcessConnection().connection();
 67}
 68
 69uint64_t RemoteGraphicsContextGLProxy::messageSenderDestinationID() const
 70{
 71 return m_graphicsContextGLIdentifier.toUInt64();
 72}
 73
 74void RemoteGraphicsContextGLProxy::reshape(int width, int height)
 75{
 76 m_currentWidth = width;
 77 m_currentHeight = height;
 78 send(Messages::RemoteGraphicsContextGL::Reshape(width, height), m_graphicsContextGLIdentifier);
 79}
 80
 81void RemoteGraphicsContextGLProxy::prepareForDisplay()
 82{
 83 MachSendRight displayBufferSendRight;
 84 sendSync(Messages::RemoteGraphicsContextGL::PrepareForDisplay(), Messages::RemoteGraphicsContextGL::PrepareForDisplay::Reply(displayBufferSendRight), m_graphicsContextGLIdentifier, 1_s);
 85 auto displayBuffer = IOSurface::createFromSendRight(WTFMove(displayBufferSendRight), sRGBColorSpaceRef());
 86 if (displayBuffer) {
 87 auto& sc = swapChain();
 88 sc.recycleBuffer();
 89 sc.present({ WTFMove(displayBuffer), nullptr });
 90 }
 91
 92 markLayerComposited();
 93}
 94
 95void RemoteGraphicsContextGLProxy::ensureExtensionEnabled(const String& extension)
 96{
 97 send(Messages::RemoteGraphicsContextGL::EnsureExtensionEnabled(extension), m_graphicsContextGLIdentifier);
 98}
 99
 100void RemoteGraphicsContextGLProxy::notifyMarkContextChanged()
 101{
 102 send(Messages::RemoteGraphicsContextGL::NotifyMarkContextChanged(), m_graphicsContextGLIdentifier);
 103}
 104
 105void RemoteGraphicsContextGLProxy::simulateContextChanged()
 106{
 107 // FIXME: Currently not implemented because it's not clear this is the right way. https://bugs.webkit.org/show_bug.cgi?id=219349
 108}
 109
 110void RemoteGraphicsContextGLProxy::wasCreated(String&& availableExtensions, String&& requestedExtensions)
 111{
 112 if (m_didInitialize) {
 113 // Initialization timed out before, so lose the context now.
 114 wasLost();
 115 return;
 116 }
 117 initialize(availableExtensions, requestedExtensions);
 118 m_didInitialize = true;
 119}
 120
 121void RemoteGraphicsContextGLProxy::wasLost()
 122{
 123 for (auto* client : copyToVector(m_clients))
 124 client->forceContextLost();
 125}
 126
 127void RemoteGraphicsContextGLProxy::wasChanged()
 128{
 129 for (auto* client : copyToVector(m_clients))
 130 client->dispatchContextChangedNotification();
 131}
 132
 133void RemoteGraphicsContextGLProxy::waitUntilInitialized()
 134{
 135 if (m_didInitialize)
 136 return;
 137 Ref<IPC::Connection> connection = WebProcess::singleton().ensureGPUProcessConnection().connection();
 138 if (connection->waitForAndDispatchImmediately<Messages::RemoteGraphicsContextGLProxy::WasCreated>(m_graphicsContextGLIdentifier, 10_s, IPC::WaitForOption::InterruptWaitingIfSyncMessageArrives))
 139 return;
 140 // Timed out, so report initialized with dummy data. We should lose the context.
 141 wasCreated("", "");
 142 // FIXME: Need to mark the context as lost, but it's not safe to force lost in this call stack.
 143}
 144
 145} // namespace WebKit
 146
 147#endif

Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.h

 1/*
 2 * Copyright (C) 2020 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#pragma once
 27
 28#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL)
 29
 30#include "GraphicsContextGLIdentifier.h"
 31#include "MessageReceiver.h"
 32#include "MessageSender.h"
 33#include "RemoteGraphicsContextGLMessages.h"
 34#include "RemoteResourceCacheProxy.h"
 35#include "WebCoreArgumentCoders.h"
 36
 37#include <WebCore/NotImplemented.h>
 38#include <WebCore/PlatformRemoteGraphicsContextGLProxyBase.h>
 39#include <wtf/HashMap.h>
 40#include <wtf/WeakPtr.h>
 41
 42
 43namespace WebKit {
 44
 45// Web process side implementation of GraphicsContextGL interface. The implementation
 46// converts the interface to a sequence of IPC messages and sends the messages to
 47// RemoteGraphicsContextGL in GPU process.
 48// The implementation is largely generated by running Tools/Scripts/generate-gpup-webgl.
 49class RemoteGraphicsContextGLProxy final
 50 : public IPC::MessageSender
 51 , private IPC::MessageReceiver
 52 , public CanMakeWeakPtr<RemoteGraphicsContextGLProxy>
 53 , public WebCore::PlatformRemoteGraphicsContextGLProxyBase {
 54public:
 55 static RefPtr<RemoteGraphicsContextGLProxy> create(const WebCore::GraphicsContextGLAttributes&);
 56 ~RemoteGraphicsContextGLProxy() final;
 57
 58 // IPC::MessageSender overrides.
 59 IPC::Connection* messageSenderConnection() const final;
 60 uint64_t messageSenderDestinationID() const final;
 61
 62 // IPC::MessageReceiver overrides.
 63 void didReceiveMessage(IPC::Connection&, IPC::Decoder&) final;
 64
 65 // PlatformRemoteGraphicsContextGLProxyBase overrides.
 66 void reshape(int width, int height) final;
 67 void prepareForDisplay() final;
 68 using WebCore::PlatformRemoteGraphicsContextGLProxyBase::isEnabled;
 69 void ensureExtensionEnabled(const String& extension) final;
 70 void notifyMarkContextChanged() final;
 71 void simulateContextChanged() final;
 72
 73 // Functions with a generated implementation. This list is used by generate-gpup-webgl script.
 74 void setFailNextGPUStatusCheck() final;
 75 void synthesizeGLError(GCGLenum error) final;
 76 bool moveErrorsToSyntheticErrorList() final;
 77 void activeTexture(GCGLenum texture) final;
 78 void attachShader(PlatformGLObject program, PlatformGLObject shader) final;
 79 void bindAttribLocation(PlatformGLObject arg0, GCGLuint index, const String& name) final;
 80 void bindBuffer(GCGLenum target, PlatformGLObject arg1) final;
 81 void bindFramebuffer(GCGLenum target, PlatformGLObject arg1) final;
 82 void bindRenderbuffer(GCGLenum target, PlatformGLObject arg1) final;
 83 void bindTexture(GCGLenum target, PlatformGLObject arg1) final;
 84 void blendColor(GCGLclampf red, GCGLclampf green, GCGLclampf blue, GCGLclampf alpha) final;
 85 void blendEquation(GCGLenum mode) final;
 86 void blendEquationSeparate(GCGLenum modeRGB, GCGLenum modeAlpha) final;
 87 void blendFunc(GCGLenum sfactor, GCGLenum dfactor) final;
 88 void blendFuncSeparate(GCGLenum srcRGB, GCGLenum dstRGB, GCGLenum srcAlpha, GCGLenum dstAlpha) final;
 89 GCGLenum checkFramebufferStatus(GCGLenum target) final;
 90 void clear(GCGLbitfield mask) final;
 91 void clearColor(GCGLclampf red, GCGLclampf green, GCGLclampf blue, GCGLclampf alpha) final;
 92 void clearDepth(GCGLclampf depth) final;
 93 void clearStencil(GCGLint s) final;
 94 void colorMask(GCGLboolean red, GCGLboolean green, GCGLboolean blue, GCGLboolean alpha) final;
 95 void compileShader(PlatformGLObject arg0) final;
 96 void copyTexImage2D(GCGLenum target, GCGLint level, GCGLenum internalformat, GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLint border) final;
 97 void copyTexSubImage2D(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height) final;
 98 PlatformGLObject createBuffer() final;
 99 PlatformGLObject createFramebuffer() final;
 100 PlatformGLObject createProgram() final;
 101 PlatformGLObject createRenderbuffer() final;
 102 PlatformGLObject createShader(GCGLenum arg0) final;
 103 PlatformGLObject createTexture() final;
 104 void cullFace(GCGLenum mode) final;
 105 void deleteBuffer(PlatformGLObject arg0) final;
 106 void deleteFramebuffer(PlatformGLObject arg0) final;
 107 void deleteProgram(PlatformGLObject arg0) final;
 108 void deleteRenderbuffer(PlatformGLObject arg0) final;
 109 void deleteShader(PlatformGLObject arg0) final;
 110 void deleteTexture(PlatformGLObject arg0) final;
 111 void depthFunc(GCGLenum func) final;
 112 void depthMask(GCGLboolean flag) final;
 113 void depthRange(GCGLclampf zNear, GCGLclampf zFar) final;
 114 void detachShader(PlatformGLObject arg0, PlatformGLObject arg1) final;
 115 void disable(GCGLenum cap) final;
 116 void disableVertexAttribArray(GCGLuint index) final;
 117 void drawArrays(GCGLenum mode, GCGLint first, GCGLsizei count) final;
 118 void drawElements(GCGLenum mode, GCGLsizei count, GCGLenum type, GCGLintptr offset) final;
 119 void enable(GCGLenum cap) final;
 120 void enableVertexAttribArray(GCGLuint index) final;
 121 void finish() final;
 122 void flush() final;
 123 void framebufferRenderbuffer(GCGLenum target, GCGLenum attachment, GCGLenum renderbuffertarget, PlatformGLObject arg3) final;
 124 void framebufferTexture2D(GCGLenum target, GCGLenum attachment, GCGLenum textarget, PlatformGLObject arg3, GCGLint level) final;
 125 void frontFace(GCGLenum mode) final;
 126 void generateMipmap(GCGLenum target) final;
 127 bool getActiveAttrib(PlatformGLObject program, GCGLuint index, ActiveInfo& arg2) final;
 128 bool getActiveUniform(PlatformGLObject program, GCGLuint index, ActiveInfo& arg2) final;
 129 GCGLint getAttribLocation(PlatformGLObject arg0, const String& name) final;
 130 GCGLint getBufferParameteri(GCGLenum target, GCGLenum pname) final;
 131 String getString(GCGLenum name) final;
 132 void getFloatv(GCGLenum pname, GCGLSpan<GCGLfloat> value) final;
 133 void getIntegerv(GCGLenum pname, GCGLSpan<GCGLint> value) final;
 134 GCGLint64 getInteger64(GCGLenum pname) final;
 135 GCGLint64 getInteger64i(GCGLenum pname, GCGLuint index) final;
 136 GCGLint getProgrami(PlatformGLObject program, GCGLenum pname) final;
 137 void getBooleanv(GCGLenum pname, GCGLSpan<GCGLboolean> value) final;
 138 GCGLenum getError() final;
 139 GCGLint getFramebufferAttachmentParameteri(GCGLenum target, GCGLenum attachment, GCGLenum pname) final;
 140 String getProgramInfoLog(PlatformGLObject arg0) final;
 141 GCGLint getRenderbufferParameteri(GCGLenum target, GCGLenum pname) final;
 142 GCGLint getShaderi(PlatformGLObject arg0, GCGLenum pname) final;
 143 String getShaderInfoLog(PlatformGLObject arg0) final;
 144 void getShaderPrecisionFormat(GCGLenum shaderType, GCGLenum precisionType, GCGLSpan<GCGLint, 2> range, GCGLint* precision) final;
 145 String getShaderSource(PlatformGLObject arg0) final;
 146 GCGLfloat getTexParameterf(GCGLenum target, GCGLenum pname) final;
 147 GCGLint getTexParameteri(GCGLenum target, GCGLenum pname) final;
 148 void getUniformfv(PlatformGLObject program, GCGLint location, GCGLSpan<GCGLfloat> value) final;
 149 void getUniformiv(PlatformGLObject program, GCGLint location, GCGLSpan<GCGLint> value) final;
 150 void getUniformuiv(PlatformGLObject program, GCGLint location, GCGLSpan<GCGLuint> value) final;
 151 GCGLint getUniformLocation(PlatformGLObject arg0, const String& name) final;
 152 GCGLsizeiptr getVertexAttribOffset(GCGLuint index, GCGLenum pname) final;
 153 void hint(GCGLenum target, GCGLenum mode) final;
 154 GCGLboolean isBuffer(PlatformGLObject arg0) final;
 155 GCGLboolean isEnabled(GCGLenum cap) final;
 156 GCGLboolean isFramebuffer(PlatformGLObject arg0) final;
 157 GCGLboolean isProgram(PlatformGLObject arg0) final;
 158 GCGLboolean isRenderbuffer(PlatformGLObject arg0) final;
 159 GCGLboolean isShader(PlatformGLObject arg0) final;
 160 GCGLboolean isTexture(PlatformGLObject arg0) final;
 161 void lineWidth(GCGLfloat arg0) final;
 162 void linkProgram(PlatformGLObject arg0) final;
 163 void pixelStorei(GCGLenum pname, GCGLint param) final;
 164 void polygonOffset(GCGLfloat factor, GCGLfloat units) final;
 165 void renderbufferStorage(GCGLenum target, GCGLenum internalformat, GCGLsizei width, GCGLsizei height) final;
 166 void sampleCoverage(GCGLclampf value, GCGLboolean invert) final;
 167 void scissor(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height) final;
 168 void shaderSource(PlatformGLObject arg0, const String&) final;
 169 void stencilFunc(GCGLenum func, GCGLint ref, GCGLuint mask) final;
 170 void stencilFuncSeparate(GCGLenum face, GCGLenum func, GCGLint ref, GCGLuint mask) final;
 171 void stencilMask(GCGLuint mask) final;
 172 void stencilMaskSeparate(GCGLenum face, GCGLuint mask) final;
 173 void stencilOp(GCGLenum fail, GCGLenum zfail, GCGLenum zpass) final;
 174 void stencilOpSeparate(GCGLenum face, GCGLenum fail, GCGLenum zfail, GCGLenum zpass) final;
 175 void texParameterf(GCGLenum target, GCGLenum pname, GCGLfloat param) final;
 176 void texParameteri(GCGLenum target, GCGLenum pname, GCGLint param) final;
 177 void uniform1f(GCGLint location, GCGLfloat x) final;
 178 void uniform1fv(GCGLint location, GCGLSpan<const GCGLfloat> v) final;
 179 void uniform1i(GCGLint location, GCGLint x) final;
 180 void uniform1iv(GCGLint location, GCGLSpan<const GCGLint> v) final;
 181 void uniform2f(GCGLint location, GCGLfloat x, GCGLfloat y) final;
 182 void uniform2fv(GCGLint location, GCGLSpan<const GCGLfloat> v) final;
 183 void uniform2i(GCGLint location, GCGLint x, GCGLint y) final;
 184 void uniform2iv(GCGLint location, GCGLSpan<const GCGLint> v) final;
 185 void uniform3f(GCGLint location, GCGLfloat x, GCGLfloat y, GCGLfloat z) final;
 186 void uniform3fv(GCGLint location, GCGLSpan<const GCGLfloat> v) final;
 187 void uniform3i(GCGLint location, GCGLint x, GCGLint y, GCGLint z) final;
 188 void uniform3iv(GCGLint location, GCGLSpan<const GCGLint> v) final;
 189 void uniform4f(GCGLint location, GCGLfloat x, GCGLfloat y, GCGLfloat z, GCGLfloat w) final;
 190 void uniform4fv(GCGLint location, GCGLSpan<const GCGLfloat> v) final;
 191 void uniform4i(GCGLint location, GCGLint x, GCGLint y, GCGLint z, GCGLint w) final;
 192 void uniform4iv(GCGLint location, GCGLSpan<const GCGLint> v) final;
 193 void uniformMatrix2fv(GCGLint location, GCGLboolean transpose, GCGLSpan<const GCGLfloat> value) final;
 194 void uniformMatrix3fv(GCGLint location, GCGLboolean transpose, GCGLSpan<const GCGLfloat> value) final;
 195 void uniformMatrix4fv(GCGLint location, GCGLboolean transpose, GCGLSpan<const GCGLfloat> value) final;
 196 void useProgram(PlatformGLObject arg0) final;
 197 void validateProgram(PlatformGLObject arg0) final;
 198 void vertexAttrib1f(GCGLuint index, GCGLfloat x) final;
 199 void vertexAttrib1fv(GCGLuint index, GCGLSpan<const GCGLfloat, 1> values) final;
 200 void vertexAttrib2f(GCGLuint index, GCGLfloat x, GCGLfloat y) final;
 201 void vertexAttrib2fv(GCGLuint index, GCGLSpan<const GCGLfloat, 2> values) final;
 202 void vertexAttrib3f(GCGLuint index, GCGLfloat x, GCGLfloat y, GCGLfloat z) final;
 203 void vertexAttrib3fv(GCGLuint index, GCGLSpan<const GCGLfloat, 3> values) final;
 204 void vertexAttrib4f(GCGLuint index, GCGLfloat x, GCGLfloat y, GCGLfloat z, GCGLfloat w) final;
 205 void vertexAttrib4fv(GCGLuint index, GCGLSpan<const GCGLfloat, 4> values) final;
 206 void vertexAttribPointer(GCGLuint index, GCGLint size, GCGLenum type, GCGLboolean normalized, GCGLsizei stride, GCGLintptr offset) final;
 207 void viewport(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height) final;
 208 void bufferData(GCGLenum target, GCGLsizeiptr arg1, GCGLenum usage) final;
 209 void bufferData(GCGLenum target, GCGLSpan<const GCGLvoid> data, GCGLenum usage) final;
 210 void bufferSubData(GCGLenum target, GCGLintptr offset, GCGLSpan<const GCGLvoid> data) final;
 211 void readnPixels(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLSpan<GCGLvoid> data) final;
 212 void readnPixels(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLintptr offset) final;
 213 void texImage2D(GCGLenum target, GCGLint level, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, GCGLint border, GCGLenum format, GCGLenum type, GCGLSpan<const GCGLvoid> pixels) final;
 214 void texImage2D(GCGLenum target, GCGLint level, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, GCGLint border, GCGLenum format, GCGLenum type, GCGLintptr offset) final;
 215 void texSubImage2D(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLSpan<const GCGLvoid> pixels) final;
 216 void texSubImage2D(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLintptr offset) final;
 217 void compressedTexImage2D(GCGLenum target, GCGLint level, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, GCGLint border, GCGLsizei imageSize, GCGLSpan<const GCGLvoid> data) final;
 218 void compressedTexImage2D(GCGLenum target, GCGLint level, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, GCGLint border, GCGLsizei imageSize, GCGLintptr offset) final;
 219 void compressedTexSubImage2D(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLsizei imageSize, GCGLSpan<const GCGLvoid> data) final;
 220 void compressedTexSubImage2D(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLsizei imageSize, GCGLintptr offset) final;
 221 void drawArraysInstanced(GCGLenum mode, GCGLint first, GCGLsizei count, GCGLsizei primcount) final;
 222 void drawElementsInstanced(GCGLenum mode, GCGLsizei count, GCGLenum type, GCGLintptr offset, GCGLsizei primcount) final;
 223 void vertexAttribDivisor(GCGLuint index, GCGLuint divisor) final;
 224 PlatformGLObject createVertexArray() final;
 225 void deleteVertexArray(PlatformGLObject arg0) final;
 226 GCGLboolean isVertexArray(PlatformGLObject arg0) final;
 227 void bindVertexArray(PlatformGLObject arg0) final;
 228 void copyBufferSubData(GCGLenum readTarget, GCGLenum writeTarget, GCGLintptr readOffset, GCGLintptr writeOffset, GCGLsizeiptr) final;
 229 void getBufferSubData(GCGLenum target, GCGLintptr offset, GCGLSpan<GCGLvoid> data) final;
 230 void blitFramebuffer(GCGLint srcX0, GCGLint srcY0, GCGLint srcX1, GCGLint srcY1, GCGLint dstX0, GCGLint dstY0, GCGLint dstX1, GCGLint dstY1, GCGLbitfield mask, GCGLenum filter) final;
 231 void framebufferTextureLayer(GCGLenum target, GCGLenum attachment, PlatformGLObject texture, GCGLint level, GCGLint layer) final;
 232 void invalidateFramebuffer(GCGLenum target, GCGLSpan<const GCGLenum> attachments) final;
 233 void invalidateSubFramebuffer(GCGLenum target, GCGLSpan<const GCGLenum> attachments, GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height) final;
 234 void readBuffer(GCGLenum src) final;
 235 void renderbufferStorageMultisample(GCGLenum target, GCGLsizei samples, GCGLenum internalformat, GCGLsizei width, GCGLsizei height) final;
 236 void texStorage2D(GCGLenum target, GCGLsizei levels, GCGLenum internalformat, GCGLsizei width, GCGLsizei height) final;
 237 void texStorage3D(GCGLenum target, GCGLsizei levels, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, GCGLsizei depth) final;
 238 void texImage3D(GCGLenum target, GCGLint level, GCGLint internalformat, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLint border, GCGLenum format, GCGLenum type, GCGLSpan<const GCGLvoid> pixels) final;
 239 void texImage3D(GCGLenum target, GCGLint level, GCGLint internalformat, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLint border, GCGLenum format, GCGLenum type, GCGLintptr offset) final;
 240 void texSubImage3D(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLint zoffset, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLenum format, GCGLenum type, GCGLSpan<const GCGLvoid> pixels) final;
 241 void texSubImage3D(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLint zoffset, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLenum format, GCGLenum type, GCGLintptr offset) final;
 242 void copyTexSubImage3D(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLint zoffset, GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height) final;
 243 void compressedTexImage3D(GCGLenum target, GCGLint level, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLint border, GCGLsizei imageSize, GCGLSpan<const GCGLvoid> data) final;
 244 void compressedTexImage3D(GCGLenum target, GCGLint level, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLint border, GCGLsizei imageSize, GCGLintptr offset) final;
 245 void compressedTexSubImage3D(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLint zoffset, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLenum format, GCGLsizei imageSize, GCGLSpan<const GCGLvoid> data) final;
 246 void compressedTexSubImage3D(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLint zoffset, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLenum format, GCGLsizei imageSize, GCGLintptr offset) final;
 247 GCGLint getFragDataLocation(PlatformGLObject program, const String& name) final;
 248 void uniform1ui(GCGLint location, GCGLuint v0) final;
 249 void uniform2ui(GCGLint location, GCGLuint v0, GCGLuint v1) final;
 250 void uniform3ui(GCGLint location, GCGLuint v0, GCGLuint v1, GCGLuint v2) final;
 251 void uniform4ui(GCGLint location, GCGLuint v0, GCGLuint v1, GCGLuint v2, GCGLuint v3) final;
 252 void uniform1uiv(GCGLint location, GCGLSpan<const GCGLuint> data) final;
 253 void uniform2uiv(GCGLint location, GCGLSpan<const GCGLuint> data) final;
 254 void uniform3uiv(GCGLint location, GCGLSpan<const GCGLuint> data) final;
 255 void uniform4uiv(GCGLint location, GCGLSpan<const GCGLuint> data) final;
 256 void uniformMatrix2x3fv(GCGLint location, GCGLboolean transpose, GCGLSpan<const GCGLfloat> data) final;
 257 void uniformMatrix3x2fv(GCGLint location, GCGLboolean transpose, GCGLSpan<const GCGLfloat> data) final;
 258 void uniformMatrix2x4fv(GCGLint location, GCGLboolean transpose, GCGLSpan<const GCGLfloat> data) final;
 259 void uniformMatrix4x2fv(GCGLint location, GCGLboolean transpose, GCGLSpan<const GCGLfloat> data) final;
 260 void uniformMatrix3x4fv(GCGLint location, GCGLboolean transpose, GCGLSpan<const GCGLfloat> data) final;
 261 void uniformMatrix4x3fv(GCGLint location, GCGLboolean transpose, GCGLSpan<const GCGLfloat> data) final;
 262 void vertexAttribI4i(GCGLuint index, GCGLint x, GCGLint y, GCGLint z, GCGLint w) final;
 263 void vertexAttribI4iv(GCGLuint index, GCGLSpan<const GCGLint, 4> values) final;
 264 void vertexAttribI4ui(GCGLuint index, GCGLuint x, GCGLuint y, GCGLuint z, GCGLuint w) final;
 265 void vertexAttribI4uiv(GCGLuint index, GCGLSpan<const GCGLuint, 4> values) final;
 266 void vertexAttribIPointer(GCGLuint index, GCGLint size, GCGLenum type, GCGLsizei stride, GCGLintptr offset) final;
 267 void drawRangeElements(GCGLenum mode, GCGLuint start, GCGLuint end, GCGLsizei count, GCGLenum type, GCGLintptr offset) final;
 268 void drawBuffers(GCGLSpan<const GCGLenum> bufs) final;
 269 void clearBufferiv(GCGLenum buffer, GCGLint drawbuffer, GCGLSpan<const GCGLint> values) final;
 270 void clearBufferuiv(GCGLenum buffer, GCGLint drawbuffer, GCGLSpan<const GCGLuint> values) final;
 271 void clearBufferfv(GCGLenum buffer, GCGLint drawbuffer, GCGLSpan<const GCGLfloat> values) final;
 272 void clearBufferfi(GCGLenum buffer, GCGLint drawbuffer, GCGLfloat depth, GCGLint stencil) final;
 273 PlatformGLObject createQuery() final;
 274 void deleteQuery(PlatformGLObject query) final;
 275 GCGLboolean isQuery(PlatformGLObject query) final;
 276 void beginQuery(GCGLenum target, PlatformGLObject query) final;
 277 void endQuery(GCGLenum target) final;
 278 PlatformGLObject getQuery(GCGLenum target, GCGLenum pname) final;
 279 GCGLuint getQueryObjectui(PlatformGLObject query, GCGLenum pname) final;
 280 PlatformGLObject createSampler() final;
 281 void deleteSampler(PlatformGLObject sampler) final;
 282 GCGLboolean isSampler(PlatformGLObject sampler) final;
 283 void bindSampler(GCGLuint unit, PlatformGLObject sampler) final;
 284 void samplerParameteri(PlatformGLObject sampler, GCGLenum pname, GCGLint param) final;
 285 void samplerParameterf(PlatformGLObject sampler, GCGLenum pname, GCGLfloat param) final;
 286 GCGLfloat getSamplerParameterf(PlatformGLObject sampler, GCGLenum pname) final;
 287 GCGLint getSamplerParameteri(PlatformGLObject sampler, GCGLenum pname) final;
 288 GCGLsync fenceSync(GCGLenum condition, GCGLbitfield flags) final;
 289 GCGLboolean isSync(GCGLsync arg0) final;
 290 void deleteSync(GCGLsync arg0) final;
 291 GCGLenum clientWaitSync(GCGLsync arg0, GCGLbitfield flags, GCGLuint64 timeout) final;
 292 void waitSync(GCGLsync arg0, GCGLbitfield flags, GCGLint64 timeout) final;
 293 GCGLint getSynci(GCGLsync arg0, GCGLenum pname) final;
 294 PlatformGLObject createTransformFeedback() final;
 295 void deleteTransformFeedback(PlatformGLObject id) final;
 296 GCGLboolean isTransformFeedback(PlatformGLObject id) final;
 297 void bindTransformFeedback(GCGLenum target, PlatformGLObject id) final;
 298 void beginTransformFeedback(GCGLenum primitiveMode) final;
 299 void endTransformFeedback() final;
 300 void transformFeedbackVaryings(PlatformGLObject program, const Vector<String>& varyings, GCGLenum bufferMode) final;
 301 void getTransformFeedbackVarying(PlatformGLObject program, GCGLuint index, ActiveInfo& arg2) final;
 302 void pauseTransformFeedback() final;
 303 void resumeTransformFeedback() final;
 304 void bindBufferBase(GCGLenum target, GCGLuint index, PlatformGLObject buffer) final;
 305 void bindBufferRange(GCGLenum target, GCGLuint index, PlatformGLObject buffer, GCGLintptr offset, GCGLsizeiptr) final;
 306 Vector<GCGLuint> getUniformIndices(PlatformGLObject program, const Vector<String>& uniformNames) final;
 307 Vector<GCGLint> getActiveUniforms(PlatformGLObject program, const Vector<GCGLuint>& uniformIndices, GCGLenum pname) final;
 308 GCGLuint getUniformBlockIndex(PlatformGLObject program, const String& uniformBlockName) final;
 309 String getActiveUniformBlockName(PlatformGLObject program, GCGLuint uniformBlockIndex) final;
 310 void uniformBlockBinding(PlatformGLObject program, GCGLuint uniformBlockIndex, GCGLuint uniformBlockBinding) final;
 311 void getActiveUniformBlockiv(GCGLuint program, GCGLuint uniformBlockIndex, GCGLenum pname, GCGLSpan<GCGLint> params) final;
 312 GCGLint getGraphicsResetStatusARB() final;
 313 void blitFramebufferANGLE(GCGLint srcX0, GCGLint srcY0, GCGLint srcX1, GCGLint srcY1, GCGLint dstX0, GCGLint dstY0, GCGLint dstX1, GCGLint dstY1, GCGLbitfield mask, GCGLenum filter) final;
 314 void renderbufferStorageMultisampleANGLE(GCGLenum target, GCGLsizei samples, GCGLenum internalformat, GCGLsizei width, GCGLsizei height) final;
 315 PlatformGLObject createVertexArrayOES() final;
 316 void deleteVertexArrayOES(PlatformGLObject arg0) final;
 317 GCGLboolean isVertexArrayOES(PlatformGLObject arg0) final;
 318 void bindVertexArrayOES(PlatformGLObject arg0) final;
 319 String getTranslatedShaderSourceANGLE(PlatformGLObject arg0) final;
 320 void insertEventMarkerEXT(const String& arg0) final;
 321 void pushGroupMarkerEXT(const String& arg0) final;
 322 void popGroupMarkerEXT() final;
 323 void drawBuffersEXT(GCGLSpan<const GCGLenum> bufs) final;
 324 void drawArraysInstancedANGLE(GCGLenum mode, GCGLint first, GCGLsizei count, GCGLsizei primcount) final;
 325 void drawElementsInstancedANGLE(GCGLenum mode, GCGLsizei count, GCGLenum type, GCGLvoidptr offset, GCGLsizei primcount) final;
 326 void vertexAttribDivisorANGLE(GCGLuint index, GCGLuint divisor) final;
 327 void getInternalformativ(GCGLenum target, GCGLenum internalformat, GCGLenum pname, GCGLsizei bufSize, GCGLint* params) final;
 328 void readPixelsRobustANGLE(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, GCGLsizei* length, GCGLsizei* columns, GCGLsizei* rows, GCGLvoid* pixels) final;
 329 void texParameterfvRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, const GCGLfloat* params) final;
 330 void texParameterivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, const GCGLint* params) final;
 331 void getQueryivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) final;
 332 void getQueryObjectuivRobustANGLE(GCGLuint id, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLuint* params) final;
 333 void getBufferPointervRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLvoid** params) final;
 334 void getInternalformativRobustANGLE(GCGLenum target, GCGLenum internalformat, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) final;
 335 void getVertexAttribIivRobustANGLE(GCGLuint index, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) final;
 336 void getVertexAttribIuivRobustANGLE(GCGLuint index, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLuint* params) final;
 337 void getUniformuivRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei* length, GCGLuint* params) final;
 338 void getBufferParameteri64vRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint64* params) final;
 339 void samplerParameterivRobustANGLE(GCGLuint sampler, GCGLenum pname, GCGLsizei bufSize, const GCGLint* param) final;
 340 void samplerParameterfvRobustANGLE(GCGLuint sampler, GCGLenum pname, GCGLsizei bufSize, const GCGLfloat* param) final;
 341 void getSamplerParameterivRobustANGLE(GCGLuint sampler, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) final;
 342 void getSamplerParameterfvRobustANGLE(GCGLuint sampler, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLfloat* params) final;
 343 void getFramebufferParameterivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) final;
 344 void getProgramInterfaceivRobustANGLE(GCGLuint program, GCGLenum programInterface, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) final;
 345 void getBooleani_vRobustANGLE(GCGLenum target, GCGLuint index, GCGLsizei bufSize, GCGLsizei* length, GCGLboolean* data) final; // NOLINT
 346 void getMultisamplefvRobustANGLE(GCGLenum pname, GCGLuint index, GCGLsizei bufSize, GCGLsizei* length, GCGLfloat* val) final;
 347 void getTexLevelParameterivRobustANGLE(GCGLenum target, GCGLint level, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) final;
 348 void getTexLevelParameterfvRobustANGLE(GCGLenum target, GCGLint level, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLfloat* params) final;
 349 void getPointervRobustANGLERobustANGLE(GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLvoid** params) final;
 350 void getnUniformfvRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei* length, GCGLfloat* params) final;
 351 void getnUniformivRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) final;
 352 void getnUniformuivRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei* length, GCGLuint* params) final;
 353 void texParameterIivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, const GCGLint* params) final;
 354 void texParameterIuivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, const GCGLuint* params) final;
 355 void getTexParameterIivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) final;
 356 void getTexParameterIuivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLuint* params) final;
 357 void samplerParameterIivRobustANGLE(GCGLuint sampler, GCGLenum pname, GCGLsizei bufSize, const GCGLint* param) final;
 358 void samplerParameterIuivRobustANGLE(GCGLuint sampler, GCGLenum pname, GCGLsizei bufSize, const GCGLuint* param) final;
 359 void getSamplerParameterIivRobustANGLE(GCGLuint sampler, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) final;
 360 void getSamplerParameterIuivRobustANGLE(GCGLuint sampler, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLuint* params) final;
 361 void getQueryObjectivRobustANGLE(GCGLuint id, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params) final;
 362 void getQueryObjecti64vRobustANGLE(GCGLuint id, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint64* params) final;
 363 void getQueryObjectui64vRobustANGLE(GCGLuint id, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLuint64* params) final;
 364 // End of list used by generate-gpup-webgl script.
 365
 366protected:
 367 // PlatformRemoteGraphicsContextGLProxyBase overrides.
 368 void waitUntilInitialized() final;
 369
 370private:
 371 // Messages to be received.
 372 void wasCreated(String&& availableExtensions, String&& requestedExtensions);
 373 void wasLost();
 374 void wasChanged();
 375
 376 RemoteGraphicsContextGLProxy(const WebCore::GraphicsContextGLAttributes&);
 377 bool m_didInitialize { false };
 378 GraphicsContextGLIdentifier m_graphicsContextGLIdentifier { GraphicsContextGLIdentifier::generate() };
 379};
 380
 381// The GCGL types map to following WebKit IPC types. The list is used by generate-gpup-webgl script.
 382static_assert(std::is_same_v<GCGLenum, uint32_t>);
 383static_assert(sizeof(GCGLboolean) == sizeof(bool));
 384static_assert(std::is_same_v<GCGLbitfield, uint32_t>);
 385static_assert(std::is_same_v<GCGLbyte, int8_t>);
 386static_assert(std::is_same_v<GCGLubyte, uint8_t>);
 387static_assert(std::is_same_v<GCGLshort, int16_t>);
 388static_assert(std::is_same_v<GCGLushort, uint16_t>);
 389static_assert(std::is_same_v<GCGLint, int32_t>);
 390static_assert(std::is_same_v<GCGLsizei, int32_t>);
 391static_assert(std::is_same_v<GCGLuint, uint32_t>);
 392static_assert(std::is_same_v<GCGLfloat, float>);
 393static_assert(std::is_same_v<GCGLhalffloat, uint16_t>);
 394static_assert(std::is_same_v<GCGLclampf, float>);
 395static_assert(std::is_same_v<GCGLvoid, void>);
 396static_assert(std::is_same_v<PlatformGLObject, uint32_t>);
 397static_assert(sizeof(GCGLintptr) == sizeof(uint64_t));
 398static_assert(sizeof(GCGLsizeiptr) == sizeof(uint64_t));
 399static_assert(sizeof(GCGLvoidptr) == sizeof(uint64_t));
 400static_assert(sizeof(GCGLchar) == sizeof(uint8_t));
 401static_assert(sizeof(GCGLint64) == sizeof(int64_t));
 402static_assert(sizeof(GCGLuint64) == sizeof(uint64_t));
 403static_assert(sizeof(GCGLsync) == sizeof(uint64_t) && sizeof(GCGLsync) == sizeof(intptr_t));
 404// End of list used by generate-gpup-webgl script.
 405
 406} // namespace WebKit
 407
 408#endif

Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.messages.in

 1# Copyright (C) 2020 Apple Inc. All rights reserved.
 2#
 3# Redistribution and use in source and binary forms, with or without
 4# modification, are permitted provided that the following conditions
 5# are met:
 6# 1. Redistributions of source code must retain the above copyright
 7# notice, this list of conditions and the following disclaimer.
 8# 2. Redistributions in binary form must reproduce the above copyright
 9# notice, this list of conditions and the following disclaimer in the
 10# documentation and/or other materials provided with the distribution.
 11#
 12# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
 13# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 14# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 15# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
 16# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 17# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 18# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 19# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 20# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 21# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 22
 23#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL)
 24
 25messages -> RemoteGraphicsContextGLProxy NotRefCounted {
 26 void WasCreated(String availableExtensions, String requestableExtensions)
 27 void WasLost()
 28 void WasChanged();
 29}
 30
 31#endif

Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxyFunctionsGenerated.cpp

 1/* Copyright (C) 2020 Apple Inc. All rights reserved.
 2 *
 3 * Redistribution and use in source and binary forms, with or without
 4 * modification, are permitted provided that the following conditions
 5 * are met:
 6 * 1. Redistributions of source code must retain the above copyright
 7 * notice, this list of conditions and the following disclaimer.
 8 * 2. Redistributions in binary form must reproduce the above copyright
 9 * notice, this list of conditions and the following disclaimer in the
 10 * documentation and/or other materials provided with the distribution.
 11 *
 12 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
 13 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 14 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 15 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
 16 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 17 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 18 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 19 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 20 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 21 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 22 */
 23
 24// This file is generated by generate-gpup-webgl. Do not edit.
 25
 26#include "config.h"
 27#include "RemoteGraphicsContextGLProxy.h"
 28
 29#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL) && PLATFORM(COCOA)
 30
 31namespace WebKit {
 32
 33void RemoteGraphicsContextGLProxy::setFailNextGPUStatusCheck()
 34{
 35 send(Messages::RemoteGraphicsContextGL::SetFailNextGPUStatusCheck(), m_graphicsContextGLIdentifier);
 36}
 37
 38void RemoteGraphicsContextGLProxy::synthesizeGLError(GCGLenum error)
 39{
 40 send(Messages::RemoteGraphicsContextGL::SynthesizeGLError(error), m_graphicsContextGLIdentifier);
 41}
 42
 43bool RemoteGraphicsContextGLProxy::moveErrorsToSyntheticErrorList()
 44{
 45 bool returnValue = { };
 46 sendSync(Messages::RemoteGraphicsContextGL::MoveErrorsToSyntheticErrorList(), Messages::RemoteGraphicsContextGL::MoveErrorsToSyntheticErrorList::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 47 return returnValue;
 48}
 49
 50void RemoteGraphicsContextGLProxy::activeTexture(GCGLenum texture)
 51{
 52 send(Messages::RemoteGraphicsContextGL::ActiveTexture(texture), m_graphicsContextGLIdentifier);
 53}
 54
 55void RemoteGraphicsContextGLProxy::attachShader(PlatformGLObject program, PlatformGLObject shader)
 56{
 57 send(Messages::RemoteGraphicsContextGL::AttachShader(program, shader), m_graphicsContextGLIdentifier);
 58}
 59
 60void RemoteGraphicsContextGLProxy::bindAttribLocation(PlatformGLObject arg0, GCGLuint index, const String& name)
 61{
 62 send(Messages::RemoteGraphicsContextGL::BindAttribLocation(arg0, index, name), m_graphicsContextGLIdentifier);
 63}
 64
 65void RemoteGraphicsContextGLProxy::bindBuffer(GCGLenum target, PlatformGLObject arg1)
 66{
 67 send(Messages::RemoteGraphicsContextGL::BindBuffer(target, arg1), m_graphicsContextGLIdentifier);
 68}
 69
 70void RemoteGraphicsContextGLProxy::bindFramebuffer(GCGLenum target, PlatformGLObject arg1)
 71{
 72 send(Messages::RemoteGraphicsContextGL::BindFramebuffer(target, arg1), m_graphicsContextGLIdentifier);
 73}
 74
 75void RemoteGraphicsContextGLProxy::bindRenderbuffer(GCGLenum target, PlatformGLObject arg1)
 76{
 77 send(Messages::RemoteGraphicsContextGL::BindRenderbuffer(target, arg1), m_graphicsContextGLIdentifier);
 78}
 79
 80void RemoteGraphicsContextGLProxy::bindTexture(GCGLenum target, PlatformGLObject arg1)
 81{
 82 send(Messages::RemoteGraphicsContextGL::BindTexture(target, arg1), m_graphicsContextGLIdentifier);
 83}
 84
 85void RemoteGraphicsContextGLProxy::blendColor(GCGLclampf red, GCGLclampf green, GCGLclampf blue, GCGLclampf alpha)
 86{
 87 send(Messages::RemoteGraphicsContextGL::BlendColor(red, green, blue, alpha), m_graphicsContextGLIdentifier);
 88}
 89
 90void RemoteGraphicsContextGLProxy::blendEquation(GCGLenum mode)
 91{
 92 send(Messages::RemoteGraphicsContextGL::BlendEquation(mode), m_graphicsContextGLIdentifier);
 93}
 94
 95void RemoteGraphicsContextGLProxy::blendEquationSeparate(GCGLenum modeRGB, GCGLenum modeAlpha)
 96{
 97 send(Messages::RemoteGraphicsContextGL::BlendEquationSeparate(modeRGB, modeAlpha), m_graphicsContextGLIdentifier);
 98}
 99
 100void RemoteGraphicsContextGLProxy::blendFunc(GCGLenum sfactor, GCGLenum dfactor)
 101{
 102 send(Messages::RemoteGraphicsContextGL::BlendFunc(sfactor, dfactor), m_graphicsContextGLIdentifier);
 103}
 104
 105void RemoteGraphicsContextGLProxy::blendFuncSeparate(GCGLenum srcRGB, GCGLenum dstRGB, GCGLenum srcAlpha, GCGLenum dstAlpha)
 106{
 107 send(Messages::RemoteGraphicsContextGL::BlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha), m_graphicsContextGLIdentifier);
 108}
 109
 110GCGLenum RemoteGraphicsContextGLProxy::checkFramebufferStatus(GCGLenum target)
 111{
 112 uint32_t returnValue = { };
 113 sendSync(Messages::RemoteGraphicsContextGL::CheckFramebufferStatus(target), Messages::RemoteGraphicsContextGL::CheckFramebufferStatus::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 114 return returnValue;
 115}
 116
 117void RemoteGraphicsContextGLProxy::clear(GCGLbitfield mask)
 118{
 119 send(Messages::RemoteGraphicsContextGL::Clear(mask), m_graphicsContextGLIdentifier);
 120}
 121
 122void RemoteGraphicsContextGLProxy::clearColor(GCGLclampf red, GCGLclampf green, GCGLclampf blue, GCGLclampf alpha)
 123{
 124 send(Messages::RemoteGraphicsContextGL::ClearColor(red, green, blue, alpha), m_graphicsContextGLIdentifier);
 125}
 126
 127void RemoteGraphicsContextGLProxy::clearDepth(GCGLclampf depth)
 128{
 129 send(Messages::RemoteGraphicsContextGL::ClearDepth(depth), m_graphicsContextGLIdentifier);
 130}
 131
 132void RemoteGraphicsContextGLProxy::clearStencil(GCGLint s)
 133{
 134 send(Messages::RemoteGraphicsContextGL::ClearStencil(s), m_graphicsContextGLIdentifier);
 135}
 136
 137void RemoteGraphicsContextGLProxy::colorMask(GCGLboolean red, GCGLboolean green, GCGLboolean blue, GCGLboolean alpha)
 138{
 139 send(Messages::RemoteGraphicsContextGL::ColorMask(static_cast<bool>(red), static_cast<bool>(green), static_cast<bool>(blue), static_cast<bool>(alpha)), m_graphicsContextGLIdentifier);
 140}
 141
 142void RemoteGraphicsContextGLProxy::compileShader(PlatformGLObject arg0)
 143{
 144 send(Messages::RemoteGraphicsContextGL::CompileShader(arg0), m_graphicsContextGLIdentifier);
 145}
 146
 147void RemoteGraphicsContextGLProxy::copyTexImage2D(GCGLenum target, GCGLint level, GCGLenum internalformat, GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLint border)
 148{
 149 send(Messages::RemoteGraphicsContextGL::CopyTexImage2D(target, level, internalformat, x, y, width, height, border), m_graphicsContextGLIdentifier);
 150}
 151
 152void RemoteGraphicsContextGLProxy::copyTexSubImage2D(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height)
 153{
 154 send(Messages::RemoteGraphicsContextGL::CopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height), m_graphicsContextGLIdentifier);
 155}
 156
 157PlatformGLObject RemoteGraphicsContextGLProxy::createBuffer()
 158{
 159 uint32_t returnValue = { };
 160 sendSync(Messages::RemoteGraphicsContextGL::CreateBuffer(), Messages::RemoteGraphicsContextGL::CreateBuffer::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 161 return returnValue;
 162}
 163
 164PlatformGLObject RemoteGraphicsContextGLProxy::createFramebuffer()
 165{
 166 uint32_t returnValue = { };
 167 sendSync(Messages::RemoteGraphicsContextGL::CreateFramebuffer(), Messages::RemoteGraphicsContextGL::CreateFramebuffer::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 168 return returnValue;
 169}
 170
 171PlatformGLObject RemoteGraphicsContextGLProxy::createProgram()
 172{
 173 uint32_t returnValue = { };
 174 sendSync(Messages::RemoteGraphicsContextGL::CreateProgram(), Messages::RemoteGraphicsContextGL::CreateProgram::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 175 return returnValue;
 176}
 177
 178PlatformGLObject RemoteGraphicsContextGLProxy::createRenderbuffer()
 179{
 180 uint32_t returnValue = { };
 181 sendSync(Messages::RemoteGraphicsContextGL::CreateRenderbuffer(), Messages::RemoteGraphicsContextGL::CreateRenderbuffer::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 182 return returnValue;
 183}
 184
 185PlatformGLObject RemoteGraphicsContextGLProxy::createShader(GCGLenum arg0)
 186{
 187 uint32_t returnValue = { };
 188 sendSync(Messages::RemoteGraphicsContextGL::CreateShader(arg0), Messages::RemoteGraphicsContextGL::CreateShader::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 189 return returnValue;
 190}
 191
 192PlatformGLObject RemoteGraphicsContextGLProxy::createTexture()
 193{
 194 uint32_t returnValue = { };
 195 sendSync(Messages::RemoteGraphicsContextGL::CreateTexture(), Messages::RemoteGraphicsContextGL::CreateTexture::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 196 return returnValue;
 197}
 198
 199void RemoteGraphicsContextGLProxy::cullFace(GCGLenum mode)
 200{
 201 send(Messages::RemoteGraphicsContextGL::CullFace(mode), m_graphicsContextGLIdentifier);
 202}
 203
 204void RemoteGraphicsContextGLProxy::deleteBuffer(PlatformGLObject arg0)
 205{
 206 send(Messages::RemoteGraphicsContextGL::DeleteBuffer(arg0), m_graphicsContextGLIdentifier);
 207}
 208
 209void RemoteGraphicsContextGLProxy::deleteFramebuffer(PlatformGLObject arg0)
 210{
 211 send(Messages::RemoteGraphicsContextGL::DeleteFramebuffer(arg0), m_graphicsContextGLIdentifier);
 212}
 213
 214void RemoteGraphicsContextGLProxy::deleteProgram(PlatformGLObject arg0)
 215{
 216 send(Messages::RemoteGraphicsContextGL::DeleteProgram(arg0), m_graphicsContextGLIdentifier);
 217}
 218
 219void RemoteGraphicsContextGLProxy::deleteRenderbuffer(PlatformGLObject arg0)
 220{
 221 send(Messages::RemoteGraphicsContextGL::DeleteRenderbuffer(arg0), m_graphicsContextGLIdentifier);
 222}
 223
 224void RemoteGraphicsContextGLProxy::deleteShader(PlatformGLObject arg0)
 225{
 226 send(Messages::RemoteGraphicsContextGL::DeleteShader(arg0), m_graphicsContextGLIdentifier);
 227}
 228
 229void RemoteGraphicsContextGLProxy::deleteTexture(PlatformGLObject arg0)
 230{
 231 send(Messages::RemoteGraphicsContextGL::DeleteTexture(arg0), m_graphicsContextGLIdentifier);
 232}
 233
 234void RemoteGraphicsContextGLProxy::depthFunc(GCGLenum func)
 235{
 236 send(Messages::RemoteGraphicsContextGL::DepthFunc(func), m_graphicsContextGLIdentifier);
 237}
 238
 239void RemoteGraphicsContextGLProxy::depthMask(GCGLboolean flag)
 240{
 241 send(Messages::RemoteGraphicsContextGL::DepthMask(static_cast<bool>(flag)), m_graphicsContextGLIdentifier);
 242}
 243
 244void RemoteGraphicsContextGLProxy::depthRange(GCGLclampf zNear, GCGLclampf zFar)
 245{
 246 send(Messages::RemoteGraphicsContextGL::DepthRange(zNear, zFar), m_graphicsContextGLIdentifier);
 247}
 248
 249void RemoteGraphicsContextGLProxy::detachShader(PlatformGLObject arg0, PlatformGLObject arg1)
 250{
 251 send(Messages::RemoteGraphicsContextGL::DetachShader(arg0, arg1), m_graphicsContextGLIdentifier);
 252}
 253
 254void RemoteGraphicsContextGLProxy::disable(GCGLenum cap)
 255{
 256 send(Messages::RemoteGraphicsContextGL::Disable(cap), m_graphicsContextGLIdentifier);
 257}
 258
 259void RemoteGraphicsContextGLProxy::disableVertexAttribArray(GCGLuint index)
 260{
 261 send(Messages::RemoteGraphicsContextGL::DisableVertexAttribArray(index), m_graphicsContextGLIdentifier);
 262}
 263
 264void RemoteGraphicsContextGLProxy::drawArrays(GCGLenum mode, GCGLint first, GCGLsizei count)
 265{
 266 send(Messages::RemoteGraphicsContextGL::DrawArrays(mode, first, count), m_graphicsContextGLIdentifier);
 267}
 268
 269void RemoteGraphicsContextGLProxy::drawElements(GCGLenum mode, GCGLsizei count, GCGLenum type, GCGLintptr offset)
 270{
 271 send(Messages::RemoteGraphicsContextGL::DrawElements(mode, count, type, static_cast<uint64_t>(offset)), m_graphicsContextGLIdentifier);
 272}
 273
 274void RemoteGraphicsContextGLProxy::enable(GCGLenum cap)
 275{
 276 send(Messages::RemoteGraphicsContextGL::Enable(cap), m_graphicsContextGLIdentifier);
 277}
 278
 279void RemoteGraphicsContextGLProxy::enableVertexAttribArray(GCGLuint index)
 280{
 281 send(Messages::RemoteGraphicsContextGL::EnableVertexAttribArray(index), m_graphicsContextGLIdentifier);
 282}
 283
 284void RemoteGraphicsContextGLProxy::finish()
 285{
 286 send(Messages::RemoteGraphicsContextGL::Finish(), m_graphicsContextGLIdentifier);
 287}
 288
 289void RemoteGraphicsContextGLProxy::flush()
 290{
 291 send(Messages::RemoteGraphicsContextGL::Flush(), m_graphicsContextGLIdentifier);
 292}
 293
 294void RemoteGraphicsContextGLProxy::framebufferRenderbuffer(GCGLenum target, GCGLenum attachment, GCGLenum renderbuffertarget, PlatformGLObject arg3)
 295{
 296 send(Messages::RemoteGraphicsContextGL::FramebufferRenderbuffer(target, attachment, renderbuffertarget, arg3), m_graphicsContextGLIdentifier);
 297}
 298
 299void RemoteGraphicsContextGLProxy::framebufferTexture2D(GCGLenum target, GCGLenum attachment, GCGLenum textarget, PlatformGLObject arg3, GCGLint level)
 300{
 301 send(Messages::RemoteGraphicsContextGL::FramebufferTexture2D(target, attachment, textarget, arg3, level), m_graphicsContextGLIdentifier);
 302}
 303
 304void RemoteGraphicsContextGLProxy::frontFace(GCGLenum mode)
 305{
 306 send(Messages::RemoteGraphicsContextGL::FrontFace(mode), m_graphicsContextGLIdentifier);
 307}
 308
 309void RemoteGraphicsContextGLProxy::generateMipmap(GCGLenum target)
 310{
 311 send(Messages::RemoteGraphicsContextGL::GenerateMipmap(target), m_graphicsContextGLIdentifier);
 312}
 313
 314bool RemoteGraphicsContextGLProxy::getActiveAttrib(PlatformGLObject program, GCGLuint index, ActiveInfo& arg2)
 315{
 316 bool returnValue = { };
 317 sendSync(Messages::RemoteGraphicsContextGL::GetActiveAttrib(program, index), Messages::RemoteGraphicsContextGL::GetActiveAttrib::Reply(returnValue, arg2), m_graphicsContextGLIdentifier, 10_s);
 318 return returnValue;
 319}
 320
 321bool RemoteGraphicsContextGLProxy::getActiveUniform(PlatformGLObject program, GCGLuint index, ActiveInfo& arg2)
 322{
 323 bool returnValue = { };
 324 sendSync(Messages::RemoteGraphicsContextGL::GetActiveUniform(program, index), Messages::RemoteGraphicsContextGL::GetActiveUniform::Reply(returnValue, arg2), m_graphicsContextGLIdentifier, 10_s);
 325 return returnValue;
 326}
 327
 328GCGLint RemoteGraphicsContextGLProxy::getAttribLocation(PlatformGLObject arg0, const String& name)
 329{
 330 int32_t returnValue = { };
 331 sendSync(Messages::RemoteGraphicsContextGL::GetAttribLocation(arg0, name), Messages::RemoteGraphicsContextGL::GetAttribLocation::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 332 return returnValue;
 333}
 334
 335GCGLint RemoteGraphicsContextGLProxy::getBufferParameteri(GCGLenum target, GCGLenum pname)
 336{
 337 int32_t returnValue = { };
 338 sendSync(Messages::RemoteGraphicsContextGL::GetBufferParameteri(target, pname), Messages::RemoteGraphicsContextGL::GetBufferParameteri::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 339 return returnValue;
 340}
 341
 342String RemoteGraphicsContextGLProxy::getString(GCGLenum name)
 343{
 344 String returnValue = { };
 345 sendSync(Messages::RemoteGraphicsContextGL::GetString(name), Messages::RemoteGraphicsContextGL::GetString::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 346 return returnValue;
 347}
 348
 349void RemoteGraphicsContextGLProxy::getFloatv(GCGLenum pname, GCGLSpan<GCGLfloat> value)
 350{
 351 IPC::ArrayReference<float> valueReply;
 352 auto sendResult = sendSync(Messages::RemoteGraphicsContextGL::GetFloatv(pname, value.bufSize), Messages::RemoteGraphicsContextGL::GetFloatv::Reply(valueReply), m_graphicsContextGLIdentifier, 10_s);
 353 if (sendResult)
 354 memcpy(value.data, valueReply.data(), value.bufSize * sizeof(float));
 355
 356}
 357
 358void RemoteGraphicsContextGLProxy::getIntegerv(GCGLenum pname, GCGLSpan<GCGLint> value)
 359{
 360 IPC::ArrayReference<int32_t> valueReply;
 361 auto sendResult = sendSync(Messages::RemoteGraphicsContextGL::GetIntegerv(pname, value.bufSize), Messages::RemoteGraphicsContextGL::GetIntegerv::Reply(valueReply), m_graphicsContextGLIdentifier, 10_s);
 362 if (sendResult)
 363 memcpy(value.data, valueReply.data(), value.bufSize * sizeof(int32_t));
 364
 365}
 366
 367GCGLint64 RemoteGraphicsContextGLProxy::getInteger64(GCGLenum pname)
 368{
 369 int64_t returnValue = { };
 370 sendSync(Messages::RemoteGraphicsContextGL::GetInteger64(pname), Messages::RemoteGraphicsContextGL::GetInteger64::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 371 return static_cast<GCGLint64>(returnValue);
 372}
 373
 374GCGLint64 RemoteGraphicsContextGLProxy::getInteger64i(GCGLenum pname, GCGLuint index)
 375{
 376 int64_t returnValue = { };
 377 sendSync(Messages::RemoteGraphicsContextGL::GetInteger64i(pname, index), Messages::RemoteGraphicsContextGL::GetInteger64i::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 378 return static_cast<GCGLint64>(returnValue);
 379}
 380
 381GCGLint RemoteGraphicsContextGLProxy::getProgrami(PlatformGLObject program, GCGLenum pname)
 382{
 383 int32_t returnValue = { };
 384 sendSync(Messages::RemoteGraphicsContextGL::GetProgrami(program, pname), Messages::RemoteGraphicsContextGL::GetProgrami::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 385 return returnValue;
 386}
 387
 388void RemoteGraphicsContextGLProxy::getBooleanv(GCGLenum pname, GCGLSpan<GCGLboolean> value)
 389{
 390 IPC::ArrayReference<bool> valueReply;
 391 auto sendResult = sendSync(Messages::RemoteGraphicsContextGL::GetBooleanv(pname, value.bufSize), Messages::RemoteGraphicsContextGL::GetBooleanv::Reply(valueReply), m_graphicsContextGLIdentifier, 10_s);
 392 if (sendResult)
 393 memcpy(value.data, valueReply.data(), value.bufSize * sizeof(bool));
 394
 395}
 396
 397GCGLenum RemoteGraphicsContextGLProxy::getError()
 398{
 399 uint32_t returnValue = { };
 400 sendSync(Messages::RemoteGraphicsContextGL::GetError(), Messages::RemoteGraphicsContextGL::GetError::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 401 return returnValue;
 402}
 403
 404GCGLint RemoteGraphicsContextGLProxy::getFramebufferAttachmentParameteri(GCGLenum target, GCGLenum attachment, GCGLenum pname)
 405{
 406 int32_t returnValue = { };
 407 sendSync(Messages::RemoteGraphicsContextGL::GetFramebufferAttachmentParameteri(target, attachment, pname), Messages::RemoteGraphicsContextGL::GetFramebufferAttachmentParameteri::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 408 return returnValue;
 409}
 410
 411String RemoteGraphicsContextGLProxy::getProgramInfoLog(PlatformGLObject arg0)
 412{
 413 String returnValue = { };
 414 sendSync(Messages::RemoteGraphicsContextGL::GetProgramInfoLog(arg0), Messages::RemoteGraphicsContextGL::GetProgramInfoLog::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 415 return returnValue;
 416}
 417
 418GCGLint RemoteGraphicsContextGLProxy::getRenderbufferParameteri(GCGLenum target, GCGLenum pname)
 419{
 420 int32_t returnValue = { };
 421 sendSync(Messages::RemoteGraphicsContextGL::GetRenderbufferParameteri(target, pname), Messages::RemoteGraphicsContextGL::GetRenderbufferParameteri::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 422 return returnValue;
 423}
 424
 425GCGLint RemoteGraphicsContextGLProxy::getShaderi(PlatformGLObject arg0, GCGLenum pname)
 426{
 427 int32_t returnValue = { };
 428 sendSync(Messages::RemoteGraphicsContextGL::GetShaderi(arg0, pname), Messages::RemoteGraphicsContextGL::GetShaderi::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 429 return returnValue;
 430}
 431
 432String RemoteGraphicsContextGLProxy::getShaderInfoLog(PlatformGLObject arg0)
 433{
 434 String returnValue = { };
 435 sendSync(Messages::RemoteGraphicsContextGL::GetShaderInfoLog(arg0), Messages::RemoteGraphicsContextGL::GetShaderInfoLog::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 436 return returnValue;
 437}
 438
 439void RemoteGraphicsContextGLProxy::getShaderPrecisionFormat(GCGLenum shaderType, GCGLenum precisionType, GCGLSpan<GCGLint, 2> range, GCGLint* precision)
 440{
 441 IPC::ArrayReference<int32_t, 2> rangeReply;
 442 int32_t precisionReply = { };
 443 auto sendResult = sendSync(Messages::RemoteGraphicsContextGL::GetShaderPrecisionFormat(shaderType, precisionType), Messages::RemoteGraphicsContextGL::GetShaderPrecisionFormat::Reply(rangeReply, precisionReply), m_graphicsContextGLIdentifier, 10_s);
 444 if (sendResult) {
 445 memcpy(range.data, rangeReply.data(), range.bufSize * sizeof(int32_t));
 446 if (precision)
 447 *precision = precisionReply;
 448 }
 449}
 450
 451String RemoteGraphicsContextGLProxy::getShaderSource(PlatformGLObject arg0)
 452{
 453 String returnValue = { };
 454 sendSync(Messages::RemoteGraphicsContextGL::GetShaderSource(arg0), Messages::RemoteGraphicsContextGL::GetShaderSource::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 455 return returnValue;
 456}
 457
 458GCGLfloat RemoteGraphicsContextGLProxy::getTexParameterf(GCGLenum target, GCGLenum pname)
 459{
 460 float returnValue = { };
 461 sendSync(Messages::RemoteGraphicsContextGL::GetTexParameterf(target, pname), Messages::RemoteGraphicsContextGL::GetTexParameterf::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 462 return returnValue;
 463}
 464
 465GCGLint RemoteGraphicsContextGLProxy::getTexParameteri(GCGLenum target, GCGLenum pname)
 466{
 467 int32_t returnValue = { };
 468 sendSync(Messages::RemoteGraphicsContextGL::GetTexParameteri(target, pname), Messages::RemoteGraphicsContextGL::GetTexParameteri::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 469 return returnValue;
 470}
 471
 472void RemoteGraphicsContextGLProxy::getUniformfv(PlatformGLObject program, GCGLint location, GCGLSpan<GCGLfloat> value)
 473{
 474 IPC::ArrayReference<float> valueReply;
 475 auto sendResult = sendSync(Messages::RemoteGraphicsContextGL::GetUniformfv(program, location, value.bufSize), Messages::RemoteGraphicsContextGL::GetUniformfv::Reply(valueReply), m_graphicsContextGLIdentifier, 10_s);
 476 if (sendResult)
 477 memcpy(value.data, valueReply.data(), value.bufSize * sizeof(float));
 478
 479}
 480
 481void RemoteGraphicsContextGLProxy::getUniformiv(PlatformGLObject program, GCGLint location, GCGLSpan<GCGLint> value)
 482{
 483 IPC::ArrayReference<int32_t> valueReply;
 484 auto sendResult = sendSync(Messages::RemoteGraphicsContextGL::GetUniformiv(program, location, value.bufSize), Messages::RemoteGraphicsContextGL::GetUniformiv::Reply(valueReply), m_graphicsContextGLIdentifier, 10_s);
 485 if (sendResult)
 486 memcpy(value.data, valueReply.data(), value.bufSize * sizeof(int32_t));
 487
 488}
 489
 490void RemoteGraphicsContextGLProxy::getUniformuiv(PlatformGLObject program, GCGLint location, GCGLSpan<GCGLuint> value)
 491{
 492 IPC::ArrayReference<uint32_t> valueReply;
 493 auto sendResult = sendSync(Messages::RemoteGraphicsContextGL::GetUniformuiv(program, location, value.bufSize), Messages::RemoteGraphicsContextGL::GetUniformuiv::Reply(valueReply), m_graphicsContextGLIdentifier, 10_s);
 494 if (sendResult)
 495 memcpy(value.data, valueReply.data(), value.bufSize * sizeof(uint32_t));
 496
 497}
 498
 499GCGLint RemoteGraphicsContextGLProxy::getUniformLocation(PlatformGLObject arg0, const String& name)
 500{
 501 int32_t returnValue = { };
 502 sendSync(Messages::RemoteGraphicsContextGL::GetUniformLocation(arg0, name), Messages::RemoteGraphicsContextGL::GetUniformLocation::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 503 return returnValue;
 504}
 505
 506GCGLsizeiptr RemoteGraphicsContextGLProxy::getVertexAttribOffset(GCGLuint index, GCGLenum pname)
 507{
 508 uint64_t returnValue = { };
 509 sendSync(Messages::RemoteGraphicsContextGL::GetVertexAttribOffset(index, pname), Messages::RemoteGraphicsContextGL::GetVertexAttribOffset::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 510 return static_cast<GCGLsizeiptr>(returnValue);
 511}
 512
 513void RemoteGraphicsContextGLProxy::hint(GCGLenum target, GCGLenum mode)
 514{
 515 send(Messages::RemoteGraphicsContextGL::Hint(target, mode), m_graphicsContextGLIdentifier);
 516}
 517
 518GCGLboolean RemoteGraphicsContextGLProxy::isBuffer(PlatformGLObject arg0)
 519{
 520 bool returnValue = { };
 521 sendSync(Messages::RemoteGraphicsContextGL::IsBuffer(arg0), Messages::RemoteGraphicsContextGL::IsBuffer::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 522 return static_cast<GCGLboolean>(returnValue);
 523}
 524
 525GCGLboolean RemoteGraphicsContextGLProxy::isEnabled(GCGLenum cap)
 526{
 527 bool returnValue = { };
 528 sendSync(Messages::RemoteGraphicsContextGL::IsEnabled(cap), Messages::RemoteGraphicsContextGL::IsEnabled::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 529 return static_cast<GCGLboolean>(returnValue);
 530}
 531
 532GCGLboolean RemoteGraphicsContextGLProxy::isFramebuffer(PlatformGLObject arg0)
 533{
 534 bool returnValue = { };
 535 sendSync(Messages::RemoteGraphicsContextGL::IsFramebuffer(arg0), Messages::RemoteGraphicsContextGL::IsFramebuffer::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 536 return static_cast<GCGLboolean>(returnValue);
 537}
 538
 539GCGLboolean RemoteGraphicsContextGLProxy::isProgram(PlatformGLObject arg0)
 540{
 541 bool returnValue = { };
 542 sendSync(Messages::RemoteGraphicsContextGL::IsProgram(arg0), Messages::RemoteGraphicsContextGL::IsProgram::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 543 return static_cast<GCGLboolean>(returnValue);
 544}
 545
 546GCGLboolean RemoteGraphicsContextGLProxy::isRenderbuffer(PlatformGLObject arg0)
 547{
 548 bool returnValue = { };
 549 sendSync(Messages::RemoteGraphicsContextGL::IsRenderbuffer(arg0), Messages::RemoteGraphicsContextGL::IsRenderbuffer::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 550 return static_cast<GCGLboolean>(returnValue);
 551}
 552
 553GCGLboolean RemoteGraphicsContextGLProxy::isShader(PlatformGLObject arg0)
 554{
 555 bool returnValue = { };
 556 sendSync(Messages::RemoteGraphicsContextGL::IsShader(arg0), Messages::RemoteGraphicsContextGL::IsShader::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 557 return static_cast<GCGLboolean>(returnValue);
 558}
 559
 560GCGLboolean RemoteGraphicsContextGLProxy::isTexture(PlatformGLObject arg0)
 561{
 562 bool returnValue = { };
 563 sendSync(Messages::RemoteGraphicsContextGL::IsTexture(arg0), Messages::RemoteGraphicsContextGL::IsTexture::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 564 return static_cast<GCGLboolean>(returnValue);
 565}
 566
 567void RemoteGraphicsContextGLProxy::lineWidth(GCGLfloat arg0)
 568{
 569 send(Messages::RemoteGraphicsContextGL::LineWidth(arg0), m_graphicsContextGLIdentifier);
 570}
 571
 572void RemoteGraphicsContextGLProxy::linkProgram(PlatformGLObject arg0)
 573{
 574 send(Messages::RemoteGraphicsContextGL::LinkProgram(arg0), m_graphicsContextGLIdentifier);
 575}
 576
 577void RemoteGraphicsContextGLProxy::pixelStorei(GCGLenum pname, GCGLint param)
 578{
 579 send(Messages::RemoteGraphicsContextGL::PixelStorei(pname, param), m_graphicsContextGLIdentifier);
 580}
 581
 582void RemoteGraphicsContextGLProxy::polygonOffset(GCGLfloat factor, GCGLfloat units)
 583{
 584 send(Messages::RemoteGraphicsContextGL::PolygonOffset(factor, units), m_graphicsContextGLIdentifier);
 585}
 586
 587void RemoteGraphicsContextGLProxy::renderbufferStorage(GCGLenum target, GCGLenum internalformat, GCGLsizei width, GCGLsizei height)
 588{
 589 send(Messages::RemoteGraphicsContextGL::RenderbufferStorage(target, internalformat, width, height), m_graphicsContextGLIdentifier);
 590}
 591
 592void RemoteGraphicsContextGLProxy::sampleCoverage(GCGLclampf value, GCGLboolean invert)
 593{
 594 send(Messages::RemoteGraphicsContextGL::SampleCoverage(value, static_cast<bool>(invert)), m_graphicsContextGLIdentifier);
 595}
 596
 597void RemoteGraphicsContextGLProxy::scissor(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height)
 598{
 599 send(Messages::RemoteGraphicsContextGL::Scissor(x, y, width, height), m_graphicsContextGLIdentifier);
 600}
 601
 602void RemoteGraphicsContextGLProxy::shaderSource(PlatformGLObject arg0, const String& string)
 603{
 604 send(Messages::RemoteGraphicsContextGL::ShaderSource(arg0, string), m_graphicsContextGLIdentifier);
 605}
 606
 607void RemoteGraphicsContextGLProxy::stencilFunc(GCGLenum func, GCGLint ref, GCGLuint mask)
 608{
 609 send(Messages::RemoteGraphicsContextGL::StencilFunc(func, ref, mask), m_graphicsContextGLIdentifier);
 610}
 611
 612void RemoteGraphicsContextGLProxy::stencilFuncSeparate(GCGLenum face, GCGLenum func, GCGLint ref, GCGLuint mask)
 613{
 614 send(Messages::RemoteGraphicsContextGL::StencilFuncSeparate(face, func, ref, mask), m_graphicsContextGLIdentifier);
 615}
 616
 617void RemoteGraphicsContextGLProxy::stencilMask(GCGLuint mask)
 618{
 619 send(Messages::RemoteGraphicsContextGL::StencilMask(mask), m_graphicsContextGLIdentifier);
 620}
 621
 622void RemoteGraphicsContextGLProxy::stencilMaskSeparate(GCGLenum face, GCGLuint mask)
 623{
 624 send(Messages::RemoteGraphicsContextGL::StencilMaskSeparate(face, mask), m_graphicsContextGLIdentifier);
 625}
 626
 627void RemoteGraphicsContextGLProxy::stencilOp(GCGLenum fail, GCGLenum zfail, GCGLenum zpass)
 628{
 629 send(Messages::RemoteGraphicsContextGL::StencilOp(fail, zfail, zpass), m_graphicsContextGLIdentifier);
 630}
 631
 632void RemoteGraphicsContextGLProxy::stencilOpSeparate(GCGLenum face, GCGLenum fail, GCGLenum zfail, GCGLenum zpass)
 633{
 634 send(Messages::RemoteGraphicsContextGL::StencilOpSeparate(face, fail, zfail, zpass), m_graphicsContextGLIdentifier);
 635}
 636
 637void RemoteGraphicsContextGLProxy::texParameterf(GCGLenum target, GCGLenum pname, GCGLfloat param)
 638{
 639 send(Messages::RemoteGraphicsContextGL::TexParameterf(target, pname, param), m_graphicsContextGLIdentifier);
 640}
 641
 642void RemoteGraphicsContextGLProxy::texParameteri(GCGLenum target, GCGLenum pname, GCGLint param)
 643{
 644 send(Messages::RemoteGraphicsContextGL::TexParameteri(target, pname, param), m_graphicsContextGLIdentifier);
 645}
 646
 647void RemoteGraphicsContextGLProxy::uniform1f(GCGLint location, GCGLfloat x)
 648{
 649 send(Messages::RemoteGraphicsContextGL::Uniform1f(location, x), m_graphicsContextGLIdentifier);
 650}
 651
 652void RemoteGraphicsContextGLProxy::uniform1fv(GCGLint location, GCGLSpan<const GCGLfloat> v)
 653{
 654 send(Messages::RemoteGraphicsContextGL::Uniform1fv(location, IPC::ArrayReference<float>(reinterpret_cast<const float*>(v.data), v.bufSize)), m_graphicsContextGLIdentifier);
 655}
 656
 657void RemoteGraphicsContextGLProxy::uniform1i(GCGLint location, GCGLint x)
 658{
 659 send(Messages::RemoteGraphicsContextGL::Uniform1i(location, x), m_graphicsContextGLIdentifier);
 660}
 661
 662void RemoteGraphicsContextGLProxy::uniform1iv(GCGLint location, GCGLSpan<const GCGLint> v)
 663{
 664 send(Messages::RemoteGraphicsContextGL::Uniform1iv(location, IPC::ArrayReference<int32_t>(reinterpret_cast<const int32_t*>(v.data), v.bufSize)), m_graphicsContextGLIdentifier);
 665}
 666
 667void RemoteGraphicsContextGLProxy::uniform2f(GCGLint location, GCGLfloat x, GCGLfloat y)
 668{
 669 send(Messages::RemoteGraphicsContextGL::Uniform2f(location, x, y), m_graphicsContextGLIdentifier);
 670}
 671
 672void RemoteGraphicsContextGLProxy::uniform2fv(GCGLint location, GCGLSpan<const GCGLfloat> v)
 673{
 674 send(Messages::RemoteGraphicsContextGL::Uniform2fv(location, IPC::ArrayReference<float>(reinterpret_cast<const float*>(v.data), v.bufSize)), m_graphicsContextGLIdentifier);
 675}
 676
 677void RemoteGraphicsContextGLProxy::uniform2i(GCGLint location, GCGLint x, GCGLint y)
 678{
 679 send(Messages::RemoteGraphicsContextGL::Uniform2i(location, x, y), m_graphicsContextGLIdentifier);
 680}
 681
 682void RemoteGraphicsContextGLProxy::uniform2iv(GCGLint location, GCGLSpan<const GCGLint> v)
 683{
 684 send(Messages::RemoteGraphicsContextGL::Uniform2iv(location, IPC::ArrayReference<int32_t>(reinterpret_cast<const int32_t*>(v.data), v.bufSize)), m_graphicsContextGLIdentifier);
 685}
 686
 687void RemoteGraphicsContextGLProxy::uniform3f(GCGLint location, GCGLfloat x, GCGLfloat y, GCGLfloat z)
 688{
 689 send(Messages::RemoteGraphicsContextGL::Uniform3f(location, x, y, z), m_graphicsContextGLIdentifier);
 690}
 691
 692void RemoteGraphicsContextGLProxy::uniform3fv(GCGLint location, GCGLSpan<const GCGLfloat> v)
 693{
 694 send(Messages::RemoteGraphicsContextGL::Uniform3fv(location, IPC::ArrayReference<float>(reinterpret_cast<const float*>(v.data), v.bufSize)), m_graphicsContextGLIdentifier);
 695}
 696
 697void RemoteGraphicsContextGLProxy::uniform3i(GCGLint location, GCGLint x, GCGLint y, GCGLint z)
 698{
 699 send(Messages::RemoteGraphicsContextGL::Uniform3i(location, x, y, z), m_graphicsContextGLIdentifier);
 700}
 701
 702void RemoteGraphicsContextGLProxy::uniform3iv(GCGLint location, GCGLSpan<const GCGLint> v)
 703{
 704 send(Messages::RemoteGraphicsContextGL::Uniform3iv(location, IPC::ArrayReference<int32_t>(reinterpret_cast<const int32_t*>(v.data), v.bufSize)), m_graphicsContextGLIdentifier);
 705}
 706
 707void RemoteGraphicsContextGLProxy::uniform4f(GCGLint location, GCGLfloat x, GCGLfloat y, GCGLfloat z, GCGLfloat w)
 708{
 709 send(Messages::RemoteGraphicsContextGL::Uniform4f(location, x, y, z, w), m_graphicsContextGLIdentifier);
 710}
 711
 712void RemoteGraphicsContextGLProxy::uniform4fv(GCGLint location, GCGLSpan<const GCGLfloat> v)
 713{
 714 send(Messages::RemoteGraphicsContextGL::Uniform4fv(location, IPC::ArrayReference<float>(reinterpret_cast<const float*>(v.data), v.bufSize)), m_graphicsContextGLIdentifier);
 715}
 716
 717void RemoteGraphicsContextGLProxy::uniform4i(GCGLint location, GCGLint x, GCGLint y, GCGLint z, GCGLint w)
 718{
 719 send(Messages::RemoteGraphicsContextGL::Uniform4i(location, x, y, z, w), m_graphicsContextGLIdentifier);
 720}
 721
 722void RemoteGraphicsContextGLProxy::uniform4iv(GCGLint location, GCGLSpan<const GCGLint> v)
 723{
 724 send(Messages::RemoteGraphicsContextGL::Uniform4iv(location, IPC::ArrayReference<int32_t>(reinterpret_cast<const int32_t*>(v.data), v.bufSize)), m_graphicsContextGLIdentifier);
 725}
 726
 727void RemoteGraphicsContextGLProxy::uniformMatrix2fv(GCGLint location, GCGLboolean transpose, GCGLSpan<const GCGLfloat> value)
 728{
 729 send(Messages::RemoteGraphicsContextGL::UniformMatrix2fv(location, static_cast<bool>(transpose), IPC::ArrayReference<float>(reinterpret_cast<const float*>(value.data), value.bufSize)), m_graphicsContextGLIdentifier);
 730}
 731
 732void RemoteGraphicsContextGLProxy::uniformMatrix3fv(GCGLint location, GCGLboolean transpose, GCGLSpan<const GCGLfloat> value)
 733{
 734 send(Messages::RemoteGraphicsContextGL::UniformMatrix3fv(location, static_cast<bool>(transpose), IPC::ArrayReference<float>(reinterpret_cast<const float*>(value.data), value.bufSize)), m_graphicsContextGLIdentifier);
 735}
 736
 737void RemoteGraphicsContextGLProxy::uniformMatrix4fv(GCGLint location, GCGLboolean transpose, GCGLSpan<const GCGLfloat> value)
 738{
 739 send(Messages::RemoteGraphicsContextGL::UniformMatrix4fv(location, static_cast<bool>(transpose), IPC::ArrayReference<float>(reinterpret_cast<const float*>(value.data), value.bufSize)), m_graphicsContextGLIdentifier);
 740}
 741
 742void RemoteGraphicsContextGLProxy::useProgram(PlatformGLObject arg0)
 743{
 744 send(Messages::RemoteGraphicsContextGL::UseProgram(arg0), m_graphicsContextGLIdentifier);
 745}
 746
 747void RemoteGraphicsContextGLProxy::validateProgram(PlatformGLObject arg0)
 748{
 749 send(Messages::RemoteGraphicsContextGL::ValidateProgram(arg0), m_graphicsContextGLIdentifier);
 750}
 751
 752void RemoteGraphicsContextGLProxy::vertexAttrib1f(GCGLuint index, GCGLfloat x)
 753{
 754 send(Messages::RemoteGraphicsContextGL::VertexAttrib1f(index, x), m_graphicsContextGLIdentifier);
 755}
 756
 757void RemoteGraphicsContextGLProxy::vertexAttrib1fv(GCGLuint index, GCGLSpan<const GCGLfloat, 1> values)
 758{
 759 send(Messages::RemoteGraphicsContextGL::VertexAttrib1fv(index, IPC::ArrayReference<float, 1>(reinterpret_cast<const float*>(values.data), values.bufSize)), m_graphicsContextGLIdentifier);
 760}
 761
 762void RemoteGraphicsContextGLProxy::vertexAttrib2f(GCGLuint index, GCGLfloat x, GCGLfloat y)
 763{
 764 send(Messages::RemoteGraphicsContextGL::VertexAttrib2f(index, x, y), m_graphicsContextGLIdentifier);
 765}
 766
 767void RemoteGraphicsContextGLProxy::vertexAttrib2fv(GCGLuint index, GCGLSpan<const GCGLfloat, 2> values)
 768{
 769 send(Messages::RemoteGraphicsContextGL::VertexAttrib2fv(index, IPC::ArrayReference<float, 2>(reinterpret_cast<const float*>(values.data), values.bufSize)), m_graphicsContextGLIdentifier);
 770}
 771
 772void RemoteGraphicsContextGLProxy::vertexAttrib3f(GCGLuint index, GCGLfloat x, GCGLfloat y, GCGLfloat z)
 773{
 774 send(Messages::RemoteGraphicsContextGL::VertexAttrib3f(index, x, y, z), m_graphicsContextGLIdentifier);
 775}
 776
 777void RemoteGraphicsContextGLProxy::vertexAttrib3fv(GCGLuint index, GCGLSpan<const GCGLfloat, 3> values)
 778{
 779 send(Messages::RemoteGraphicsContextGL::VertexAttrib3fv(index, IPC::ArrayReference<float, 3>(reinterpret_cast<const float*>(values.data), values.bufSize)), m_graphicsContextGLIdentifier);
 780}
 781
 782void RemoteGraphicsContextGLProxy::vertexAttrib4f(GCGLuint index, GCGLfloat x, GCGLfloat y, GCGLfloat z, GCGLfloat w)
 783{
 784 send(Messages::RemoteGraphicsContextGL::VertexAttrib4f(index, x, y, z, w), m_graphicsContextGLIdentifier);
 785}
 786
 787void RemoteGraphicsContextGLProxy::vertexAttrib4fv(GCGLuint index, GCGLSpan<const GCGLfloat, 4> values)
 788{
 789 send(Messages::RemoteGraphicsContextGL::VertexAttrib4fv(index, IPC::ArrayReference<float, 4>(reinterpret_cast<const float*>(values.data), values.bufSize)), m_graphicsContextGLIdentifier);
 790}
 791
 792void RemoteGraphicsContextGLProxy::vertexAttribPointer(GCGLuint index, GCGLint size, GCGLenum type, GCGLboolean normalized, GCGLsizei stride, GCGLintptr offset)
 793{
 794 send(Messages::RemoteGraphicsContextGL::VertexAttribPointer(index, size, type, static_cast<bool>(normalized), stride, static_cast<uint64_t>(offset)), m_graphicsContextGLIdentifier);
 795}
 796
 797void RemoteGraphicsContextGLProxy::viewport(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height)
 798{
 799 send(Messages::RemoteGraphicsContextGL::Viewport(x, y, width, height), m_graphicsContextGLIdentifier);
 800}
 801
 802void RemoteGraphicsContextGLProxy::bufferData(GCGLenum target, GCGLsizeiptr arg1, GCGLenum usage)
 803{
 804 send(Messages::RemoteGraphicsContextGL::BufferData0(target, static_cast<uint64_t>(arg1), usage), m_graphicsContextGLIdentifier);
 805}
 806
 807void RemoteGraphicsContextGLProxy::bufferData(GCGLenum target, GCGLSpan<const GCGLvoid> data, GCGLenum usage)
 808{
 809 send(Messages::RemoteGraphicsContextGL::BufferData1(target, IPC::ArrayReference<uint8_t>(reinterpret_cast<const uint8_t*>(data.data), data.bufSize), usage), m_graphicsContextGLIdentifier);
 810}
 811
 812void RemoteGraphicsContextGLProxy::bufferSubData(GCGLenum target, GCGLintptr offset, GCGLSpan<const GCGLvoid> data)
 813{
 814 send(Messages::RemoteGraphicsContextGL::BufferSubData(target, static_cast<uint64_t>(offset), IPC::ArrayReference<uint8_t>(reinterpret_cast<const uint8_t*>(data.data), data.bufSize)), m_graphicsContextGLIdentifier);
 815}
 816
 817void RemoteGraphicsContextGLProxy::readnPixels(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLSpan<GCGLvoid> data)
 818{
 819 IPC::ArrayReference<uint8_t> dataReply;
 820 auto sendResult = sendSync(Messages::RemoteGraphicsContextGL::ReadnPixels0(x, y, width, height, format, type, data.bufSize), Messages::RemoteGraphicsContextGL::ReadnPixels0::Reply(dataReply), m_graphicsContextGLIdentifier, 10_s);
 821 if (sendResult)
 822 memcpy(data.data, dataReply.data(), data.bufSize * sizeof(uint8_t));
 823
 824}
 825
 826void RemoteGraphicsContextGLProxy::readnPixels(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLintptr offset)
 827{
 828 send(Messages::RemoteGraphicsContextGL::ReadnPixels1(x, y, width, height, format, type, static_cast<uint64_t>(offset)), m_graphicsContextGLIdentifier);
 829}
 830
 831void RemoteGraphicsContextGLProxy::texImage2D(GCGLenum target, GCGLint level, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, GCGLint border, GCGLenum format, GCGLenum type, GCGLSpan<const GCGLvoid> pixels)
 832{
 833 send(Messages::RemoteGraphicsContextGL::TexImage2D0(target, level, internalformat, width, height, border, format, type, IPC::ArrayReference<uint8_t>(reinterpret_cast<const uint8_t*>(pixels.data), pixels.bufSize)), m_graphicsContextGLIdentifier);
 834}
 835
 836void RemoteGraphicsContextGLProxy::texImage2D(GCGLenum target, GCGLint level, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, GCGLint border, GCGLenum format, GCGLenum type, GCGLintptr offset)
 837{
 838 send(Messages::RemoteGraphicsContextGL::TexImage2D1(target, level, internalformat, width, height, border, format, type, static_cast<uint64_t>(offset)), m_graphicsContextGLIdentifier);
 839}
 840
 841void RemoteGraphicsContextGLProxy::texSubImage2D(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLSpan<const GCGLvoid> pixels)
 842{
 843 send(Messages::RemoteGraphicsContextGL::TexSubImage2D0(target, level, xoffset, yoffset, width, height, format, type, IPC::ArrayReference<uint8_t>(reinterpret_cast<const uint8_t*>(pixels.data), pixels.bufSize)), m_graphicsContextGLIdentifier);
 844}
 845
 846void RemoteGraphicsContextGLProxy::texSubImage2D(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLintptr offset)
 847{
 848 send(Messages::RemoteGraphicsContextGL::TexSubImage2D1(target, level, xoffset, yoffset, width, height, format, type, static_cast<uint64_t>(offset)), m_graphicsContextGLIdentifier);
 849}
 850
 851void RemoteGraphicsContextGLProxy::compressedTexImage2D(GCGLenum target, GCGLint level, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, GCGLint border, GCGLsizei imageSize, GCGLSpan<const GCGLvoid> data)
 852{
 853 send(Messages::RemoteGraphicsContextGL::CompressedTexImage2D0(target, level, internalformat, width, height, border, imageSize, IPC::ArrayReference<uint8_t>(reinterpret_cast<const uint8_t*>(data.data), data.bufSize)), m_graphicsContextGLIdentifier);
 854}
 855
 856void RemoteGraphicsContextGLProxy::compressedTexImage2D(GCGLenum target, GCGLint level, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, GCGLint border, GCGLsizei imageSize, GCGLintptr offset)
 857{
 858 send(Messages::RemoteGraphicsContextGL::CompressedTexImage2D1(target, level, internalformat, width, height, border, imageSize, static_cast<uint64_t>(offset)), m_graphicsContextGLIdentifier);
 859}
 860
 861void RemoteGraphicsContextGLProxy::compressedTexSubImage2D(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLsizei imageSize, GCGLSpan<const GCGLvoid> data)
 862{
 863 send(Messages::RemoteGraphicsContextGL::CompressedTexSubImage2D0(target, level, xoffset, yoffset, width, height, format, imageSize, IPC::ArrayReference<uint8_t>(reinterpret_cast<const uint8_t*>(data.data), data.bufSize)), m_graphicsContextGLIdentifier);
 864}
 865
 866void RemoteGraphicsContextGLProxy::compressedTexSubImage2D(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLsizei imageSize, GCGLintptr offset)
 867{
 868 send(Messages::RemoteGraphicsContextGL::CompressedTexSubImage2D1(target, level, xoffset, yoffset, width, height, format, imageSize, static_cast<uint64_t>(offset)), m_graphicsContextGLIdentifier);
 869}
 870
 871void RemoteGraphicsContextGLProxy::drawArraysInstanced(GCGLenum mode, GCGLint first, GCGLsizei count, GCGLsizei primcount)
 872{
 873 send(Messages::RemoteGraphicsContextGL::DrawArraysInstanced(mode, first, count, primcount), m_graphicsContextGLIdentifier);
 874}
 875
 876void RemoteGraphicsContextGLProxy::drawElementsInstanced(GCGLenum mode, GCGLsizei count, GCGLenum type, GCGLintptr offset, GCGLsizei primcount)
 877{
 878 send(Messages::RemoteGraphicsContextGL::DrawElementsInstanced(mode, count, type, static_cast<uint64_t>(offset), primcount), m_graphicsContextGLIdentifier);
 879}
 880
 881void RemoteGraphicsContextGLProxy::vertexAttribDivisor(GCGLuint index, GCGLuint divisor)
 882{
 883 send(Messages::RemoteGraphicsContextGL::VertexAttribDivisor(index, divisor), m_graphicsContextGLIdentifier);
 884}
 885
 886PlatformGLObject RemoteGraphicsContextGLProxy::createVertexArray()
 887{
 888 uint32_t returnValue = { };
 889 sendSync(Messages::RemoteGraphicsContextGL::CreateVertexArray(), Messages::RemoteGraphicsContextGL::CreateVertexArray::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 890 return returnValue;
 891}
 892
 893void RemoteGraphicsContextGLProxy::deleteVertexArray(PlatformGLObject arg0)
 894{
 895 send(Messages::RemoteGraphicsContextGL::DeleteVertexArray(arg0), m_graphicsContextGLIdentifier);
 896}
 897
 898GCGLboolean RemoteGraphicsContextGLProxy::isVertexArray(PlatformGLObject arg0)
 899{
 900 bool returnValue = { };
 901 sendSync(Messages::RemoteGraphicsContextGL::IsVertexArray(arg0), Messages::RemoteGraphicsContextGL::IsVertexArray::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 902 return static_cast<GCGLboolean>(returnValue);
 903}
 904
 905void RemoteGraphicsContextGLProxy::bindVertexArray(PlatformGLObject arg0)
 906{
 907 send(Messages::RemoteGraphicsContextGL::BindVertexArray(arg0), m_graphicsContextGLIdentifier);
 908}
 909
 910void RemoteGraphicsContextGLProxy::copyBufferSubData(GCGLenum readTarget, GCGLenum writeTarget, GCGLintptr readOffset, GCGLintptr writeOffset, GCGLsizeiptr size)
 911{
 912 send(Messages::RemoteGraphicsContextGL::CopyBufferSubData(readTarget, writeTarget, static_cast<uint64_t>(readOffset), static_cast<uint64_t>(writeOffset), static_cast<uint64_t>(size)), m_graphicsContextGLIdentifier);
 913}
 914
 915void RemoteGraphicsContextGLProxy::getBufferSubData(GCGLenum target, GCGLintptr offset, GCGLSpan<GCGLvoid> data)
 916{
 917 IPC::ArrayReference<uint8_t> dataReply;
 918 auto sendResult = sendSync(Messages::RemoteGraphicsContextGL::GetBufferSubData(target, static_cast<uint64_t>(offset), data.bufSize), Messages::RemoteGraphicsContextGL::GetBufferSubData::Reply(dataReply), m_graphicsContextGLIdentifier, 10_s);
 919 if (sendResult)
 920 memcpy(data.data, dataReply.data(), data.bufSize * sizeof(uint8_t));
 921
 922}
 923
 924void RemoteGraphicsContextGLProxy::blitFramebuffer(GCGLint srcX0, GCGLint srcY0, GCGLint srcX1, GCGLint srcY1, GCGLint dstX0, GCGLint dstY0, GCGLint dstX1, GCGLint dstY1, GCGLbitfield mask, GCGLenum filter)
 925{
 926 send(Messages::RemoteGraphicsContextGL::BlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter), m_graphicsContextGLIdentifier);
 927}
 928
 929void RemoteGraphicsContextGLProxy::framebufferTextureLayer(GCGLenum target, GCGLenum attachment, PlatformGLObject texture, GCGLint level, GCGLint layer)
 930{
 931 send(Messages::RemoteGraphicsContextGL::FramebufferTextureLayer(target, attachment, texture, level, layer), m_graphicsContextGLIdentifier);
 932}
 933
 934void RemoteGraphicsContextGLProxy::invalidateFramebuffer(GCGLenum target, GCGLSpan<const GCGLenum> attachments)
 935{
 936 send(Messages::RemoteGraphicsContextGL::InvalidateFramebuffer(target, IPC::ArrayReference<uint32_t>(reinterpret_cast<const uint32_t*>(attachments.data), attachments.bufSize)), m_graphicsContextGLIdentifier);
 937}
 938
 939void RemoteGraphicsContextGLProxy::invalidateSubFramebuffer(GCGLenum target, GCGLSpan<const GCGLenum> attachments, GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height)
 940{
 941 send(Messages::RemoteGraphicsContextGL::InvalidateSubFramebuffer(target, IPC::ArrayReference<uint32_t>(reinterpret_cast<const uint32_t*>(attachments.data), attachments.bufSize), x, y, width, height), m_graphicsContextGLIdentifier);
 942}
 943
 944void RemoteGraphicsContextGLProxy::readBuffer(GCGLenum src)
 945{
 946 send(Messages::RemoteGraphicsContextGL::ReadBuffer(src), m_graphicsContextGLIdentifier);
 947}
 948
 949void RemoteGraphicsContextGLProxy::renderbufferStorageMultisample(GCGLenum target, GCGLsizei samples, GCGLenum internalformat, GCGLsizei width, GCGLsizei height)
 950{
 951 send(Messages::RemoteGraphicsContextGL::RenderbufferStorageMultisample(target, samples, internalformat, width, height), m_graphicsContextGLIdentifier);
 952}
 953
 954void RemoteGraphicsContextGLProxy::texStorage2D(GCGLenum target, GCGLsizei levels, GCGLenum internalformat, GCGLsizei width, GCGLsizei height)
 955{
 956 send(Messages::RemoteGraphicsContextGL::TexStorage2D(target, levels, internalformat, width, height), m_graphicsContextGLIdentifier);
 957}
 958
 959void RemoteGraphicsContextGLProxy::texStorage3D(GCGLenum target, GCGLsizei levels, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, GCGLsizei depth)
 960{
 961 send(Messages::RemoteGraphicsContextGL::TexStorage3D(target, levels, internalformat, width, height, depth), m_graphicsContextGLIdentifier);
 962}
 963
 964void RemoteGraphicsContextGLProxy::texImage3D(GCGLenum target, GCGLint level, GCGLint internalformat, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLint border, GCGLenum format, GCGLenum type, GCGLSpan<const GCGLvoid> pixels)
 965{
 966 send(Messages::RemoteGraphicsContextGL::TexImage3D0(target, level, internalformat, width, height, depth, border, format, type, IPC::ArrayReference<uint8_t>(reinterpret_cast<const uint8_t*>(pixels.data), pixels.bufSize)), m_graphicsContextGLIdentifier);
 967}
 968
 969void RemoteGraphicsContextGLProxy::texImage3D(GCGLenum target, GCGLint level, GCGLint internalformat, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLint border, GCGLenum format, GCGLenum type, GCGLintptr offset)
 970{
 971 send(Messages::RemoteGraphicsContextGL::TexImage3D1(target, level, internalformat, width, height, depth, border, format, type, static_cast<uint64_t>(offset)), m_graphicsContextGLIdentifier);
 972}
 973
 974void RemoteGraphicsContextGLProxy::texSubImage3D(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLint zoffset, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLenum format, GCGLenum type, GCGLSpan<const GCGLvoid> pixels)
 975{
 976 send(Messages::RemoteGraphicsContextGL::TexSubImage3D0(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, IPC::ArrayReference<uint8_t>(reinterpret_cast<const uint8_t*>(pixels.data), pixels.bufSize)), m_graphicsContextGLIdentifier);
 977}
 978
 979void RemoteGraphicsContextGLProxy::texSubImage3D(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLint zoffset, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLenum format, GCGLenum type, GCGLintptr offset)
 980{
 981 send(Messages::RemoteGraphicsContextGL::TexSubImage3D1(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, static_cast<uint64_t>(offset)), m_graphicsContextGLIdentifier);
 982}
 983
 984void RemoteGraphicsContextGLProxy::copyTexSubImage3D(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLint zoffset, GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height)
 985{
 986 send(Messages::RemoteGraphicsContextGL::CopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height), m_graphicsContextGLIdentifier);
 987}
 988
 989void RemoteGraphicsContextGLProxy::compressedTexImage3D(GCGLenum target, GCGLint level, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLint border, GCGLsizei imageSize, GCGLSpan<const GCGLvoid> data)
 990{
 991 send(Messages::RemoteGraphicsContextGL::CompressedTexImage3D0(target, level, internalformat, width, height, depth, border, imageSize, IPC::ArrayReference<uint8_t>(reinterpret_cast<const uint8_t*>(data.data), data.bufSize)), m_graphicsContextGLIdentifier);
 992}
 993
 994void RemoteGraphicsContextGLProxy::compressedTexImage3D(GCGLenum target, GCGLint level, GCGLenum internalformat, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLint border, GCGLsizei imageSize, GCGLintptr offset)
 995{
 996 send(Messages::RemoteGraphicsContextGL::CompressedTexImage3D1(target, level, internalformat, width, height, depth, border, imageSize, static_cast<uint64_t>(offset)), m_graphicsContextGLIdentifier);
 997}
 998
 999void RemoteGraphicsContextGLProxy::compressedTexSubImage3D(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLint zoffset, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLenum format, GCGLsizei imageSize, GCGLSpan<const GCGLvoid> data)
 1000{
 1001 send(Messages::RemoteGraphicsContextGL::CompressedTexSubImage3D0(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, IPC::ArrayReference<uint8_t>(reinterpret_cast<const uint8_t*>(data.data), data.bufSize)), m_graphicsContextGLIdentifier);
 1002}
 1003
 1004void RemoteGraphicsContextGLProxy::compressedTexSubImage3D(GCGLenum target, GCGLint level, GCGLint xoffset, GCGLint yoffset, GCGLint zoffset, GCGLsizei width, GCGLsizei height, GCGLsizei depth, GCGLenum format, GCGLsizei imageSize, GCGLintptr offset)
 1005{
 1006 send(Messages::RemoteGraphicsContextGL::CompressedTexSubImage3D1(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, static_cast<uint64_t>(offset)), m_graphicsContextGLIdentifier);
 1007}
 1008
 1009GCGLint RemoteGraphicsContextGLProxy::getFragDataLocation(PlatformGLObject program, const String& name)
 1010{
 1011 int32_t returnValue = { };
 1012 sendSync(Messages::RemoteGraphicsContextGL::GetFragDataLocation(program, name), Messages::RemoteGraphicsContextGL::GetFragDataLocation::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 1013 return returnValue;
 1014}
 1015
 1016void RemoteGraphicsContextGLProxy::uniform1ui(GCGLint location, GCGLuint v0)
 1017{
 1018 send(Messages::RemoteGraphicsContextGL::Uniform1ui(location, v0), m_graphicsContextGLIdentifier);
 1019}
 1020
 1021void RemoteGraphicsContextGLProxy::uniform2ui(GCGLint location, GCGLuint v0, GCGLuint v1)
 1022{
 1023 send(Messages::RemoteGraphicsContextGL::Uniform2ui(location, v0, v1), m_graphicsContextGLIdentifier);
 1024}
 1025
 1026void RemoteGraphicsContextGLProxy::uniform3ui(GCGLint location, GCGLuint v0, GCGLuint v1, GCGLuint v2)
 1027{
 1028 send(Messages::RemoteGraphicsContextGL::Uniform3ui(location, v0, v1, v2), m_graphicsContextGLIdentifier);
 1029}
 1030
 1031void RemoteGraphicsContextGLProxy::uniform4ui(GCGLint location, GCGLuint v0, GCGLuint v1, GCGLuint v2, GCGLuint v3)
 1032{
 1033 send(Messages::RemoteGraphicsContextGL::Uniform4ui(location, v0, v1, v2, v3), m_graphicsContextGLIdentifier);
 1034}
 1035
 1036void RemoteGraphicsContextGLProxy::uniform1uiv(GCGLint location, GCGLSpan<const GCGLuint> data)
 1037{
 1038 send(Messages::RemoteGraphicsContextGL::Uniform1uiv(location, IPC::ArrayReference<uint32_t>(reinterpret_cast<const uint32_t*>(data.data), data.bufSize)), m_graphicsContextGLIdentifier);
 1039}
 1040
 1041void RemoteGraphicsContextGLProxy::uniform2uiv(GCGLint location, GCGLSpan<const GCGLuint> data)
 1042{
 1043 send(Messages::RemoteGraphicsContextGL::Uniform2uiv(location, IPC::ArrayReference<uint32_t>(reinterpret_cast<const uint32_t*>(data.data), data.bufSize)), m_graphicsContextGLIdentifier);
 1044}
 1045
 1046void RemoteGraphicsContextGLProxy::uniform3uiv(GCGLint location, GCGLSpan<const GCGLuint> data)
 1047{
 1048 send(Messages::RemoteGraphicsContextGL::Uniform3uiv(location, IPC::ArrayReference<uint32_t>(reinterpret_cast<const uint32_t*>(data.data), data.bufSize)), m_graphicsContextGLIdentifier);
 1049}
 1050
 1051void RemoteGraphicsContextGLProxy::uniform4uiv(GCGLint location, GCGLSpan<const GCGLuint> data)
 1052{
 1053 send(Messages::RemoteGraphicsContextGL::Uniform4uiv(location, IPC::ArrayReference<uint32_t>(reinterpret_cast<const uint32_t*>(data.data), data.bufSize)), m_graphicsContextGLIdentifier);
 1054}
 1055
 1056void RemoteGraphicsContextGLProxy::uniformMatrix2x3fv(GCGLint location, GCGLboolean transpose, GCGLSpan<const GCGLfloat> data)
 1057{
 1058 send(Messages::RemoteGraphicsContextGL::UniformMatrix2x3fv(location, static_cast<bool>(transpose), IPC::ArrayReference<float>(reinterpret_cast<const float*>(data.data), data.bufSize)), m_graphicsContextGLIdentifier);
 1059}
 1060
 1061void RemoteGraphicsContextGLProxy::uniformMatrix3x2fv(GCGLint location, GCGLboolean transpose, GCGLSpan<const GCGLfloat> data)
 1062{
 1063 send(Messages::RemoteGraphicsContextGL::UniformMatrix3x2fv(location, static_cast<bool>(transpose), IPC::ArrayReference<float>(reinterpret_cast<const float*>(data.data), data.bufSize)), m_graphicsContextGLIdentifier);
 1064}
 1065
 1066void RemoteGraphicsContextGLProxy::uniformMatrix2x4fv(GCGLint location, GCGLboolean transpose, GCGLSpan<const GCGLfloat> data)
 1067{
 1068 send(Messages::RemoteGraphicsContextGL::UniformMatrix2x4fv(location, static_cast<bool>(transpose), IPC::ArrayReference<float>(reinterpret_cast<const float*>(data.data), data.bufSize)), m_graphicsContextGLIdentifier);
 1069}
 1070
 1071void RemoteGraphicsContextGLProxy::uniformMatrix4x2fv(GCGLint location, GCGLboolean transpose, GCGLSpan<const GCGLfloat> data)
 1072{
 1073 send(Messages::RemoteGraphicsContextGL::UniformMatrix4x2fv(location, static_cast<bool>(transpose), IPC::ArrayReference<float>(reinterpret_cast<const float*>(data.data), data.bufSize)), m_graphicsContextGLIdentifier);
 1074}
 1075
 1076void RemoteGraphicsContextGLProxy::uniformMatrix3x4fv(GCGLint location, GCGLboolean transpose, GCGLSpan<const GCGLfloat> data)
 1077{
 1078 send(Messages::RemoteGraphicsContextGL::UniformMatrix3x4fv(location, static_cast<bool>(transpose), IPC::ArrayReference<float>(reinterpret_cast<const float*>(data.data), data.bufSize)), m_graphicsContextGLIdentifier);
 1079}
 1080
 1081void RemoteGraphicsContextGLProxy::uniformMatrix4x3fv(GCGLint location, GCGLboolean transpose, GCGLSpan<const GCGLfloat> data)
 1082{
 1083 send(Messages::RemoteGraphicsContextGL::UniformMatrix4x3fv(location, static_cast<bool>(transpose), IPC::ArrayReference<float>(reinterpret_cast<const float*>(data.data), data.bufSize)), m_graphicsContextGLIdentifier);
 1084}
 1085
 1086void RemoteGraphicsContextGLProxy::vertexAttribI4i(GCGLuint index, GCGLint x, GCGLint y, GCGLint z, GCGLint w)
 1087{
 1088 send(Messages::RemoteGraphicsContextGL::VertexAttribI4i(index, x, y, z, w), m_graphicsContextGLIdentifier);
 1089}
 1090
 1091void RemoteGraphicsContextGLProxy::vertexAttribI4iv(GCGLuint index, GCGLSpan<const GCGLint, 4> values)
 1092{
 1093 send(Messages::RemoteGraphicsContextGL::VertexAttribI4iv(index, IPC::ArrayReference<int32_t, 4>(reinterpret_cast<const int32_t*>(values.data), values.bufSize)), m_graphicsContextGLIdentifier);
 1094}
 1095
 1096void RemoteGraphicsContextGLProxy::vertexAttribI4ui(GCGLuint index, GCGLuint x, GCGLuint y, GCGLuint z, GCGLuint w)
 1097{
 1098 send(Messages::RemoteGraphicsContextGL::VertexAttribI4ui(index, x, y, z, w), m_graphicsContextGLIdentifier);
 1099}
 1100
 1101void RemoteGraphicsContextGLProxy::vertexAttribI4uiv(GCGLuint index, GCGLSpan<const GCGLuint, 4> values)
 1102{
 1103 send(Messages::RemoteGraphicsContextGL::VertexAttribI4uiv(index, IPC::ArrayReference<uint32_t, 4>(reinterpret_cast<const uint32_t*>(values.data), values.bufSize)), m_graphicsContextGLIdentifier);
 1104}
 1105
 1106void RemoteGraphicsContextGLProxy::vertexAttribIPointer(GCGLuint index, GCGLint size, GCGLenum type, GCGLsizei stride, GCGLintptr offset)
 1107{
 1108 send(Messages::RemoteGraphicsContextGL::VertexAttribIPointer(index, size, type, stride, static_cast<uint64_t>(offset)), m_graphicsContextGLIdentifier);
 1109}
 1110
 1111void RemoteGraphicsContextGLProxy::drawRangeElements(GCGLenum mode, GCGLuint start, GCGLuint end, GCGLsizei count, GCGLenum type, GCGLintptr offset)
 1112{
 1113 send(Messages::RemoteGraphicsContextGL::DrawRangeElements(mode, start, end, count, type, static_cast<uint64_t>(offset)), m_graphicsContextGLIdentifier);
 1114}
 1115
 1116void RemoteGraphicsContextGLProxy::drawBuffers(GCGLSpan<const GCGLenum> bufs)
 1117{
 1118 send(Messages::RemoteGraphicsContextGL::DrawBuffers(IPC::ArrayReference<uint32_t>(reinterpret_cast<const uint32_t*>(bufs.data), bufs.bufSize)), m_graphicsContextGLIdentifier);
 1119}
 1120
 1121void RemoteGraphicsContextGLProxy::clearBufferiv(GCGLenum buffer, GCGLint drawbuffer, GCGLSpan<const GCGLint> values)
 1122{
 1123 send(Messages::RemoteGraphicsContextGL::ClearBufferiv(buffer, drawbuffer, IPC::ArrayReference<int32_t>(reinterpret_cast<const int32_t*>(values.data), values.bufSize)), m_graphicsContextGLIdentifier);
 1124}
 1125
 1126void RemoteGraphicsContextGLProxy::clearBufferuiv(GCGLenum buffer, GCGLint drawbuffer, GCGLSpan<const GCGLuint> values)
 1127{
 1128 send(Messages::RemoteGraphicsContextGL::ClearBufferuiv(buffer, drawbuffer, IPC::ArrayReference<uint32_t>(reinterpret_cast<const uint32_t*>(values.data), values.bufSize)), m_graphicsContextGLIdentifier);
 1129}
 1130
 1131void RemoteGraphicsContextGLProxy::clearBufferfv(GCGLenum buffer, GCGLint drawbuffer, GCGLSpan<const GCGLfloat> values)
 1132{
 1133 send(Messages::RemoteGraphicsContextGL::ClearBufferfv(buffer, drawbuffer, IPC::ArrayReference<float>(reinterpret_cast<const float*>(values.data), values.bufSize)), m_graphicsContextGLIdentifier);
 1134}
 1135
 1136void RemoteGraphicsContextGLProxy::clearBufferfi(GCGLenum buffer, GCGLint drawbuffer, GCGLfloat depth, GCGLint stencil)
 1137{
 1138 send(Messages::RemoteGraphicsContextGL::ClearBufferfi(buffer, drawbuffer, depth, stencil), m_graphicsContextGLIdentifier);
 1139}
 1140
 1141PlatformGLObject RemoteGraphicsContextGLProxy::createQuery()
 1142{
 1143 uint32_t returnValue = { };
 1144 sendSync(Messages::RemoteGraphicsContextGL::CreateQuery(), Messages::RemoteGraphicsContextGL::CreateQuery::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 1145 return returnValue;
 1146}
 1147
 1148void RemoteGraphicsContextGLProxy::deleteQuery(PlatformGLObject query)
 1149{
 1150 send(Messages::RemoteGraphicsContextGL::DeleteQuery(query), m_graphicsContextGLIdentifier);
 1151}
 1152
 1153GCGLboolean RemoteGraphicsContextGLProxy::isQuery(PlatformGLObject query)
 1154{
 1155 bool returnValue = { };
 1156 sendSync(Messages::RemoteGraphicsContextGL::IsQuery(query), Messages::RemoteGraphicsContextGL::IsQuery::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 1157 return static_cast<GCGLboolean>(returnValue);
 1158}
 1159
 1160void RemoteGraphicsContextGLProxy::beginQuery(GCGLenum target, PlatformGLObject query)
 1161{
 1162 send(Messages::RemoteGraphicsContextGL::BeginQuery(target, query), m_graphicsContextGLIdentifier);
 1163}
 1164
 1165void RemoteGraphicsContextGLProxy::endQuery(GCGLenum target)
 1166{
 1167 send(Messages::RemoteGraphicsContextGL::EndQuery(target), m_graphicsContextGLIdentifier);
 1168}
 1169
 1170PlatformGLObject RemoteGraphicsContextGLProxy::getQuery(GCGLenum target, GCGLenum pname)
 1171{
 1172 uint32_t returnValue = { };
 1173 sendSync(Messages::RemoteGraphicsContextGL::GetQuery(target, pname), Messages::RemoteGraphicsContextGL::GetQuery::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 1174 return returnValue;
 1175}
 1176
 1177GCGLuint RemoteGraphicsContextGLProxy::getQueryObjectui(PlatformGLObject query, GCGLenum pname)
 1178{
 1179 uint32_t returnValue = { };
 1180 sendSync(Messages::RemoteGraphicsContextGL::GetQueryObjectui(query, pname), Messages::RemoteGraphicsContextGL::GetQueryObjectui::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 1181 return returnValue;
 1182}
 1183
 1184PlatformGLObject RemoteGraphicsContextGLProxy::createSampler()
 1185{
 1186 uint32_t returnValue = { };
 1187 sendSync(Messages::RemoteGraphicsContextGL::CreateSampler(), Messages::RemoteGraphicsContextGL::CreateSampler::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 1188 return returnValue;
 1189}
 1190
 1191void RemoteGraphicsContextGLProxy::deleteSampler(PlatformGLObject sampler)
 1192{
 1193 send(Messages::RemoteGraphicsContextGL::DeleteSampler(sampler), m_graphicsContextGLIdentifier);
 1194}
 1195
 1196GCGLboolean RemoteGraphicsContextGLProxy::isSampler(PlatformGLObject sampler)
 1197{
 1198 bool returnValue = { };
 1199 sendSync(Messages::RemoteGraphicsContextGL::IsSampler(sampler), Messages::RemoteGraphicsContextGL::IsSampler::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 1200 return static_cast<GCGLboolean>(returnValue);
 1201}
 1202
 1203void RemoteGraphicsContextGLProxy::bindSampler(GCGLuint unit, PlatformGLObject sampler)
 1204{
 1205 send(Messages::RemoteGraphicsContextGL::BindSampler(unit, sampler), m_graphicsContextGLIdentifier);
 1206}
 1207
 1208void RemoteGraphicsContextGLProxy::samplerParameteri(PlatformGLObject sampler, GCGLenum pname, GCGLint param)
 1209{
 1210 send(Messages::RemoteGraphicsContextGL::SamplerParameteri(sampler, pname, param), m_graphicsContextGLIdentifier);
 1211}
 1212
 1213void RemoteGraphicsContextGLProxy::samplerParameterf(PlatformGLObject sampler, GCGLenum pname, GCGLfloat param)
 1214{
 1215 send(Messages::RemoteGraphicsContextGL::SamplerParameterf(sampler, pname, param), m_graphicsContextGLIdentifier);
 1216}
 1217
 1218GCGLfloat RemoteGraphicsContextGLProxy::getSamplerParameterf(PlatformGLObject sampler, GCGLenum pname)
 1219{
 1220 float returnValue = { };
 1221 sendSync(Messages::RemoteGraphicsContextGL::GetSamplerParameterf(sampler, pname), Messages::RemoteGraphicsContextGL::GetSamplerParameterf::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 1222 return returnValue;
 1223}
 1224
 1225GCGLint RemoteGraphicsContextGLProxy::getSamplerParameteri(PlatformGLObject sampler, GCGLenum pname)
 1226{
 1227 int32_t returnValue = { };
 1228 sendSync(Messages::RemoteGraphicsContextGL::GetSamplerParameteri(sampler, pname), Messages::RemoteGraphicsContextGL::GetSamplerParameteri::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 1229 return returnValue;
 1230}
 1231
 1232GCGLsync RemoteGraphicsContextGLProxy::fenceSync(GCGLenum condition, GCGLbitfield flags)
 1233{
 1234 uint64_t returnValue = { };
 1235 sendSync(Messages::RemoteGraphicsContextGL::FenceSync(condition, flags), Messages::RemoteGraphicsContextGL::FenceSync::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 1236 return reinterpret_cast<GCGLsync>(static_cast<intptr_t>(returnValue));
 1237}
 1238
 1239GCGLboolean RemoteGraphicsContextGLProxy::isSync(GCGLsync arg0)
 1240{
 1241 bool returnValue = { };
 1242 sendSync(Messages::RemoteGraphicsContextGL::IsSync(static_cast<uint64_t>(reinterpret_cast<intptr_t>(arg0))), Messages::RemoteGraphicsContextGL::IsSync::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 1243 return static_cast<GCGLboolean>(returnValue);
 1244}
 1245
 1246void RemoteGraphicsContextGLProxy::deleteSync(GCGLsync arg0)
 1247{
 1248 send(Messages::RemoteGraphicsContextGL::DeleteSync(static_cast<uint64_t>(reinterpret_cast<intptr_t>(arg0))), m_graphicsContextGLIdentifier);
 1249}
 1250
 1251GCGLenum RemoteGraphicsContextGLProxy::clientWaitSync(GCGLsync arg0, GCGLbitfield flags, GCGLuint64 timeout)
 1252{
 1253 uint32_t returnValue = { };
 1254 sendSync(Messages::RemoteGraphicsContextGL::ClientWaitSync(static_cast<uint64_t>(reinterpret_cast<intptr_t>(arg0)), flags, static_cast<uint64_t>(timeout)), Messages::RemoteGraphicsContextGL::ClientWaitSync::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 1255 return returnValue;
 1256}
 1257
 1258void RemoteGraphicsContextGLProxy::waitSync(GCGLsync arg0, GCGLbitfield flags, GCGLint64 timeout)
 1259{
 1260 send(Messages::RemoteGraphicsContextGL::WaitSync(static_cast<uint64_t>(reinterpret_cast<intptr_t>(arg0)), flags, static_cast<int64_t>(timeout)), m_graphicsContextGLIdentifier);
 1261}
 1262
 1263GCGLint RemoteGraphicsContextGLProxy::getSynci(GCGLsync arg0, GCGLenum pname)
 1264{
 1265 int32_t returnValue = { };
 1266 sendSync(Messages::RemoteGraphicsContextGL::GetSynci(static_cast<uint64_t>(reinterpret_cast<intptr_t>(arg0)), pname), Messages::RemoteGraphicsContextGL::GetSynci::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 1267 return returnValue;
 1268}
 1269
 1270PlatformGLObject RemoteGraphicsContextGLProxy::createTransformFeedback()
 1271{
 1272 uint32_t returnValue = { };
 1273 sendSync(Messages::RemoteGraphicsContextGL::CreateTransformFeedback(), Messages::RemoteGraphicsContextGL::CreateTransformFeedback::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 1274 return returnValue;
 1275}
 1276
 1277void RemoteGraphicsContextGLProxy::deleteTransformFeedback(PlatformGLObject id)
 1278{
 1279 send(Messages::RemoteGraphicsContextGL::DeleteTransformFeedback(id), m_graphicsContextGLIdentifier);
 1280}
 1281
 1282GCGLboolean RemoteGraphicsContextGLProxy::isTransformFeedback(PlatformGLObject id)
 1283{
 1284 bool returnValue = { };
 1285 sendSync(Messages::RemoteGraphicsContextGL::IsTransformFeedback(id), Messages::RemoteGraphicsContextGL::IsTransformFeedback::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 1286 return static_cast<GCGLboolean>(returnValue);
 1287}
 1288
 1289void RemoteGraphicsContextGLProxy::bindTransformFeedback(GCGLenum target, PlatformGLObject id)
 1290{
 1291 send(Messages::RemoteGraphicsContextGL::BindTransformFeedback(target, id), m_graphicsContextGLIdentifier);
 1292}
 1293
 1294void RemoteGraphicsContextGLProxy::beginTransformFeedback(GCGLenum primitiveMode)
 1295{
 1296 send(Messages::RemoteGraphicsContextGL::BeginTransformFeedback(primitiveMode), m_graphicsContextGLIdentifier);
 1297}
 1298
 1299void RemoteGraphicsContextGLProxy::endTransformFeedback()
 1300{
 1301 send(Messages::RemoteGraphicsContextGL::EndTransformFeedback(), m_graphicsContextGLIdentifier);
 1302}
 1303
 1304void RemoteGraphicsContextGLProxy::transformFeedbackVaryings(PlatformGLObject program, const Vector<String>& varyings, GCGLenum bufferMode)
 1305{
 1306 send(Messages::RemoteGraphicsContextGL::TransformFeedbackVaryings(program, varyings, bufferMode), m_graphicsContextGLIdentifier);
 1307}
 1308
 1309void RemoteGraphicsContextGLProxy::getTransformFeedbackVarying(PlatformGLObject program, GCGLuint index, ActiveInfo& arg2)
 1310{
 1311 sendSync(Messages::RemoteGraphicsContextGL::GetTransformFeedbackVarying(program, index), Messages::RemoteGraphicsContextGL::GetTransformFeedbackVarying::Reply(arg2), m_graphicsContextGLIdentifier, 10_s);
 1312}
 1313
 1314void RemoteGraphicsContextGLProxy::pauseTransformFeedback()
 1315{
 1316 send(Messages::RemoteGraphicsContextGL::PauseTransformFeedback(), m_graphicsContextGLIdentifier);
 1317}
 1318
 1319void RemoteGraphicsContextGLProxy::resumeTransformFeedback()
 1320{
 1321 send(Messages::RemoteGraphicsContextGL::ResumeTransformFeedback(), m_graphicsContextGLIdentifier);
 1322}
 1323
 1324void RemoteGraphicsContextGLProxy::bindBufferBase(GCGLenum target, GCGLuint index, PlatformGLObject buffer)
 1325{
 1326 send(Messages::RemoteGraphicsContextGL::BindBufferBase(target, index, buffer), m_graphicsContextGLIdentifier);
 1327}
 1328
 1329void RemoteGraphicsContextGLProxy::bindBufferRange(GCGLenum target, GCGLuint index, PlatformGLObject buffer, GCGLintptr offset, GCGLsizeiptr size)
 1330{
 1331 send(Messages::RemoteGraphicsContextGL::BindBufferRange(target, index, buffer, static_cast<uint64_t>(offset), static_cast<uint64_t>(size)), m_graphicsContextGLIdentifier);
 1332}
 1333
 1334Vector<GCGLuint> RemoteGraphicsContextGLProxy::getUniformIndices(PlatformGLObject program, const Vector<String>& uniformNames)
 1335{
 1336 Vector<uint32_t> returnValue = { };
 1337 sendSync(Messages::RemoteGraphicsContextGL::GetUniformIndices(program, uniformNames), Messages::RemoteGraphicsContextGL::GetUniformIndices::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 1338 return returnValue;
 1339}
 1340
 1341Vector<GCGLint> RemoteGraphicsContextGLProxy::getActiveUniforms(PlatformGLObject program, const Vector<GCGLuint>& uniformIndices, GCGLenum pname)
 1342{
 1343 Vector<int32_t> returnValue = { };
 1344 sendSync(Messages::RemoteGraphicsContextGL::GetActiveUniforms(program, uniformIndices, pname), Messages::RemoteGraphicsContextGL::GetActiveUniforms::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 1345 return returnValue;
 1346}
 1347
 1348GCGLuint RemoteGraphicsContextGLProxy::getUniformBlockIndex(PlatformGLObject program, const String& uniformBlockName)
 1349{
 1350 uint32_t returnValue = { };
 1351 sendSync(Messages::RemoteGraphicsContextGL::GetUniformBlockIndex(program, uniformBlockName), Messages::RemoteGraphicsContextGL::GetUniformBlockIndex::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 1352 return returnValue;
 1353}
 1354
 1355String RemoteGraphicsContextGLProxy::getActiveUniformBlockName(PlatformGLObject program, GCGLuint uniformBlockIndex)
 1356{
 1357 String returnValue = { };
 1358 sendSync(Messages::RemoteGraphicsContextGL::GetActiveUniformBlockName(program, uniformBlockIndex), Messages::RemoteGraphicsContextGL::GetActiveUniformBlockName::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 1359 return returnValue;
 1360}
 1361
 1362void RemoteGraphicsContextGLProxy::uniformBlockBinding(PlatformGLObject program, GCGLuint uniformBlockIndex, GCGLuint uniformBlockBinding)
 1363{
 1364 send(Messages::RemoteGraphicsContextGL::UniformBlockBinding(program, uniformBlockIndex, uniformBlockBinding), m_graphicsContextGLIdentifier);
 1365}
 1366
 1367void RemoteGraphicsContextGLProxy::getActiveUniformBlockiv(GCGLuint program, GCGLuint uniformBlockIndex, GCGLenum pname, GCGLSpan<GCGLint> params)
 1368{
 1369 IPC::ArrayReference<int32_t> paramsReply;
 1370 auto sendResult = sendSync(Messages::RemoteGraphicsContextGL::GetActiveUniformBlockiv(program, uniformBlockIndex, pname, params.bufSize), Messages::RemoteGraphicsContextGL::GetActiveUniformBlockiv::Reply(paramsReply), m_graphicsContextGLIdentifier, 10_s);
 1371 if (sendResult)
 1372 memcpy(params.data, paramsReply.data(), params.bufSize * sizeof(int32_t));
 1373
 1374}
 1375
 1376GCGLint RemoteGraphicsContextGLProxy::getGraphicsResetStatusARB()
 1377{
 1378 int32_t returnValue = { };
 1379 sendSync(Messages::RemoteGraphicsContextGL::GetGraphicsResetStatusARB(), Messages::RemoteGraphicsContextGL::GetGraphicsResetStatusARB::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 1380 return returnValue;
 1381}
 1382
 1383void RemoteGraphicsContextGLProxy::blitFramebufferANGLE(GCGLint srcX0, GCGLint srcY0, GCGLint srcX1, GCGLint srcY1, GCGLint dstX0, GCGLint dstY0, GCGLint dstX1, GCGLint dstY1, GCGLbitfield mask, GCGLenum filter)
 1384{
 1385 send(Messages::RemoteGraphicsContextGL::BlitFramebufferANGLE(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter), m_graphicsContextGLIdentifier);
 1386}
 1387
 1388void RemoteGraphicsContextGLProxy::renderbufferStorageMultisampleANGLE(GCGLenum target, GCGLsizei samples, GCGLenum internalformat, GCGLsizei width, GCGLsizei height)
 1389{
 1390 send(Messages::RemoteGraphicsContextGL::RenderbufferStorageMultisampleANGLE(target, samples, internalformat, width, height), m_graphicsContextGLIdentifier);
 1391}
 1392
 1393PlatformGLObject RemoteGraphicsContextGLProxy::createVertexArrayOES()
 1394{
 1395 uint32_t returnValue = { };
 1396 sendSync(Messages::RemoteGraphicsContextGL::CreateVertexArrayOES(), Messages::RemoteGraphicsContextGL::CreateVertexArrayOES::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 1397 return returnValue;
 1398}
 1399
 1400void RemoteGraphicsContextGLProxy::deleteVertexArrayOES(PlatformGLObject arg0)
 1401{
 1402 send(Messages::RemoteGraphicsContextGL::DeleteVertexArrayOES(arg0), m_graphicsContextGLIdentifier);
 1403}
 1404
 1405GCGLboolean RemoteGraphicsContextGLProxy::isVertexArrayOES(PlatformGLObject arg0)
 1406{
 1407 bool returnValue = { };
 1408 sendSync(Messages::RemoteGraphicsContextGL::IsVertexArrayOES(arg0), Messages::RemoteGraphicsContextGL::IsVertexArrayOES::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 1409 return static_cast<GCGLboolean>(returnValue);
 1410}
 1411
 1412void RemoteGraphicsContextGLProxy::bindVertexArrayOES(PlatformGLObject arg0)
 1413{
 1414 send(Messages::RemoteGraphicsContextGL::BindVertexArrayOES(arg0), m_graphicsContextGLIdentifier);
 1415}
 1416
 1417String RemoteGraphicsContextGLProxy::getTranslatedShaderSourceANGLE(PlatformGLObject arg0)
 1418{
 1419 String returnValue = { };
 1420 sendSync(Messages::RemoteGraphicsContextGL::GetTranslatedShaderSourceANGLE(arg0), Messages::RemoteGraphicsContextGL::GetTranslatedShaderSourceANGLE::Reply(returnValue), m_graphicsContextGLIdentifier, 10_s);
 1421 return returnValue;
 1422}
 1423
 1424void RemoteGraphicsContextGLProxy::insertEventMarkerEXT(const String& arg0)
 1425{
 1426 send(Messages::RemoteGraphicsContextGL::InsertEventMarkerEXT(arg0), m_graphicsContextGLIdentifier);
 1427}
 1428
 1429void RemoteGraphicsContextGLProxy::pushGroupMarkerEXT(const String& arg0)
 1430{
 1431 send(Messages::RemoteGraphicsContextGL::PushGroupMarkerEXT(arg0), m_graphicsContextGLIdentifier);
 1432}
 1433
 1434void RemoteGraphicsContextGLProxy::popGroupMarkerEXT()
 1435{
 1436 send(Messages::RemoteGraphicsContextGL::PopGroupMarkerEXT(), m_graphicsContextGLIdentifier);
 1437}
 1438
 1439void RemoteGraphicsContextGLProxy::drawBuffersEXT(GCGLSpan<const GCGLenum> bufs)
 1440{
 1441 send(Messages::RemoteGraphicsContextGL::DrawBuffersEXT(IPC::ArrayReference<uint32_t>(reinterpret_cast<const uint32_t*>(bufs.data), bufs.bufSize)), m_graphicsContextGLIdentifier);
 1442}
 1443
 1444void RemoteGraphicsContextGLProxy::drawArraysInstancedANGLE(GCGLenum mode, GCGLint first, GCGLsizei count, GCGLsizei primcount)
 1445{
 1446 send(Messages::RemoteGraphicsContextGL::DrawArraysInstancedANGLE(mode, first, count, primcount), m_graphicsContextGLIdentifier);
 1447}
 1448
 1449void RemoteGraphicsContextGLProxy::drawElementsInstancedANGLE(GCGLenum mode, GCGLsizei count, GCGLenum type, GCGLvoidptr offset, GCGLsizei primcount)
 1450{
 1451 send(Messages::RemoteGraphicsContextGL::DrawElementsInstancedANGLE(mode, count, type, static_cast<uint64_t>(offset), primcount), m_graphicsContextGLIdentifier);
 1452}
 1453
 1454void RemoteGraphicsContextGLProxy::vertexAttribDivisorANGLE(GCGLuint index, GCGLuint divisor)
 1455{
 1456 send(Messages::RemoteGraphicsContextGL::VertexAttribDivisorANGLE(index, divisor), m_graphicsContextGLIdentifier);
 1457}
 1458
 1459void RemoteGraphicsContextGLProxy::getInternalformativ(GCGLenum target, GCGLenum internalformat, GCGLenum pname, GCGLsizei bufSize, GCGLint* params)
 1460{
 1461 notImplemented();
 1462}
 1463
 1464void RemoteGraphicsContextGLProxy::readPixelsRobustANGLE(GCGLint x, GCGLint y, GCGLsizei width, GCGLsizei height, GCGLenum format, GCGLenum type, GCGLsizei bufSize, GCGLsizei* length, GCGLsizei* columns, GCGLsizei* rows, GCGLvoid* pixels)
 1465{
 1466 notImplemented();
 1467}
 1468
 1469void RemoteGraphicsContextGLProxy::texParameterfvRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, const GCGLfloat* params)
 1470{
 1471 notImplemented();
 1472}
 1473
 1474void RemoteGraphicsContextGLProxy::texParameterivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, const GCGLint* params)
 1475{
 1476 notImplemented();
 1477}
 1478
 1479void RemoteGraphicsContextGLProxy::getQueryivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params)
 1480{
 1481 notImplemented();
 1482}
 1483
 1484void RemoteGraphicsContextGLProxy::getQueryObjectuivRobustANGLE(GCGLuint id, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLuint* params)
 1485{
 1486 notImplemented();
 1487}
 1488
 1489void RemoteGraphicsContextGLProxy::getBufferPointervRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLvoid** params)
 1490{
 1491 notImplemented();
 1492}
 1493
 1494void RemoteGraphicsContextGLProxy::getInternalformativRobustANGLE(GCGLenum target, GCGLenum internalformat, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params)
 1495{
 1496 notImplemented();
 1497}
 1498
 1499void RemoteGraphicsContextGLProxy::getVertexAttribIivRobustANGLE(GCGLuint index, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params)
 1500{
 1501 notImplemented();
 1502}
 1503
 1504void RemoteGraphicsContextGLProxy::getVertexAttribIuivRobustANGLE(GCGLuint index, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLuint* params)
 1505{
 1506 notImplemented();
 1507}
 1508
 1509void RemoteGraphicsContextGLProxy::getUniformuivRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei* length, GCGLuint* params)
 1510{
 1511 notImplemented();
 1512}
 1513
 1514void RemoteGraphicsContextGLProxy::getBufferParameteri64vRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint64* params)
 1515{
 1516 notImplemented();
 1517}
 1518
 1519void RemoteGraphicsContextGLProxy::samplerParameterivRobustANGLE(GCGLuint sampler, GCGLenum pname, GCGLsizei bufSize, const GCGLint* param)
 1520{
 1521 notImplemented();
 1522}
 1523
 1524void RemoteGraphicsContextGLProxy::samplerParameterfvRobustANGLE(GCGLuint sampler, GCGLenum pname, GCGLsizei bufSize, const GCGLfloat* param)
 1525{
 1526 notImplemented();
 1527}
 1528
 1529void RemoteGraphicsContextGLProxy::getSamplerParameterivRobustANGLE(GCGLuint sampler, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params)
 1530{
 1531 notImplemented();
 1532}
 1533
 1534void RemoteGraphicsContextGLProxy::getSamplerParameterfvRobustANGLE(GCGLuint sampler, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLfloat* params)
 1535{
 1536 notImplemented();
 1537}
 1538
 1539void RemoteGraphicsContextGLProxy::getFramebufferParameterivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params)
 1540{
 1541 notImplemented();
 1542}
 1543
 1544void RemoteGraphicsContextGLProxy::getProgramInterfaceivRobustANGLE(GCGLuint program, GCGLenum programInterface, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params)
 1545{
 1546 notImplemented();
 1547}
 1548
 1549void RemoteGraphicsContextGLProxy::getBooleani_vRobustANGLE(GCGLenum target, GCGLuint index, GCGLsizei bufSize, GCGLsizei* length, GCGLboolean* data) // NOLINT
 1550{
 1551 notImplemented();
 1552}
 1553
 1554void RemoteGraphicsContextGLProxy::getMultisamplefvRobustANGLE(GCGLenum pname, GCGLuint index, GCGLsizei bufSize, GCGLsizei* length, GCGLfloat* val)
 1555{
 1556 notImplemented();
 1557}
 1558
 1559void RemoteGraphicsContextGLProxy::getTexLevelParameterivRobustANGLE(GCGLenum target, GCGLint level, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params)
 1560{
 1561 notImplemented();
 1562}
 1563
 1564void RemoteGraphicsContextGLProxy::getTexLevelParameterfvRobustANGLE(GCGLenum target, GCGLint level, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLfloat* params)
 1565{
 1566 notImplemented();
 1567}
 1568
 1569void RemoteGraphicsContextGLProxy::getPointervRobustANGLERobustANGLE(GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLvoid** params)
 1570{
 1571 notImplemented();
 1572}
 1573
 1574void RemoteGraphicsContextGLProxy::getnUniformfvRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei* length, GCGLfloat* params)
 1575{
 1576 notImplemented();
 1577}
 1578
 1579void RemoteGraphicsContextGLProxy::getnUniformivRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params)
 1580{
 1581 notImplemented();
 1582}
 1583
 1584void RemoteGraphicsContextGLProxy::getnUniformuivRobustANGLE(GCGLuint program, GCGLint location, GCGLsizei bufSize, GCGLsizei* length, GCGLuint* params)
 1585{
 1586 notImplemented();
 1587}
 1588
 1589void RemoteGraphicsContextGLProxy::texParameterIivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, const GCGLint* params)
 1590{
 1591 notImplemented();
 1592}
 1593
 1594void RemoteGraphicsContextGLProxy::texParameterIuivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, const GCGLuint* params)
 1595{
 1596 notImplemented();
 1597}
 1598
 1599void RemoteGraphicsContextGLProxy::getTexParameterIivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params)
 1600{
 1601 notImplemented();
 1602}
 1603
 1604void RemoteGraphicsContextGLProxy::getTexParameterIuivRobustANGLE(GCGLenum target, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLuint* params)
 1605{
 1606 notImplemented();
 1607}
 1608
 1609void RemoteGraphicsContextGLProxy::samplerParameterIivRobustANGLE(GCGLuint sampler, GCGLenum pname, GCGLsizei bufSize, const GCGLint* param)
 1610{
 1611 notImplemented();
 1612}
 1613
 1614void RemoteGraphicsContextGLProxy::samplerParameterIuivRobustANGLE(GCGLuint sampler, GCGLenum pname, GCGLsizei bufSize, const GCGLuint* param)
 1615{
 1616 notImplemented();
 1617}
 1618
 1619void RemoteGraphicsContextGLProxy::getSamplerParameterIivRobustANGLE(GCGLuint sampler, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params)
 1620{
 1621 notImplemented();
 1622}
 1623
 1624void RemoteGraphicsContextGLProxy::getSamplerParameterIuivRobustANGLE(GCGLuint sampler, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLuint* params)
 1625{
 1626 notImplemented();
 1627}
 1628
 1629void RemoteGraphicsContextGLProxy::getQueryObjectivRobustANGLE(GCGLuint id, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint* params)
 1630{
 1631 notImplemented();
 1632}
 1633
 1634void RemoteGraphicsContextGLProxy::getQueryObjecti64vRobustANGLE(GCGLuint id, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLint64* params)
 1635{
 1636 notImplemented();
 1637}
 1638
 1639void RemoteGraphicsContextGLProxy::getQueryObjectui64vRobustANGLE(GCGLuint id, GCGLenum pname, GCGLsizei bufSize, GCGLsizei* length, GCGLuint64* params)
 1640{
 1641 notImplemented();
 1642}
 1643
 1644}
 1645
 1646#endif
 1647

Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp

@@void MediaPlayerPrivateRemote::paintCurrentFrameInContext(GraphicsContext&, cons
818818 notImplemented();
819819}
820820
821 bool MediaPlayerPrivateRemote::copyVideoTextureToPlatformTexture(GraphicsContextGL*, PlatformGLObject, GCGLenum, GCGLint, GCGLenum, GCGLenum, GCGLenum, bool, bool)
 821bool MediaPlayerPrivateRemote::copyVideoTextureToPlatformTexture(WebCore::GraphicsContextGL*, PlatformGLObject, GCGLenum, GCGLint, GCGLenum, GCGLenum, GCGLenum, bool, bool)
822822{
823823 notImplemented();
824824 return false;

Source/WebKit/WebProcess/GPU/media/RemoteAudioDestinationProxy.cpp

@@void RemoteAudioDestinationProxy::connectToGPUProcess()
8282
8383 auto& connection = WebProcess::singleton().ensureGPUProcessConnection();
8484 connection.addClient(*this);
85  bool didSucceed = connection.connection().sendSync(
 85 auto didSucceed = connection.connection().sendSync(
8686 Messages::RemoteAudioDestinationManager::CreateAudioDestination(m_inputDeviceId, m_numberOfInputChannels, numberOfOutputChannels(), sampleRate(), hardwareSampleRate()),
8787 Messages::RemoteAudioDestinationManager::CreateAudioDestination::Reply(destinationID), 0);
8888

@@void RemoteAudioDestinationProxy::connectToGPUProcess()
100100 AudioStreamBasicDescription streamFormat;
101101 getAudioStreamBasicDescription(streamFormat);
102102 m_ringBuffer->allocate(streamFormat, m_numberOfFrames);
103  m_audioBufferList = makeUnique<WebAudioBufferList>(streamFormat);
 103 m_audioBufferList = makeUnique<WebCore::WebAudioBufferList>(streamFormat);
104104#endif
105105}
106106

Source/WebKit/WebProcess/GPU/media/RemoteAudioSession.cpp

2929#if ENABLE(GPU_PROCESS) && USE(AUDIO_SESSION)
3030
3131#include "GPUConnectionToWebProcessMessages.h"
 32#include "GPUProcessConnection.h"
3233#include "GPUProcessProxy.h"
3334#include "RemoteAudioSessionMessages.h"
3435#include "RemoteAudioSessionProxyMessages.h"
 36#include "WebProcess.h"
3537#include <WebCore/PlatformMediaSessionManager.h>
3638
3739namespace WebKit {

Source/WebKit/WebProcess/GPU/media/RemoteAudioSourceProviderManager.cpp

2626#include "config.h"
2727#include "RemoteAudioSourceProviderManager.h"
2828
 29#include "GPUProcessConnection.h"
2930#include "Logging.h"
 31#include "RemoteAudioSourceProvider.h"
3032#include "RemoteAudioSourceProviderManagerMessages.h"
3133#include "SharedRingBufferStorage.h"
3234

Source/WebKit/WebProcess/GPU/media/RemoteAudioSourceProviderManager.h

2727
2828#if PLATFORM(COCOA) && ENABLE(GPU_PROCESS)
2929
 30#include "Connection.h"
 31#include "SharedMemory.h"
 32#include "WebProcess.h"
3033#include <WebCore/CAAudioStreamDescription.h>
3134#include <WebCore/CARingBuffer.h>
3235#include <WebCore/MediaPlayerIdentifier.h>

Source/WebKit/WebProcess/GPU/media/RemoteLegacyCDMSession.cpp

2828
2929#if ENABLE(GPU_PROCESS) && ENABLE(LEGACY_ENCRYPTED_MEDIA)
3030
 31#include "GPUProcessConnection.h"
3132#include "RemoteLegacyCDMFactory.h"
3233#include "RemoteLegacyCDMSessionProxyMessages.h"
3334#include "SharedBufferCopy.h"

Source/WebKit/WebProcess/GPU/media/SourceBufferPrivateRemote.h

4444namespace IPC {
4545class Connection;
4646class Decoder;
47 class DataReference;
4847}
4948
5049namespace WebKit {

Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.h

3333#include "TrackPrivateRemoteIdentifier.h"
3434#include <WebCore/InbandTextTrackPrivate.h>
3535
36 namespace IPC {
37 class DataReference;
38 }
39 
4036namespace WebCore {
4137class InbandGenericCue;
4238class ISOWebVTTCue;

Source/WebKit/WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp

2828
2929#if USE(LIBWEBRTC) && PLATFORM(COCOA) && ENABLE(GPU_PROCESS)
3030
31 #include "DataReference.h"
3231#include "GPUProcessConnection.h"
3332#include "LibWebRTCCodecsMessages.h"
3433#include "LibWebRTCCodecsProxyMessages.h"

Source/WebKit/WebProcess/GPU/webrtc/LibWebRTCCodecs.h

2828#if USE(LIBWEBRTC) && PLATFORM(COCOA) && ENABLE(GPU_PROCESS)
2929
3030#include "Connection.h"
 31#include "DataReference.h"
3132#include "MessageReceiver.h"
3233#include "RTCDecoderIdentifier.h"
3334#include "RTCEncoderIdentifier.h"

@@using CVPixelBufferPoolRef = struct __CVPixelBufferPool*;
4344
4445namespace IPC {
4546class Connection;
46 class DataReference;
4747class Decoder;
4848}
4949

Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.h

2727
2828#include "APIInjectedBundleBundleClient.h"
2929#include "APIObject.h"
 30#include "DataReference.h"
3031#include "SandboxExtension.h"
3132#include <JavaScriptCore/JavaScript.h>
3233#include <WebCore/UserContentTypes.h>

@@class Data;
5455namespace IPC {
5556class Decoder;
5657class Connection;
57 class DataReference;
5858}
5959
6060namespace WebKit {

@@private:
161161};
162162
163163} // namespace WebKit
164 

Source/WebKit/WebProcess/Network/NetworkProcessConnection.h

3434#include <wtf/RefCounted.h>
3535#include <wtf/text/WTFString.h>
3636
37 namespace IPC {
38 class DataReference;
39 }
40 
4137namespace WebCore {
4238class ResourceError;
4339class ResourceRequest;

Source/WebKit/WebProcess/Network/WebResourceLoader.cpp

2626#include "config.h"
2727#include "WebResourceLoader.h"
2828
29 #include "DataReference.h"
3029#include "FormDataReference.h"
3130#include "Logging.h"
3231#include "NetworkProcessConnection.h"

Source/WebKit/WebProcess/Network/WebResourceLoader.h

2626#pragma once
2727
2828#include "Connection.h"
 29#include "DataReference.h"
2930#include "MessageSender.h"
3031#include "ShareableResource.h"
3132#include "WebPageProxyIdentifier.h"

3637#include <wtf/RefPtr.h>
3738
3839namespace IPC {
39 class DataReference;
4040class FormDataReference;
4141}
4242

Source/WebKit/WebProcess/Network/WebSocketChannel.cpp

2626#include "config.h"
2727#include "WebSocketChannel.h"
2828
29 #include "DataReference.h"
3029#include "NetworkConnectionToWebProcessMessages.h"
3130#include "NetworkProcessConnection.h"
3231#include "NetworkSocketChannelMessages.h"

Source/WebKit/WebProcess/Network/WebSocketChannel.h

2525
2626#pragma once
2727
 28#include "DataReference.h"
2829#include "MessageReceiver.h"
2930#include "MessageSender.h"
3031#include <WebCore/NetworkSendQueue.h>

3839namespace IPC {
3940class Connection;
4041class Decoder;
41 class DataReference;
4242}
4343
4444namespace WebKit {

Source/WebKit/WebProcess/Network/WebSocketStream.cpp

2626#include "config.h"
2727#include "WebSocketStream.h"
2828
29 #include "DataReference.h"
3029#include "NetworkConnectionToWebProcessMessages.h"
3130#include "NetworkProcessConnection.h"
3231#include "NetworkSocketStreamMessages.h"

Source/WebKit/WebProcess/Network/WebSocketStream.h

2525
2626#pragma once
2727
 28#include "DataReference.h"
2829#include "MessageReceiver.h"
2930#include "MessageSender.h"
3031#include <WebCore/SocketStreamHandle.h>

3334namespace IPC {
3435class Connection;
3536class Decoder;
36 class DataReference;
3737}
3838
3939namespace WebCore {

Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocket.h

3535
3636namespace IPC {
3737class Connection;
38 class DataReference;
3938class Decoder;
4039}
4140

Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h

@@OBJC_CLASS PDFSelection;
6060OBJC_CLASS WKPDFPluginAccessibilityObject;
6161OBJC_CLASS WKPDFLayerControllerDelegate;
6262
63 namespace IPC {
64 class DataReference;
65 }
66 
6763namespace WebCore {
6864class AXObjectCache;
6965class Element;

Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp

108108#include <WebCore/MockWebAuthenticationConfiguration.h>
109109#endif
110110
 111#if PLATFORM(COCOA)
 112#include "RemoteGraphicsContextGLProxy.h"
 113#endif
 114
111115namespace WebKit {
112116using namespace WebCore;
113117using namespace HTMLNames;

@@RefPtr<ImageBuffer> WebChromeClient::createImageBuffer(const FloatSize& size, Re
912916 return m_page.ensureRemoteRenderingBackendProxy().createImageBuffer(size, renderingMode, resolutionScale, colorSpace, pixelFormat);
913917}
914918
 919#if ENABLE(WEBGL)
 920
 921RefPtr<GraphicsContextGL> WebChromeClient::createGraphicsContextGL(const GraphicsContextGLAttributes& attributes, PlatformDisplayID hostWindowDisplayID) const
 922{
 923 if (!WebProcess::singleton().shouldUseRemoteRenderingForWebGL())
 924 return nullptr;
 925 UNUSED_VARIABLE(hostWindowDisplayID);
 926#if PLATFORM(COCOA)
 927 return RemoteGraphicsContextGLProxy::create(attributes);
 928#else
 929 return nullptr;
 930#endif
 931}
 932
 933#endif
 934
915935#endif // ENABLE(GPU_PROCESS)
916936
917937void WebChromeClient::attachRootGraphicsLayer(Frame&, GraphicsLayer* layer)

Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h

@@private:
243243
244244#if ENABLE(GPU_PROCESS)
245245 RefPtr<WebCore::ImageBuffer> createImageBuffer(const WebCore::FloatSize&, WebCore::RenderingMode, WebCore::RenderingPurpose, float resolutionScale, WebCore::ColorSpace, WebCore::PixelFormat) const final;
 246#if ENABLE(WEBGL)
 247 RefPtr<WebCore::GraphicsContextGL> createGraphicsContextGL(const WebCore::GraphicsContextGLAttributes&, WebCore::PlatformDisplayID hostWindowDisplayID) const final;
246248#endif
 249#endif
 250
247251
248252 CompositingTriggerFlags allowedCompositingTriggers() const final
249253 {

@@private:
403407
404408 mutable bool m_cachedMainFrameHasHorizontalScrollbar { false };
405409 mutable bool m_cachedMainFrameHasVerticalScrollbar { false };
 410
406411 WebPage& m_page;
407412};
408413

Source/WebKit/WebProcess/WebPage/WebPage.cpp

@@WebPage::WebPage(PageIdentifier pageID, WebPageCreationParameters&& parameters)
422422 , m_shouldRenderCanvasInGPUProcess { parameters.shouldRenderCanvasInGPUProcess }
423423 , m_shouldRenderDOMInGPUProcess { parameters.shouldRenderDOMInGPUProcess }
424424 , m_shouldPlayMediaInGPUProcess { parameters.shouldPlayMediaInGPUProcess }
 425#if ENABLE(WEBGL)
 426 , m_shouldRenderWebGLInGPUProcess { parameters.shouldRenderWebGLInGPUProcess}
 427#endif
425428#if ENABLE(APP_BOUND_DOMAINS)
426429 , m_needsInAppBrowserPrivacyQuirks { parameters.needsInAppBrowserPrivacyQuirks }
427430#endif

@@WebPage::WebPage(PageIdentifier pageID, WebPageCreationParameters&& parameters)
725728 if (WebMediaKeyStorageManager* manager = webProcess.supplement<WebMediaKeyStorageManager>())
726729 m_page->settings().setMediaKeysStorageDirectory(manager->mediaKeyStorageDirectory());
727730#endif
728 
729731 if (parameters.viewScaleFactor != 1)
730732 scaleView(parameters.viewScaleFactor);
731733

@@void WebPage::updatePreferences(const WebPreferencesStore& store)
37933795 WebProcess::singleton().setUseGPUProcessForCanvasRendering(m_shouldRenderCanvasInGPUProcess);
37943796 WebProcess::singleton().setUseGPUProcessForDOMRendering(m_shouldRenderDOMInGPUProcess);
37953797 WebProcess::singleton().setUseGPUProcessForMedia(m_shouldPlayMediaInGPUProcess);
 3798#if ENABLE(WEBGL)
 3799 WebProcess::singleton().setUseGPUProcessForWebGL(m_shouldRenderWebGLInGPUProcess);
 3800#endif
37963801#endif
37973802
37983803#if ENABLE(IPC_TESTING_API)

@@void WebPage::synchronizeCORSDisablingPatternsWithNetworkProcess()
69906995 WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::SetCORSDisablingPatterns(m_identifier, m_corsDisablingPatterns), 0);
69916996}
69926997
 6998
69936999#if ENABLE(MEDIA_USAGE)
69947000void WebPage::addMediaUsageManagerSession(MediaSessionIdentifier identifier, const String& bundleIdentifier, const URL& pageURL)
69957001{

Source/WebKit/WebProcess/WebPage/WebPage.h

3434#include "APIObject.h"
3535#include "CallbackID.h"
3636#include "ContentAsStringIncludesChildFrames.h"
 37#include "DataReference.h"
3738#include "DownloadID.h"
3839#include "DrawingAreaInfo.h"
3940#include "EditingRange.h"

@@class Array;
160161
161162namespace IPC {
162163class Connection;
163 class DataReference;
164164class Decoder;
165165class FormDataReference;
166166}

@@public:
12571257 void didReceiveWebPageMessage(IPC::Connection&, IPC::Decoder&);
12581258
12591259 template<typename T>
1260  bool sendSyncWithDelayedReply(T&& message, typename T::Reply&& reply)
 1260 SendSyncResult sendSyncWithDelayedReply(T&& message, typename T::Reply&& reply)
12611261 {
12621262 cancelGesturesBlockedOnSynchronousReplies();
12631263 return sendSync(WTFMove(message), WTFMove(reply), Seconds::infinity(), IPC::SendSyncOption::InformPlatformProcessWillSuspend);

@@private:
18261826 bool m_shouldRenderCanvasInGPUProcess { false };
18271827 bool m_shouldRenderDOMInGPUProcess { false };
18281828 bool m_shouldPlayMediaInGPUProcess { false };
 1829#if ENABLE(WEBGL)
 1830 bool m_shouldRenderWebGLInGPUProcess { false };
 1831#endif
18291832#if ENABLE(APP_BOUND_DOMAINS)
18301833 bool m_needsInAppBrowserPrivacyQuirks { false };
18311834#endif

@@inline bool WebPage::platformNeedsLayoutForEditorState(const WebCore::Frame&) co
21832186#endif
21842187
21852188} // namespace WebKit
2186 

Source/WebKit/WebProcess/WebProcess.cpp

@@bool WebProcess::shouldUseRemoteRenderingFor(RenderingPurpose purpose)
19421942 }
19431943 return false;
19441944}
 1945
 1946#if ENABLE(WEBGL)
 1947void WebProcess::setUseGPUProcessForWebGL(bool useGPUProcessForWebGL)
 1948{
 1949 m_useGPUProcessForWebGL = useGPUProcessForWebGL;
 1950}
 1951
 1952bool WebProcess::shouldUseRemoteRenderingForWebGL() const
 1953{
 1954 return m_useGPUProcessForWebGL;
 1955}
 1956
 1957#endif
 1958
19451959#endif
19461960
19471961#if ENABLE(VP9)

Source/WebKit/WebProcess/WebProcess.h

@@public:
347347 void setUseGPUProcessForDOMRendering(bool);
348348 void setUseGPUProcessForMedia(bool);
349349 bool shouldUseRemoteRenderingFor(WebCore::RenderingPurpose);
 350#if ENABLE(WEBGL)
 351 void setUseGPUProcessForWebGL(bool);
 352 bool shouldUseRemoteRenderingForWebGL() const;
 353#endif
350354#endif
351355
352356#if ENABLE(VP9)

@@private:
687691 bool m_useGPUProcessForCanvasRendering { false };
688692 bool m_useGPUProcessForDOMRendering { false };
689693 bool m_useGPUProcessForMedia { false };
 694#if ENABLE(WEBGL)
 695 bool m_useGPUProcessForWebGL { false };
 696#endif
690697#endif
691698
692699#if ENABLE(VP9)

Tools/ChangeLog

 12020-11-03 Kimmo Kinnunen <kkinnunen@apple.com>
 2
 3 Implement RemoteGraphicsContextGL
 4 https://bugs.webkit.org/show_bug.cgi?id=217216
 5 <rdar://problem/69876258>
 6
 7 Reviewed by NOBODY (OOPS!).
 8
 9 Implements a remote version of GraphicsContextGL for GPU process.
 10 Current implementation is using WebKit IPC and is incomplete.
 11
 12 Add the code generator to generate the implementation.
 13
 14 * Scripts/generate-gpup-webgl: Added.
 15
1162020-11-27 Wenson Hsieh <wenson_hsieh@apple.com>
217
318 Introduce new display list meta commands in preparation for webkit.org/b/219091

Tools/Scripts/generate-gpup-webgl

 1#!/usr/bin/env python3
 2# -*- coding: utf-8 -*-
 3#
 4# Copyright (C) 2020 Apple Inc. All rights reserved.
 5#
 6# Redistribution and use in source and binary forms, with or without
 7# modification, are permitted provided that the following conditions
 8# are met:
 9#
 10# 1. Redistributions of source code must retain the above copyright
 11# notice, this list of conditions and the following disclaimer.
 12# 2. Redistributions in binary form must reproduce the above copyright
 13# notice, this list of conditions and the following disclaimer in the
 14# documentation and/or other materials provided with the distribution.
 15#
 16# THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 17# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 18# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 19# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
 20# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 21# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 22# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 23# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 24# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 25# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 26# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 27
 28
 29# This script generates the source files for WebGL GPU process IPC.
 30#
 31# python3 -m black -l 150 Tools/Scripts/generate-gpup-webgl
 32# python3 -m mypy Tools/Scripts/generate-gpup-webgl
 33#
 34import argparse
 35import enum
 36import pathlib
 37import re
 38import sys
 39import collections
 40
 41from typing import List, Dict, Iterable, Callable, Tuple, Set, Optional, Generator, Iterator, Counter
 42
 43root_dir = (pathlib.Path(__file__).parent / ".." / "..").resolve()
 44extensions_input_fn = root_dir / "Source" / "WebCore" / "platform" / "graphics" / "ExtensionsGL.h"
 45
 46functions_input_fns = [
 47 root_dir / "Source" / "WebKit" / "WebProcess" / "GPU" / "graphics" / "RemoteGraphicsContextGLProxy.h"
 48]
 49types_input_fn = root_dir / "Source" / "WebKit" / "WebProcess" / "GPU" / "graphics" / "RemoteGraphicsContextGLProxy.h"
 50
 51
 52template_preamble = """/* Copyright (C) 2020 Apple Inc. All rights reserved.
 53 *
 54 * Redistribution and use in source and binary forms, with or without
 55 * modification, are permitted provided that the following conditions
 56 * are met:
 57 * 1. Redistributions of source code must retain the above copyright
 58 * notice, this list of conditions and the following disclaimer.
 59 * 2. Redistributions in binary form must reproduce the above copyright
 60 * notice, this list of conditions and the following disclaimer in the
 61 * documentation and/or other materials provided with the distribution.
 62 *
 63 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
 64 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 65 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 66 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
 67 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 68 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 69 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 70 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 71 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 72 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 73 */
 74
 75// This file is generated by generate-gpup-webgl. Do not edit.
 76"""
 77context_functions_fn = root_dir / "Source" / "WebKit" / "GPUProcess" / "graphics" / "RemoteGraphicsContextGLFunctionsGenerated.h"
 78context_functions_template = (
 79 template_preamble
 80 + """// This file should be included in the private section of the
 81// RemoteGraphicsContextGL implementations.
 82#pragma once
 83{}
 84
 85"""
 86)
 87context_messages_fn = root_dir / "Source" / "WebKit" / "GPUProcess" / "graphics" / "RemoteGraphicsContextGL.messages.in"
 88context_messages_template = (
 89 template_preamble
 90 + """#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL) && PLATFORM(COCOA)
 91
 92messages -> RemoteGraphicsContextGL NotRefCounted {{
 93 void Reshape(int32_t width, int32_t height)
 94 void PrepareForDisplay() -> (MachSendRight displayBuffer) Synchronous
 95 void EnsureExtensionEnabled(String extension)
 96 void NotifyMarkContextChanged()
 97{}
 98}}
 99
 100#endif
 101
 102"""
 103)
 104
 105context_proxy_functions_fn = root_dir / "Source" / "WebKit" / "WebProcess" / "GPU" / "graphics" / "RemoteGraphicsContextGLProxyFunctionsGenerated.cpp"
 106context_proxy_functions_template = (
 107 template_preamble
 108 + """
 109#include "config.h"
 110#include "RemoteGraphicsContextGLProxy.h"
 111
 112#if ENABLE(GPU_PROCESS) && ENABLE(WEBGL) && PLATFORM(COCOA)
 113
 114namespace WebKit {{
 115{}
 116
 117}}
 118
 119#endif
 120
 121"""
 122)
 123
 124
 125def write_file(fn, new_contents):
 126 try:
 127 with open(fn) as f:
 128 if f.read() == new_contents:
 129 return
 130 except:
 131 pass
 132 with open(fn, "w") as f:
 133 f.write(new_contents)
 134
 135class cpp_type(object):
 136 type_name: str
 137
 138 def __init__(self, type_name : str):
 139 self.type_name = type_name
 140
 141 def __str__(self):
 142 return self.type_name
 143
 144 def __hash__(self):
 145 return hash(self.type_name)
 146
 147 def __repr__(self):
 148 return self.type_name
 149
 150 def __eq__(self, other):
 151 return self.type_name == other.type_name
 152
 153 def is_void(self) -> bool:
 154 return self.type_name in ["void", "GCGLvoid", "const void", "const GCGLvoid"]
 155
 156 def is_const(self) -> bool:
 157 return self.type_name.startswith("const ")
 158
 159 def is_container(self) -> bool:
 160 return False
 161
 162 def is_output_buffer_type(self) -> bool:
 163 return False
 164
 165 def is_span(self) -> bool:
 166 return False
 167
 168 def is_dynamic_span(self) -> bool:
 169 return False
 170
 171 def is_pointer(self) -> bool:
 172 return False
 173
 174 def is_const_pointer(self) -> bool:
 175 return False
 176
 177 def is_reference(self) -> bool:
 178 return False
 179
 180 def is_const_reference(self) -> bool:
 181 return False
 182
 183 def get_value_type(self) -> 'cpp_type':
 184 return self
 185
 186 def get_decay_type(self) -> 'cpp_type':
 187 if self.is_const():
 188 return get_cpp_type(self.type_name[6:])
 189 return self
 190
 191 def get_rvalue_type(self) -> 'cpp_type':
 192 return get_cpp_type(self.type_name + "&&")
 193
 194 def get_pointer_type(self) -> 'cpp_type':
 195 return get_cpp_type(self.type_name + "*")
 196
 197class cpp_type_container(cpp_type):
 198 def __init__(self, type_name : str, container_name : str, contained_type : cpp_type, arity : Optional[int] = None):
 199 cpp_type.__init__(self, type_name)
 200 self.container_name = container_name
 201 self.contained_type = contained_type
 202 self.arity = arity
 203 def is_container(self) -> bool:
 204 return True
 205 def is_span(self) -> bool:
 206 return self.container_name == "GCGLSpan"
 207 def is_dynamic_span(self) -> bool:
 208 return self.container_name == "GCGLSpan" and self.arity is None
 209 def get_container_name(self):
 210 return self.container_name
 211 def get_arity(self) -> Optional[int]:
 212 return self.arity
 213 def get_contained_type(self) -> cpp_type:
 214 return self.contained_type
 215 def is_output_buffer_type(self) -> bool:
 216 return self.contained_type.is_const()
 217
 218def create_cpp_type_container(type_name : str) -> Optional[cpp_type_container]:
 219 m = re.match(r"([\w:]+)<(.+)>$", type_name)
 220 if not m:
 221 return None
 222 container_name = m[1]
 223 templates = m[2]
 224 arity = None
 225 m = re.match(r"([^,]+),\s*(\d+)", templates)
 226 if m:
 227 templates = m[1]
 228 arity = int(m[2])
 229 return cpp_type_container(type_name, container_name, get_cpp_type(templates), arity)
 230
 231class cpp_type_function(cpp_type):
 232 def __init__(self, type_name : str, return_value_type : cpp_type, argument_types : List[cpp_type]):
 233 cpp_type.__init__(self, type_name)
 234 self.return_value_type = return_value_type
 235 self.argument_types = argument_types
 236
 237def cpp_split_args_specs(args_spec : str) -> Iterator[str]:
 238 # https://stackoverflow.com/questions/33527245/python-split-by-comma-skipping-the-content-inside-parentheses
 239 comma = r",(?!(?:[^<]*\<[^>]*\>)*[^<>]*\>)"
 240 return filter(None, [a.strip() for a in re.split(comma, args_spec.strip())])
 241
 242def create_cpp_type_function(type_name : str) -> Optional[cpp_type_function]:
 243 m = re.match(r'(.*)\((.*)\)', type_name)
 244 if not m:
 245 return None
 246 return_value_type = get_cpp_type(m[1])
 247 args_types = [get_cpp_type(a) for a in cpp_split_args_specs(m[2])]
 248 return cpp_type_function(type_name, return_value_type, args_types)
 249
 250# Pointer or refererence
 251class cpp_type_indirect(cpp_type):
 252 category : str
 253 value_type : cpp_type
 254
 255 def __init__(self, type_name : str, category : str, value_type : cpp_type):
 256 cpp_type.__init__(self, type_name)
 257 self.category = category
 258 self.value_type = value_type
 259
 260 def is_const_pointer(self):
 261 return self.category == '*' and self.is_const()
 262 def is_pointer(self):
 263 return self.category == '*' and not self.is_const()
 264 def is_const_reference(self):
 265 return self.category == '&' and self.is_const()
 266 def is_reference(self):
 267 return self.category == '&' and not self.is_const()
 268 def is_rvalue_reference(self):
 269 return self.category == '&&'
 270 def get_value_type(self):
 271 return self.value_type
 272
 273def create_cpp_type_indirect(type_name : str) -> Optional[cpp_type_indirect]:
 274 m = re.match(r"const (.+)&&$", type_name)
 275 if not m:
 276 m = re.match(r"(.+)&&$", type_name)
 277 if m:
 278 return cpp_type_indirect(type_name, '&&', get_cpp_type(m[1]))
 279 m = re.match(r"const (.+)&$", type_name)
 280 if not m:
 281 m = re.match(r"(.+)&$", type_name)
 282 if m:
 283 return cpp_type_indirect(type_name, '&', get_cpp_type(m[1]))
 284 m = re.match(r"const (.+)\*$", type_name)
 285 if not m:
 286 m = re.match(r"(.+)\*$", type_name)
 287 if m:
 288 return cpp_type_indirect(type_name, '*', get_cpp_type(m[1]))
 289 return None
 290
 291
 292class cpp_expr(object):
 293 type: cpp_type
 294 expr: str
 295
 296 def __init__(self, type: cpp_type, expr: str):
 297 self.type = type
 298 self.expr = expr
 299
 300 def __str__(self):
 301 return self.expr
 302
 303
 304CppExprConverter = Callable[[cpp_expr, cpp_type], cpp_expr]
 305
 306
 307def cpp_reinterpret_cast_from_pointer_through(cast_through_type : cpp_type) -> Callable[[cpp_expr, cpp_type], cpp_expr]:
 308 def cpp_reinterpret_cast_from_pointer(expr: cpp_expr, type: cpp_type) -> cpp_expr:
 309 return cpp_expr(type, f"static_cast<{type.type_name}>(reinterpret_cast<{str(cast_through_type)}>({str(expr)}))")
 310 return cpp_reinterpret_cast_from_pointer
 311
 312def cpp_reinterpret_cast_to_pointer_through(cast_through_type : cpp_type) -> Callable[[cpp_expr, cpp_type], cpp_expr]:
 313 def cpp_reinterpret_cast_to_pointer(expr: cpp_expr, type: cpp_type) -> cpp_expr:
 314 return cpp_expr(type, f"reinterpret_cast<{type.type_name}>(static_cast<{str(cast_through_type)}>({str(expr)}))")
 315 return cpp_reinterpret_cast_to_pointer
 316
 317def cpp_static_cast(expr: cpp_expr, type: cpp_type) -> cpp_expr:
 318 return cpp_expr(type, f"static_cast<{type.type_name}>({str(expr)})")
 319
 320
 321def cpp_implicit_cast(expr: cpp_expr, type: cpp_type) -> cpp_expr:
 322 return cpp_expr(type, str(expr))
 323
 324
 325def cpp_array_reinterpret_cast_conversion(expr: cpp_expr, type: cpp_type_container) -> cpp_expr:
 326 element_pointer_type = type.get_contained_type().get_pointer_type()
 327 return cpp_expr(type, f"{str(type)}(reinterpret_cast<{element_pointer_type}>({str(expr)}.data()), {str(expr)}.size())")
 328
 329def webkit_ipc_span_transfer_type_reinterpret_cast_conversion(expr: cpp_expr, type: cpp_type_container) -> cpp_expr:
 330 element_pointer_type = type.get_contained_type().get_pointer_type()
 331 return cpp_expr(type, f"{str(type)}(reinterpret_cast<const {element_pointer_type}>({str(expr)}.data), {str(expr)}.bufSize)")
 332
 333def cpp_move_expr(expr: cpp_expr) -> cpp_expr:
 334 return cpp_expr(expr.type.get_rvalue_type(), f"WTFMove({str(expr)})")
 335
 336
 337cpp_types: Dict[str, cpp_type] = {}
 338
 339cpp_type_constructors : List[Callable[[str], Optional[cpp_type]]] = [
 340 create_cpp_type_function,
 341 create_cpp_type_container,
 342 create_cpp_type_indirect
 343]
 344
 345def get_cpp_type(type_name: str):
 346 r = cpp_types.get(type_name, None)
 347 if r:
 348 return r
 349 for type_constr in cpp_type_constructors:
 350 r = type_constr(type_name)
 351 if r:
 352 break
 353 if not r:
 354 r = cpp_type(type_name)
 355 cpp_types[type_name] = r
 356 return r
 357
 358
 359class cpp_arg(object):
 360 name: str
 361 type: cpp_type
 362
 363 def __init__(self, type: cpp_type, name: str):
 364 self.name = name
 365 self.type = type
 366
 367 def __str__(self):
 368 return "{} {}".format(self.type, self.name)
 369
 370
 371class cpp_decl(object):
 372 type: cpp_type
 373 name: str
 374
 375 def __init__(self, type: cpp_type, name: str):
 376 self.type = type
 377 self.name = name
 378
 379 def __str__(self):
 380 return f"{str(self.type)} {self.name}"
 381
 382
 383class cpp_arg_list(object):
 384 args: List[cpp_arg]
 385
 386 def __init__(self, args: List[cpp_arg]):
 387 self.args = args
 388
 389 def names(self):
 390 return ", ".join(a.name for a in self.args)
 391
 392 def exprs(self):
 393 return [cpp_expr(a.type, a.name) for a in self.args]
 394
 395 def decls(self):
 396 return [cpp_decl(a.type, a.name) for a in self.args]
 397
 398 def types(self):
 399 return [a.type for a in self.args]
 400
 401 def __str__(self):
 402 return ", ".join(str(a) for a in self.args)
 403
 404
 405class cpp_func(object):
 406 name: str
 407 args: cpp_arg_list
 408 return_type: cpp_type
 409 is_extension: bool
 410 overload_suffix: str
 411
 412 def __init__(self, name: str, return_type: cpp_type, args: cpp_arg_list, is_extension: bool):
 413 self.name = name
 414 self.return_type = return_type
 415 self.args = args
 416 self.is_extension = is_extension
 417 self.overload_suffix = ""
 418
 419 def __str__(self):
 420 return f"{self.return_type} {self.name}({str(self.args)})"
 421
 422 def get_args_categories(self) -> Tuple[List[cpp_arg], List[cpp_arg]]:
 423 in_args = []
 424 out_args = []
 425 for a in self.args.args:
 426 #fmt: off
 427 if a.type.is_pointer() or \
 428 a.type.is_reference():
 429 out_args += [a]
 430 elif isinstance(a.type, cpp_type_container) and (((a.type.is_span() or a.type.is_dynamic_span()) and not a.type.get_contained_type().is_const())):
 431 out_args += [a]
 432 else:
 433 in_args += [a]
 434 #fmt: on
 435 return in_args, out_args
 436
 437 def is_implemented_type(self, type: cpp_type):
 438 if type.is_const_pointer():
 439 return False
 440 return True
 441
 442 def is_implemented(self):
 443 #" in a.type.type_name for a in self.args.args):
 444 # return False
 445 #if "GCGLsync" in self.return_type.type_name:
 446 # return False
 447 if any(a.name == "bufSize" for a in self.args.args):
 448 return False
 449 if any(a.type.is_pointer() and a.type.get_value_type().is_void() for a in self.args.args):
 450 return False
 451 if any(not self.is_implemented_type(a.type) for a in self.args.args):
 452 return False
 453 if self.return_type.is_pointer():
 454 return False
 455 if not self.is_implemented_type(self.return_type):
 456 return False
 457 return True
 458
 459
 460webkit_ipc_types: Dict[cpp_type, cpp_type] = {}
 461
 462webkit_ipc_types_converters: Dict[Tuple[cpp_type, cpp_type], CppExprConverter] = {}
 463
 464
 465def webkit_ipc_convert_expr(expr: cpp_expr, type: cpp_type) -> cpp_expr:
 466 """ Converts `expr` of type of `self` to `type` """
 467 convert = webkit_ipc_types_converters.get((expr.type, type), None)
 468 if not convert:
 469 if expr.type == type:
 470 return expr
 471 convert = cpp_implicit_cast
 472 return convert(expr, type)
 473
 474
 475def webkit_ipc_get_span_transfer_type(type : cpp_type_container) -> cpp_type:
 476 element_type = type.get_contained_type().get_decay_type()
 477 arity = type.get_arity()
 478 webkit_ipc_element_type = webkit_ipc_types[element_type] if not element_type.is_void() else get_cpp_type('uint8_t')
 479 if arity is not None:
 480 return get_cpp_type(f"IPC::ArrayReference<{str(webkit_ipc_element_type)}, {arity}>")
 481 return get_cpp_type(f"IPC::ArrayReference<{str(webkit_ipc_element_type)}>")
 482
 483
 484
 485def webkit_ipc_get_span_store_type(type: cpp_type_container) -> cpp_type:
 486 element_type = type.get_contained_type().get_decay_type()
 487 if element_type.is_void():
 488 element_type = get_cpp_type('GCGLchar')
 489 if type.is_dynamic_span():
 490 inline_capacity = 16 if "float" in element_type.type_name else 4
 491 return get_cpp_type(f"Vector<{str(element_type)}, {str(inline_capacity)}>")
 492 return get_cpp_type(f"std::array<{str(element_type)}, {str(type.get_arity())}>")
 493
 494def webkit_ipc_make_gcglspan_conversion(expr : cpp_expr, type : cpp_type_container) -> cpp_expr:
 495 pointer_cast_type = type.get_contained_type().get_pointer_type()
 496 if type.is_dynamic_span():
 497 return cpp_expr(type, f"makeGCGLSpan(reinterpret_cast<{str(pointer_cast_type)}>({str(expr)}.data()), {str(expr)}.size())")
 498
 499 assert(type.is_span())
 500 return cpp_expr(type, f"makeGCGLSpan<{str(type.get_arity())}>(reinterpret_cast<{str(pointer_cast_type)}>({str(expr)}.data()))")
 501
 502# See messages.py function_parameter_type
 503webkit_ipc_builtin_types = set(
 504 ["uint8_t", "uint16_t", "uint32_t", "uint64_t", "int8_t", "int16_t", "int32_t", "int64_t", "bool", "float", "double" "bool"]
 505)
 506
 507
 508def webkit_ipc_get_message_forwarder_type(type: cpp_type) -> cpp_type:
 509 if type.type_name in webkit_ipc_builtin_types:
 510 return type
 511 return type.get_rvalue_type()
 512
 513
 514def webkit_ipc_move_expr(expr: cpp_expr) -> cpp_expr:
 515 if expr.type.type_name in webkit_ipc_builtin_types:
 516 return expr
 517 return cpp_move_expr(expr)
 518
 519
 520def webkit_ipc_msg_name(func: cpp_func):
 521 return func.name[0].capitalize() + func.name[1:] + func.overload_suffix
 522
 523
 524class webkit_ipc_msg(object):
 525 name: str
 526 in_args: cpp_arg_list
 527 out_args: cpp_arg_list
 528
 529 def __init__(self, func: cpp_func):
 530 self.name = webkit_ipc_msg_name(func)
 531 in_args, out_args = func.get_args_categories()
 532 ipc_in_args = [cpp_arg(webkit_ipc_types[a.type], a.name) for a in in_args]
 533 ipc_out_args = []
 534 if not func.return_type.is_void():
 535 ipc_out_args += [cpp_arg(webkit_ipc_types[func.return_type], "returnValue")]
 536 for a in out_args:
 537 ipc_out_args += [cpp_arg(webkit_ipc_types[a.type], a.name)]
 538 if a.type.is_dynamic_span():
 539 ipc_in_args += [cpp_arg(get_cpp_type("uint64_t"), f"{a.name}Size")]
 540 self.in_args = cpp_arg_list(ipc_in_args)
 541 self.out_args = cpp_arg_list(ipc_out_args)
 542
 543 def __str__(self):
 544 if len(self.out_args.args):
 545 return f"\n void {self.name}({str(self.in_args)}) -> ({str(self.out_args)}) Synchronous"
 546 return f"\n void {self.name}({str(self.in_args)})"
 547
 548
 549class webkit_ipc_cpp_proxy_impl(object):
 550 name: str
 551 msg_name: str
 552 return_type: cpp_type
 553 args: cpp_arg_list
 554
 555 pre_call_stmts: List[str]
 556 call_stmts: List[str]
 557 post_call_stmts: List[str]
 558 return_stmts: List[str]
 559 in_exprs: List[cpp_expr]
 560 out_exprs: List[cpp_expr]
 561
 562 def __init__(self, cpp_func: cpp_func):
 563 self.name = cpp_func.name
 564 self.msg_name = webkit_ipc_msg_name(cpp_func)
 565 self.return_type = cpp_func.return_type
 566 self.args = cpp_func.args
 567 self.pre_call_stmts = []
 568 self.call_stmts = []
 569 self.post_call_stmts = []
 570 self.return_stmts = []
 571 self.in_exprs = []
 572 self.out_exprs = []
 573 in_args, out_args = cpp_func.get_args_categories()
 574 self.process_return_value(cpp_func.return_type)
 575 self.process_in_args(in_args)
 576 self.process_out_args(out_args)
 577 self.process_call()
 578
 579 def process_call(self):
 580 in_exprs = ", ".join([str(i) for i in self.in_exprs])
 581 out_exprs = ", ".join(str(o) for o in self.out_exprs)
 582 is_async = self.return_type.is_void() and len(out_exprs) == 0
 583 if is_async:
 584 self.call_stmts += [
 585 f"send(Messages::RemoteGraphicsContextGL::{self.msg_name}({in_exprs}), m_graphicsContextGLIdentifier);",
 586 ]
 587 else:
 588 send_result = ""
 589 if self.post_call_stmts:
 590 send_result = "auto sendResult = "
 591 self.post_call_stmts = [
 592 "if (sendResult)" + (" {" if len(self.post_call_stmts) > 1 else "")
 593 ] + [" " + s for s in self.post_call_stmts] + [
 594 ("}" if len(self.post_call_stmts) > 1 else "")
 595 ]
 596 self.call_stmts += [
 597 f"{send_result}sendSync(Messages::RemoteGraphicsContextGL::{self.msg_name}({in_exprs}), Messages::RemoteGraphicsContextGL::{self.msg_name}::Reply({out_exprs}), m_graphicsContextGLIdentifier, 10_s);",
 598 ]
 599
 600
 601 def process_in_args(self, in_args: List[cpp_arg]):
 602 for i in in_args:
 603 if i.type.is_const_pointer():
 604 assert False
 605 else:
 606 self.in_exprs += [webkit_ipc_convert_expr(cpp_expr(i.type, i.name), webkit_ipc_types[i.type])]
 607
 608 def process_out_args(self, out_args: List[cpp_arg]):
 609 for o in out_args:
 610 if o.type.is_pointer():
 611 value_type = o.type.get_value_type()
 612 webkit_ipc_value_type = webkit_ipc_types[value_type]
 613 v = cpp_arg(webkit_ipc_value_type, o.name + "Reply")
 614 self.pre_call_stmts += [f"{str(v.type)} {str(v.name)} = {{ }};"]
 615 e = cpp_expr(v.type, v.name)
 616 self.out_exprs += [e]
 617 self.post_call_stmts += [
 618 #fmt: off
 619 f"if ({o.name})",
 620 f" *{o.name} = {webkit_ipc_convert_expr(e, value_type)};"
 621 #fmt: on
 622 ]
 623 elif o.type.is_span():
 624 webkit_ipc_type = webkit_ipc_types[o.type]
 625 assert(isinstance(webkit_ipc_type, cpp_type_container))
 626 v = cpp_arg(webkit_ipc_type, o.name + "Reply")
 627 self.pre_call_stmts += [f"{str(v.type)} {str(v.name)};"]
 628 self.out_exprs += [cpp_expr(v.type, v.name)]
 629 if o.type.is_dynamic_span():
 630 self.in_exprs += [cpp_expr(get_cpp_type("size_t"), f"{o.name}.bufSize")]
 631 self.post_call_stmts += [
 632 f"memcpy({o.name}.data, {v.name}.data(), {o.name}.bufSize * sizeof({str(webkit_ipc_type.get_contained_type())}));"
 633 ]
 634 else:
 635 self.out_exprs += [cpp_expr(o.type, o.name)]
 636
 637 def process_return_value(self, return_type: cpp_type):
 638 if return_type.is_void():
 639 return
 640 self.return_type = return_type
 641 ipc_return_type = webkit_ipc_types[return_type]
 642 return_value_expr = cpp_expr(ipc_return_type, "returnValue")
 643 self.pre_call_stmts += [f"{return_value_expr.type} {return_value_expr.expr} = {{ }};"]
 644 self.out_exprs = [return_value_expr] + self.out_exprs
 645 self.return_stmts = [f"return {str(webkit_ipc_convert_expr(return_value_expr, return_type))};"]
 646
 647 def __str__(self):
 648 nolint = " // NOLINT" if "_" in self.name else ""
 649 body = "".join(f"\n {b}" for b in self.pre_call_stmts + self.call_stmts + self.post_call_stmts + self.return_stmts)
 650 return f"""\n{str(self.return_type)} RemoteGraphicsContextGLProxy::{self.name}({str(self.args)}){nolint}
 651{{{body}
 652}}"""
 653
 654
 655class webkit_ipc_cpp_proxy_placeholder(object):
 656 name: str
 657 return_type: cpp_type
 658 args: cpp_arg_list
 659 body: List[str]
 660
 661 def __init__(self, cpp_func: cpp_func):
 662 self.name = cpp_func.name
 663
 664 self.return_type = cpp_func.return_type
 665 self.args = cpp_func.args
 666 self.body = ["notImplemented();"]
 667 if cpp_func.return_type.type_name != "void":
 668 self.body += ["return { };"]
 669
 670 def __str__(self):
 671 nolint = " // NOLINT" if "_" in self.name else ""
 672 body = "\n{\n " + "\n ".join(self.body) + "\n}"
 673 return f"\n{str(self.return_type)} RemoteGraphicsContextGLProxy::{self.name}({str(self.args)}){nolint}{body}"
 674
 675
 676class context_proxy_cpp_webkit_ipc_generator(object):
 677 "RemoteGraphicsContextGLProxy C++ implementation generator."
 678 impls: List[webkit_ipc_cpp_proxy_impl]
 679 unimpls: List[webkit_ipc_cpp_proxy_placeholder]
 680
 681 def __init__(self, funcs: Iterable[cpp_func], unimplemented: Iterable[cpp_func]):
 682 self.impls = [webkit_ipc_cpp_proxy_impl(f) for f in funcs]
 683 self.unimpls = [webkit_ipc_cpp_proxy_placeholder(f) for f in unimplemented]
 684
 685 def get_functions(self):
 686 return "\n".join(str(i) for i in self.impls + self.unimpls)
 687
 688 def generate(self):
 689 write_file(
 690 context_proxy_functions_fn,
 691 context_proxy_functions_template.format(self.get_functions()),
 692 )
 693
 694
 695class webkit_ipc_cpp_impl(object):
 696 name: str
 697 args: cpp_arg_list
 698 is_extension: bool
 699 pre_call_stmts: List[str]
 700 call_stmts: List[str]
 701 post_call_stmts: List[str]
 702 in_exprs: List[cpp_expr]
 703 out_exprs: List[cpp_expr]
 704 return_value_expr: Optional[cpp_expr]
 705
 706 def __init__(self, cpp_func: cpp_func):
 707 self.name = cpp_func.name
 708 self.overload_suffix = cpp_func.overload_suffix
 709 self.args = cpp_arg_list([])
 710 self.is_extension = cpp_func.is_extension
 711 self.pre_call_stmts = []
 712 self.call_stmts = []
 713 self.post_call_stmts = []
 714 self.in_exprs = []
 715 self.out_exprs = []
 716 self.return_value_expr = None
 717
 718 self.process_return_value(cpp_func.return_type)
 719 in_args, out_args = cpp_func.get_args_categories()
 720 self.process_args(cpp_func.args.args, set(in_args), set(out_args))
 721 self.process_call()
 722
 723 def process_call(self):
 724 ext = "getExtensions()." if self.is_extension else ""
 725
 726 in_exprs = ", ".join(str(e) for e in self.in_exprs)
 727 is_async = len(self.out_exprs) == 0
 728
 729 call_expr = f"m_context->{ext}{self.name}({in_exprs})"
 730 if not self.return_value_expr:
 731 self.call_stmts += [f"{call_expr};"]
 732 else:
 733 self.call_stmts += [f"{str(self.return_value_expr)} = {call_expr};"]
 734 if not is_async:
 735 out_exprs = ", ".join(str(e) for e in self.out_exprs)
 736 self.post_call_stmts += [f"completionHandler({out_exprs});"]
 737
 738 def process_args(self, args: List[cpp_arg], in_args: Set[cpp_arg], out_args: Set[cpp_arg]):
 739 for a in args:
 740 if a.type.is_const_pointer():
 741 assert False
 742 if a in in_args:
 743 self.process_in_arg(a)
 744 else:
 745 self.process_out_arg(a)
 746 if self.out_exprs:
 747 out_arg_decls = ", ".join(f"{str(e.type)}" for e in self.out_exprs)
 748 self.args.args += [cpp_arg(get_cpp_type(f"CompletionHandler<void({out_arg_decls})>&&"), "completionHandler")]
 749
 750 def process_in_arg(self, a: cpp_arg):
 751 self.args.args += [cpp_arg(webkit_ipc_get_message_forwarder_type(webkit_ipc_types[a.type]), a.name)]
 752 self.in_exprs += [webkit_ipc_convert_expr(cpp_expr(webkit_ipc_types[a.type], a.name), a.type)]
 753
 754 def process_out_arg(self, a: cpp_arg):
 755 if a.type.is_pointer():
 756 value_arg = cpp_arg(a.type.get_value_type(), a.name)
 757 self.pre_call_stmts += [f"{str(value_arg.type)} {str(value_arg.name)} = {{ }};"]
 758 self.in_exprs += [cpp_expr(a.type, f"&{value_arg.name}")]
 759 e = cpp_expr(value_arg.type, value_arg.name)
 760 webkit_ipc_value_type = webkit_ipc_types[e.type]
 761 self.out_exprs += [webkit_ipc_convert_expr(e, webkit_ipc_value_type)]
 762 elif a.type.is_dynamic_span():
 763 assert(isinstance(a.type, cpp_type_container))
 764 size_arg = cpp_arg(get_cpp_type("uint64_t"), f"{a.name}Size")
 765 self.args.args += [size_arg]
 766 store_arg = cpp_arg(webkit_ipc_get_span_store_type(a.type), a.name)
 767 self.pre_call_stmts += [f"{str(store_arg.type)} {str(store_arg.name)}(static_cast<size_t>({a.name}Size), 0);"]
 768 self.in_exprs += [cpp_expr(store_arg.type, f"{store_arg.name}")]
 769 webkit_ipc_type = webkit_ipc_types[a.type]
 770 self.out_exprs += [webkit_ipc_convert_expr(cpp_expr(store_arg.type, store_arg.name), webkit_ipc_type)]
 771 elif a.type.is_span():
 772 assert(isinstance(a.type, cpp_type_container))
 773 store_arg = cpp_arg(webkit_ipc_get_span_store_type(a.type), a.name)
 774 self.pre_call_stmts += [f"{str(store_arg.type)} {str(store_arg.name)} {{ }};"]
 775 self.in_exprs += [cpp_expr(store_arg.type, store_arg.name)]
 776 webkit_ipc_type = webkit_ipc_types[a.type]
 777 self.out_exprs += [webkit_ipc_convert_expr(cpp_expr(store_arg.type, store_arg.name), webkit_ipc_type)]
 778 else:
 779 assert a.type.is_reference()
 780 webkit_ipc_type = webkit_ipc_types[a.type]
 781 value_arg = cpp_arg(a.type.get_value_type(), a.name)
 782 self.pre_call_stmts += [f"{self.ns(value_arg.type)} {str(value_arg.name)} {{ }};"]
 783 e = cpp_expr(value_arg.type, value_arg.name)
 784 self.in_exprs += [e]
 785 self.out_exprs += [webkit_ipc_move_expr(webkit_ipc_convert_expr(e, webkit_ipc_type))]
 786
 787 def process_return_value(self, return_type: cpp_type):
 788 if return_type.is_void():
 789 return
 790 ipc_return_type = webkit_ipc_types[return_type]
 791 return_value_expr = cpp_expr(return_type, "returnValue")
 792 self.pre_call_stmts += [f"{return_value_expr.type} {return_value_expr.expr} = {{ }};"]
 793 self.out_exprs += [webkit_ipc_move_expr(webkit_ipc_convert_expr(return_value_expr, ipc_return_type))]
 794 self.return_value_expr = return_value_expr
 795
 796 def __str__(self):
 797 body = "".join(f"\n {b}" for b in self.pre_call_stmts + self.call_stmts + self.post_call_stmts)
 798 return f""" void {self.name}{self.overload_suffix}({str(self.args)})
 799 {{{body}
 800 }}"""
 801
 802 def ns(self, type: cpp_type):
 803 # TODO: namespace info is not stored in names.
 804 if type.type_name == "ActiveInfo":
 805 return "WebCore::GraphicsContextGL::" + str(type)
 806 return str(type)
 807
 808def webkit_ipc_resolve_overload_suffix(funcs : Iterable[cpp_func]):
 809 counts = collections.Counter(f.name for f in funcs)
 810 suffixes : Counter[str] = collections.Counter()
 811 for f in funcs:
 812 if counts[f.name] > 1:
 813 f.overload_suffix = str(suffixes[f.name])
 814 suffixes.update([f.name])
 815
 816
 817class context_cpp_webkit_ipc_generator(object):
 818 "RemoteGraphicsContextGL C++ implementation generator."
 819 impls: List[webkit_ipc_cpp_impl]
 820
 821 def __init__(self, funcs: Iterable[cpp_func]):
 822 self.impls = [webkit_ipc_cpp_impl(f) for f in funcs]
 823
 824 def get_functions(self):
 825 return "\n".join(str(i) for i in self.impls)
 826
 827 def generate(self):
 828 write_file(
 829 context_functions_fn,
 830 context_functions_template.format(self.get_functions()),
 831 )
 832
 833
 834class context_msg_webkit_ipc_generator(object):
 835 "RemoteGraphicsContextGL WebKit IPC message definition generator."
 836 msgs: List[webkit_ipc_msg]
 837
 838 def __init__(self, funcs: Iterable[cpp_func]):
 839 self.msgs = [webkit_ipc_msg(f) for f in funcs]
 840
 841 def get_messages(self):
 842 return "".join(str(m) for m in self.msgs)
 843
 844 def generate(self):
 845 write_file(context_messages_fn, context_messages_template.format(self.get_messages()))
 846
 847
 848def create_cpp_arg(arg_spec: str, arg_index: int):
 849 r = arg_spec.rsplit(" ", 1)
 850 name = ""
 851 type = None
 852 if len(r) > 1 and r[0] != "const":
 853 name = r[1].strip()
 854 type = get_cpp_type(r[0])
 855 else:
 856 name = "arg{}".format(arg_index)
 857 type = get_cpp_type(arg_spec)
 858 return cpp_arg(type, name)
 859
 860
 861def create_cpp_arg_list(args_specs: Iterable[str]):
 862 return cpp_arg_list([create_cpp_arg(arg_spec=e, arg_index=i) for i, e in enumerate(args_specs)])
 863
 864
 865def create_cpp_func(name: str, return_spec: str, args_specs: List[str], is_extension: bool):
 866 return cpp_func(name=name, return_type=get_cpp_type(return_spec), args=create_cpp_arg_list(args_specs), is_extension=is_extension)
 867
 868
 869def read_lines_until(lines : Iterable[str], match : str) -> Generator[str, None, None]:
 870 for line in lines:
 871 if re.match(match, line.strip()):
 872 break
 873 yield line
 874
 875def main():
 876 parser = argparse.ArgumentParser("usage: %prog [options]")
 877 parser.add_argument("--verbose", action="store_true", help="Print some debug info from the generator script")
 878 options = parser.parse_args()
 879
 880 # Construct the list of functions to remote from web process to GPU process.
 881
 882 # FIXME: Until extensions header is removed, we need to complicate the implementation
 883 # with the distinction of whether a function is or is not an extension function.
 884 extension_signatures : Set[str] = set()
 885 with open(extensions_input_fn) as f:
 886 for line in f.readlines():
 887 m = re.match(r".*virtual (\S+)\s+(\w+)\((.*)\) = 0;", line)
 888 if m:
 889 func = create_cpp_func(
 890 name=m[2],
 891 return_spec=m[1],
 892 args_specs=cpp_split_args_specs(m[3]),
 893 is_extension=True,
 894 )
 895 extension_signatures.update([str(func)])
 896 funcs = []
 897 unimplemented = []
 898 for fn in functions_input_fns:
 899 with open(fn) as f:
 900 lines = iter(f.readlines())
 901 for _ in read_lines_until(lines, "// Functions with a generated implementation. This list is used by generate-gpup-webgl script."):
 902 pass
 903
 904 for line in read_lines_until(lines, "// End of list used by generate-gpup-webgl script."):
 905 m = re.match(r"\s*(\S+)\s+(\w+)\((.*)\) final;", line)
 906 if m:
 907 func_name = m[2]
 908 func = create_cpp_func(
 909 name=func_name,
 910 return_spec=m[1],
 911 args_specs=cpp_split_args_specs(m[3]),
 912 is_extension=False,
 913 )
 914 func.is_extension = str(func) in extension_signatures
 915 if func.is_implemented():
 916 funcs.append(func)
 917 else:
 918 unimplemented.append(func)
 919
 920
 921 webkit_ipc_resolve_overload_suffix(funcs)
 922 # Initialize WebKit IPC generation. Construct type mappings for the used C++ types -> IPC types.
 923 # TODO: namespacing issues.
 924 ai_type = get_cpp_type("ActiveInfo&")
 925 ai_transfer_type = get_cpp_type("WebCore::GraphicsContextGL::ActiveInfo")
 926 webkit_ipc_types[ai_type] = ai_transfer_type
 927
 928 with open(types_input_fn) as f:
 929 lines = iter(f.readlines())
 930 for _ in read_lines_until(lines, "// The GCGL types map to following WebKit IPC types. The list is used by generate-gpup-webgl script."):
 931 pass
 932 for line in read_lines_until(lines, "// End of list used by generate-gpup-webgl script."):
 933 m = re.match(r".*static_assert\(std::is_same_v<(\w+), (\w+)>\);", line)
 934 if m:
 935 webkit_ipc_types[get_cpp_type(m[1])] = get_cpp_type(m[2])
 936 continue
 937 m = re.match(r".*static_assert\(sizeof\((\w+)\) == sizeof\((\w+)\) && sizeof\((\w+)\) == sizeof\((\w+)\)\);", line)
 938 if m:
 939 cpp_type = get_cpp_type(m[1])
 940 ipc_type = get_cpp_type(m[2])
 941 cpp_cast_through_type = get_cpp_type(m[4])
 942 webkit_ipc_types[cpp_type] = ipc_type
 943 webkit_ipc_types_converters[(cpp_type, ipc_type)] = cpp_reinterpret_cast_from_pointer_through(cpp_cast_through_type)
 944 webkit_ipc_types_converters[(ipc_type, cpp_type)] = cpp_reinterpret_cast_to_pointer_through(cpp_cast_through_type)
 945 continue
 946 m = re.match(r".*static_assert\(sizeof\((\w+)\) == sizeof\((\w+)\)\);", line)
 947 if m:
 948 cpp_type = get_cpp_type(m[1])
 949 ipc_type = get_cpp_type(m[2])
 950 webkit_ipc_types[cpp_type] = ipc_type
 951 webkit_ipc_types_converters[(cpp_type, ipc_type)] = cpp_static_cast
 952 webkit_ipc_types_converters[(ipc_type, cpp_type)] = cpp_static_cast
 953 continue
 954 # For all types in the input API, form corresponding IPC types and conversions.
 955 # TODO: this is not driven by the typing.
 956 all_types = set()
 957 for func in funcs:
 958 all_types.update(func.args.types() + [func.return_type])
 959 # Sort by len so that template args come before templates.
 960 for cpp_type in sorted(all_types, key=lambda x: len(x.type_name)):
 961 if cpp_type in webkit_ipc_types:
 962 continue
 963
 964 if cpp_type.is_dynamic_span() or cpp_type.is_span():
 965 transfer_type = webkit_ipc_get_span_transfer_type(cpp_type)
 966 webkit_ipc_types[cpp_type] = transfer_type.get_value_type()
 967 if cpp_type.get_contained_type().is_const():
 968 webkit_ipc_types_converters[(cpp_type, transfer_type)] = webkit_ipc_span_transfer_type_reinterpret_cast_conversion
 969 webkit_ipc_types_converters[(transfer_type, cpp_type)] = webkit_ipc_make_gcglspan_conversion
 970 else:
 971 store_type = webkit_ipc_get_span_store_type(cpp_type)
 972 webkit_ipc_types_converters[(store_type, transfer_type)] = cpp_array_reinterpret_cast_conversion
 973 elif cpp_type.is_reference() or cpp_type.is_const_reference() or cpp_type.is_container():
 974 value_type = cpp_type.get_value_type() if not cpp_type.is_container() else cpp_type
 975 if value_type.is_container():
 976 contained_type = value_type.get_contained_type()
 977 webkit_ipc_contained_type = webkit_ipc_types[contained_type]
 978 if webkit_ipc_contained_type == contained_type:
 979 webkit_ipc_types[cpp_type] = value_type
 980 else:
 981 transfer_type = get_cpp_type(f"{value_type.get_container_name()}<{str(webkit_ipc_contained_type)}>")
 982 webkit_ipc_types[cpp_type] = transfer_type
 983 # TODO: Here might be case where Vector<GCGLint> was used in the interface and Vector<int32_t> is used
 984 # in the IPC definition. There is no sensible way to do this at the moment. We do not convert, rather
 985 # expect that all the invocations are taken care of the fact that GCGLint is the same type as int32_t.
 986 # This will not hold for all types such as GCGLboolean.
 987 #webkit_ipc_types_converters[(cpp_type, transfer_type)] = cpp_array_reinterpret_cast_conversion
 988 else:
 989 webkit_ipc_types[cpp_type] = value_type
 990 else:
 991 webkit_ipc_types[cpp_type] = cpp_type.get_value_type()
 992
 993 # The input to the generators is list of functions to remote.
 994 # Run the various generators.
 995 generators = [
 996 context_proxy_cpp_webkit_ipc_generator(funcs, unimplemented),
 997 context_msg_webkit_ipc_generator(funcs),
 998 context_cpp_webkit_ipc_generator(funcs),
 999 ]
 1000 for g in generators:
 1001 g.generate()
 1002
 1003 if options.verbose:
 1004 print("Implemented:")
 1005 print("".join(f" {str(i)} final\n" for i in funcs))
 1006 print("Unimplemented:")
 1007 print("".join(f" {str(u)} final\n" for u in unimplemented))
 1008 print(f"Implemented: {len(funcs)}, unimplemented: {len(unimplemented)}, total: {len(funcs)+len(unimplemented)}")
 1009 print("C++ type map to WebKit IPC type map:")
 1010 for _, t in cpp_types.items():
 1011 if t in webkit_ipc_types:
 1012 print(f" {str(t)} -> {str(webkit_ipc_types[t])}")
 1013 print("C++ types without WebKit IPC type:")
 1014 for _, t in cpp_types.items():
 1015 if t not in webkit_ipc_types:
 1016 print(f" {str(t)}")
 1017 print("WebKit IPC type conversions")
 1018 for (a, b), converter in webkit_ipc_types_converters.items():
 1019 print(f" {str(a)} -> {str(b)} : {converter.__name__}")
 1020 print("Done.")
 1021 return 0
 1022
 1023
 1024if __name__ == "__main__":
 1025 sys.exit(main())

LayoutTests/gpu-process/TestExpectations

@@http/tests/security/webgl-remote-read-remote-image-allowed-with-credentials.html
317317http/tests/webgl [ Skip ]
318318js/shared-array-buffer-webgl.html [ Skip ]
319319
 320webkit.org/b/218184 fast/canvas/webgl/texImage2D-mse-flipY-false.html [ Timeout ]
 321webkit.org/b/218184 fast/canvas/webgl/texImage2D-mse-flipY-true.html [ Timeout ]
 322webkit.org/b/219349 fast/canvas/webgl/context-update-on-display-configuration.html [ Timeout ]
 323webkit.org/b/219349 fast/canvas/webgl/webglcontextchangedevent.html [ Timeout ]
 324webkit.org/b/219351 fast/canvas/webgl/gl-pixelstorei.html [ Failure ]
 325webkit.org/b/219351 fast/canvas/webgl/premultiplyalpha-test.html [ Failure ]
 326webkit.org/b/219352 fast/canvas/webgl/lose-context-on-status-failure.html [ Failure ]
 327
320328webgpu [ Skip ]
321329
322330accessibility/press-works-on-control-types.html [ Skip ]