Title: [199314] trunk/Source/WebCore
- Revision
- 199314
- Author
- [email protected]
- Date
- 2016-04-11 14:42:15 -0700 (Mon, 11 Apr 2016)
Log Message
[WebGL2] Use Open GL ES 3.0 to back WebGL2 contexts
https://bugs.webkit.org/show_bug.cgi?id=141178
Patch by Antoine Quint <[email protected]> on 2016-04-11
Reviewed by Dean Jackson.
We add a new `useGLES3` attribute when creating a GraphicsContext3D in the event that the
context type is "webgl2". This attribute is then read by the GraphicsContext3D constructor
to request an Open GL ES 3.0 backend when creating the EAGLContext on iOS.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
* platform/graphics/GraphicsContext3D.h:
(WebCore::GraphicsContext3D::Attributes::Attributes):
* platform/graphics/mac/GraphicsContext3DMac.mm:
(WebCore::GraphicsContext3D::GraphicsContext3D):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (199313 => 199314)
--- trunk/Source/WebCore/ChangeLog 2016-04-11 21:35:39 UTC (rev 199313)
+++ trunk/Source/WebCore/ChangeLog 2016-04-11 21:42:15 UTC (rev 199314)
@@ -1,3 +1,21 @@
+2016-04-11 Antoine Quint <[email protected]>
+
+ [WebGL2] Use Open GL ES 3.0 to back WebGL2 contexts
+ https://bugs.webkit.org/show_bug.cgi?id=141178
+
+ Reviewed by Dean Jackson.
+
+ We add a new `useGLES3` attribute when creating a GraphicsContext3D in the event that the
+ context type is "webgl2". This attribute is then read by the GraphicsContext3D constructor
+ to request an Open GL ES 3.0 backend when creating the EAGLContext on iOS.
+
+ * html/canvas/WebGLRenderingContextBase.cpp:
+ (WebCore::WebGLRenderingContextBase::create):
+ * platform/graphics/GraphicsContext3D.h:
+ (WebCore::GraphicsContext3D::Attributes::Attributes):
+ * platform/graphics/mac/GraphicsContext3DMac.mm:
+ (WebCore::GraphicsContext3D::GraphicsContext3D):
+
2016-04-11 Jiewen Tan <[email protected]>
fast/loader/opaque-base-url.html crashing during mac and ios debug tests
Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp (199313 => 199314)
--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp 2016-04-11 21:35:39 UTC (rev 199313)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp 2016-04-11 21:42:15 UTC (rev 199314)
@@ -400,6 +400,11 @@
if (page)
attributes.devicePixelRatio = page->deviceScaleFactor();
+#if ENABLE(WEBGL2)
+ if (type == "webgl2")
+ attributes.useGLES3 = true;
+#endif
+
if (isPendingPolicyResolution) {
LOG(WebGL, "Create a WebGL context that looks real, but will require a policy resolution if used.");
std::unique_ptr<WebGLRenderingContextBase> renderingContext = nullptr;
Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h (199313 => 199314)
--- trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h 2016-04-11 21:35:39 UTC (rev 199313)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h 2016-04-11 21:42:15 UTC (rev 199314)
@@ -728,6 +728,7 @@
, shareResources(true)
, preferDiscreteGPU(false)
, forceSoftwareRenderer(false)
+ , useGLES3(false)
, devicePixelRatio(1)
{
}
@@ -742,6 +743,7 @@
bool shareResources;
bool preferDiscreteGPU;
bool forceSoftwareRenderer;
+ bool useGLES3;
float devicePixelRatio;
};
Modified: trunk/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm (199313 => 199314)
--- trunk/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm 2016-04-11 21:35:39 UTC (rev 199313)
+++ trunk/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm 2016-04-11 21:42:15 UTC (rev 199314)
@@ -156,7 +156,8 @@
UNUSED_PARAM(renderStyle);
#if PLATFORM(IOS)
- m_contextObj = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
+ EAGLRenderingAPI api = m_attrs.useGLES3 ? kEAGLRenderingAPIOpenGLES3 : kEAGLRenderingAPIOpenGLES2;
+ m_contextObj = [[EAGLContext alloc] initWithAPI:api];
makeContextCurrent();
#else
Vector<CGLPixelFormatAttribute> attribs;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes