EXT_draw_buffers needs implementation
https://bugs.webkit.org/show_bug.cgi?id=109331

Reviewed by Kenneth Russell.

Source/Platform: 

Add EXT_draw_buffers support for chromium port.

* chromium/public/WebGraphicsContext3D.h:
(WebGraphicsContext3D):
(WebKit::WebGraphicsContext3D::drawBuffersEXT):

Source/WebCore: 

This patch adds support for EXT_draw_buffers for WebGL.
mac OpenGL port is passing khronos WebGL conformance test with this patch. OpenGL ES port implementation isn't added in this patch.
Also, it has the WebKit side support for chromium port, but pending command buffer implementation.

Besides the basic extension implementation, we also added drawBuffers() wrapper to work around a mac driver bug: i.e., do not enable a buffer if there is no attachment added.

* CMakeLists.txt:
* DerivedSources.make:
* DerivedSources.pri:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSWebGLRenderingContextCustom.cpp:
(WebCore::toJS):
* bindings/v8/V8Binding.h:
(WebCore):
(WebCore::toInt32):
(WebCore::toUInt32):
(WebCore::toFloat):
(WebCore::toInt64):
* bindings/v8/custom/V8WebGLRenderingContextCustom.cpp:
(WebCore::toV8Object):
* html/canvas/EXTDrawBuffers.cpp: Added.
(WebCore):
(WebCore::EXTDrawBuffers::EXTDrawBuffers):
(WebCore::EXTDrawBuffers::~EXTDrawBuffers):
(WebCore::EXTDrawBuffers::getName):
(WebCore::EXTDrawBuffers::create):
(WebCore::EXTDrawBuffers::supported):
(WebCore::EXTDrawBuffers::drawBuffersEXT):
* html/canvas/EXTDrawBuffers.h: Added.
(WebCore):
(EXTDrawBuffers):
* html/canvas/EXTDrawBuffers.idl: Added.
* html/canvas/WebGLExtension.h:
* html/canvas/WebGLFramebuffer.cpp:
(WebCore::WebGLFramebuffer::setAttachmentForBoundFramebuffer):
(WebCore::WebGLFramebuffer::removeAttachmentFromBoundFramebuffer):
(WebCore::WebGLFramebuffer::drawBuffers):
(WebCore):
(WebCore::WebGLFramebuffer::drawBuffersIfNecessary):
* html/canvas/WebGLFramebuffer.h:
(WebGLFramebuffer):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore):
(WebCore::WebGLRenderingContext::initializeNewContext):
(WebCore::WebGLRenderingContext::framebufferRenderbuffer):
(WebCore::WebGLRenderingContext::getExtension):
(WebCore::WebGLRenderingContext::getParameter):
(WebCore::WebGLRenderingContext::getSupportedExtensions):
(WebCore::WebGLRenderingContext::validateFramebufferFuncParameters):
(WebCore::WebGLRenderingContext::getMaxDrawBuffers):
(WebCore::WebGLRenderingContext::getMaxColorAttachments):
* html/canvas/WebGLRenderingContext.h:
(WebCore):
(WebGLRenderingContext):
* platform/chromium/support/Extensions3DChromium.cpp:
(WebCore::Extensions3DChromium::drawBuffersEXT):
(WebCore):
* platform/graphics/Extensions3D.h:
(Extensions3D):
* platform/graphics/GraphicsContext3D.cpp:
(WebCore::GraphicsContext3D::getClearBitsByAttachmentType):
* platform/graphics/chromium/Extensions3DChromium.h:
(Extensions3DChromium):
* platform/graphics/opengl/Extensions3DOpenGL.cpp:
(WebCore::Extensions3DOpenGL::supportsExtension):
(WebCore::Extensions3DOpenGL::drawBuffersEXT):
(WebCore):
* platform/graphics/opengl/Extensions3DOpenGL.h:
(Extensions3DOpenGL):
* platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
(WebCore::Extensions3DOpenGLCommon::ensureEnabled):
* platform/graphics/opengl/Extensions3DOpenGLCommon.h:
(Extensions3DOpenGLCommon):
* platform/graphics/opengl/Extensions3DOpenGLES.cpp:
(WebCore::Extensions3DOpenGLES::drawBuffersEXT):
(WebCore):
(WebCore::Extensions3DOpenGLES::supportsExtension):
* platform/graphics/opengl/Extensions3DOpenGLES.h:
(Extensions3DOpenGLES):


