Diff
Modified: releases/WebKitGTK/webkit-2.14/LayoutTests/ChangeLog (210157 => 210158)
--- releases/WebKitGTK/webkit-2.14/LayoutTests/ChangeLog 2016-12-27 10:43:51 UTC (rev 210157)
+++ releases/WebKitGTK/webkit-2.14/LayoutTests/ChangeLog 2016-12-27 11:41:48 UTC (rev 210158)
@@ -1,3 +1,14 @@
+2016-10-27 Myles C. Maxfield <[email protected]>
+
+ [macOS] [WebGL2] Temporarily upgrade WebGL 2's internal OpenGL context from version 2.1 to 3.2
+ https://bugs.webkit.org/show_bug.cgi?id=164091
+
+ Reviewed by Dean Jackson.
+
+ * TestExpectations:
+ * fast/canvas/webgl/webgl2-context-creation-expected.txt: Added.
+ * fast/canvas/webgl/webgl2-context-creation.html: Added.
+
2016-10-25 Daniel Bates <[email protected]>
REGRESSION (r178265): XSS Auditor fails to block document.write() of incomplete tag
Added: releases/WebKitGTK/webkit-2.14/LayoutTests/fast/canvas/webgl/webgl2-context-creation-expected.txt (0 => 210158)
--- releases/WebKitGTK/webkit-2.14/LayoutTests/fast/canvas/webgl/webgl2-context-creation-expected.txt (rev 0)
+++ releases/WebKitGTK/webkit-2.14/LayoutTests/fast/canvas/webgl/webgl2-context-creation-expected.txt 2016-12-27 11:41:48 UTC (rev 210158)
@@ -0,0 +1,10 @@
+Checks that using a WebGL 2 context doesn't cause an error.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS context.getError() is context.NO_ERROR
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: releases/WebKitGTK/webkit-2.14/LayoutTests/fast/canvas/webgl/webgl2-context-creation.html (0 => 210158)
--- releases/WebKitGTK/webkit-2.14/LayoutTests/fast/canvas/webgl/webgl2-context-creation.html (rev 0)
+++ releases/WebKitGTK/webkit-2.14/LayoutTests/fast/canvas/webgl/webgl2-context-creation.html 2016-12-27 11:41:48 UTC (rev 210158)
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<canvas id="c" width="40" height="40"></canvas>
+<script>
+description("Checks that using a WebGL 2 context doesn't cause an error.");
+
+if (window.internals)
+ internals.setWebGL2Enabled(true);
+
+var canvas = document.getElementById("c");
+var context = canvas.getContext("webgl2");
+shouldBe("context.getError()", "context.NO_ERROR");
+</script>
+<script src=""
+</body>
+</html>
\ No newline at end of file
Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog (210157 => 210158)
--- releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog 2016-12-27 10:43:51 UTC (rev 210157)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog 2016-12-27 11:41:48 UTC (rev 210158)
@@ -1,3 +1,59 @@
+2016-10-27 Myles C. Maxfield <[email protected]>
+
+ [macOS] [WebGL2] Temporarily upgrade WebGL 2's internal OpenGL context from version 2.1 to 3.2
+ https://bugs.webkit.org/show_bug.cgi?id=164091
+
+ Reviewed by Dean Jackson.
+
+ In order to test WebGL2 correctly, I had to upgrade the macOS's OpenGL
+ context to a 3.2-compatible context to make sure the new symbols are
+ accepted. Eventually, this 3.2-compatible context will have to be
+ reverted and replaced with an ANGLE context. The current 3.2-compatible
+ context is just for testing.
+
+ Test: fast/canvas/webgl/webgl2-context-creation.html
+
+ * html/canvas/WebGLBuffer.cpp: Use "nullptr" instead of 0.
+ (WebCore::WebGLBuffer::associateBufferData):
+ * html/canvas/WebGLRenderingContextBase.cpp: Use make_unique() instead
+ of the unique_ptr constructor.
+ (WebCore::WebGLRenderingContextBase::create):
+ * platform/graphics/GraphicsContext3D.h: GraphicsContext should know
+ if it is using a 3.2-compatible context because some parts of 2.1 are
+ removed in these contexts, and replaced with new things which aren't
+ in 2.1.
+ * platform/graphics/mac/GraphicsContext3DMac.mm:
+ (WebCore::setPixelFormat): Use kCGLPFAOpenGLProfile to specify an
+ OpenGL 3.2 context.
+ (WebCore::GraphicsContext3D::GraphicsContext3D): GL_CLAMP is deprecated
+ in OpenGL 3.2. Fortunately, GL_CLAMP_TO_EDGE isn't deprecated and does
+ exactly what we want. In OpenGL3.2, point sprites are always enabled,
+ so there's no need to enable them in those contexts.
+ (WebCore::GraphicsContext3D::isGLES2Compliant):
+ * platform/graphics/opengl/Extensions3DOpenGL.cpp: In OpenGL 3.2,
+ glGetString() no longer accepts GL_EXTENSIONS. Instead, glGetStringi()
+ is used instead. Unfortunately, glGetString() is not available in
+ OpenGL 2.1 contexts, so we need to use one or the other based on the
+ version of the context we're using.
+ (WebCore::Extensions3DOpenGL::Extensions3DOpenGL):
+ (WebCore::Extensions3DOpenGL::getExtensions):
+ * platform/graphics/opengl/Extensions3DOpenGL.h:
+ * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
+ (WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon):
+ (WebCore::Extensions3DOpenGLCommon::initializeAvailableExtensions):
+ Instead of modifying getExtensions() to use glGetStringi(), it makes
+ better sense to modify this function because getExtensions() returns
+ a string. Building up a string just to split it up again is silly, so
+ modifying this function instead makes more sense.
+ * platform/graphics/opengl/Extensions3DOpenGLCommon.h:
+ * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
+ (WebCore::GraphicsContext3D::getIntegerv): GL_MAX_VARYING_FLOATS is
+ removed in OpenGL 3.2 contexts. However, it is replaced by
+ GL_MAX_VARYING_COMPONENTS, though this is deprecated but not removed.
+ In the more recent OpenGL context versions, GL_MAX_VARYING_VECTORS is
+ recommended instead, but that isn't available in OpenGL 3.2.
+ (WebCore::GraphicsContext3D::getExtensions):
+
2016-10-21 Miguel Gomez <[email protected]>
[GTK] Several tests crashing on debug bot in (anonymous namespace)::MediaPlayerPrivateGStreamerBase::repaint
Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/html/canvas/WebGLBuffer.cpp (210157 => 210158)
--- releases/WebKitGTK/webkit-2.14/Source/WebCore/html/canvas/WebGLBuffer.cpp 2016-12-27 10:43:51 UTC (rev 210157)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/html/canvas/WebGLBuffer.cpp 2016-12-27 11:41:48 UTC (rev 210158)
@@ -93,7 +93,7 @@
bool WebGLBuffer::associateBufferData(GC3Dsizeiptr size)
{
- return associateBufferDataImpl(0, size);
+ return associateBufferDataImpl(nullptr, size);
}
bool WebGLBuffer::associateBufferData(ArrayBuffer* array)
Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp (210157 => 210158)
--- releases/WebKitGTK/webkit-2.14/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp 2016-12-27 10:43:51 UTC (rev 210157)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp 2016-12-27 11:41:48 UTC (rev 210158)
@@ -414,10 +414,10 @@
std::unique_ptr<WebGLRenderingContextBase> renderingContext = nullptr;
#if ENABLE(WEBGL2)
if (type == "webgl2")
- renderingContext = std::unique_ptr<WebGL2RenderingContext>(new WebGL2RenderingContext(canvas, attributes));
+ renderingContext = std::make_unique<WebGL2RenderingContext>(canvas, attributes);
else
#endif
- renderingContext = std::unique_ptr<WebGLRenderingContext>(new WebGLRenderingContext(canvas, attributes));
+ renderingContext = std::make_unique<WebGLRenderingContext>(canvas, attributes);
renderingContext->suspendIfNeeded();
return renderingContext;
}
@@ -437,10 +437,10 @@
std::unique_ptr<WebGLRenderingContextBase> renderingContext = nullptr;
#if ENABLE(WEBGL2)
if (type == "webgl2")
- renderingContext = std::unique_ptr<WebGL2RenderingContext>(new WebGL2RenderingContext(canvas, WTFMove(context), attributes));
+ renderingContext = std::make_unique<WebGL2RenderingContext>(canvas, WTFMove(context), attributes);
else
#endif
- renderingContext = std::unique_ptr<WebGLRenderingContext>(new WebGLRenderingContext(canvas, WTFMove(context), attributes));
+ renderingContext = std::make_unique<WebGLRenderingContext>(canvas, WTFMove(context), attributes);
renderingContext->suspendIfNeeded();
return renderingContext;
Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/GraphicsContext3D.h (210157 => 210158)
--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/GraphicsContext3D.h 2016-12-27 10:43:51 UTC (rev 210157)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/GraphicsContext3D.h 2016-12-27 11:41:48 UTC (rev 210158)
@@ -1443,6 +1443,8 @@
std::unique_ptr<GraphicsContext3DPrivate> m_private;
WebGLRenderingContextBase* m_webglContext;
+
+ bool m_isForWebGL2 { false };
};
} // namespace WebCore
Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm (210157 => 210158)
--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm 2016-12-27 10:43:51 UTC (rev 210157)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm 2016-12-27 11:41:48 UTC (rev 210158)
@@ -84,7 +84,7 @@
};
#if !PLATFORM(IOS)
-static void setPixelFormat(Vector<CGLPixelFormatAttribute>& attribs, int colorBits, int depthBits, bool accelerated, bool supersample, bool closest, bool antialias, bool allowOffline)
+static void setPixelFormat(Vector<CGLPixelFormatAttribute>& attribs, int colorBits, int depthBits, bool accelerated, bool supersample, bool closest, bool antialias, bool allowOffline, bool useGLES3)
{
attribs.clear();
@@ -120,6 +120,13 @@
attribs.append(kCGLPFASamples);
attribs.append(static_cast<CGLPixelFormatAttribute>(4));
}
+
+ if (useGLES3) {
+ // FIXME: Instead of backing a WebGL2 GraphicsContext3D with a OpenGL 3.2 context, we should instead back it with ANGLE.
+ // Use an OpenGL 3.2 context for now until the ANGLE backend is ready.
+ attribs.append(kCGLPFAOpenGLProfile);
+ attribs.append(static_cast<CGLPixelFormatAttribute>(kCGLOGLPVersion_3_2_Core));
+ }
attribs.append(static_cast<CGLPixelFormatAttribute>(0));
}
@@ -199,19 +206,19 @@
bool useMultisampling = m_attrs.antialias;
- setPixelFormat(attribs, 32, 32, !attrs.forceSoftwareRenderer, true, false, useMultisampling, attrs.preferLowPowerToHighPerformance);
+ setPixelFormat(attribs, 32, 32, !attrs.forceSoftwareRenderer, true, false, useMultisampling, attrs.preferLowPowerToHighPerformance, attrs.useGLES3);
CGLChoosePixelFormat(attribs.data(), &pixelFormatObj, &numPixelFormats);
if (!numPixelFormats) {
- setPixelFormat(attribs, 32, 32, !attrs.forceSoftwareRenderer, false, false, useMultisampling, attrs.preferLowPowerToHighPerformance);
+ setPixelFormat(attribs, 32, 32, !attrs.forceSoftwareRenderer, false, false, useMultisampling, attrs.preferLowPowerToHighPerformance, attrs.useGLES3);
CGLChoosePixelFormat(attribs.data(), &pixelFormatObj, &numPixelFormats);
if (!numPixelFormats) {
- setPixelFormat(attribs, 32, 16, !attrs.forceSoftwareRenderer, false, false, useMultisampling, attrs.preferLowPowerToHighPerformance);
+ setPixelFormat(attribs, 32, 16, !attrs.forceSoftwareRenderer, false, false, useMultisampling, attrs.preferLowPowerToHighPerformance, attrs.useGLES3);
CGLChoosePixelFormat(attribs.data(), &pixelFormatObj, &numPixelFormats);
if (!attrs.forceSoftwareRenderer && !numPixelFormats) {
- setPixelFormat(attribs, 32, 16, false, false, true, false, false);
+ setPixelFormat(attribs, 32, 16, false, false, true, false, false, attrs.useGLES3);
CGLChoosePixelFormat(attribs.data(), &pixelFormatObj, &numPixelFormats);
useMultisampling = false;
}
@@ -237,6 +244,8 @@
return;
}
+ m_isForWebGL2 = attrs.useGLES3;
+
// Set the current context to the one given to us.
CGLSetCurrentContext(m_contextObj);
@@ -263,16 +272,16 @@
// create a texture to render into
::glGenTextures(1, &m_texture);
::glBindTexture(GL_TEXTURE_2D, m_texture);
- ::glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- ::glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
- ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
+ ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
::glGenTextures(1, &m_compositorTexture);
::glBindTexture(GL_TEXTURE_2D, m_compositorTexture);
- ::glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- ::glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
- ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
+ ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
::glBindTexture(GL_TEXTURE_2D, 0);
#endif
@@ -318,7 +327,8 @@
#if !PLATFORM(IOS)
::glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
- ::glEnable(GL_POINT_SPRITE);
+ if (!isGLES2Compliant())
+ ::glEnable(GL_POINT_SPRITE);
#endif
::glClearColor(0, 0, 0, 0);
@@ -438,7 +448,7 @@
bool GraphicsContext3D::isGLES2Compliant() const
{
- return false;
+ return m_isForWebGL2;
}
void GraphicsContext3D::setContextLostCallback(std::unique_ptr<ContextLostCallback>)
Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp (210157 => 210158)
--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp 2016-12-27 10:43:51 UTC (rev 210157)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp 2016-12-27 11:41:48 UTC (rev 210158)
@@ -45,8 +45,8 @@
namespace WebCore {
-Extensions3DOpenGL::Extensions3DOpenGL(GraphicsContext3D* context)
- : Extensions3DOpenGLCommon(context)
+Extensions3DOpenGL::Extensions3DOpenGL(GraphicsContext3D* context, bool useIndexedGetString)
+ : Extensions3DOpenGLCommon(context, useIndexedGetString)
{
}
@@ -296,6 +296,7 @@
String Extensions3DOpenGL::getExtensions()
{
+ ASSERT(!m_useIndexedGetString);
return String(reinterpret_cast<const char*>(::glGetString(GL_EXTENSIONS)));
}
Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h (210157 => 210158)
--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h 2016-12-27 10:43:51 UTC (rev 210157)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h 2016-12-27 11:41:48 UTC (rev 210158)
@@ -23,8 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef Extensions3DOpenGL_h
-#define Extensions3DOpenGL_h
+#pragma once
#include "Extensions3DOpenGLCommon.h"
@@ -38,7 +37,7 @@
WTF_MAKE_FAST_ALLOCATED;
public:
// This class only needs to be instantiated by GraphicsContext3D implementations.
- explicit Extensions3DOpenGL(GraphicsContext3D*);
+ explicit Extensions3DOpenGL(GraphicsContext3D*, bool useIndexedGetString);
virtual ~Extensions3DOpenGL();
// Extensions3D methods.
@@ -61,12 +60,11 @@
protected:
virtual bool supportsExtension(const WTF::String&);
virtual String getExtensions();
+
+private:
#if (PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(IOS))
-private:
bool isVertexArrayObjectSupported();
#endif
};
} // namespace WebCore
-
-#endif // Extensions3DOpenGL_h
Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp (210157 => 210158)
--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp 2016-12-27 10:43:51 UTC (rev 210157)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp 2016-12-27 11:41:48 UTC (rev 210158)
@@ -34,6 +34,7 @@
#if PLATFORM(IOS)
#include <OpenGLES/ES2/glext.h>
+#include <OpenGLES/ES3/gl.h>
#else
#if USE(OPENGL_ES_2)
#include "OpenGLESShims.h"
@@ -40,7 +41,10 @@
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#elif PLATFORM(MAC)
+#define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
#include <OpenGL/gl.h>
+#include <OpenGL/gl3.h>
+#undef GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
#elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN)
#include "OpenGLShims.h"
#endif
@@ -51,7 +55,7 @@
namespace WebCore {
-Extensions3DOpenGLCommon::Extensions3DOpenGLCommon(GraphicsContext3D* context)
+Extensions3DOpenGLCommon::Extensions3DOpenGLCommon(GraphicsContext3D* context, bool useIndexedGetString)
: m_initializedAvailableExtensions(false)
, m_context(context)
, m_isNVIDIA(false)
@@ -60,6 +64,7 @@
, m_isImagination(false)
, m_requiresBuiltInFunctionEmulation(false)
, m_requiresRestrictedMaximumTextureSize(false)
+ , m_useIndexedGetString(useIndexedGetString)
{
m_vendor = String(reinterpret_cast<const char*>(::glGetString(GL_VENDOR)));
m_renderer = String(reinterpret_cast<const char*>(::glGetString(GL_RENDERER)));
@@ -206,11 +211,21 @@
void Extensions3DOpenGLCommon::initializeAvailableExtensions()
{
- String extensionsString = getExtensions();
- Vector<String> availableExtensions;
- extensionsString.split(' ', availableExtensions);
- for (size_t i = 0; i < availableExtensions.size(); ++i)
- m_availableExtensions.add(availableExtensions[i]);
+#if PLATFORM(MAC)
+ if (m_useIndexedGetString) {
+ GLint numExtensions = 0;
+ ::glGetIntegerv(GL_NUM_EXTENSIONS, &numExtensions);
+ for (GLint i = 0; i < numExtensions; ++i)
+ m_availableExtensions.add(glGetStringi(GL_EXTENSIONS, i));
+ } else
+#endif
+ {
+ String extensionsString = getExtensions();
+ Vector<String> availableExtensions;
+ extensionsString.split(' ', availableExtensions);
+ for (size_t i = 0; i < availableExtensions.size(); ++i)
+ m_availableExtensions.add(availableExtensions[i]);
+ }
m_initializedAvailableExtensions = true;
}
Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.h (210157 => 210158)
--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.h 2016-12-27 10:43:51 UTC (rev 210157)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.h 2016-12-27 11:41:48 UTC (rev 210158)
@@ -70,7 +70,7 @@
protected:
friend class Extensions3DOpenGLES;
- Extensions3DOpenGLCommon(GraphicsContext3D*);
+ Extensions3DOpenGLCommon(GraphicsContext3D*, bool useIndexedGetString);
virtual bool supportsExtension(const String&) = 0;
virtual String getExtensions() = 0;
@@ -89,6 +89,8 @@
bool m_requiresBuiltInFunctionEmulation;
bool m_requiresRestrictedMaximumTextureSize;
+ bool m_useIndexedGetString { false };
+
String m_vendor;
String m_renderer;
};
Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp (210157 => 210158)
--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp 2016-12-27 10:43:51 UTC (rev 210157)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp 2016-12-27 11:41:48 UTC (rev 210158)
@@ -54,7 +54,10 @@
#define GL_RGBA32F_ARB 0x8814
#define GL_RGB32F_ARB 0x8815
#elif PLATFORM(MAC)
+#define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
#include <OpenGL/gl.h>
+#include <OpenGL/gl3.h>
+#undef GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
#elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN)
#include "OpenGLShims.h"
#endif
@@ -285,8 +288,17 @@
*value /= 4;
break;
case MAX_VARYING_VECTORS:
- ::glGetIntegerv(GL_MAX_VARYING_FLOATS, value);
- *value /= 4;
+ if (isGLES2Compliant()) {
+ ASSERT(::glGetError() == GL_NO_ERROR);
+ ::glGetIntegerv(GL_MAX_VARYING_VECTORS, value);
+ if (::glGetError() == GL_INVALID_ENUM) {
+ ::glGetIntegerv(GL_MAX_VARYING_COMPONENTS, value);
+ *value /= 4;
+ }
+ } else {
+ ::glGetIntegerv(GL_MAX_VARYING_FLOATS, value);
+ *value /= 4;
+ }
break;
#endif
case MAX_TEXTURE_SIZE:
@@ -397,7 +409,7 @@
Extensions3D* GraphicsContext3D::getExtensions()
{
if (!m_extensions)
- m_extensions = std::make_unique<Extensions3DOpenGL>(this);
+ m_extensions = std::make_unique<Extensions3DOpenGL>(this, isGLES2Compliant());
return m_extensions.get();
}