Diff
Modified: trunk/LayoutTests/ChangeLog (212649 => 212650)
--- trunk/LayoutTests/ChangeLog 2017-02-20 17:52:16 UTC (rev 212649)
+++ trunk/LayoutTests/ChangeLog 2017-02-20 17:52:57 UTC (rev 212650)
@@ -1,3 +1,15 @@
+2017-02-20 Jon Lee <jon...@apple.com>
+
+ Unreviewed, rolling out r212639.
+
+ Have a fix for the linker error on iOS.
+
+ Reverted changeset:
+
+ "Unreviewed, rolling out r212637."
+ https://bugs.webkit.org/show_bug.cgi?id=168595
+ http://trac.webkit.org/changeset/212639
+
2017-02-20 Ryan Haddad <ryanhad...@apple.com>
Unreviewed, rolling out r212637.
Added: trunk/LayoutTests/fast/canvas/webgl/webglcontextchangedevent-expected.txt (0 => 212650)
--- trunk/LayoutTests/fast/canvas/webgl/webglcontextchangedevent-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/canvas/webgl/webglcontextchangedevent-expected.txt 2017-02-20 17:52:57 UTC (rev 212650)
@@ -0,0 +1,8 @@
+
+We should see three changed events.
+
+Saw webglcontextchanged event.
+
+Saw webglcontextchanged event.
+
+Saw webglcontextchanged event.
Added: trunk/LayoutTests/fast/canvas/webgl/webglcontextchangedevent.html (0 => 212650)
--- trunk/LayoutTests/fast/canvas/webgl/webglcontextchangedevent.html (rev 0)
+++ trunk/LayoutTests/fast/canvas/webgl/webglcontextchangedevent.html 2017-02-20 17:52:57 UTC (rev 212650)
@@ -0,0 +1,50 @@
+<script>
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+}
+
+function log(msg)
+{
+ let p = document.createElement("p");
+ p.textContent = msg;
+ document.body.appendChild(p);
+}
+
+function runTest()
+{
+ if (!window.internals) {
+ log("This test must run inside DRT/WKTR.");
+ return;
+ }
+
+ log("We should see three changed events.");
+
+ let changedEventsSeen = 0;
+
+ let handleChangedEvent = (event) => {
+ log("Saw webglcontextchanged event.");
+ changedEventsSeen++;
+ if (changedEventsSeen == 3)
+ testRunner.notifyDone();
+ }
+
+ document.querySelectorAll("canvas").forEach((c) =>
+ {
+ c.addEventListener("webglcontextchanged", handleChangedEvent, false);
+ let gl = c.getContext("webgl");
+ gl.clearColor(1, 0, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ });
+
+ let gl = document.querySelector("canvas").getContext("webgl");
+ window.internals.simulateWebGLContextChanged(gl);
+}
+
+
+window.addEventListener("load", runTest, false);
+</script>
+
+<canvas></canvas>
+<canvas></canvas>
+<canvas></canvas>
Modified: trunk/LayoutTests/platform/gtk/TestExpectations (212649 => 212650)
--- trunk/LayoutTests/platform/gtk/TestExpectations 2017-02-20 17:52:16 UTC (rev 212649)
+++ trunk/LayoutTests/platform/gtk/TestExpectations 2017-02-20 17:52:57 UTC (rev 212650)
@@ -665,6 +665,9 @@
# This requires a specific font on Mac
fast/text/hidpi-text-selection-gap-between-words.html [ Skip ]
+# webglcontextchanged event not supported
+fast/canvas/webgl/webglcontextchangedevent.html [ Skip ]
+
# Test requires hardcoded font names, which I do not have for this port.
fast/text/han-generic-font-families.html [ WontFix ]
fast/text/hangul-generic-font-families.html [ WontFix ]
Modified: trunk/LayoutTests/platform/win/TestExpectations (212649 => 212650)
--- trunk/LayoutTests/platform/win/TestExpectations 2017-02-20 17:52:16 UTC (rev 212649)
+++ trunk/LayoutTests/platform/win/TestExpectations 2017-02-20 17:52:57 UTC (rev 212650)
@@ -3784,3 +3784,6 @@
# WebCrypto tests are failing.
webkit.org/b/165090 imported/w3c/WebCryptoAPI [ Skip ]
+
+# webglcontextchanged event not supported
+fast/canvas/webgl/webglcontextchangedevent.html [ Skip ]
Modified: trunk/Source/WebCore/ChangeLog (212649 => 212650)
--- trunk/Source/WebCore/ChangeLog 2017-02-20 17:52:16 UTC (rev 212649)
+++ trunk/Source/WebCore/ChangeLog 2017-02-20 17:52:57 UTC (rev 212650)
@@ -1,3 +1,15 @@
+2017-02-20 Jon Lee <jon...@apple.com>
+
+ Unreviewed, rolling out r212639.
+
+ Have a fix for the linker error on iOS.
+
+ Reverted changeset:
+
+ "Unreviewed, rolling out r212637."
+ https://bugs.webkit.org/show_bug.cgi?id=168595
+ http://trac.webkit.org/changeset/212639
+
2017-02-20 Youenn Fablet <you...@apple.com>
[WebRTC] Fix some memory leaks in libwebrtc binding code
Modified: trunk/Source/WebCore/dom/EventNames.h (212649 => 212650)
--- trunk/Source/WebCore/dom/EventNames.h 2017-02-20 17:52:16 UTC (rev 212649)
+++ trunk/Source/WebCore/dom/EventNames.h 2017-02-20 17:52:57 UTC (rev 212650)
@@ -242,6 +242,7 @@
macro(volumechange) \
macro(waiting) \
macro(waitingforkey) \
+ macro(webglcontextchanged) \
macro(webglcontextcreationerror) \
macro(webglcontextlost) \
macro(webglcontextrestored) \
Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp (212649 => 212650)
--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp 2017-02-20 17:52:16 UTC (rev 212649)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp 2017-02-20 17:52:57 UTC (rev 212650)
@@ -5631,6 +5631,17 @@
canvas().dispatchEvent(WebGLContextEvent::create(eventNames().webglcontextrestoredEvent, false, true, emptyString()));
}
+void WebGLRenderingContextBase::dispatchContextChangedEvent()
+{
+ canvas().dispatchEvent(WebGLContextEvent::create(eventNames().webglcontextchangedEvent, false, true, emptyString()));
+}
+
+void WebGLRenderingContextBase::simulateContextChanged()
+{
+ if (m_context)
+ m_context->simulateContextChanged();
+}
+
String WebGLRenderingContextBase::ensureNotNull(const String& text) const
{
if (text.isNull())
Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h (212649 => 212650)
--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h 2017-02-20 17:52:16 UTC (rev 212649)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h 2017-02-20 17:52:57 UTC (rev 212650)
@@ -340,6 +340,8 @@
void recycleContext();
void forceRestoreContext();
void loseContextImpl(LostContextMode);
+ void dispatchContextChangedEvent();
+ WEBCORE_EXPORT void simulateContextChanged();
GraphicsContext3D* graphicsContext3D() const { return m_context.get(); }
WebGLContextGroup* contextGroup() const { return m_contextGroup.get(); }
Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.idl (212649 => 212650)
--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.idl 2017-02-20 17:52:16 UTC (rev 212649)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.idl 2017-02-20 17:52:57 UTC (rev 212650)
@@ -51,6 +51,7 @@
DoNotCheckConstants,
JSCustomMarkFunction,
NoInterfaceObject,
+ ExportMacro=WEBCORE_EXPORT,
] interface WebGLRenderingContextBase {
// back-reference to the canvas
Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext3D.cpp (212649 => 212650)
--- trunk/Source/WebCore/platform/graphics/GraphicsContext3D.cpp 2017-02-20 17:52:16 UTC (rev 212649)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext3D.cpp 2017-02-20 17:52:57 UTC (rev 212650)
@@ -659,6 +659,10 @@
void GraphicsContext3D::setContextVisibility(bool)
{
}
+
+void GraphicsContext3D::simulateContextChanged()
+{
+}
#endif
} // namespace WebCore
Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h (212649 => 212650)
--- trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h 2017-02-20 17:52:16 UTC (rev 212649)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h 2017-02-20 17:52:57 UTC (rev 212650)
@@ -1133,6 +1133,9 @@
void forceContextLost();
void recycleContext();
+ void dispatchContextChangedNotification();
+ void simulateContextChanged();
+
void paintRenderingResultsToCanvas(ImageBuffer*);
RefPtr<ImageData> paintRenderingResultsToImageData();
bool paintCompositedResultsToCanvas(ImageBuffer*);
@@ -1427,7 +1430,8 @@
friend class GraphicsContext3DPrivate;
std::unique_ptr<GraphicsContext3DPrivate> m_private;
#endif
-
+
+ // FIXME: Layering violation.
WebGLRenderingContextBase* m_webglContext;
bool m_isForWebGL2 { false };
Modified: trunk/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm (212649 => 212650)
--- trunk/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm 2017-02-20 17:52:16 UTC (rev 212649)
+++ trunk/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm 2017-02-20 17:52:57 UTC (rev 212650)
@@ -189,8 +189,10 @@
void GraphicsContext3DManager::updateAllContexts()
{
#if PLATFORM(MAC)
- for (auto* context : m_contexts)
+ for (auto* context : m_contexts) {
context->updateCGLContext();
+ context->dispatchContextChangedNotification();
+ }
#endif
}
@@ -720,6 +722,11 @@
{
}
+void GraphicsContext3D::simulateContextChanged()
+{
+ manager().updateAllContexts();
}
+}
+
#endif // ENABLE(GRAPHICS_CONTEXT_3D)
Modified: trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp (212649 => 212650)
--- trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp 2017-02-20 17:52:16 UTC (rev 212649)
+++ trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp 2017-02-20 17:52:57 UTC (rev 212650)
@@ -1895,6 +1895,14 @@
#endif
}
+void GraphicsContext3D::dispatchContextChangedNotification()
+{
+#if ENABLE(WEBGL)
+ if (m_webglContext)
+ m_webglContext->dispatchContextChangedEvent();
+#endif
+}
+
void GraphicsContext3D::texImage2DDirect(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, const void* pixels)
{
makeContextCurrent();
Modified: trunk/Source/WebCore/testing/Internals.cpp (212649 => 212650)
--- trunk/Source/WebCore/testing/Internals.cpp 2017-02-20 17:52:16 UTC (rev 212649)
+++ trunk/Source/WebCore/testing/Internals.cpp 2017-02-20 17:52:57 UTC (rev 212650)
@@ -134,6 +134,7 @@
#include "UserMediaController.h"
#include "ViewportArguments.h"
#include "WebCoreJSClientData.h"
+#include "WebGLRenderingContextBase.h"
#include "WorkerThread.h"
#include "WritingDirection.h"
#include "XMLHttpRequest.h"
@@ -3712,4 +3713,12 @@
document.page()->setAsRunningUserScripts();
}
+#if ENABLE(WEBGL)
+void Internals::simulateWebGLContextChanged(WebGLRenderingContextBase& context)
+{
+ context.simulateContextChanged();
+}
+#endif
+
+
} // namespace WebCore
Modified: trunk/Source/WebCore/testing/Internals.h (212649 => 212650)
--- trunk/Source/WebCore/testing/Internals.h 2017-02-20 17:52:16 UTC (rev 212649)
+++ trunk/Source/WebCore/testing/Internals.h 2017-02-20 17:52:57 UTC (rev 212650)
@@ -71,6 +71,7 @@
class StyleSheet;
class TimeRanges;
class TypeConversions;
+class WebGLRenderingContextBase;
class XMLHttpRequest;
class Internals final : public RefCounted<Internals>, private ContextDestructionObserver {
@@ -531,6 +532,10 @@
void setAsRunningUserScripts(Document&);
+#if ENABLE(WEBGL)
+ void simulateWebGLContextChanged(WebGLRenderingContextBase&);
+#endif
+
private:
explicit Internals(Document&);
Document* contextDocument() const;
Modified: trunk/Source/WebCore/testing/Internals.idl (212649 => 212650)
--- trunk/Source/WebCore/testing/Internals.idl 2017-02-20 17:52:16 UTC (rev 212649)
+++ trunk/Source/WebCore/testing/Internals.idl 2017-02-20 17:52:57 UTC (rev 212650)
@@ -504,4 +504,6 @@
[CallWith=Document] void setAsRunningUserScripts();
void disableTileSizeUpdateDelay();
+
+ [Conditional=WEBGL] void simulateWebGLContextChanged(WebGLRenderingContextBase context);
};