git-svn-id: https://svn.webkit.org/repository/webkit/trunk/Source/Platform/chromium/public@144358 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 file changed
tree: 7eaed0b5dd44243ef3a5a245c513b256e93199d6
  1. android/
  2. default/
  3. linux/
  4. mac/
  5. win/
  6. Platform.h
  7. WebAnimation.h
  8. WebAnimationCurve.h
  9. WebAnimationDelegate.h
  10. WebAudioBus.h
  11. WebAudioDestinationConsumer.h
  12. WebAudioDevice.h
  13. WebBlobData.h
  14. WebBlobRegistry.h
  15. WebCanvas.h
  16. WebClipboard.h
  17. WebColor.h
  18. WebCommon.h
  19. WebCompositorOutputSurface.h
  20. WebCompositorSupport.h
  21. WebContentLayer.h
  22. WebContentLayerClient.h
  23. WebCookie.h
  24. WebCookieJar.h
  25. WebCString.h
  26. WebData.h
  27. WebDiscardableMemory.h
  28. WebDragData.h
  29. WebExternalTextureLayer.h
  30. WebExternalTextureLayerClient.h
  31. WebFileInfo.h
  32. WebFileSystem.h
  33. WebFileUtilities.h
  34. WebFilterOperation.h
  35. WebFilterOperations.h
  36. WebFlingAnimator.h
  37. WebFloatAnimationCurve.h
  38. WebFloatKeyframe.h
  39. WebFloatPoint.h
  40. WebFloatQuad.h
  41. WebFloatRect.h
  42. WebGamepad.h
  43. WebGamepads.h
  44. WebGestureCurve.h
  45. WebGestureCurveTarget.h
  46. WebGraphicsContext3D.h
  47. WebGraphicsMemoryAllocation.h
  48. WebGraphicsMemoryStats.h
  49. WebHTTPBody.h
  50. WebHTTPHeaderVisitor.h
  51. WebHTTPLoadInfo.h
  52. WebHyphenator.h
  53. WebImage.h
  54. WebImageLayer.h
  55. WebInputHandler.h
  56. WebInputHandlerClient.h
  57. WebIOSurfaceLayer.h
  58. WebLayer.h
  59. WebLayerScrollClient.h
  60. WebLayerTreeView.h
  61. WebLayerTreeViewClient.h
  62. WebLocalizedString.h
  63. WebMediaConstraints.h
  64. WebMediaStream.h
  65. WebMediaStreamCenter.h
  66. WebMediaStreamCenterClient.h
  67. WebMediaStreamSource.h
  68. WebMediaStreamSourcesRequest.h
  69. WebMediaStreamTrack.h
  70. WebMessagePortChannel.h
  71. WebMessagePortChannelClient.h
  72. WebMimeRegistry.h
  73. WebNonCopyable.h
  74. WebPluginListBuilder.h
  75. WebPoint.h
  76. WebPrerender.h
  77. WebPrerenderingSupport.h
  78. WebPrivateOwnPtr.h
  79. WebPrivatePtr.h
  80. WebRect.h
  81. WebReferrerPolicy.h
  82. WebRenderingStats.h
  83. WebRTCConfiguration.h
  84. WebRTCDataChannelHandler.h
  85. WebRTCDataChannelHandlerClient.h
  86. WebRTCDTMFSenderHandler.h
  87. WebRTCDTMFSenderHandlerClient.h
  88. WebRTCICECandidate.h
  89. WebRTCPeerConnectionHandler.h
  90. WebRTCPeerConnectionHandlerClient.h
  91. WebRTCSessionDescription.h
  92. WebRTCSessionDescriptionRequest.h
  93. WebRTCStatsRequest.h
  94. WebRTCStatsResponse.h
  95. WebRTCVoidRequest.h
  96. WebScreenInfo.h
  97. WebScrollbar.h
  98. WebScrollbarLayer.h
  99. WebScrollbarThemeGeometry.h
  100. WebScrollbarThemePainter.h
  101. WebSharedGraphicsContext3D.h
  102. WebSize.h
  103. WebSocketStreamError.h
  104. WebSocketStreamHandle.h
  105. WebSocketStreamHandleClient.h
  106. WebSolidColorLayer.h
  107. WebStorageArea.h
  108. WebStorageNamespace.h
  109. WebString.h
  110. WebThread.h
  111. WebThreadSafeData.h
  112. WebTransformAnimationCurve.h
  113. WebTransformationMatrix.h
  114. WebTransformKeyframe.h
  115. WebTransformOperations.h
  116. WebUnitTestSupport.h
  117. WebURL.h
  118. WebURLError.h
  119. WebURLLoader.h
  120. WebURLLoaderClient.h
  121. WebURLLoadTiming.h
  122. WebURLRequest.h
  123. WebURLResponse.h
  124. WebVector.h
  125. WebVideoFrame.h
  126. WebVideoFrameProvider.h
  127. WebVideoLayer.h
  128. WebWorkerRunLoop.h