Unreviewed, rolling out r246501.
authorryanhaddad@apple.com <ryanhaddad@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Jun 2019 20:23:46 +0000 (20:23 +0000)
committerryanhaddad@apple.com <ryanhaddad@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Jun 2019 20:23:46 +0000 (20:23 +0000)
Breaks Apple internal builds.

Reverted changeset:

"Support using ANGLE as the backend for the WebGL
implementation"
https://bugs.webkit.org/show_bug.cgi?id=197755
https://trac.webkit.org/changeset/246501

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246512 268f45cc-cd09-0410-ab3c-d52691b4dbfc

26 files changed:
Source/ThirdParty/ANGLE/ANGLE.xcodeproj/project.pbxproj
Source/ThirdParty/ANGLE/ChangeLog
Source/ThirdParty/ANGLE/adjust-angle-include-paths.sh [deleted file]
Source/WTF/ChangeLog
Source/WTF/wtf/Platform.h
Source/WebCore/ChangeLog
Source/WebCore/SourcesCocoa.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/platform/graphics/ANGLEWebKitBridge.h
Source/WebCore/platform/graphics/GraphicsContext3D.h
Source/WebCore/platform/graphics/GraphicsContext3DManager.cpp
Source/WebCore/platform/graphics/angle/Extensions3DANGLE.cpp [deleted file]
Source/WebCore/platform/graphics/angle/Extensions3DANGLE.h [deleted file]
Source/WebCore/platform/graphics/angle/GraphicsContext3DANGLE.cpp [deleted file]
Source/WebCore/platform/graphics/angle/TemporaryANGLESetting.cpp [deleted file]
Source/WebCore/platform/graphics/angle/TemporaryANGLESetting.h [deleted file]
Source/WebCore/platform/graphics/cocoa/GraphicsContext3DCocoa.mm
Source/WebCore/platform/graphics/cocoa/WebGLLayer.h
Source/WebCore/platform/graphics/cocoa/WebGLLayer.mm
Source/WebCore/platform/graphics/cv/TextureCacheCV.mm
Source/WebCore/platform/graphics/cv/VideoTextureCopierCV.cpp
Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp
Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp
Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp

index 7cefc59..cf94bad 100644 (file)
                                FB39D0CF1200F0E300088E69 /* Frameworks */,
                                312BDB0B15FECAB00097EBC7 /* CopyFiles */,
                                312BDB0D15FECACE0097EBC7 /* CopyFiles */,
-                               6E28B8742294DD8000717E69 /* ShellScript */,
                        );
                        buildRules = (
                        );
                };
 /* End PBXProject section */
 
-/* Begin PBXShellScriptBuildPhase section */
-               6E28B8742294DD8000717E69 /* ShellScript */ = {
-                       isa = PBXShellScriptBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       inputFileListPaths = (
-                       );
-                       inputPaths = (
-                       );
-                       outputFileListPaths = (
-                       );
-                       outputPaths = (
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-                       shellPath = /bin/sh;
-                       shellScript = "/bin/sh $SRCROOT/adjust-angle-include-paths.sh\n";
-               };
-/* End PBXShellScriptBuildPhase section */
-
 /* Begin PBXSourcesBuildPhase section */
                FB39D0CE1200F0E300088E69 /* Sources */ = {
                        isa = PBXSourcesBuildPhase;
index 526254a..d38a5f0 100644 (file)
@@ -1,3 +1,16 @@
+2019-06-17  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rolling out r246501.
+
+        Breaks Apple internal builds.
+
+        Reverted changeset:
+
+        "Support using ANGLE as the backend for the WebGL
+        implementation"
+        https://bugs.webkit.org/show_bug.cgi?id=197755
+        https://trac.webkit.org/changeset/246501
+
 2019-06-17  Kenneth Russell  <kbr@chromium.org>
 
         Support using ANGLE as the backend for the WebGL implementation
diff --git a/Source/ThirdParty/ANGLE/adjust-angle-include-paths.sh b/Source/ThirdParty/ANGLE/adjust-angle-include-paths.sh
deleted file mode 100755 (executable)
index da38a13..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/sh
-
-# WebKit builds ANGLE as a static library, and exports some of the
-# internal header files as "public headers" in the Xcode project for
-# consumption by other build targets - e.g. WebCore.
-#
-# The build phase which copies these headers also flattens the
-# directory structure (so that "ANGLE" is the top-level directory
-# containing all of them - e.g., "#include <ANGLE/gl2.h>").
-#
-# It isn't practical to override the include paths so drastically for
-# the other build targets (like WebCore) that we could make the
-# original include paths, like <GLES2/gl2.h> work. Changing them so
-# their namespace is "ANGLE", which implicitly occurs during the "copy
-# headers" phase, is a reasonable solution.
-#
-# This script processes the header files after they're copied during
-# the Copy Header Files build phase, and adjusts their #includes so
-# that they refer to each other. This avoids modifying the ANGLE
-# sources, and allows WebCore to more easily call ANGLE APIs directly.
-
-if [ -z "$BUILT_PRODUCTS_DIR" ] ; then
-  echo Requires BUILT_PRODUCTS_DIR environment variable to be set
-  exit 1
-fi
-
-output_dir=$BUILT_PRODUCTS_DIR/usr/local/include/ANGLE
-
-for i in $output_dir/*.h ; do
-  sed -i -e '
-s/^#include <EGL\/\(.*\)>/#include <ANGLE\/\1>/
-s/^#include <GLES2\/\(.*\)>/#include <ANGLE\/\1>/
-s/^#include <GLES3\/\(.*\)>/#include <ANGLE\/\1>/
-s/^#include <KHR\/\(.*\)>/#include <ANGLE\/\1>/
-s/^#include <export.h>/#include <ANGLE\/export.h>/
-s/^#include "\(eglext_angle\|gl2ext_angle\|ShaderVars\).h"/#include <ANGLE\/\1.h>/
-' $i
-done
index b432726..9c9f5ca 100644 (file)
@@ -1,3 +1,16 @@
+2019-06-17  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rolling out r246501.
+
+        Breaks Apple internal builds.
+
+        Reverted changeset:
+
+        "Support using ANGLE as the backend for the WebGL
+        implementation"
+        https://bugs.webkit.org/show_bug.cgi?id=197755
+        https://trac.webkit.org/changeset/246501
+
 2019-06-17  Kenneth Russell  <kbr@chromium.org>
 
         Support using ANGLE as the backend for the WebGL implementation
index 2d9fd1d..d56b0b2 100644 (file)
 #endif
 
 #if ENABLE(WEBGL)
-/* USE_ANGLE=1 uses ANGLE for the WebGL backend.
-   It replaces USE_OPENGL, USE_OPENGL_ES and USE_EGL. */
 #if PLATFORM(MAC)
 #define USE_OPENGL 1
 #define USE_OPENGL_ES 0
-#define USE_ANGLE 0
 #elif PLATFORM(IOSMAC) && __has_include(<OpenGL/OpenGL.h>)
 #define USE_OPENGL 1
 #define USE_OPENGL_ES 0
-#define USE_ANGLE 0
 #else
 #define USE_OPENGL 0
 #define USE_OPENGL_ES 1
-#define USE_ANGLE 0
 #endif
 #if PLATFORM(COCOA)
 #ifndef GL_SILENCE_DEPRECATION
 #define USE_EGL 1
 #endif
 
-#if ENABLE(WEBGL)
-#if (USE_ANGLE && (USE_OPENGL || USE_OPENGL_ES || (defined(USE_EGL) && USE_EGL)))
-#error USE_ANGLE is incompatible with USE_OPENGL, USE_OPENGL_ES and USE_EGL
-#endif
-#endif
-
 #if USE(TEXTURE_MAPPER) && ENABLE(GRAPHICS_CONTEXT_3D) && !defined(USE_TEXTURE_MAPPER_GL)
 #define USE_TEXTURE_MAPPER_GL 1
 #endif
index c9aed57..94711c2 100644 (file)
@@ -1,3 +1,16 @@
+2019-06-17  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rolling out r246501.
+
+        Breaks Apple internal builds.
+
+        Reverted changeset:
+
+        "Support using ANGLE as the backend for the WebGL
+        implementation"
+        https://bugs.webkit.org/show_bug.cgi?id=197755
+        https://trac.webkit.org/changeset/246501
+
 2019-06-17  Kenneth Russell  <kbr@chromium.org>
 
         Support using ANGLE as the backend for the WebGL implementation
index e80a53d..18bfd30 100644 (file)
@@ -220,12 +220,6 @@ platform/gamepad/mac/HIDGamepadProvider.cpp
 
 platform/graphics/MediaPlaybackTargetPicker.cpp
 
-// These sources can't be unified with others in case they are merged
-// with files that use the system OpenGL.
-platform/graphics/angle/Extensions3DANGLE.cpp @no-unify
-platform/graphics/angle/GraphicsContext3DANGLE.cpp @no-unify
-platform/graphics/angle/TemporaryANGLESetting.cpp @no-unify
-
 platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm @no-unify
 platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm @no-unify
 platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm @no-unify
index 36cf664..aacba4c 100644 (file)
                6E4E91AF10F7FB3100A2779C /* WebGLContextAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E4E91AA10F7FB3100A2779C /* WebGLContextAttributes.h */; settings = {ATTRIBUTES = (Private, ); }; };
                6E67D2A71280E8A4008758F7 /* Extensions3DOpenGL.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E67D2A51280E8A4008758F7 /* Extensions3DOpenGL.h */; };
                6E67D2A91280E8BD008758F7 /* Extensions3D.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E67D2A81280E8BD008758F7 /* Extensions3D.h */; };
-               6E72F54C229DCD0C00B3E151 /* Extensions3DANGLE.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E27F243229C9F8400F1F632 /* Extensions3DANGLE.cpp */; };
-               6E72F54E229DCD1000B3E151 /* GraphicsContext3DANGLE.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E27F2422298CE4B00F1F632 /* GraphicsContext3DANGLE.cpp */; };
-               6E72F54F229DCD1300B3E151 /* TemporaryANGLESetting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E290861229DB950000986E2 /* TemporaryANGLESetting.cpp */; };
-               6E72F550229DCD1700B3E151 /* Extensions3DANGLE.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E27F244229C9F8D00F1F632 /* Extensions3DANGLE.h */; };
-               6E72F551229DCD1A00B3E151 /* TemporaryANGLESetting.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E290863229DB970000986E2 /* TemporaryANGLESetting.h */; };
                6E84E9E117668BF100815B68 /* RasterShape.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E84E9DF17668BAD00815B68 /* RasterShape.h */; settings = {ATTRIBUTES = (Private, ); }; };
                6EBF0E4812A8926100DB1709 /* OESTextureFloat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6EBF0E4512A8926100DB1709 /* OESTextureFloat.cpp */; };
                6EBF0E4912A8926100DB1709 /* OESTextureFloat.h in Headers */ = {isa = PBXBuildFile; fileRef = 6EBF0E4612A8926100DB1709 /* OESTextureFloat.h */; };
                6E0E569A183BFFE600E0E8D5 /* FloatRoundedRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FloatRoundedRect.h; sourceTree = "<group>"; };
                6E21C6BF1126338500A7BE02 /* GraphicsContext3D.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContext3D.cpp; sourceTree = "<group>"; };
                6E21C6C11126339900A7BE02 /* GraphicsContext3DCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContext3DCG.cpp; sourceTree = "<group>"; };
-               6E27F2422298CE4B00F1F632 /* GraphicsContext3DANGLE.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContext3DANGLE.cpp; sourceTree = "<group>"; };
-               6E27F243229C9F8400F1F632 /* Extensions3DANGLE.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Extensions3DANGLE.cpp; sourceTree = "<group>"; };
-               6E27F244229C9F8D00F1F632 /* Extensions3DANGLE.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Extensions3DANGLE.h; sourceTree = "<group>"; };
-               6E290861229DB950000986E2 /* TemporaryANGLESetting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TemporaryANGLESetting.cpp; sourceTree = "<group>"; };
-               6E290863229DB970000986E2 /* TemporaryANGLESetting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TemporaryANGLESetting.h; sourceTree = "<group>"; };
                6E3FAD3614733F4000E42306 /* JSWebGLCompressedTextureS3TC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGLCompressedTextureS3TC.cpp; sourceTree = "<group>"; };
                6E3FAD3614733F4000E42307 /* JSWebGLDepthTexture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGLDepthTexture.cpp; sourceTree = "<group>"; };
                6E3FAD3614733F4010E42307 /* JSWebGLDebugRendererInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGLDebugRendererInfo.cpp; sourceTree = "<group>"; };
                        tabWidth = 4;
                        usesTabs = 0;
                };
-               6E27F2412298CE2E00F1F632 /* angle */ = {
-                       isa = PBXGroup;
-                       children = (
-                               6E27F243229C9F8400F1F632 /* Extensions3DANGLE.cpp */,
-                               6E27F244229C9F8D00F1F632 /* Extensions3DANGLE.h */,
-                               6E27F2422298CE4B00F1F632 /* GraphicsContext3DANGLE.cpp */,
-                               6E290861229DB950000986E2 /* TemporaryANGLESetting.cpp */,
-                               6E290863229DB970000986E2 /* TemporaryANGLESetting.h */,
-                       );
-                       path = angle;
-                       sourceTree = "<group>";
-               };
                6FCFC055212DACC2007695D2 /* floats */ = {
                        isa = PBXGroup;
                        children = (
                B2A015910AF6CD53006BCE0E /* graphics */ = {
                        isa = PBXGroup;
                        children = (
-                               6E27F2412298CE2E00F1F632 /* angle */,
                                076F0D0812B8192700C26AA4 /* avfoundation */,
                                499B3EC0128CCC1800E726C2 /* ca */,
                                B27535290B053814002CE64F /* cg */,
                                837FB3451F9EA06D00D0FC31 /* ExtendableMessageEvent.h in Headers */,
                                31DCDF441DA1C45400EA5B93 /* ExtendedColor.h in Headers */,
                                6E67D2A91280E8BD008758F7 /* Extensions3D.h in Headers */,
-                               6E72F550229DCD1700B3E151 /* Extensions3DANGLE.h in Headers */,
                                6E67D2A71280E8A4008758F7 /* Extensions3DOpenGL.h in Headers */,
                                44DAB5B215A623580097C1E4 /* Extensions3DOpenGLCommon.h in Headers */,
                                E47E276516036ED200EE2AFB /* ExtensionStyleSheets.h in Headers */,
                                F55B3DD61251F12D003EF269 /* TelephoneInputType.h in Headers */,
                                7CC564B818BABEA6001B9652 /* TelephoneNumberDetector.h in Headers */,
                                C65046A9167BFB5500CC2A4D /* TemplateContentDocumentFragment.h in Headers */,
-                               6E72F551229DCD1A00B3E151 /* TemporaryANGLESetting.h in Headers */,
                                26E944DD1AC4B4EA007B85B5 /* Term.h in Headers */,
                                6550B6A6099DF0270090D781 /* Text.h in Headers */,
                                93309E17099E64920056E581 /* TextAffinity.h in Headers */,
                                E58B45BB20AD07DD00991025 /* DataListButtonElement.cpp in Sources */,
                                515BE18F1D54F5FB00DD7C68 /* EmptyGamepadProvider.cpp in Sources */,
                                724ED32C1A3A7E5400F5F13C /* EXTBlendMinMax.cpp in Sources */,
-                               6E72F54C229DCD0C00B3E151 /* Extensions3DANGLE.cpp in Sources */,
                                72F1ADA21A3904DC00014E18 /* EXTFragDepth.cpp in Sources */,
                                5C4304B0191AC908000E2BC0 /* EXTShaderTextureLOD.cpp in Sources */,
                                727AFED41A2EA6AE000442E8 /* EXTsRGB.cpp in Sources */,
                                837964CF1F8DB69D00218EA0 /* GeolocationPositionIOS.mm in Sources */,
                                D084033C221CBF6900007205 /* GPUBuffer.cpp in Sources */,
                                6E21C6C01126338500A7BE02 /* GraphicsContext3D.cpp in Sources */,
-                               6E72F54E229DCD1000B3E151 /* GraphicsContext3DANGLE.cpp in Sources */,
                                7C3E510B18DF8F3500C112F7 /* HTMLConverter.mm in Sources */,
                                A8D06B3A0A265DCD005E7203 /* HTMLNames.cpp in Sources */,
                                1AC900C31943C0FC008625B5 /* HTTPHeaderNames.cpp in Sources */,
                                538F10A81F9022A4005102CE /* SoftLinkLibxslt.cpp in Sources */,
                                CDC8B5AA18047FF10016E685 /* SourceBufferPrivateAVFObjC.mm in Sources */,
                                A833C7CA0A2CF06B00D57664 /* SVGNames.cpp in Sources */,
-                               6E72F54F229DCD1300B3E151 /* TemporaryANGLESetting.cpp in Sources */,
                                9759E93F14EF1CF80026A2DD /* TextTrack.cpp in Sources */,
                                9759E94214EF1CF80026A2DD /* TextTrackCue.cpp in Sources */,
                                071A9EC2168FBC43002629F9 /* TextTrackCueGeneric.cpp in Sources */,
index 60af01b..4f38bf3 100644 (file)
 
 #if USE(OPENGL_ES)
 #import <OpenGLES/ES2/glext.h>
-#elif USE(OPENGL)
-#include <OpenGL/gl.h>
-#elif USE(ANGLE)
-#include <ANGLE/gl2.h>
 #else
-#error Unsupported configuration
+#include <OpenGL/gl.h>
 #endif
 
 #elif PLATFORM(WIN)
index 49eba7a..11b0e99 100644 (file)
@@ -64,14 +64,10 @@ typedef void* PlatformGraphicsContext3D;
 #endif // __OBJC__
 #endif // USE(OPENGL_ES)
 
-#if USE(OPENGL)
+#if !USE(OPENGL_ES)
 typedef struct _CGLContextObject *CGLContextObj;
 typedef CGLContextObj PlatformGraphicsContext3D;
-#endif // USE(OPENGL)
-
-#if USE(ANGLE)
-typedef void* PlatformGraphicsContext3D;
-#endif // USE(ANGLE)
+#endif
 
 OBJC_CLASS CALayer;
 OBJC_CLASS WebGLLayer;
@@ -98,10 +94,8 @@ namespace WebCore {
 class Extensions3D;
 #if !PLATFORM(COCOA) && USE(OPENGL_ES)
 class Extensions3DOpenGLES;
-#elif USE(OPENGL) || (PLATFORM(COCOA) && USE(OPENGL_ES))
+#else
 class Extensions3DOpenGL;
-#elif USE(ANGLE)
-class Extensions3DANGLE;
 #endif
 class HostWindow;
 class Image;
@@ -1437,16 +1431,12 @@ private:
 
 #if !PLATFORM(COCOA) && USE(OPENGL_ES)
     friend class Extensions3DOpenGLES;
-    friend class Extensions3DOpenGLCommon;
     std::unique_ptr<Extensions3DOpenGLES> m_extensions;
-#elif USE(OPENGL) || (PLATFORM(COCOA) && USE(OPENGL_ES))
+#else
     friend class Extensions3DOpenGL;
-    friend class Extensions3DOpenGLCommon;
     std::unique_ptr<Extensions3DOpenGL> m_extensions;
-#elif USE(ANGLE)
-    friend class Extensions3DANGLE;
-    std::unique_ptr<Extensions3DANGLE> m_extensions;
 #endif
+    friend class Extensions3DOpenGLCommon;
 
     GraphicsContext3DAttributes m_attrs;
     GraphicsContext3DPowerPreference m_powerPreferenceUsedForCreation { GraphicsContext3DPowerPreference::Default };
index 0880008..286b4ed 100644 (file)
@@ -35,7 +35,7 @@
 #include <sys/sysctl.h>
 #endif
 
-#if PLATFORM(MAC) && USE(OPENGL)
+#if PLATFORM(MAC)
 #include "SwitchingGPUClient.h"
 #include <OpenGL/OpenGL.h>
 #endif
@@ -134,8 +134,7 @@ void GraphicsContext3DManager::displayWasReconfigured(CGDirectDisplayID, CGDispl
 
 void GraphicsContext3DManager::updateAllContexts()
 {
-    // FIXME: determine whether to do anything when using ANGLE.
-#if PLATFORM(MAC) && USE(OPENGL)
+#if PLATFORM(MAC)
     for (const auto& context : m_contexts) {
         context->updateCGLContext();
         context->dispatchContextChangedNotification();
@@ -218,7 +217,7 @@ void GraphicsContext3DManager::removeContextRequiringHighPerformance(GraphicsCon
 
 void GraphicsContext3DManager::updateHighPerformanceState()
 {
-#if PLATFORM(MAC) && USE(OPENGL)
+#if PLATFORM(MAC)
     if (!hasLowAndHighPowerGPUs())
         return;
     
@@ -258,7 +257,7 @@ void GraphicsContext3DManager::disableHighPerformanceGPUTimerFired()
         return;
 
     m_requestingHighPerformance = false;
-#if PLATFORM(MAC) && USE(OPENGL)
+#if PLATFORM(MAC)
     SwitchingGPUClient::singleton().releaseHighPerformanceGPU();
 #endif
 }
diff --git a/Source/WebCore/platform/graphics/angle/Extensions3DANGLE.cpp b/Source/WebCore/platform/graphics/angle/Extensions3DANGLE.cpp
deleted file mode 100644 (file)
index 5ef9011..0000000
+++ /dev/null
@@ -1,314 +0,0 @@
-/*
- * Copyright (C) 2019 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if ENABLE(GRAPHICS_CONTEXT_3D) && USE(ANGLE)
-#include "Extensions3DANGLE.h"
-
-#include "GraphicsContext3D.h"
-
-#include <ANGLE/entry_points_gles_2_0_autogen.h>
-#include <ANGLE/entry_points_gles_3_0_autogen.h>
-
-// Note: this file can't be compiled in the same unified source file
-// as others which include the system's OpenGL headers.
-
-namespace WebCore {
-
-Extensions3DANGLE::Extensions3DANGLE(GraphicsContext3D* context, bool useIndexedGetString)
-    : m_initializedAvailableExtensions(false)
-    , m_context(context)
-    , m_isNVIDIA(false)
-    , m_isAMD(false)
-    , m_isIntel(false)
-    , m_isImagination(false)
-    , m_requiresBuiltInFunctionEmulation(false)
-    , m_requiresRestrictedMaximumTextureSize(false)
-    , m_useIndexedGetString(useIndexedGetString)
-{
-    // FIXME: ideally, remove this initialization altogether. ANGLE
-    // subsumes the responsibility for graphics driver workarounds.
-    m_vendor = String(reinterpret_cast<const char*>(::glGetString(GL_VENDOR)));
-    m_renderer = String(reinterpret_cast<const char*>(::glGetString(GL_RENDERER)));
-
-    Vector<String> vendorComponents = m_vendor.convertToASCIILowercase().split(' ');
-    if (vendorComponents.contains("nvidia"))
-        m_isNVIDIA = true;
-    if (vendorComponents.contains("ati") || vendorComponents.contains("amd"))
-        m_isAMD = true;
-    if (vendorComponents.contains("intel"))
-        m_isIntel = true;
-    if (vendorComponents.contains("imagination"))
-        m_isImagination = true;
-}
-
-Extensions3DANGLE::~Extensions3DANGLE() = default;
-
-bool Extensions3DANGLE::supports(const String& name)
-{
-    if (!m_initializedAvailableExtensions)
-        initializeAvailableExtensions();
-
-    // We explicitly do not support this extension until
-    // we fix the following bug:
-    // https://bugs.webkit.org/show_bug.cgi?id=149734
-    // FIXME: given that ANGLE is in use, rewrite this in terms of
-    // ANGLE queries and enable this extension.
-    if (name == "GL_ANGLE_translated_shader_source")
-        return false;
-
-    return supportsExtension(name);
-}
-
-void Extensions3DANGLE::ensureEnabled(const String& name)
-{
-    if (name == "GL_OES_standard_derivatives") {
-        // Enable support in ANGLE (if not enabled already).
-        ANGLEWebKitBridge& compiler = m_context->m_compiler;
-        ShBuiltInResources ANGLEResources = compiler.getResources();
-        if (!ANGLEResources.OES_standard_derivatives) {
-            ANGLEResources.OES_standard_derivatives = 1;
-            compiler.setResources(ANGLEResources);
-        }
-    } else if (name == "GL_EXT_draw_buffers") {
-        // Enable support in ANGLE (if not enabled already).
-        ANGLEWebKitBridge& compiler = m_context->m_compiler;
-        ShBuiltInResources ANGLEResources = compiler.getResources();
-        if (!ANGLEResources.EXT_draw_buffers) {
-            ANGLEResources.EXT_draw_buffers = 1;
-            m_context->getIntegerv(Extensions3D::MAX_DRAW_BUFFERS_EXT, &ANGLEResources.MaxDrawBuffers);
-            compiler.setResources(ANGLEResources);
-        }
-    } else if (name == "GL_EXT_shader_texture_lod") {
-        // Enable support in ANGLE (if not enabled already).
-        ANGLEWebKitBridge& compiler = m_context->m_compiler;
-        ShBuiltInResources ANGLEResources = compiler.getResources();
-        if (!ANGLEResources.EXT_shader_texture_lod) {
-            ANGLEResources.EXT_shader_texture_lod = 1;
-            compiler.setResources(ANGLEResources);
-        }
-    } else if (name == "GL_EXT_frag_depth") {
-        // Enable support in ANGLE (if not enabled already).
-        ANGLEWebKitBridge& compiler = m_context->m_compiler;
-        ShBuiltInResources ANGLEResources = compiler.getResources();
-        if (!ANGLEResources.EXT_frag_depth) {
-            ANGLEResources.EXT_frag_depth = 1;
-            compiler.setResources(ANGLEResources);
-        }
-    }
-}
-
-bool Extensions3DANGLE::isEnabled(const String& name)
-{
-    if (name == "GL_OES_standard_derivatives") {
-        ANGLEWebKitBridge& compiler = m_context->m_compiler;
-        return compiler.getResources().OES_standard_derivatives;
-    }
-    return supports(name);
-}
-
-int Extensions3DANGLE::getGraphicsResetStatusARB()
-{
-    return GraphicsContext3D::NO_ERROR;
-}
-
-String Extensions3DANGLE::getTranslatedShaderSourceANGLE(Platform3DObject shader)
-{
-    // FIXME: port to use ANGLE's implementation directly.
-    ASSERT(shader);
-    int GLshaderType;
-    ANGLEShaderType shaderType;
-
-    ANGLEWebKitBridge& compiler = m_context->m_compiler;
-
-    m_context->getShaderiv(shader, GraphicsContext3D::SHADER_TYPE, &GLshaderType);
-
-    if (GLshaderType == GraphicsContext3D::VERTEX_SHADER)
-        shaderType = SHADER_TYPE_VERTEX;
-    else if (GLshaderType == GraphicsContext3D::FRAGMENT_SHADER)
-        shaderType = SHADER_TYPE_FRAGMENT;
-    else
-        return emptyString(); // Invalid shader type.
-
-    HashMap<Platform3DObject, GraphicsContext3D::ShaderSourceEntry>::iterator result = m_context->m_shaderSourceMap.find(shader);
-
-    if (result == m_context->m_shaderSourceMap.end())
-        return emptyString();
-
-    GraphicsContext3D::ShaderSourceEntry& entry = result->value;
-
-    String translatedShaderSource;
-    String shaderInfoLog;
-    uint64_t extraCompileOptions = SH_CLAMP_INDIRECT_ARRAY_BOUNDS | SH_UNFOLD_SHORT_CIRCUIT | SH_INIT_OUTPUT_VARIABLES | SH_ENFORCE_PACKING_RESTRICTIONS | SH_LIMIT_EXPRESSION_COMPLEXITY | SH_LIMIT_CALL_STACK_DEPTH | SH_INITIALIZE_UNINITIALIZED_LOCALS;
-
-    if (m_requiresBuiltInFunctionEmulation)
-        extraCompileOptions |= SH_EMULATE_ABS_INT_FUNCTION;
-
-    Vector<std::pair<ANGLEShaderSymbolType, sh::ShaderVariable>> symbols;
-    bool isValid = compiler.compileShaderSource(entry.source.utf8().data(), shaderType, translatedShaderSource, shaderInfoLog, symbols, extraCompileOptions);
-
-    entry.log = shaderInfoLog;
-    entry.isValid = isValid;
-
-    for (const std::pair<ANGLEShaderSymbolType, sh::ShaderVariable>& pair : symbols) {
-        const std::string& name = pair.second.name;
-        entry.symbolMap(pair.first).set(String(name.c_str(), name.length()), pair.second);
-    }
-
-    if (!isValid)
-        return emptyString();
-
-    return translatedShaderSource;
-}
-
-void Extensions3DANGLE::initializeAvailableExtensions()
-{
-    if (m_useIndexedGetString) {
-        GLint numExtensions = 0;
-        gl::GetIntegerv(GL_NUM_EXTENSIONS, &numExtensions);
-        for (GLint i = 0; i < numExtensions; ++i)
-            m_availableExtensions.add(glGetStringi(GL_EXTENSIONS, i));
-    } else {
-        String extensionsString = getExtensions();
-        for (auto& extension : extensionsString.split(' '))
-            m_availableExtensions.add(extension);
-    }
-    m_initializedAvailableExtensions = true;
-}
-
-void Extensions3DANGLE::readnPixelsEXT(int, int, GC3Dsizei, GC3Dsizei, GC3Denum, GC3Denum, GC3Dsizei, void *)
-{
-    m_context->synthesizeGLError(GL_INVALID_OPERATION);
-}
-
-void Extensions3DANGLE::getnUniformfvEXT(GC3Duint, int, GC3Dsizei, float *)
-{
-    m_context->synthesizeGLError(GL_INVALID_OPERATION);
-}
-
-void Extensions3DANGLE::getnUniformivEXT(GC3Duint, int, GC3Dsizei, int *)
-{
-    m_context->synthesizeGLError(GL_INVALID_OPERATION);
-}
-
-void Extensions3DANGLE::blitFramebuffer(long srcX0, long srcY0, long srcX1, long srcY1, long dstX0, long dstY0, long dstX1, long dstY1, unsigned long mask, unsigned long filter)
-{
-    // FIXME: consider adding support for APPLE_framebuffer_multisample.
-    gl::BlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
-}
-
-void Extensions3DANGLE::renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height)
-{
-    gl::RenderbufferStorageMultisample(target, samples, internalformat, width, height);
-}
-
-Platform3DObject Extensions3DANGLE::createVertexArrayOES()
-{
-    m_context->makeContextCurrent();
-    GLuint array = 0;
-    gl::GenVertexArrays(1, &array);
-    return array;
-}
-
-void Extensions3DANGLE::deleteVertexArrayOES(Platform3DObject array)
-{
-    if (!array)
-        return;
-
-    m_context->makeContextCurrent();
-    gl::DeleteVertexArrays(1, &array);
-}
-
-GC3Dboolean Extensions3DANGLE::isVertexArrayOES(Platform3DObject array)
-{
-    if (!array)
-        return GL_FALSE;
-
-    m_context->makeContextCurrent();
-    return gl::IsVertexArray(array);
-}
-
-void Extensions3DANGLE::bindVertexArrayOES(Platform3DObject array)
-{
-    m_context->makeContextCurrent();
-    gl::BindVertexArray(array);
-}
-
-void Extensions3DANGLE::insertEventMarkerEXT(const String&)
-{
-    // FIXME: implement this function and add GL_EXT_debug_marker in supports().
-    return;
-}
-
-void Extensions3DANGLE::pushGroupMarkerEXT(const String&)
-{
-    // FIXME: implement this function and add GL_EXT_debug_marker in supports().
-    return;
-}
-
-void Extensions3DANGLE::popGroupMarkerEXT(void)
-{
-    // FIXME: implement this function and add GL_EXT_debug_marker in supports().
-    return;
-}
-
-bool Extensions3DANGLE::supportsExtension(const String& name)
-{
-    return m_availableExtensions.contains(name);
-}
-
-void Extensions3DANGLE::drawBuffersEXT(GC3Dsizei n, const GC3Denum* bufs)
-{
-    gl::DrawBuffers(n, bufs);
-}
-
-void Extensions3DANGLE::drawArraysInstanced(GC3Denum mode, GC3Dint first, GC3Dsizei count, GC3Dsizei primcount)
-{
-    m_context->makeContextCurrent();
-    gl::DrawArraysInstanced(mode, first, count, primcount);
-}
-
-void Extensions3DANGLE::drawElementsInstanced(GC3Denum mode, GC3Dsizei count, GC3Denum type, long long offset, GC3Dsizei primcount)
-{
-    m_context->makeContextCurrent();
-    gl::DrawElementsInstanced(mode, count, type, reinterpret_cast<GLvoid*>(static_cast<intptr_t>(offset)), primcount);
-}
-
-void Extensions3DANGLE::vertexAttribDivisor(GC3Duint index, GC3Duint divisor)
-{
-    m_context->makeContextCurrent();
-    gl::VertexAttribDivisor(index, divisor);
-}
-
-String Extensions3DANGLE::getExtensions()
-{
-    ASSERT(!m_useIndexedGetString);
-    return String(reinterpret_cast<const char*>(gl::GetString(GL_EXTENSIONS)));
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(GRAPHICS_CONTEXT_3D) && USE(ANGLE)
diff --git a/Source/WebCore/platform/graphics/angle/Extensions3DANGLE.h b/Source/WebCore/platform/graphics/angle/Extensions3DANGLE.h
deleted file mode 100644 (file)
index dc29af6..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (C) 2019 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "Extensions3D.h"
-
-#include "GraphicsContext3D.h"
-#include <wtf/text/StringHash.h>
-
-namespace WebCore {
-
-class Extensions3DANGLE : public Extensions3D {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    // This class only needs to be instantiated by GraphicsContext3D implementations.
-    Extensions3DANGLE(GraphicsContext3D*, bool useIndexedGetString);
-    virtual ~Extensions3DANGLE();
-
-    // Extensions3D methods.
-    bool supports(const String&) override;
-    void ensureEnabled(const String&) override;
-    bool isEnabled(const String&) override;
-    int getGraphicsResetStatusARB() override;
-
-    Platform3DObject createVertexArrayOES() override;
-    void deleteVertexArrayOES(Platform3DObject) override;
-    GC3Dboolean isVertexArrayOES(Platform3DObject) override;
-    void bindVertexArrayOES(Platform3DObject) override;
-    void insertEventMarkerEXT(const String&) override;
-    void pushGroupMarkerEXT(const String&) override;
-    void popGroupMarkerEXT(void) override;
-    void drawBuffersEXT(GC3Dsizei, const GC3Denum*) override;
-
-    String getTranslatedShaderSourceANGLE(Platform3DObject) override;
-
-    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;
-    void renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height) override;
-
-    void drawArraysInstanced(GC3Denum mode, GC3Dint first, GC3Dsizei count, GC3Dsizei primcount) override;
-    void drawElementsInstanced(GC3Denum mode, GC3Dsizei count, GC3Denum type, long long offset, GC3Dsizei primcount) override;
-    void vertexAttribDivisor(GC3Duint index, GC3Duint divisor) override;
-
-    // EXT Robustness - uses getGraphicsResetStatusARB()
-    void readnPixelsEXT(int x, int y, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, GC3Dsizei bufSize, void *data) override;
-    void getnUniformfvEXT(GC3Duint program, int location, GC3Dsizei bufSize, float *params) override;
-    void getnUniformivEXT(GC3Duint program, int location, GC3Dsizei bufSize, int *params) override;
-
-    bool isNVIDIA() override { return m_isNVIDIA; }
-    bool isAMD() override { return m_isAMD; }
-    bool isIntel() override { return m_isIntel; }
-    bool isImagination() override { return m_isImagination; }
-    String vendor() override { return m_vendor; }
-
-    bool requiresBuiltInFunctionEmulation() override { return m_requiresBuiltInFunctionEmulation; }
-    bool requiresRestrictedMaximumTextureSize() override { return m_requiresRestrictedMaximumTextureSize; }
-
-private:
-    bool supportsExtension(const WTF::String&);
-    String getExtensions();
-
-    virtual void initializeAvailableExtensions();
-    bool m_initializedAvailableExtensions;
-    HashSet<String> m_availableExtensions;
-
-    // Weak pointer back to GraphicsContext3D.
-    GraphicsContext3D* m_context;
-
-    bool m_isNVIDIA;
-    bool m_isAMD;
-    bool m_isIntel;
-    bool m_isImagination;
-    bool m_requiresBuiltInFunctionEmulation;
-    bool m_requiresRestrictedMaximumTextureSize;
-
-    bool m_useIndexedGetString { false };
-
-    String m_vendor;
-    String m_renderer;
-};
-
-} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/angle/GraphicsContext3DANGLE.cpp b/Source/WebCore/platform/graphics/angle/GraphicsContext3DANGLE.cpp
deleted file mode 100644 (file)
index 94e5af3..0000000
+++ /dev/null
@@ -1,2305 +0,0 @@
-/*
- * Copyright (C) 2010, 2013 Apple Inc. All rights reserved.
- * Copyright (C) 2019 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#include "config.h"
-
-#if ENABLE(GRAPHICS_CONTEXT_3D) && USE(ANGLE)
-#include "GraphicsContext3D.h"
-
-#if PLATFORM(IOS_FAMILY)
-#include "GraphicsContext3DIOS.h"
-#endif
-#include "Extensions3DANGLE.h"
-#include "ImageBuffer.h"
-#include "ImageData.h"
-#include "IntRect.h"
-#include "IntSize.h"
-#include "Logging.h"
-#include "NotImplemented.h"
-#include "TemporaryANGLESetting.h"
-#include <JavaScriptCore/RegularExpression.h>
-#include <algorithm>
-#include <cstring>
-#include <wtf/HexNumber.h>
-#include <wtf/ThreadSpecific.h>
-#include <wtf/text/CString.h>
-#include <wtf/text/StringBuilder.h>
-
-#if USE(ACCELERATE)
-#include <Accelerate/Accelerate.h>
-#endif
-
-#include <ANGLE/entry_points_gles_2_0_autogen.h>
-#include <ANGLE/entry_points_gles_3_0_autogen.h>
-
-// Note: this file can't be compiled in the same unified source file
-// as others which include the system's OpenGL headers.
-
-// This one definition short-circuits the need for gl2ext.h, which
-// would need more work to be included from WebCore.
-#define GL_MAX_SAMPLES_EXT 0x8D57
-
-namespace WebCore {
-
-void GraphicsContext3D::releaseShaderCompiler()
-{
-    makeContextCurrent();
-    notImplemented();
-}
-
-#if PLATFORM(MAC)
-static void wipeAlphaChannelFromPixels(int width, int height, unsigned char* pixels)
-{
-    // We can assume this doesn't overflow because the calling functions
-    // use checked arithmetic.
-    int totalBytes = width * height * 4;
-    for (int i = 0; i < totalBytes; i += 4)
-        pixels[i + 3] = 255;
-}
-#endif
-
-void GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary(int x, int y, int width, int height, unsigned char* pixels)
-{
-    // NVIDIA drivers have a bug where calling readPixels in BGRA can return the wrong values for the alpha channel when the alpha is off for the context.
-    gl::ReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
-#if USE(ACCELERATE)
-    vImage_Buffer src;
-    src.height = height;
-    src.width = width;
-    src.rowBytes = width * 4;
-    src.data = pixels;
-
-    vImage_Buffer dest;
-    dest.height = height;
-    dest.width = width;
-    dest.rowBytes = width * 4;
-    dest.data = pixels;
-
-    // Swap pixel channels from RGBA to BGRA.
-    const uint8_t map[4] = { 2, 1, 0, 3 };
-    vImagePermuteChannels_ARGB8888(&src, &dest, map, kvImageNoFlags);
-#else
-    int totalBytes = width * height * 4;
-    for (int i = 0; i < totalBytes; i += 4)
-        std::swap(pixels[i], pixels[i + 2]);
-#endif
-
-#if PLATFORM(MAC)
-    if (!m_attrs.alpha)
-        wipeAlphaChannelFromPixels(width, height, pixels);
-#endif
-}
-
-void GraphicsContext3D::validateAttributes()
-{
-    validateDepthStencil("GL_EXT_packed_depth_stencil");
-}
-
-bool GraphicsContext3D::reshapeFBOs(const IntSize& size)
-{
-    const int width = size.width();
-    const int height = size.height();
-    GLuint colorFormat, internalDepthStencilFormat = 0;
-    if (m_attrs.alpha) {
-        m_internalColorFormat = GL_RGBA8;
-        colorFormat = GL_RGBA;
-    } else {
-        m_internalColorFormat = GL_RGB8;
-        colorFormat = GL_RGB;
-    }
-    if (m_attrs.stencil || m_attrs.depth) {
-        // We don't allow the logic where stencil is required and depth is not.
-        // See GraphicsContext3D::validateAttributes.
-
-        Extensions3D& extensions = getExtensions();
-        // Use a 24 bit depth buffer where we know we have it.
-        if (extensions.supports("GL_OES_packed_depth_stencil"))
-            internalDepthStencilFormat = GL_DEPTH24_STENCIL8;
-        else
-            internalDepthStencilFormat = GL_DEPTH_COMPONENT16;
-    }
-
-    // Resize multisample FBO.
-    if (m_attrs.antialias) {
-        GLint maxSampleCount;
-        gl::GetIntegerv(GL_MAX_SAMPLES_EXT, &maxSampleCount);
-        // Using more than 4 samples is slow on some hardware and is unlikely to
-        // produce a significantly better result.
-        GLint sampleCount = std::min(4, maxSampleCount);
-        gl::BindFramebuffer(GL_FRAMEBUFFER, m_multisampleFBO);
-        gl::BindRenderbuffer(GL_RENDERBUFFER, m_multisampleColorBuffer);
-        gl::RenderbufferStorageMultisample(GL_RENDERBUFFER, sampleCount, GL_RGBA8, width, height);
-        gl::FramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, m_multisampleColorBuffer);
-        if (m_attrs.stencil || m_attrs.depth) {
-            gl::BindRenderbuffer(GL_RENDERBUFFER, m_multisampleDepthStencilBuffer);
-            gl::RenderbufferStorageMultisample(GL_RENDERBUFFER, sampleCount, internalDepthStencilFormat, width, height);
-            if (m_attrs.stencil)
-                gl::FramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, m_multisampleDepthStencilBuffer);
-            if (m_attrs.depth)
-                gl::FramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, m_multisampleDepthStencilBuffer);
-        }
-        gl::BindRenderbuffer(GL_RENDERBUFFER, 0);
-        if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) {
-            // FIXME: cleanup.
-            notImplemented();
-        }
-    }
-
-    // resize regular FBO
-    gl::BindFramebuffer(GL_FRAMEBUFFER, m_fbo);
-    ASSERT(m_texture);
-#if PLATFORM(COCOA)
-
-#if PLATFORM(MAC)
-    // FIXME: implement back buffer path using ANGLE and pbuffers.
-    // allocateIOSurfaceBackingStore(IntSize(width, height));
-    // updateFramebufferTextureBackingStoreFromLayer();
-    // gl::FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_RECTANGLE_ARB, m_texture, 0);
-#elif PLATFORM(IOS_FAMILY)
-    // FIXME (kbr): implement iOS path, ideally using glFramebufferTexture2DMultisample.
-    // gl::BindRenderbuffer(GL_RENDERBUFFER, m_texture);
-    // gl::FramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, m_texture);
-    // setRenderbufferStorageFromDrawable(m_currentWidth, m_currentHeight);
-#else
-#error Unknown platform
-#endif
-#else
-    gl::BindTexture(GL_TEXTURE_2D, m_texture);
-    gl::TexImage2D(GL_TEXTURE_2D, 0, m_internalColorFormat, width, height, 0, colorFormat, GL_UNSIGNED_BYTE, 0);
-    gl::FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_texture, 0);
-
-#if USE(COORDINATED_GRAPHICS)
-    if (m_compositorTexture) {
-        gl::BindTexture(GL_TEXTURE_2D, m_compositorTexture);
-        gl::TexImage2D(GL_TEXTURE_2D, 0, m_internalColorFormat, width, height, 0, colorFormat, GL_UNSIGNED_BYTE, 0);
-        gl::BindTexture(GL_TEXTURE_2D, 0);
-        gl::BindTexture(GL_TEXTURE_2D, m_intermediateTexture);
-        gl::TexImage2D(GL_TEXTURE_2D, 0, m_internalColorFormat, width, height, 0, colorFormat, GL_UNSIGNED_BYTE, 0);
-        gl::BindTexture(GL_TEXTURE_2D, 0);
-    }
-#endif
-#endif // PLATFORM(COCOA)
-
-    attachDepthAndStencilBufferIfNeeded(internalDepthStencilFormat, width, height);
-
-    bool mustRestoreFBO = true;
-    if (m_attrs.antialias) {
-        gl::BindFramebuffer(GL_FRAMEBUFFER, m_multisampleFBO);
-        if (m_state.boundFBO == m_multisampleFBO)
-            mustRestoreFBO = false;
-    } else {
-        if (m_state.boundFBO == m_fbo)
-            mustRestoreFBO = false;
-    }
-
-    return mustRestoreFBO;
-}
-
-void GraphicsContext3D::attachDepthAndStencilBufferIfNeeded(GLuint internalDepthStencilFormat, int width, int height)
-{
-    if (!m_attrs.antialias && (m_attrs.stencil || m_attrs.depth)) {
-        gl::BindRenderbuffer(GL_RENDERBUFFER, m_depthStencilBuffer);
-        gl::RenderbufferStorage(GL_RENDERBUFFER, internalDepthStencilFormat, width, height);
-        if (m_attrs.stencil)
-            gl::FramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, m_depthStencilBuffer);
-        if (m_attrs.depth)
-            gl::FramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, m_depthStencilBuffer);
-        gl::BindRenderbuffer(GL_RENDERBUFFER, 0);
-    }
-
-    if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) {
-        // FIXME: cleanup
-        notImplemented();
-    }
-}
-
-void GraphicsContext3D::resolveMultisamplingIfNecessary(const IntRect& rect)
-{
-    TemporaryANGLESetting scopedScissor(GL_SCISSOR_TEST, GL_FALSE);
-    TemporaryANGLESetting scopedDither(GL_DITHER, GL_FALSE);
-    TemporaryANGLESetting scopedDepth(GL_DEPTH_TEST, GL_FALSE);
-    TemporaryANGLESetting scopedStencil(GL_STENCIL_TEST, GL_FALSE);
-
-    // FIXME: figure out more efficient solution for iOS.
-    IntRect resolveRect = rect;
-    if (rect.isEmpty())
-        resolveRect = IntRect(0, 0, m_currentWidth, m_currentHeight);
-
-    gl::BlitFramebuffer(resolveRect.x(), resolveRect.y(), resolveRect.maxX(), resolveRect.maxY(), resolveRect.x(), resolveRect.y(), resolveRect.maxX(), resolveRect.maxY(), GL_COLOR_BUFFER_BIT, GL_LINEAR);
-}
-
-void GraphicsContext3D::renderbufferStorage(GC3Denum target, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height)
-{
-    makeContextCurrent();
-    gl::RenderbufferStorage(target, internalformat, width, height);
-}
-
-void GraphicsContext3D::getIntegerv(GC3Denum pname, GC3Dint* value)
-{
-    makeContextCurrent();
-    switch (pname) {
-    case MAX_TEXTURE_SIZE:
-        gl::GetIntegerv(MAX_TEXTURE_SIZE, value);
-        if (getExtensions().requiresRestrictedMaximumTextureSize())
-            *value = std::min(4096, *value);
-        break;
-    case MAX_CUBE_MAP_TEXTURE_SIZE:
-        gl::GetIntegerv(MAX_CUBE_MAP_TEXTURE_SIZE, value);
-        if (getExtensions().requiresRestrictedMaximumTextureSize())
-            *value = std::min(1024, *value);
-        break;
-#if PLATFORM(MAC)
-    // Some older hardware advertises a larger maximum than they
-    // can actually handle. Rather than detecting such devices, simply
-    // clamp the maximum to 8192, which is big enough for a 5K display.
-    case MAX_RENDERBUFFER_SIZE:
-        gl::GetIntegerv(MAX_RENDERBUFFER_SIZE, value);
-        *value = std::min(8192, *value);
-        break;
-    case MAX_VIEWPORT_DIMS:
-        gl::GetIntegerv(MAX_VIEWPORT_DIMS, value);
-        value[0] = std::min(8192, value[0]);
-        value[1] = std::min(8192, value[1]);
-        break;
-#endif
-    default:
-        gl::GetIntegerv(pname, value);
-    }
-}
-
-void GraphicsContext3D::getShaderPrecisionFormat(GC3Denum shaderType, GC3Denum precisionType, GC3Dint* range, GC3Dint* precision)
-{
-    UNUSED_PARAM(shaderType);
-    ASSERT(range);
-    ASSERT(precision);
-
-    makeContextCurrent();
-
-    switch (precisionType) {
-    case GraphicsContext3D::LOW_INT:
-    case GraphicsContext3D::MEDIUM_INT:
-    case GraphicsContext3D::HIGH_INT:
-        // These values are for a 32-bit twos-complement integer format.
-        range[0] = 31;
-        range[1] = 30;
-        precision[0] = 0;
-        break;
-    case GraphicsContext3D::LOW_FLOAT:
-    case GraphicsContext3D::MEDIUM_FLOAT:
-    case GraphicsContext3D::HIGH_FLOAT:
-        // These values are for an IEEE single-precision floating-point format.
-        range[0] = 127;
-        range[1] = 127;
-        precision[0] = 23;
-        break;
-    default:
-        ASSERT_NOT_REACHED();
-        break;
-    }
-}
-
-bool GraphicsContext3D::texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, const void* pixels)
-{
-    if (width && height && !pixels) {
-        synthesizeGLError(INVALID_VALUE);
-        return false;
-    }
-
-    texImage2DDirect(target, level, internalformat, width, height, border, format, type, pixels);
-    return true;
-}
-
-void GraphicsContext3D::depthRange(GC3Dclampf zNear, GC3Dclampf zFar)
-{
-    makeContextCurrent();
-    gl::DepthRangef(static_cast<float>(zNear), static_cast<float>(zFar));
-}
-
-void GraphicsContext3D::clearDepth(GC3Dclampf depth)
-{
-    makeContextCurrent();
-    gl::ClearDepthf(static_cast<float>(depth));
-}
-
-Extensions3D& GraphicsContext3D::getExtensions()
-{
-    if (!m_extensions)
-        m_extensions = std::make_unique<Extensions3DANGLE>(this, isGLES2Compliant());
-    return *m_extensions;
-}
-
-void GraphicsContext3D::readPixels(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, void* data)
-{
-    // FIXME: remove the two glFlush calls when the driver bug is fixed, i.e.,
-    // all previous rendering calls should be done before reading pixels.
-    makeContextCurrent();
-    gl::Flush();
-    if (m_attrs.antialias && m_state.boundFBO == m_multisampleFBO) {
-        resolveMultisamplingIfNecessary(IntRect(x, y, width, height));
-        gl::BindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_fbo);
-        gl::Flush();
-    }
-    gl::ReadPixels(x, y, width, height, format, type, data);
-    if (m_attrs.antialias && m_state.boundFBO == m_multisampleFBO)
-        gl::BindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_multisampleFBO);
-
-#if PLATFORM(MAC)
-    if (!m_attrs.alpha && (format == GraphicsContext3D::RGBA || format == GraphicsContext3D::BGRA) && (m_state.boundFBO == m_fbo || (m_attrs.antialias && m_state.boundFBO == m_multisampleFBO)))
-        wipeAlphaChannelFromPixels(width, height, static_cast<unsigned char*>(data));
-#endif
-}
-
-
-// The contents of GraphicsContext3DOpenGLCommon follow, ported to use ANGLE.
-
-static ThreadSpecific<ShaderNameHash*>& getCurrentNameHashMapForShader()
-{
-    static std::once_flag onceFlag;
-    static ThreadSpecific<ShaderNameHash*>* sharedNameHash;
-    std::call_once(onceFlag, [] {
-        sharedNameHash = new ThreadSpecific<ShaderNameHash*>;
-    });
-
-    return *sharedNameHash;
-}
-
-static void setCurrentNameHashMapForShader(ShaderNameHash* shaderNameHash)
-{
-    *getCurrentNameHashMapForShader() = shaderNameHash;
-}
-
-// Hash function used by the ANGLE translator/compiler to do
-// symbol name mangling. Since this is a static method, before
-// calling compileShader we set currentNameHashMapForShader
-// to point to the map kept by the current instance of GraphicsContext3D.
-
-static uint64_t nameHashForShader(const char* name, size_t length)
-{
-    if (!length)
-        return 0;
-
-    CString nameAsCString = CString(name);
-
-    // Look up name in our local map.
-    ShaderNameHash*& currentNameHashMapForShader = *getCurrentNameHashMapForShader();
-    ShaderNameHash::iterator findResult = currentNameHashMapForShader->find(nameAsCString);
-    if (findResult != currentNameHashMapForShader->end())
-        return findResult->value;
-
-    unsigned hashValue = nameAsCString.hash();
-
-    // Convert the 32-bit hash from CString::hash into a 64-bit result
-    // by shifting then adding the size of our table. Overflow would
-    // only be a problem if we're already hashing to the same value (and
-    // we're hoping that over the lifetime of the context we
-    // don't have that many symbols).
-
-    uint64_t result = hashValue;
-    result = (result << 32) + (currentNameHashMapForShader->size() + 1);
-
-    currentNameHashMapForShader->set(nameAsCString, result);
-    return result;
-}
-
-void GraphicsContext3D::validateDepthStencil(const char* packedDepthStencilExtension)
-{
-    Extensions3D& extensions = getExtensions();
-    if (m_attrs.stencil) {
-        if (extensions.supports(packedDepthStencilExtension)) {
-            extensions.ensureEnabled(packedDepthStencilExtension);
-            // Force depth if stencil is true.
-            m_attrs.depth = true;
-        } else
-            m_attrs.stencil = false;
-    }
-    if (m_attrs.antialias) {
-        if (!extensions.supports("GL_ANGLE_framebuffer_multisample") || isGLES2Compliant())
-            m_attrs.antialias = false;
-        else
-            extensions.ensureEnabled("GL_ANGLE_framebuffer_multisample");
-    }
-}
-
-void GraphicsContext3D::paintRenderingResultsToCanvas(ImageBuffer* imageBuffer)
-{
-    Checked<int, RecordOverflow> rowBytes = Checked<int, RecordOverflow>(m_currentWidth) * 4;
-    if (rowBytes.hasOverflowed())
-        return;
-
-    Checked<int, RecordOverflow> totalBytesChecked = rowBytes * m_currentHeight;
-    if (totalBytesChecked.hasOverflowed())
-        return;
-    int totalBytes = totalBytesChecked.unsafeGet();
-
-    auto pixels = makeUniqueArray<unsigned char>(totalBytes);
-    if (!pixels)
-        return;
-
-    readRenderingResults(pixels.get(), totalBytes);
-
-    if (!m_attrs.premultipliedAlpha) {
-        for (int i = 0; i < totalBytes; i += 4) {
-            // Premultiply alpha.
-            pixels[i + 0] = std::min(255, pixels[i + 0] * pixels[i + 3] / 255);
-            pixels[i + 1] = std::min(255, pixels[i + 1] * pixels[i + 3] / 255);
-            pixels[i + 2] = std::min(255, pixels[i + 2] * pixels[i + 3] / 255);
-        }
-    }
-
-    paintToCanvas(pixels.get(), IntSize(m_currentWidth, m_currentHeight), imageBuffer->internalSize(), imageBuffer->context());
-
-#if PLATFORM(COCOA) && USE(OPENGL_ES)
-    // FIXME: work on iOS integration.
-    presentRenderbuffer();
-#endif
-}
-
-bool GraphicsContext3D::paintCompositedResultsToCanvas(ImageBuffer*)
-{
-    // Not needed at the moment, so return that nothing was done.
-    return false;
-}
-
-RefPtr<ImageData> GraphicsContext3D::paintRenderingResultsToImageData()
-{
-    // Reading premultiplied alpha would involve unpremultiplying, which is
-    // lossy.
-    if (m_attrs.premultipliedAlpha)
-        return nullptr;
-
-    auto imageData = ImageData::create(IntSize(m_currentWidth, m_currentHeight));
-    unsigned char* pixels = imageData->data()->data();
-    Checked<int, RecordOverflow> totalBytesChecked = 4 * Checked<int, RecordOverflow>(m_currentWidth) * Checked<int, RecordOverflow>(m_currentHeight);
-    if (totalBytesChecked.hasOverflowed())
-        return imageData;
-    int totalBytes = totalBytesChecked.unsafeGet();
-
-    readRenderingResults(pixels, totalBytes);
-
-    // Convert to RGBA.
-    for (int i = 0; i < totalBytes; i += 4)
-        std::swap(pixels[i], pixels[i + 2]);
-
-    return imageData;
-}
-
-void GraphicsContext3D::prepareTexture()
-{
-    if (m_layerComposited)
-        return;
-
-    makeContextCurrent();
-
-#if !USE(COORDINATED_GRAPHICS)
-    TemporaryANGLESetting scopedScissor(GL_SCISSOR_TEST, GL_FALSE);
-    TemporaryANGLESetting scopedDither(GL_DITHER, GL_FALSE);
-#endif
-
-    if (m_attrs.antialias)
-        resolveMultisamplingIfNecessary();
-
-#if USE(COORDINATED_GRAPHICS)
-    std::swap(m_texture, m_compositorTexture);
-    std::swap(m_texture, m_intermediateTexture);
-    gl::BindFramebuffer(GL_FRAMEBUFFER, m_fbo);
-    gl::FramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, m_texture, 0);
-    glFlush();
-
-    if (m_state.boundFBO != m_fbo)
-        gl::BindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_state.boundFBO);
-    else
-        gl::BindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_fbo);
-    return;
-#endif
-
-    gl::ActiveTexture(GL_TEXTURE0);
-    gl::BindTexture(GL_TEXTURE_2D, m_state.boundTarget(GL_TEXTURE0) == GL_TEXTURE_2D ? m_state.boundTexture(GL_TEXTURE0) : 0);
-    gl::ActiveTexture(m_state.activeTextureUnit);
-    if (m_state.boundFBO != m_fbo)
-        gl::BindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_state.boundFBO);
-    gl::Flush();
-}
-
-void GraphicsContext3D::readRenderingResults(unsigned char *pixels, int pixelsSize)
-{
-    if (pixelsSize < m_currentWidth * m_currentHeight * 4)
-        return;
-
-    makeContextCurrent();
-
-    bool mustRestoreFBO = false;
-    if (m_attrs.antialias) {
-        resolveMultisamplingIfNecessary();
-        gl::BindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_fbo);
-        mustRestoreFBO = true;
-    } else {
-        if (m_state.boundFBO != m_fbo) {
-            mustRestoreFBO = true;
-            gl::BindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_fbo);
-        }
-    }
-
-    GLint packAlignment = 4;
-    bool mustRestorePackAlignment = false;
-    gl::GetIntegerv(GL_PACK_ALIGNMENT, &packAlignment);
-    if (packAlignment > 4) {
-        gl::PixelStorei(GL_PACK_ALIGNMENT, 4);
-        mustRestorePackAlignment = true;
-    }
-
-    readPixelsAndConvertToBGRAIfNecessary(0, 0, m_currentWidth, m_currentHeight, pixels);
-
-    if (mustRestorePackAlignment)
-        gl::PixelStorei(GL_PACK_ALIGNMENT, packAlignment);
-
-    if (mustRestoreFBO)
-        gl::BindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_state.boundFBO);
-}
-
-void GraphicsContext3D::reshape(int width, int height)
-{
-    if (!platformGraphicsContext3D())
-        return;
-
-    if (width == m_currentWidth && height == m_currentHeight)
-        return;
-
-    ASSERT(width >= 0 && height >= 0);
-    if (width < 0 || height < 0)
-        return;
-
-    markContextChanged();
-
-    m_currentWidth = width;
-    m_currentHeight = height;
-
-    makeContextCurrent();
-    validateAttributes();
-
-    TemporaryANGLESetting scopedScissor(GL_SCISSOR_TEST, GL_FALSE);
-    TemporaryANGLESetting scopedDither(GL_DITHER, GL_FALSE);
-
-    bool mustRestoreFBO = reshapeFBOs(IntSize(width, height));
-
-    // Initialize renderbuffers to 0.
-    GLfloat clearColor[] = {0, 0, 0, 0}, clearDepth = 0;
-    GLint clearStencil = 0;
-    GLboolean colorMask[] = {GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE}, depthMask = GL_TRUE;
-    GLuint stencilMask = 0xffffffff, stencilMaskBack = 0xffffffff;
-    GLbitfield clearMask = GL_COLOR_BUFFER_BIT;
-    gl::GetFloatv(GL_COLOR_CLEAR_VALUE, clearColor);
-    gl::ClearColor(0, 0, 0, 0);
-    gl::GetBooleanv(GL_COLOR_WRITEMASK, colorMask);
-    gl::ColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
-    if (m_attrs.depth) {
-        gl::GetFloatv(GL_DEPTH_CLEAR_VALUE, &clearDepth);
-        GraphicsContext3D::clearDepth(1);
-        gl::GetBooleanv(GL_DEPTH_WRITEMASK, &depthMask);
-        gl::DepthMask(GL_TRUE);
-        clearMask |= GL_DEPTH_BUFFER_BIT;
-    }
-    if (m_attrs.stencil) {
-        gl::GetIntegerv(GL_STENCIL_CLEAR_VALUE, &clearStencil);
-        gl::ClearStencil(0);
-        gl::GetIntegerv(GL_STENCIL_WRITEMASK, reinterpret_cast<GLint*>(&stencilMask));
-        gl::GetIntegerv(GL_STENCIL_BACK_WRITEMASK, reinterpret_cast<GLint*>(&stencilMaskBack));
-        gl::StencilMaskSeparate(GL_FRONT, 0xffffffff);
-        gl::StencilMaskSeparate(GL_BACK, 0xffffffff);
-        clearMask |= GL_STENCIL_BUFFER_BIT;
-    }
-
-    gl::Clear(clearMask);
-
-    gl::ClearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
-    gl::ColorMask(colorMask[0], colorMask[1], colorMask[2], colorMask[3]);
-    if (m_attrs.depth) {
-        GraphicsContext3D::clearDepth(clearDepth);
-        gl::DepthMask(depthMask);
-    }
-    if (m_attrs.stencil) {
-        gl::ClearStencil(clearStencil);
-        gl::StencilMaskSeparate(GL_FRONT, stencilMask);
-        gl::StencilMaskSeparate(GL_BACK, stencilMaskBack);
-    }
-
-    if (mustRestoreFBO)
-        gl::BindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_state.boundFBO);
-
-    gl::Flush();
-}
-
-bool GraphicsContext3D::checkVaryingsPacking(Platform3DObject vertexShader, Platform3DObject fragmentShader) const
-{
-    ASSERT(m_shaderSourceMap.contains(vertexShader));
-    ASSERT(m_shaderSourceMap.contains(fragmentShader));
-    const auto& vertexEntry = m_shaderSourceMap.find(vertexShader)->value;
-    const auto& fragmentEntry = m_shaderSourceMap.find(fragmentShader)->value;
-
-    HashMap<String, sh::ShaderVariable> combinedVaryings;
-    for (const auto& vertexSymbol : vertexEntry.varyingMap) {
-        const String& symbolName = vertexSymbol.key;
-        // The varying map includes variables for each index of an array variable.
-        // We only want a single variable to represent the array.
-        if (symbolName.endsWith("]"))
-            continue;
-
-        // Don't count built in varyings.
-        if (symbolName == "gl_FragCoord" || symbolName == "gl_FrontFacing" || symbolName == "gl_PointCoord")
-            continue;
-
-        const auto& fragmentSymbol = fragmentEntry.varyingMap.find(symbolName);
-        if (fragmentSymbol != fragmentEntry.varyingMap.end())
-            combinedVaryings.add(symbolName, fragmentSymbol->value);
-    }
-
-    size_t numVaryings = combinedVaryings.size();
-    if (!numVaryings)
-        return true;
-
-    std::vector<sh::ShaderVariable> variables;
-    variables.reserve(combinedVaryings.size());
-    for (const auto& varyingSymbol : combinedVaryings.values())
-        variables.push_back(varyingSymbol);
-
-    GC3Dint maxVaryingVectors = 0;
-    gl::GetIntegerv(MAX_VARYING_VECTORS, &maxVaryingVectors);
-    return sh::CheckVariablesWithinPackingLimits(maxVaryingVectors, variables);
-}
-
-bool GraphicsContext3D::precisionsMatch(Platform3DObject vertexShader, Platform3DObject fragmentShader) const
-{
-    ASSERT(m_shaderSourceMap.contains(vertexShader));
-    ASSERT(m_shaderSourceMap.contains(fragmentShader));
-    const auto& vertexEntry = m_shaderSourceMap.find(vertexShader)->value;
-    const auto& fragmentEntry = m_shaderSourceMap.find(fragmentShader)->value;
-
-    HashMap<String, sh::GLenum> vertexSymbolPrecisionMap;
-
-    for (const auto& entry : vertexEntry.uniformMap) {
-        const std::string& mappedName = entry.value.mappedName;
-        vertexSymbolPrecisionMap.add(String(mappedName.c_str(), mappedName.length()), entry.value.precision);
-    }
-
-    for (const auto& entry : fragmentEntry.uniformMap) {
-        const std::string& mappedName = entry.value.mappedName;
-        const auto& vertexSymbol = vertexSymbolPrecisionMap.find(String(mappedName.c_str(), mappedName.length()));
-        if (vertexSymbol != vertexSymbolPrecisionMap.end() && vertexSymbol->value != entry.value.precision)
-            return false;
-    }
-
-    return true;
-}
-
-IntSize GraphicsContext3D::getInternalFramebufferSize() const
-{
-    return IntSize(m_currentWidth, m_currentHeight);
-}
-
-void GraphicsContext3D::activeTexture(GC3Denum texture)
-{
-    makeContextCurrent();
-    m_state.activeTextureUnit = texture;
-    gl::ActiveTexture(texture);
-}
-
-void GraphicsContext3D::attachShader(Platform3DObject program, Platform3DObject shader)
-{
-    ASSERT(program);
-    ASSERT(shader);
-    makeContextCurrent();
-    m_shaderProgramSymbolCountMap.remove(program);
-    gl::AttachShader(program, shader);
-}
-
-void GraphicsContext3D::bindAttribLocation(Platform3DObject program, GC3Duint index, const String& name)
-{
-    ASSERT(program);
-    makeContextCurrent();
-
-    String mappedName = mappedSymbolName(program, SHADER_SYMBOL_TYPE_ATTRIBUTE, name);
-    LOG(WebGL, "::bindAttribLocation is mapping %s to %s", name.utf8().data(), mappedName.utf8().data());
-    gl::BindAttribLocation(program, index, mappedName.utf8().data());
-}
-
-void GraphicsContext3D::bindBuffer(GC3Denum target, Platform3DObject buffer)
-{
-    makeContextCurrent();
-    gl::BindBuffer(target, buffer);
-}
-
-void GraphicsContext3D::bindFramebuffer(GC3Denum target, Platform3DObject buffer)
-{
-    makeContextCurrent();
-    GLuint fbo;
-    if (buffer)
-        fbo = buffer;
-    else
-        fbo = (m_attrs.antialias ? m_multisampleFBO : m_fbo);
-    if (fbo != m_state.boundFBO) {
-        gl::BindFramebuffer(target, fbo);
-        m_state.boundFBO = fbo;
-    }
-}
-
-void GraphicsContext3D::bindRenderbuffer(GC3Denum target, Platform3DObject renderbuffer)
-{
-    makeContextCurrent();
-    gl::BindRenderbuffer(target, renderbuffer);
-}
-
-
-void GraphicsContext3D::bindTexture(GC3Denum target, Platform3DObject texture)
-{
-    makeContextCurrent();
-    m_state.setBoundTexture(m_state.activeTextureUnit, texture, target);
-    gl::BindTexture(target, texture);
-}
-
-void GraphicsContext3D::blendColor(GC3Dclampf red, GC3Dclampf green, GC3Dclampf blue, GC3Dclampf alpha)
-{
-    makeContextCurrent();
-    gl::BlendColor(red, green, blue, alpha);
-}
-
-void GraphicsContext3D::blendEquation(GC3Denum mode)
-{
-    makeContextCurrent();
-    gl::BlendEquation(mode);
-}
-
-void GraphicsContext3D::blendEquationSeparate(GC3Denum modeRGB, GC3Denum modeAlpha)
-{
-    makeContextCurrent();
-    gl::BlendEquationSeparate(modeRGB, modeAlpha);
-}
-
-
-void GraphicsContext3D::blendFunc(GC3Denum sfactor, GC3Denum dfactor)
-{
-    makeContextCurrent();
-    gl::BlendFunc(sfactor, dfactor);
-}
-
-void GraphicsContext3D::blendFuncSeparate(GC3Denum srcRGB, GC3Denum dstRGB, GC3Denum srcAlpha, GC3Denum dstAlpha)
-{
-    makeContextCurrent();
-    gl::BlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
-}
-
-void GraphicsContext3D::bufferData(GC3Denum target, GC3Dsizeiptr size, GC3Denum usage)
-{
-    makeContextCurrent();
-    gl::BufferData(target, size, 0, usage);
-}
-
-void GraphicsContext3D::bufferData(GC3Denum target, GC3Dsizeiptr size, const void* data, GC3Denum usage)
-{
-    makeContextCurrent();
-    gl::BufferData(target, size, data, usage);
-}
-
-void GraphicsContext3D::bufferSubData(GC3Denum target, GC3Dintptr offset, GC3Dsizeiptr size, const void* data)
-{
-    makeContextCurrent();
-    gl::BufferSubData(target, offset, size, data);
-}
-
-void* GraphicsContext3D::mapBufferRange(GC3Denum target, GC3Dintptr offset, GC3Dsizeiptr length, GC3Dbitfield access)
-{
-    makeContextCurrent();
-    return gl::MapBufferRange(target, offset, length, access);
-}
-
-GC3Dboolean GraphicsContext3D::unmapBuffer(GC3Denum target)
-{
-    makeContextCurrent();
-    return gl::UnmapBuffer(target);
-}
-
-void GraphicsContext3D::copyBufferSubData(GC3Denum readTarget, GC3Denum writeTarget, GC3Dintptr readOffset, GC3Dintptr writeOffset, GC3Dsizeiptr size)
-{
-    makeContextCurrent();
-    gl::CopyBufferSubData(readTarget, writeTarget, readOffset, writeOffset, size);
-}
-
-void GraphicsContext3D::getInternalformativ(GC3Denum target, GC3Denum internalformat, GC3Denum pname, GC3Dsizei bufSize, GC3Dint* params)
-{
-    makeContextCurrent();
-    gl::GetInternalformativ(target, internalformat, pname, bufSize, params);
-}
-
-void GraphicsContext3D::renderbufferStorageMultisample(GC3Denum target, GC3Dsizei samples, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height)
-{
-    makeContextCurrent();
-    gl::RenderbufferStorageMultisample(target, samples, internalformat, width, height);
-}
-
-void GraphicsContext3D::texStorage2D(GC3Denum target, GC3Dsizei levels, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height)
-{
-    makeContextCurrent();
-    gl::TexStorage2D(target, levels, internalformat, width, height);
-    m_state.textureSeedCount.add(m_state.currentBoundTexture());
-}
-
-void GraphicsContext3D::texStorage3D(GC3Denum target, GC3Dsizei levels, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dsizei depth)
-{
-    makeContextCurrent();
-    gl::TexStorage3D(target, levels, internalformat, width, height, depth);
-    m_state.textureSeedCount.add(m_state.currentBoundTexture());
-}
-
-void GraphicsContext3D::getActiveUniforms(Platform3DObject program, const Vector<GC3Duint>& uniformIndices, GC3Denum pname, Vector<GC3Dint>& params)
-{
-    ASSERT(program);
-    makeContextCurrent();
-
-    gl::GetActiveUniformsiv(program, uniformIndices.size(), uniformIndices.data(), pname, params.data());
-}
-
-GC3Denum GraphicsContext3D::checkFramebufferStatus(GC3Denum target)
-{
-    makeContextCurrent();
-    return gl::CheckFramebufferStatus(target);
-}
-
-void GraphicsContext3D::clearColor(GC3Dclampf r, GC3Dclampf g, GC3Dclampf b, GC3Dclampf a)
-{
-    makeContextCurrent();
-    gl::ClearColor(r, g, b, a);
-}
-
-void GraphicsContext3D::clear(GC3Dbitfield mask)
-{
-    makeContextCurrent();
-    gl::Clear(mask);
-    checkGPUStatus();
-}
-
-void GraphicsContext3D::clearStencil(GC3Dint s)
-{
-    makeContextCurrent();
-    gl::ClearStencil(s);
-}
-
-void GraphicsContext3D::colorMask(GC3Dboolean red, GC3Dboolean green, GC3Dboolean blue, GC3Dboolean alpha)
-{
-    makeContextCurrent();
-    gl::ColorMask(red, green, blue, alpha);
-}
-
-void GraphicsContext3D::compileShader(Platform3DObject shader)
-{
-    ASSERT(shader);
-    makeContextCurrent();
-
-    // Turn on name mapping. Due to the way ANGLE name hashing works, we
-    // point a global hashmap to the map owned by this context.
-    ShBuiltInResources ANGLEResources = m_compiler.getResources();
-    ShHashFunction64 previousHashFunction = ANGLEResources.HashFunction;
-    ANGLEResources.HashFunction = nameHashForShader;
-
-    if (!nameHashMapForShaders)
-        nameHashMapForShaders = std::make_unique<ShaderNameHash>();
-    setCurrentNameHashMapForShader(nameHashMapForShaders.get());
-    m_compiler.setResources(ANGLEResources);
-
-    String translatedShaderSource = m_extensions->getTranslatedShaderSourceANGLE(shader);
-
-    ANGLEResources.HashFunction = previousHashFunction;
-    m_compiler.setResources(ANGLEResources);
-    setCurrentNameHashMapForShader(nullptr);
-
-    if (!translatedShaderSource.length())
-        return;
-
-    const CString& translatedShaderCString = translatedShaderSource.utf8();
-    const char* translatedShaderPtr = translatedShaderCString.data();
-    int translatedShaderLength = translatedShaderCString.length();
-
-    LOG(WebGL, "--- begin original shader source ---\n%s\n--- end original shader source ---\n", getShaderSource(shader).utf8().data());
-    LOG(WebGL, "--- begin translated shader source ---\n%s\n--- end translated shader source ---", translatedShaderPtr);
-
-    gl::ShaderSource(shader, 1, &translatedShaderPtr, &translatedShaderLength);
-
-    ::glCompileShader(shader);
-
-    int compileStatus;
-
-    gl::GetShaderiv(shader, COMPILE_STATUS, &compileStatus);
-
-    ShaderSourceMap::iterator result = m_shaderSourceMap.find(shader);
-    GraphicsContext3D::ShaderSourceEntry& entry = result->value;
-
-    // Populate the shader log
-    GLint length = 0;
-    gl::GetShaderiv(shader, GL_INFO_LOG_LENGTH, &length);
-
-    if (length) {
-        GLsizei size = 0;
-        Vector<GLchar> info(length);
-        gl::GetShaderInfoLog(shader, length, &size, info.data());
-
-        Platform3DObject shaders[2] = { shader, 0 };
-        entry.log = getUnmangledInfoLog(shaders, 1, String(info.data(), size));
-    }
-
-    if (compileStatus != GL_TRUE) {
-        entry.isValid = false;
-        LOG(WebGL, "Error: shader translator produced a shader that OpenGL would not compile.");
-    }
-}
-
-void GraphicsContext3D::compileShaderDirect(Platform3DObject shader)
-{
-    ASSERT(shader);
-    makeContextCurrent();
-
-    HashMap<Platform3DObject, ShaderSourceEntry>::iterator result = m_shaderSourceMap.find(shader);
-
-    if (result == m_shaderSourceMap.end())
-        return;
-
-    ShaderSourceEntry& entry = result->value;
-
-    const CString& shaderSourceCString = entry.source.utf8();
-    const char* shaderSourcePtr = shaderSourceCString.data();
-    int shaderSourceLength = shaderSourceCString.length();
-
-    LOG(WebGL, "--- begin direct shader source ---\n%s\n--- end direct shader source ---\n", shaderSourcePtr);
-
-    gl::ShaderSource(shader, 1, &shaderSourcePtr, &shaderSourceLength);
-
-    gl::CompileShader(shader);
-
-    int compileStatus;
-
-    gl::GetShaderiv(shader, COMPILE_STATUS, &compileStatus);
-
-    if (compileStatus == GL_TRUE) {
-        entry.isValid = true;
-        LOG(WebGL, "Direct compilation of shader succeeded.");
-    } else {
-        entry.isValid = false;
-        LOG(WebGL, "Error: direct compilation of shader failed.");
-    }
-}
-
-void GraphicsContext3D::copyTexImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height, GC3Dint border)
-{
-    makeContextCurrent();
-    if (m_attrs.antialias && m_state.boundFBO == m_multisampleFBO) {
-        resolveMultisamplingIfNecessary(IntRect(x, y, width, height));
-        gl::BindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_fbo);
-    }
-    gl::CopyTexImage2D(target, level, internalformat, x, y, width, height, border);
-    if (m_attrs.antialias && m_state.boundFBO == m_multisampleFBO)
-        gl::BindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_multisampleFBO);
-}
-
-void GraphicsContext3D::copyTexSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height)
-{
-    makeContextCurrent();
-    if (m_attrs.antialias && m_state.boundFBO == m_multisampleFBO) {
-        resolveMultisamplingIfNecessary(IntRect(x, y, width, height));
-        gl::BindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_fbo);
-    }
-    gl::CopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
-    if (m_attrs.antialias && m_state.boundFBO == m_multisampleFBO)
-        gl::BindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_multisampleFBO);
-}
-
-void GraphicsContext3D::cullFace(GC3Denum mode)
-{
-    makeContextCurrent();
-    gl::CullFace(mode);
-}
-
-void GraphicsContext3D::depthFunc(GC3Denum func)
-{
-    makeContextCurrent();
-    gl::DepthFunc(func);
-}
-
-void GraphicsContext3D::depthMask(GC3Dboolean flag)
-{
-    makeContextCurrent();
-    gl::DepthMask(flag);
-}
-
-void GraphicsContext3D::detachShader(Platform3DObject program, Platform3DObject shader)
-{
-    ASSERT(program);
-    ASSERT(shader);
-    makeContextCurrent();
-    m_shaderProgramSymbolCountMap.remove(program);
-    gl::DetachShader(program, shader);
-}
-
-void GraphicsContext3D::disable(GC3Denum cap)
-{
-    makeContextCurrent();
-    gl::Disable(cap);
-}
-
-void GraphicsContext3D::disableVertexAttribArray(GC3Duint index)
-{
-    makeContextCurrent();
-    gl::DisableVertexAttribArray(index);
-}
-
-void GraphicsContext3D::drawArrays(GC3Denum mode, GC3Dint first, GC3Dsizei count)
-{
-    makeContextCurrent();
-    gl::DrawArrays(mode, first, count);
-    checkGPUStatus();
-}
-
-void GraphicsContext3D::drawElements(GC3Denum mode, GC3Dsizei count, GC3Denum type, GC3Dintptr offset)
-{
-    makeContextCurrent();
-    gl::DrawElements(mode, count, type, reinterpret_cast<GLvoid*>(static_cast<intptr_t>(offset)));
-    checkGPUStatus();
-}
-
-void GraphicsContext3D::enable(GC3Denum cap)
-{
-    makeContextCurrent();
-    gl::Enable(cap);
-}
-
-void GraphicsContext3D::enableVertexAttribArray(GC3Duint index)
-{
-    makeContextCurrent();
-    gl::EnableVertexAttribArray(index);
-}
-
-void GraphicsContext3D::finish()
-{
-    makeContextCurrent();
-    gl::Finish();
-}
-
-void GraphicsContext3D::flush()
-{
-    makeContextCurrent();
-    gl::Flush();
-}
-
-void GraphicsContext3D::framebufferRenderbuffer(GC3Denum target, GC3Denum attachment, GC3Denum renderbuffertarget, Platform3DObject buffer)
-{
-    makeContextCurrent();
-    gl::FramebufferRenderbuffer(target, attachment, renderbuffertarget, buffer);
-}
-
-void GraphicsContext3D::framebufferTexture2D(GC3Denum target, GC3Denum attachment, GC3Denum textarget, Platform3DObject texture, GC3Dint level)
-{
-    makeContextCurrent();
-    gl::FramebufferTexture2D(target, attachment, textarget, texture, level);
-    m_state.textureSeedCount.add(m_state.currentBoundTexture());
-}
-
-void GraphicsContext3D::frontFace(GC3Denum mode)
-{
-    makeContextCurrent();
-    gl::FrontFace(mode);
-}
-
-void GraphicsContext3D::generateMipmap(GC3Denum target)
-{
-    makeContextCurrent();
-    gl::GenerateMipmap(target);
-}
-
-bool GraphicsContext3D::getActiveAttribImpl(Platform3DObject program, GC3Duint index, ActiveInfo& info)
-{
-    if (!program) {
-        synthesizeGLError(INVALID_VALUE);
-        return false;
-    }
-    makeContextCurrent();
-    GLint maxAttributeSize = 0;
-    gl::GetProgramiv(program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &maxAttributeSize);
-    Vector<GLchar> name(maxAttributeSize); // GL_ACTIVE_ATTRIBUTE_MAX_LENGTH includes null termination.
-    GLsizei nameLength = 0;
-    GLint size = 0;
-    GLenum type = 0;
-    gl::GetActiveAttrib(program, index, maxAttributeSize, &nameLength, &size, &type, name.data());
-    if (!nameLength)
-        return false;
-
-    String originalName = originalSymbolName(program, SHADER_SYMBOL_TYPE_ATTRIBUTE, String(name.data(), nameLength));
-
-#ifndef NDEBUG
-    String uniformName(name.data(), nameLength);
-    LOG(WebGL, "Program %d is mapping active attribute %d from '%s' to '%s'", program, index, uniformName.utf8().data(), originalName.utf8().data());
-#endif
-
-    info.name = originalName;
-    info.type = type;
-    info.size = size;
-    return true;
-}
-
-bool GraphicsContext3D::getActiveAttrib(Platform3DObject program, GC3Duint index, ActiveInfo& info)
-{
-    GC3Dint symbolCount;
-    auto result = m_shaderProgramSymbolCountMap.find(program);
-    if (result == m_shaderProgramSymbolCountMap.end()) {
-        getNonBuiltInActiveSymbolCount(program, GraphicsContext3D::ACTIVE_ATTRIBUTES, &symbolCount);
-        result = m_shaderProgramSymbolCountMap.find(program);
-    }
-
-    ActiveShaderSymbolCounts& symbolCounts = result->value;
-    GC3Duint rawIndex = (index < symbolCounts.filteredToActualAttributeIndexMap.size()) ? symbolCounts.filteredToActualAttributeIndexMap[index] : -1;
-
-    return getActiveAttribImpl(program, rawIndex, info);
-}
-
-bool GraphicsContext3D::getActiveUniformImpl(Platform3DObject program, GC3Duint index, ActiveInfo& info)
-{
-    if (!program) {
-        synthesizeGLError(INVALID_VALUE);
-        return false;
-    }
-
-    makeContextCurrent();
-    GLint maxUniformSize = 0;
-    gl::GetProgramiv(program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &maxUniformSize);
-
-    Vector<GLchar> name(maxUniformSize); // GL_ACTIVE_UNIFORM_MAX_LENGTH includes null termination.
-    GLsizei nameLength = 0;
-    GLint size = 0;
-    GLenum type = 0;
-    gl::GetActiveUniform(program, index, maxUniformSize, &nameLength, &size, &type, name.data());
-    if (!nameLength)
-        return false;
-
-    String originalName = originalSymbolName(program, SHADER_SYMBOL_TYPE_UNIFORM, String(name.data(), nameLength));
-
-#ifndef NDEBUG
-    String uniformName(name.data(), nameLength);
-    LOG(WebGL, "Program %d is mapping active uniform %d from '%s' to '%s'", program, index, uniformName.utf8().data(), originalName.utf8().data());
-#endif
-
-    info.name = originalName;
-    info.type = type;
-    info.size = size;
-    return true;
-}
-
-bool GraphicsContext3D::getActiveUniform(Platform3DObject program, GC3Duint index, ActiveInfo& info)
-{
-    GC3Dint symbolCount;
-    auto result = m_shaderProgramSymbolCountMap.find(program);
-    if (result == m_shaderProgramSymbolCountMap.end()) {
-        getNonBuiltInActiveSymbolCount(program, GraphicsContext3D::ACTIVE_UNIFORMS, &symbolCount);
-        result = m_shaderProgramSymbolCountMap.find(program);
-    }
-    
-    ActiveShaderSymbolCounts& symbolCounts = result->value;
-    GC3Duint rawIndex = (index < symbolCounts.filteredToActualUniformIndexMap.size()) ? symbolCounts.filteredToActualUniformIndexMap[index] : -1;
-    
-    return getActiveUniformImpl(program, rawIndex, info);
-}
-
-void GraphicsContext3D::getAttachedShaders(Platform3DObject program, GC3Dsizei maxCount, GC3Dsizei* count, Platform3DObject* shaders)
-{
-    if (!program) {
-        synthesizeGLError(INVALID_VALUE);
-        return;
-    }
-    makeContextCurrent();
-    gl::GetAttachedShaders(program, maxCount, count, shaders);
-}
-
-static String generateHashedName(const String& name)
-{
-    if (name.isEmpty())
-        return name;
-    uint64_t number = nameHashForShader(name.utf8().data(), name.length());
-    StringBuilder builder;
-    builder.appendLiteral("webgl_");
-    appendUnsignedAsHex(number, builder, Lowercase);
-    return builder.toString();
-}
-
-Optional<String> GraphicsContext3D::mappedSymbolInShaderSourceMap(Platform3DObject shader, ANGLEShaderSymbolType symbolType, const String& name)
-{
-    auto result = m_shaderSourceMap.find(shader);
-    if (result == m_shaderSourceMap.end())
-        return WTF::nullopt;
-
-    const auto& symbolMap = result->value.symbolMap(symbolType);
-    auto symbolEntry = symbolMap.find(name);
-    if (symbolEntry == symbolMap.end())
-        return WTF::nullopt;
-
-    auto& mappedName = symbolEntry->value.mappedName;
-    return String(mappedName.c_str(), mappedName.length());
-}
-
-String GraphicsContext3D::mappedSymbolName(Platform3DObject program, ANGLEShaderSymbolType symbolType, const String& name)
-{
-    GC3Dsizei count = 0;
-    Platform3DObject shaders[2] = { };
-    getAttachedShaders(program, 2, &count, shaders);
-
-    for (GC3Dsizei i = 0; i < count; ++i) {
-        auto mappedName = mappedSymbolInShaderSourceMap(shaders[i], symbolType, name);
-        if (mappedName)
-            return mappedName.value();
-    }
-
-    // We might have detached or deleted the shaders after linking.
-    auto result = m_linkedShaderMap.find(program);
-    if (result != m_linkedShaderMap.end()) {
-        auto linkedShaders = result->value;
-        auto mappedName = mappedSymbolInShaderSourceMap(linkedShaders.first, symbolType, name);
-        if (mappedName)
-            return mappedName.value();
-        mappedName = mappedSymbolInShaderSourceMap(linkedShaders.second, symbolType, name);
-        if (mappedName)
-            return mappedName.value();
-    }
-
-    if (symbolType == SHADER_SYMBOL_TYPE_ATTRIBUTE && !name.isEmpty()) {
-        // Attributes are a special case: they may be requested before any shaders have been compiled,
-        // and aren't even required to be used in any shader program.
-        if (!nameHashMapForShaders)
-            nameHashMapForShaders = std::make_unique<ShaderNameHash>();
-        setCurrentNameHashMapForShader(nameHashMapForShaders.get());
-
-        auto generatedName = generateHashedName(name);
-
-        setCurrentNameHashMapForShader(nullptr);
-
-        m_possiblyUnusedAttributeMap.set(generatedName, name);
-
-        return generatedName;
-    }
-
-    return name;
-}
-
-Optional<String> GraphicsContext3D::originalSymbolInShaderSourceMap(Platform3DObject shader, ANGLEShaderSymbolType symbolType, const String& name)
-{
-    auto result = m_shaderSourceMap.find(shader);
-    if (result == m_shaderSourceMap.end())
-        return WTF::nullopt;
-
-    const auto& symbolMap = result->value.symbolMap(symbolType);
-    for (const auto& symbolEntry : symbolMap) {
-        if (name == symbolEntry.value.mappedName.c_str())
-            return symbolEntry.key;
-    }
-    return WTF::nullopt;
-}
-
-String GraphicsContext3D::originalSymbolName(Platform3DObject program, ANGLEShaderSymbolType symbolType, const String& name)
-{
-    GC3Dsizei count;
-    Platform3DObject shaders[2];
-    getAttachedShaders(program, 2, &count, shaders);
-    
-    for (GC3Dsizei i = 0; i < count; ++i) {
-        auto originalName = originalSymbolInShaderSourceMap(shaders[i], symbolType, name);
-        if (originalName)
-            return originalName.value();
-    }
-
-    // We might have detached or deleted the shaders after linking.
-    auto result = m_linkedShaderMap.find(program);
-    if (result != m_linkedShaderMap.end()) {
-        auto linkedShaders = result->value;
-        auto originalName = originalSymbolInShaderSourceMap(linkedShaders.first, symbolType, name);
-        if (originalName)
-            return originalName.value();
-        originalName = originalSymbolInShaderSourceMap(linkedShaders.second, symbolType, name);
-        if (originalName)
-            return originalName.value();
-    }
-
-    if (symbolType == SHADER_SYMBOL_TYPE_ATTRIBUTE && !name.isEmpty()) {
-        // Attributes are a special case: they may be requested before any shaders have been compiled,
-        // and aren't even required to be used in any shader program.
-
-        const auto& cached = m_possiblyUnusedAttributeMap.find(name);
-        if (cached != m_possiblyUnusedAttributeMap.end())
-            return cached->value;
-    }
-
-    return name;
-}
-
-String GraphicsContext3D::mappedSymbolName(Platform3DObject shaders[2], size_t count, const String& name)
-{
-    for (size_t symbolType = 0; symbolType <= static_cast<size_t>(SHADER_SYMBOL_TYPE_VARYING); ++symbolType) {
-        for (size_t i = 0; i < count; ++i) {
-            ShaderSourceMap::iterator result = m_shaderSourceMap.find(shaders[i]);
-            if (result == m_shaderSourceMap.end())
-                continue;
-            
-            const ShaderSymbolMap& symbolMap = result->value.symbolMap(static_cast<enum ANGLEShaderSymbolType>(symbolType));
-            for (const auto& symbolEntry : symbolMap) {
-                if (name == symbolEntry.value.mappedName.c_str())
-                    return symbolEntry.key;
-            }
-        }
-    }
-    return name;
-}
-
-int GraphicsContext3D::getAttribLocation(Platform3DObject program, const String& name)
-{
-    if (!program)
-        return -1;
-
-    makeContextCurrent();
-
-    String mappedName = mappedSymbolName(program, SHADER_SYMBOL_TYPE_ATTRIBUTE, name);
-    LOG(WebGL, "gl::GetAttribLocation is mapping %s to %s", name.utf8().data(), mappedName.utf8().data());
-    return gl::GetAttribLocation(program, mappedName.utf8().data());
-}
-
-int GraphicsContext3D::getAttribLocationDirect(Platform3DObject program, const String& name)
-{
-    if (!program)
-        return -1;
-
-    makeContextCurrent();
-
-    return gl::GetAttribLocation(program, name.utf8().data());
-}
-
-GraphicsContext3DAttributes GraphicsContext3D::getContextAttributes()
-{
-    return m_attrs;
-}
-
-bool GraphicsContext3D::moveErrorsToSyntheticErrorList()
-{
-    makeContextCurrent();
-    bool movedAnError = false;
-
-    // Set an arbitrary limit of 100 here to avoid creating a hang if
-    // a problem driver has a bug that causes it to never clear the error.
-    // Otherwise, we would just loop until we got NO_ERROR.
-    for (unsigned i = 0; i < 100; ++i) {
-        GC3Denum error = glGetError();
-        if (error == NO_ERROR)
-            break;
-        m_syntheticErrors.add(error);
-        movedAnError = true;
-    }
-
-    return movedAnError;
-}
-
-GC3Denum GraphicsContext3D::getError()
-{
-    if (!m_syntheticErrors.isEmpty()) {
-        // Need to move the current errors to the synthetic error list in case
-        // that error is already there, since the expected behavior of both
-        // glGetError and getError is to only report each error code once.
-        moveErrorsToSyntheticErrorList();
-        return m_syntheticErrors.takeFirst();
-    }
-
-    makeContextCurrent();
-    return gl::GetError();
-}
-
-String GraphicsContext3D::getString(GC3Denum name)
-{
-    makeContextCurrent();
-    return String(reinterpret_cast<const char*>(gl::GetString(name)));
-}
-
-void GraphicsContext3D::hint(GC3Denum target, GC3Denum mode)
-{
-    makeContextCurrent();
-    gl::Hint(target, mode);
-}
-
-GC3Dboolean GraphicsContext3D::isBuffer(Platform3DObject buffer)
-{
-    if (!buffer)
-        return GL_FALSE;
-
-    makeContextCurrent();
-    return gl::IsBuffer(buffer);
-}
-
-GC3Dboolean GraphicsContext3D::isEnabled(GC3Denum cap)
-{
-    makeContextCurrent();
-    return gl::IsEnabled(cap);
-}
-
-GC3Dboolean GraphicsContext3D::isFramebuffer(Platform3DObject framebuffer)
-{
-    if (!framebuffer)
-        return GL_FALSE;
-
-    makeContextCurrent();
-    return gl::IsFramebuffer(framebuffer);
-}
-
-GC3Dboolean GraphicsContext3D::isProgram(Platform3DObject program)
-{
-    if (!program)
-        return GL_FALSE;
-
-    makeContextCurrent();
-    return gl::IsProgram(program);
-}
-
-GC3Dboolean GraphicsContext3D::isRenderbuffer(Platform3DObject renderbuffer)
-{
-    if (!renderbuffer)
-        return GL_FALSE;
-
-    makeContextCurrent();
-    return gl::IsRenderbuffer(renderbuffer);
-}
-
-GC3Dboolean GraphicsContext3D::isShader(Platform3DObject shader)
-{
-    if (!shader)
-        return GL_FALSE;
-
-    makeContextCurrent();
-    return gl::IsShader(shader);
-}
-
-GC3Dboolean GraphicsContext3D::isTexture(Platform3DObject texture)
-{
-    if (!texture)
-        return GL_FALSE;
-
-    makeContextCurrent();
-    return gl::IsTexture(texture);
-}
-
-void GraphicsContext3D::lineWidth(GC3Dfloat width)
-{
-    makeContextCurrent();
-    gl::LineWidth(width);
-}
-
-void GraphicsContext3D::linkProgram(Platform3DObject program)
-{
-    ASSERT(program);
-    makeContextCurrent();
-
-    GC3Dsizei count = 0;
-    Platform3DObject shaders[2] = { };
-    getAttachedShaders(program, 2, &count, shaders);
-
-    if (count == 2)
-        m_linkedShaderMap.set(program, std::make_pair(shaders[0], shaders[1]));
-
-    gl::LinkProgram(program);
-}
-
-void GraphicsContext3D::pixelStorei(GC3Denum pname, GC3Dint param)
-{
-    makeContextCurrent();
-    gl::PixelStorei(pname, param);
-}
-
-void GraphicsContext3D::polygonOffset(GC3Dfloat factor, GC3Dfloat units)
-{
-    makeContextCurrent();
-    gl::PolygonOffset(factor, units);
-}
-
-void GraphicsContext3D::sampleCoverage(GC3Dclampf value, GC3Dboolean invert)
-{
-    makeContextCurrent();
-    gl::SampleCoverage(value, invert);
-}
-
-void GraphicsContext3D::scissor(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height)
-{
-    makeContextCurrent();
-    gl::Scissor(x, y, width, height);
-}
-
-void GraphicsContext3D::shaderSource(Platform3DObject shader, const String& string)
-{
-    ASSERT(shader);
-
-    makeContextCurrent();
-
-    ShaderSourceEntry entry;
-
-    entry.source = string;
-
-    m_shaderSourceMap.set(shader, entry);
-}
-
-void GraphicsContext3D::stencilFunc(GC3Denum func, GC3Dint ref, GC3Duint mask)
-{
-    makeContextCurrent();
-    gl::StencilFunc(func, ref, mask);
-}
-
-void GraphicsContext3D::stencilFuncSeparate(GC3Denum face, GC3Denum func, GC3Dint ref, GC3Duint mask)
-{
-    makeContextCurrent();
-    gl::StencilFuncSeparate(face, func, ref, mask);
-}
-
-void GraphicsContext3D::stencilMask(GC3Duint mask)
-{
-    makeContextCurrent();
-    gl::StencilMask(mask);
-}
-
-void GraphicsContext3D::stencilMaskSeparate(GC3Denum face, GC3Duint mask)
-{
-    makeContextCurrent();
-    gl::StencilMaskSeparate(face, mask);
-}
-
-void GraphicsContext3D::stencilOp(GC3Denum fail, GC3Denum zfail, GC3Denum zpass)
-{
-    makeContextCurrent();
-    gl::StencilOp(fail, zfail, zpass);
-}
-
-void GraphicsContext3D::stencilOpSeparate(GC3Denum face, GC3Denum fail, GC3Denum zfail, GC3Denum zpass)
-{
-    makeContextCurrent();
-    gl::StencilOpSeparate(face, fail, zfail, zpass);
-}
-
-void GraphicsContext3D::texParameterf(GC3Denum target, GC3Denum pname, GC3Dfloat value)
-{
-    makeContextCurrent();
-    gl::TexParameterf(target, pname, value);
-}
-
-void GraphicsContext3D::texParameteri(GC3Denum target, GC3Denum pname, GC3Dint value)
-{
-    makeContextCurrent();
-    gl::TexParameteri(target, pname, value);
-}
-
-void GraphicsContext3D::uniform1f(GC3Dint location, GC3Dfloat v0)
-{
-    makeContextCurrent();
-    gl::Uniform1f(location, v0);
-}
-
-void GraphicsContext3D::uniform1fv(GC3Dint location, GC3Dsizei size, const GC3Dfloat* array)
-{
-    makeContextCurrent();
-    gl::Uniform1fv(location, size, array);
-}
-
-void GraphicsContext3D::uniform2f(GC3Dint location, GC3Dfloat v0, GC3Dfloat v1)
-{
-    makeContextCurrent();
-    gl::Uniform2f(location, v0, v1);
-}
-
-void GraphicsContext3D::uniform2fv(GC3Dint location, GC3Dsizei size, const GC3Dfloat* array)
-{
-    // FIXME: length needs to be a multiple of 2.
-    makeContextCurrent();
-    gl::Uniform2fv(location, size, array);
-}
-
-void GraphicsContext3D::uniform3f(GC3Dint location, GC3Dfloat v0, GC3Dfloat v1, GC3Dfloat v2)
-{
-    makeContextCurrent();
-    gl::Uniform3f(location, v0, v1, v2);
-}
-
-void GraphicsContext3D::uniform3fv(GC3Dint location, GC3Dsizei size, const GC3Dfloat* array)
-{
-    // FIXME: length needs to be a multiple of 3.
-    makeContextCurrent();
-    gl::Uniform3fv(location, size, array);
-}
-
-void GraphicsContext3D::uniform4f(GC3Dint location, GC3Dfloat v0, GC3Dfloat v1, GC3Dfloat v2, GC3Dfloat v3)
-{
-    makeContextCurrent();
-    gl::Uniform4f(location, v0, v1, v2, v3);
-}
-
-void GraphicsContext3D::uniform4fv(GC3Dint location, GC3Dsizei size, const GC3Dfloat* array)
-{
-    // FIXME: length needs to be a multiple of 4.
-    makeContextCurrent();
-    gl::Uniform4fv(location, size, array);
-}
-
-void GraphicsContext3D::uniform1i(GC3Dint location, GC3Dint v0)
-{
-    makeContextCurrent();
-    gl::Uniform1i(location, v0);
-}
-
-void GraphicsContext3D::uniform1iv(GC3Dint location, GC3Dsizei size, const GC3Dint* array)
-{
-    makeContextCurrent();
-    gl::Uniform1iv(location, size, array);
-}
-
-void GraphicsContext3D::uniform2i(GC3Dint location, GC3Dint v0, GC3Dint v1)
-{
-    makeContextCurrent();
-    gl::Uniform2i(location, v0, v1);
-}
-
-void GraphicsContext3D::uniform2iv(GC3Dint location, GC3Dsizei size, const GC3Dint* array)
-{
-    // FIXME: length needs to be a multiple of 2.
-    makeContextCurrent();
-    gl::Uniform2iv(location, size, array);
-}
-
-void GraphicsContext3D::uniform3i(GC3Dint location, GC3Dint v0, GC3Dint v1, GC3Dint v2)
-{
-    makeContextCurrent();
-    gl::Uniform3i(location, v0, v1, v2);
-}
-
-void GraphicsContext3D::uniform3iv(GC3Dint location, GC3Dsizei size, const GC3Dint* array)
-{
-    // FIXME: length needs to be a multiple of 3.
-    makeContextCurrent();
-    gl::Uniform3iv(location, size, array);
-}
-
-void GraphicsContext3D::uniform4i(GC3Dint location, GC3Dint v0, GC3Dint v1, GC3Dint v2, GC3Dint v3)
-{
-    makeContextCurrent();
-    gl::Uniform4i(location, v0, v1, v2, v3);
-}
-
-void GraphicsContext3D::uniform4iv(GC3Dint location, GC3Dsizei size, const GC3Dint* array)
-{
-    // FIXME: length needs to be a multiple of 4.
-    makeContextCurrent();
-    gl::Uniform4iv(location, size, array);
-}
-
-void GraphicsContext3D::uniformMatrix2fv(GC3Dint location, GC3Dsizei size, GC3Dboolean transpose, const GC3Dfloat* array)
-{
-    // FIXME: length needs to be a multiple of 4.
-    makeContextCurrent();
-    gl::UniformMatrix2fv(location, size, transpose, array);
-}
-
-void GraphicsContext3D::uniformMatrix3fv(GC3Dint location, GC3Dsizei size, GC3Dboolean transpose, const GC3Dfloat* array)
-{
-    // FIXME: length needs to be a multiple of 9.
-    makeContextCurrent();
-    gl::UniformMatrix3fv(location, size, transpose, array);
-}
-
-void GraphicsContext3D::uniformMatrix4fv(GC3Dint location, GC3Dsizei size, GC3Dboolean transpose, const GC3Dfloat* array)
-{
-    // FIXME: length needs to be a multiple of 16.
-    makeContextCurrent();
-    gl::UniformMatrix4fv(location, size, transpose, array);
-}
-
-void GraphicsContext3D::useProgram(Platform3DObject program)
-{
-    makeContextCurrent();
-    gl::UseProgram(program);
-}
-
-void GraphicsContext3D::validateProgram(Platform3DObject program)
-{
-    ASSERT(program);
-
-    makeContextCurrent();
-    gl::ValidateProgram(program);
-}
-
-void GraphicsContext3D::vertexAttrib1f(GC3Duint index, GC3Dfloat v0)
-{
-    makeContextCurrent();
-    gl::VertexAttrib1f(index, v0);
-}
-
-void GraphicsContext3D::vertexAttrib1fv(GC3Duint index, const GC3Dfloat* array)
-{
-    makeContextCurrent();
-    gl::VertexAttrib1fv(index, array);
-}
-
-void GraphicsContext3D::vertexAttrib2f(GC3Duint index, GC3Dfloat v0, GC3Dfloat v1)
-{
-    makeContextCurrent();
-    gl::VertexAttrib2f(index, v0, v1);
-}
-
-void GraphicsContext3D::vertexAttrib2fv(GC3Duint index, const GC3Dfloat* array)
-{
-    makeContextCurrent();
-    gl::VertexAttrib2fv(index, array);
-}
-
-void GraphicsContext3D::vertexAttrib3f(GC3Duint index, GC3Dfloat v0, GC3Dfloat v1, GC3Dfloat v2)
-{
-    makeContextCurrent();
-    gl::VertexAttrib3f(index, v0, v1, v2);
-}
-
-void GraphicsContext3D::vertexAttrib3fv(GC3Duint index, const GC3Dfloat* array)
-{
-    makeContextCurrent();
-    gl::VertexAttrib3fv(index, array);
-}
-
-void GraphicsContext3D::vertexAttrib4f(GC3Duint index, GC3Dfloat v0, GC3Dfloat v1, GC3Dfloat v2, GC3Dfloat v3)
-{
-    makeContextCurrent();
-    gl::VertexAttrib4f(index, v0, v1, v2, v3);
-}
-
-void GraphicsContext3D::vertexAttrib4fv(GC3Duint index, const GC3Dfloat* array)
-{
-    makeContextCurrent();
-    gl::VertexAttrib4fv(index, array);
-}
-
-void GraphicsContext3D::vertexAttribPointer(GC3Duint index, GC3Dint size, GC3Denum type, GC3Dboolean normalized, GC3Dsizei stride, GC3Dintptr offset)
-{
-    makeContextCurrent();
-    gl::VertexAttribPointer(index, size, type, normalized, stride, reinterpret_cast<GLvoid*>(static_cast<intptr_t>(offset)));
-}
-
-void GraphicsContext3D::viewport(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height)
-{
-    makeContextCurrent();
-    gl::Viewport(x, y, width, height);
-}
-
-Platform3DObject GraphicsContext3D::createVertexArray()
-{
-    makeContextCurrent();
-    GLuint array = 0;
-    gl::GenVertexArrays(1, &array);
-    return array;
-}
-
-void GraphicsContext3D::deleteVertexArray(Platform3DObject array)
-{
-    if (!array)
-        return;
-    makeContextCurrent();
-    gl::DeleteVertexArrays(1, &array);
-}
-
-GC3Dboolean GraphicsContext3D::isVertexArray(Platform3DObject array)
-{
-    if (!array)
-        return GL_FALSE;
-    makeContextCurrent();
-    return gl::IsVertexArray(array);
-}
-
-void GraphicsContext3D::bindVertexArray(Platform3DObject array)
-{
-    makeContextCurrent();
-    gl::BindVertexArray(array);
-}
-
-void GraphicsContext3D::getBooleanv(GC3Denum pname, GC3Dboolean* value)
-{
-    makeContextCurrent();
-    gl::GetBooleanv(pname, value);
-}
-
-void GraphicsContext3D::getBufferParameteriv(GC3Denum target, GC3Denum pname, GC3Dint* value)
-{
-    makeContextCurrent();
-    gl::GetBufferParameteriv(target, pname, value);
-}
-
-void GraphicsContext3D::getFloatv(GC3Denum pname, GC3Dfloat* value)
-{
-    makeContextCurrent();
-    gl::GetFloatv(pname, value);
-}
-    
-void GraphicsContext3D::getInteger64v(GC3Denum pname, GC3Dint64* value)
-{
-    UNUSED_PARAM(pname);
-    makeContextCurrent();
-    *value = 0;
-    // FIXME 141178: Before enabling this we must first switch over to using gl3.h and creating and initialing the WebGL2 context using OpenGL ES 3.0.
-    // gl::GetInteger64v(pname, value);
-}
-
-void GraphicsContext3D::getFramebufferAttachmentParameteriv(GC3Denum target, GC3Denum attachment, GC3Denum pname, GC3Dint* value)
-{
-    makeContextCurrent();
-    if (attachment == DEPTH_STENCIL_ATTACHMENT)
-        attachment = DEPTH_ATTACHMENT; // Or STENCIL_ATTACHMENT, either works.
-    gl::GetFramebufferAttachmentParameteriv(target, attachment, pname, value);
-}
-
-void GraphicsContext3D::getProgramiv(Platform3DObject program, GC3Denum pname, GC3Dint* value)
-{
-    makeContextCurrent();
-    gl::GetProgramiv(program, pname, value);
-}
-
-void GraphicsContext3D::getNonBuiltInActiveSymbolCount(Platform3DObject program, GC3Denum pname, GC3Dint* value)
-{
-    ASSERT(ACTIVE_ATTRIBUTES == pname || ACTIVE_UNIFORMS == pname);
-    if (!value)
-        return;
-
-    makeContextCurrent();
-    const auto& result = m_shaderProgramSymbolCountMap.find(program);
-    if (result != m_shaderProgramSymbolCountMap.end()) {
-        *value = result->value.countForType(pname);
-        return;
-    }
-
-    m_shaderProgramSymbolCountMap.set(program, ActiveShaderSymbolCounts());
-    ActiveShaderSymbolCounts& symbolCounts = m_shaderProgramSymbolCountMap.find(program)->value;
-
-    // Retrieve the active attributes, build a filtered count, and a mapping of
-    // our internal attributes indexes to the real unfiltered indexes inside OpenGL.
-    GC3Dint attributeCount = 0;
-    gl::GetProgramiv(program, ACTIVE_ATTRIBUTES, &attributeCount);
-    for (GC3Dint i = 0; i < attributeCount; ++i) {
-        ActiveInfo info;
-        getActiveAttribImpl(program, i, info);
-        if (info.name.startsWith("gl_"))
-            continue;
-
-        symbolCounts.filteredToActualAttributeIndexMap.append(i);
-    }
-    
-    // Do the same for uniforms.
-    GC3Dint uniformCount = 0;
-    gl::GetProgramiv(program, ACTIVE_UNIFORMS, &uniformCount);
-    for (GC3Dint i = 0; i < uniformCount; ++i) {
-        ActiveInfo info;
-        getActiveUniformImpl(program, i, info);
-        if (info.name.startsWith("gl_"))
-            continue;
-        
-        symbolCounts.filteredToActualUniformIndexMap.append(i);
-    }
-    
-    *value = symbolCounts.countForType(pname);
-}
-
-String GraphicsContext3D::getUnmangledInfoLog(Platform3DObject shaders[2], GC3Dsizei count, const String& log)
-{
-    LOG(WebGL, "Original ShaderInfoLog:\n%s", log.utf8().data());
-
-    JSC::Yarr::RegularExpression regExp("webgl_[0123456789abcdefABCDEF]+");
-
-    StringBuilder processedLog;
-    
-    // ANGLE inserts a "#extension" line into the shader source that
-    // causes a warning in some compilers. There is no point showing
-    // this warning to the user since they didn't write the code that
-    // is causing it.
-    static const NeverDestroyed<String> angleWarning { "WARNING: 0:1: extension 'GL_ARB_gpu_shader5' is not supported\n"_s };
-    int startFrom = log.startsWith(angleWarning) ? angleWarning.get().length() : 0;
-    int matchedLength = 0;
-
-    do {
-        int start = regExp.match(log, startFrom, &matchedLength);
-        if (start == -1)
-            break;
-
-        processedLog.append(log.substring(startFrom, start - startFrom));
-        startFrom = start + matchedLength;
-
-        const String& mangledSymbol = log.substring(start, matchedLength);
-        const String& mappedSymbol = mappedSymbolName(shaders, count, mangledSymbol);
-        LOG(WebGL, "Demangling: %s to %s", mangledSymbol.utf8().data(), mappedSymbol.utf8().data());
-        processedLog.append(mappedSymbol);
-    } while (startFrom < static_cast<int>(log.length()));
-
-    processedLog.append(log.substring(startFrom, log.length() - startFrom));
-
-    LOG(WebGL, "Unmangled ShaderInfoLog:\n%s", processedLog.toString().utf8().data());
-    return processedLog.toString();
-}
-
-String GraphicsContext3D::getProgramInfoLog(Platform3DObject program)
-{
-    ASSERT(program);
-
-    makeContextCurrent();
-    GLint length = 0;
-    gl::GetProgramiv(program, GL_INFO_LOG_LENGTH, &length);
-    if (!length)
-        return String(); 
-
-    GLsizei size = 0;
-    Vector<GLchar> info(length);
-    gl::GetProgramInfoLog(program, length, &size, info.data());
-
-    GC3Dsizei count;
-    Platform3DObject shaders[2];
-    getAttachedShaders(program, 2, &count, shaders);
-
-    return getUnmangledInfoLog(shaders, count, String(info.data(), size));
-}
-
-void GraphicsContext3D::getRenderbufferParameteriv(GC3Denum target, GC3Denum pname, GC3Dint* value)
-{
-    makeContextCurrent();
-    gl::GetRenderbufferParameteriv(target, pname, value);
-}
-
-void GraphicsContext3D::getShaderiv(Platform3DObject shader, GC3Denum pname, GC3Dint* value)
-{
-    ASSERT(shader);
-
-    makeContextCurrent();
-
-    const auto& result = m_shaderSourceMap.find(shader);
-    
-    switch (pname) {
-    case DELETE_STATUS:
-    case SHADER_TYPE:
-        gl::GetShaderiv(shader, pname, value);
-        break;
-    case COMPILE_STATUS:
-        if (result == m_shaderSourceMap.end()) {
-            *value = static_cast<int>(false);
-            return;
-        }
-        *value = static_cast<int>(result->value.isValid);
-        break;
-    case INFO_LOG_LENGTH:
-        if (result == m_shaderSourceMap.end()) {
-            *value = 0;
-            return;
-        }
-        *value = getShaderInfoLog(shader).length();
-        break;
-    case SHADER_SOURCE_LENGTH:
-        *value = getShaderSource(shader).length();
-        break;
-    default:
-        synthesizeGLError(INVALID_ENUM);
-    }
-}
-
-String GraphicsContext3D::getShaderInfoLog(Platform3DObject shader)
-{
-    ASSERT(shader);
-
-    makeContextCurrent();
-
-    const auto& result = m_shaderSourceMap.find(shader);
-    if (result == m_shaderSourceMap.end())
-        return String(); 
-
-    const ShaderSourceEntry& entry = result->value;
-    if (!entry.isValid)
-        return entry.log;
-
-    GLint length = 0;
-    gl::GetShaderiv(shader, GL_INFO_LOG_LENGTH, &length);
-    if (!length)
-        return String(); 
-
-    GLsizei size = 0;
-    Vector<GLchar> info(length);
-    gl::GetShaderInfoLog(shader, length, &size, info.data());
-
-    Platform3DObject shaders[2] = { shader, 0 };
-    return getUnmangledInfoLog(shaders, 1, String(info.data(), size));
-}
-
-String GraphicsContext3D::getShaderSource(Platform3DObject shader)
-{
-    ASSERT(shader);
-
-    makeContextCurrent();
-
-    const auto& result = m_shaderSourceMap.find(shader);
-    if (result == m_shaderSourceMap.end())
-        return String(); 
-
-    return result->value.source;
-}
-
-
-void GraphicsContext3D::getTexParameterfv(GC3Denum target, GC3Denum pname, GC3Dfloat* value)
-{
-    makeContextCurrent();
-    gl::GetTexParameterfv(target, pname, value);
-}
-
-void GraphicsContext3D::getTexParameteriv(GC3Denum target, GC3Denum pname, GC3Dint* value)
-{
-    makeContextCurrent();
-    gl::GetTexParameteriv(target, pname, value);
-}
-
-void GraphicsContext3D::getUniformfv(Platform3DObject program, GC3Dint location, GC3Dfloat* value)
-{
-    makeContextCurrent();
-    gl::GetUniformfv(program, location, value);
-}
-
-void GraphicsContext3D::getUniformiv(Platform3DObject program, GC3Dint location, GC3Dint* value)
-{
-    makeContextCurrent();
-    gl::GetUniformiv(program, location, value);
-}
-
-GC3Dint GraphicsContext3D::getUniformLocation(Platform3DObject program, const String& name)
-{
-    ASSERT(program);
-
-    makeContextCurrent();
-
-    String mappedName = mappedSymbolName(program, SHADER_SYMBOL_TYPE_UNIFORM, name);
-    LOG(WebGL, "::getUniformLocation is mapping %s to %s", name.utf8().data(), mappedName.utf8().data());
-    return gl::GetUniformLocation(program, mappedName.utf8().data());
-}
-
-void GraphicsContext3D::getVertexAttribfv(GC3Duint index, GC3Denum pname, GC3Dfloat* value)
-{
-    makeContextCurrent();
-    gl::GetVertexAttribfv(index, pname, value);
-}
-
-void GraphicsContext3D::getVertexAttribiv(GC3Duint index, GC3Denum pname, GC3Dint* value)
-{
-    makeContextCurrent();
-    gl::GetVertexAttribiv(index, pname, value);
-}
-
-GC3Dsizeiptr GraphicsContext3D::getVertexAttribOffset(GC3Duint index, GC3Denum pname)
-{
-    makeContextCurrent();
-
-    GLvoid* pointer = 0;
-    gl::GetVertexAttribPointerv(index, pname, &pointer);
-    return static_cast<GC3Dsizeiptr>(reinterpret_cast<intptr_t>(pointer));
-}
-
-void GraphicsContext3D::texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoff, GC3Dint yoff, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, const void* pixels)
-{
-    makeContextCurrent();
-
-    // FIXME: we will need to deal with PixelStore params when dealing with image buffers that differ from the subimage size.
-    gl::TexSubImage2D(target, level, xoff, yoff, width, height, format, type, pixels);
-    m_state.textureSeedCount.add(m_state.currentBoundTexture());
-}
-
-void GraphicsContext3D::compressedTexImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Dsizei imageSize, const void* data)
-{
-    makeContextCurrent();
-    gl::CompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
-    m_state.textureSeedCount.add(m_state.currentBoundTexture());
-}
-
-void GraphicsContext3D::compressedTexSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Dsizei imageSize, const void* data)
-{
-    makeContextCurrent();
-    gl::CompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
-    m_state.textureSeedCount.add(m_state.currentBoundTexture());
-}
-
-Platform3DObject GraphicsContext3D::createBuffer()
-{
-    makeContextCurrent();
-    GLuint o = 0;
-    glGenBuffers(1, &o);
-    return o;
-}
-
-Platform3DObject GraphicsContext3D::createFramebuffer()
-{
-    makeContextCurrent();
-    GLuint o = 0;
-    glGenFramebuffers(1, &o);
-    return o;
-}
-
-Platform3DObject GraphicsContext3D::createProgram()
-{
-    makeContextCurrent();
-    return glCreateProgram();
-}
-
-Platform3DObject GraphicsContext3D::createRenderbuffer()
-{
-    makeContextCurrent();
-    GLuint o = 0;
-    glGenRenderbuffers(1, &o);
-    return o;
-}
-
-Platform3DObject GraphicsContext3D::createShader(GC3Denum type)
-{
-    makeContextCurrent();
-    return glCreateShader((type == FRAGMENT_SHADER) ? GL_FRAGMENT_SHADER : GL_VERTEX_SHADER);
-}
-
-Platform3DObject GraphicsContext3D::createTexture()
-{
-    makeContextCurrent();
-    GLuint o = 0;
-    glGenTextures(1, &o);
-    m_state.textureSeedCount.add(o);
-    return o;
-}
-
-void GraphicsContext3D::deleteBuffer(Platform3DObject buffer)
-{
-    makeContextCurrent();
-    glDeleteBuffers(1, &buffer);
-}
-
-void GraphicsContext3D::deleteFramebuffer(Platform3DObject framebuffer)
-{
-    makeContextCurrent();
-    if (framebuffer == m_state.boundFBO) {
-        // Make sure the framebuffer is not going to be used for drawing
-        // operations after it gets deleted.
-        bindFramebuffer(FRAMEBUFFER, 0);
-    }
-    glDeleteFramebuffers(1, &framebuffer);
-}
-
-void GraphicsContext3D::deleteProgram(Platform3DObject program)
-{
-    makeContextCurrent();
-    m_shaderProgramSymbolCountMap.remove(program);
-    glDeleteProgram(program);
-}
-
-void GraphicsContext3D::deleteRenderbuffer(Platform3DObject renderbuffer)
-{
-    makeContextCurrent();
-    glDeleteRenderbuffers(1, &renderbuffer);
-}
-
-void GraphicsContext3D::deleteShader(Platform3DObject shader)
-{
-    makeContextCurrent();
-    glDeleteShader(shader);
-}
-
-void GraphicsContext3D::deleteTexture(Platform3DObject texture)
-{
-    makeContextCurrent();
-    m_state.boundTextureMap.removeIf([texture] (auto& keyValue) {
-        return keyValue.value.first == texture;
-    });
-    glDeleteTextures(1, &texture);
-    m_state.textureSeedCount.removeAll(texture);
-}
-
-void GraphicsContext3D::synthesizeGLError(GC3Denum error)
-{
-    // Need to move the current errors to the synthetic error list to
-    // preserve the order of errors, so a caller to getError will get
-    // any errors from glError before the error we are synthesizing.
-    moveErrorsToSyntheticErrorList();
-    m_syntheticErrors.add(error);
-}
-
-void GraphicsContext3D::markContextChanged()
-{
-    m_layerComposited = false;
-}
-
-void GraphicsContext3D::markLayerComposited()
-{
-    m_layerComposited = true;
-
-    for (auto* client : copyToVector(m_clients))
-        client->didComposite();
-}
-
-bool GraphicsContext3D::layerComposited() const
-{
-    return m_layerComposited;
-}
-
-void GraphicsContext3D::forceContextLost()
-{
-    for (auto* client : copyToVector(m_clients))
-        client->forceContextLost();
-}
-
-void GraphicsContext3D::recycleContext()
-{
-    for (auto* client : copyToVector(m_clients))
-        client->recycleContext();
-}
-
-void GraphicsContext3D::dispatchContextChangedNotification()
-{
-    for (auto* client : copyToVector(m_clients))
-        client->dispatchContextChangedNotification();
-}
-
-void GraphicsContext3D::texImage2DDirect(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, const void* pixels)
-{
-    makeContextCurrent();
-    gl::TexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
-    m_state.textureSeedCount.add(m_state.currentBoundTexture());
-}
-
-void GraphicsContext3D::drawArraysInstanced(GC3Denum mode, GC3Dint first, GC3Dsizei count, GC3Dsizei primcount)
-{
-    getExtensions().drawArraysInstanced(mode, first, count, primcount);
-    checkGPUStatus();
-}
-
-void GraphicsContext3D::drawElementsInstanced(GC3Denum mode, GC3Dsizei count, GC3Denum type, GC3Dintptr offset, GC3Dsizei primcount)
-{
-    getExtensions().drawElementsInstanced(mode, count, type, offset, primcount);
-    checkGPUStatus();
-}
-
-void GraphicsContext3D::vertexAttribDivisor(GC3Duint index, GC3Duint divisor)
-{
-    getExtensions().vertexAttribDivisor(index, divisor);
-}
-
-}
-
-#endif // ENABLE(GRAPHICS_CONTEXT_3D) && USE(ANGLE)
diff --git a/Source/WebCore/platform/graphics/angle/TemporaryANGLESetting.cpp b/Source/WebCore/platform/graphics/angle/TemporaryANGLESetting.cpp
deleted file mode 100644 (file)
index bb958da..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if ENABLE(GRAPHICS_CONTEXT_3D) && USE(ANGLE)
-#include "TemporaryANGLESetting.h"
-
-#include <ANGLE/entry_points_gles_2_0_autogen.h>
-
-namespace WebCore {
-
-TemporaryANGLESetting::TemporaryANGLESetting(GLenum capability, GLenum scopedState)
-    : m_capability(capability)
-    , m_scopedState(scopedState)
-{
-    m_originalState = gl::IsEnabled(m_capability);
-    if (m_originalState == m_scopedState)
-        return;
-
-    if (GL_TRUE == m_scopedState)
-        gl::Enable(m_capability);
-    else
-        gl::Disable(m_capability);
-}
-
-TemporaryANGLESetting::~TemporaryANGLESetting()
-{
-    if (m_originalState == m_scopedState)
-        return;
-
-    if (GL_TRUE == m_originalState)
-        gl::Enable(m_capability);
-    else
-        gl::Disable(m_capability);
-}
-
-}
-
-#endif // ENABLE(GRAPHICS_CONTEXT_3D) && USE(ANGLE)
diff --git a/Source/WebCore/platform/graphics/angle/TemporaryANGLESetting.h b/Source/WebCore/platform/graphics/angle/TemporaryANGLESetting.h
deleted file mode 100644 (file)
index 8f6cfe1..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "GraphicsTypes3D.h"
-
-#include <wtf/Noncopyable.h>
-
-namespace WebCore {
-
-// TemporaryANGLESetting<> is useful for temporarily disabling (or enabling) a particular OpenGL
-// feature with a particular scope. A TemporaryANGLESetting<> object returns the flag to its original
-// value upon destruction, making it an alternative to checking, clearing, and resetting each flag
-// at all of a block's exit points.
-//
-// Based on WTF::SetForScope<>
-
-class TemporaryANGLESetting {
-    WTF_MAKE_NONCOPYABLE(TemporaryANGLESetting);
-public:
-    TemporaryANGLESetting(GC3Denum capability, GC3Denum scopedState);
-    ~TemporaryANGLESetting();
-
-private:
-    const GC3Denum m_capability;
-    const GC3Denum m_scopedState;
-    GC3Denum m_originalState;
-};
-
-}
-
-using WebCore::TemporaryANGLESetting;
index 2defba2..77c5d6c 100644 (file)
 #if ENABLE(GRAPHICS_CONTEXT_3D)
 #import "GraphicsContext3D.h"
 
-#if PLATFORM(IOS_FAMILY) && !USE(ANGLE)
+#if PLATFORM(IOS_FAMILY)
 #import "GraphicsContext3DIOS.h"
 #endif
 
 #import "CanvasRenderingContext.h"
+#import "Extensions3DOpenGL.h"
 #import "GraphicsContext.h"
 #import "GraphicsContext3DManager.h"
 #import "HTMLCanvasElement.h"
 #import <OpenGLES/ES2/glext.h>
 #import <QuartzCore/QuartzCore.h>
 #import <pal/spi/ios/OpenGLESSPI.h>
-#elif USE(OPENGL)
+#else
 #import <IOKit/IOKitLib.h>
 #import <OpenGL/CGLRenderers.h>
 #import <OpenGL/gl.h>
-#elif USE(ANGLE)
-#include <ANGLE/entry_points_gles_2_0_autogen.h>
-#endif
-
-#if USE(OPENGL_ES) || USE(OPENGL)
-#include "Extensions3DOpenGL.h"
-#elif USE(ANGLE)
-#include "Extensions3DANGLE.h"
 #endif
 
 #if PLATFORM(MAC)
@@ -168,7 +161,7 @@ Ref<GraphicsContext3D> GraphicsContext3D::createShared(GraphicsContext3D& shared
     return context;
 }
 
-#if PLATFORM(MAC) && USE(OPENGL)
+#if PLATFORM(MAC)
 
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300
 static void setGPUByRegistryID(PlatformGraphicsContext3D contextObj, CGLPixelFormatObj pixelFormatObj, IORegistryGPUID preferredGPUID)
@@ -247,18 +240,12 @@ static void setGPUByDisplayMask(PlatformGraphicsContext3D contextObj, CGLPixelFo
 }
 #endif
 
-#endif // PLATFORM(MAC) && USE(OPENGL)
+#endif // !PLATFORM(MAC)
 
 GraphicsContext3D::GraphicsContext3D(GraphicsContext3DAttributes attrs, HostWindow* hostWindow, GraphicsContext3D::RenderStyle, GraphicsContext3D* sharedContext)
     : m_attrs(attrs)
     , m_private(std::make_unique<GraphicsContext3DPrivate>(this))
 {
-#if USE(ANGLE)
-    if (m_attrs.isWebGL2)
-        m_compiler = ANGLEWebKitBridge(SH_ESSL_OUTPUT, SH_WEBGL2_SPEC);
-    else
-        m_compiler = ANGLEWebKitBridge(SH_ESSL_OUTPUT);
-#else
 #if PLATFORM(IOS_FAMILY)
     if (m_attrs.isWebGL2)
         m_compiler = ANGLEWebKitBridge(SH_ESSL_OUTPUT, SH_WEBGL2_SPEC);
@@ -267,8 +254,7 @@ GraphicsContext3D::GraphicsContext3D(GraphicsContext3DAttributes attrs, HostWind
 #else
     if (m_attrs.isWebGL2)
         m_compiler = ANGLEWebKitBridge(SH_GLSL_410_CORE_OUTPUT, SH_WEBGL2_SPEC);
-#endif // PLATFORM(IOS_FAMILY)
-#endif // USE(ANGLE)
+#endif
 
 #if USE(OPENGL_ES)
     UNUSED_PARAM(hostWindow);
@@ -281,7 +267,7 @@ GraphicsContext3D::GraphicsContext3D(GraphicsContext3DAttributes attrs, HostWind
 
     if (m_attrs.isWebGL2)
         ::glEnable(GraphicsContext3D::PRIMITIVE_RESTART_FIXED_INDEX);
-#elif USE(OPENGL)
+#else
     Vector<CGLPixelFormatAttribute> attribs;
     CGLPixelFormatObj pixelFormatObj = 0;
     GLint numPixelFormats = 0;
@@ -367,13 +353,7 @@ GraphicsContext3D::GraphicsContext3D(GraphicsContext3DAttributes attrs, HostWind
     if (m_isForWebGL2)
         ::glEnable(GraphicsContext3D::PRIMITIVE_RESTART);
 
-#elif USE(ANGLE)
-
-    // FIXME: implement context setup via ANGLE.
-    UNUSED_PARAM(hostWindow);
-    UNUSED_PARAM(sharedContext);
-
-#endif
+#endif // !USE(OPENGL_ES)
     
     validateAttributes();
 
@@ -393,7 +373,7 @@ GraphicsContext3D::GraphicsContext3D(GraphicsContext3DAttributes attrs, HostWind
     // Create the texture that will be used for the framebuffer.
 #if USE(OPENGL_ES)
     ::glGenRenderbuffers(1, &m_texture);
-#elif USE(OPENGL)
+#else
     ::glGenTextures(1, &m_texture);
     // We bind to GL_TEXTURE_RECTANGLE_EXT rather than TEXTURE_2D because
     // that's what is required for a texture backed by IOSurface.
@@ -403,13 +383,8 @@ GraphicsContext3D::GraphicsContext3D(GraphicsContext3DAttributes attrs, HostWind
     ::glTexParameteri(GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
     ::glTexParameteri(GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
     ::glBindTexture(GL_TEXTURE_RECTANGLE_EXT, 0);
-#elif USE(ANGLE)
-    // FIXME: implement back buffer setup via ANGLE.
-#else
-#error Unsupported configuration
 #endif
 
-#if USE(OPENGL) || USE(OPENGL_ES)
     // Create the framebuffer object.
     ::glGenFramebuffersEXT(1, &m_fbo);
     ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
@@ -427,8 +402,7 @@ GraphicsContext3D::GraphicsContext3D(GraphicsContext3DAttributes attrs, HostWind
         if (m_attrs.stencil || m_attrs.depth)
             ::glGenRenderbuffersEXT(1, &m_multisampleDepthStencilBuffer);
     }
-#endif // USE(ANGLE) || USE(OPENGL_ES)
-
+    
     // ANGLE initialization.
 
     ShBuiltInResources ANGLEResources;
@@ -457,9 +431,7 @@ GraphicsContext3D::GraphicsContext3D(GraphicsContext3DAttributes attrs, HostWind
         ::glEnable(GL_POINT_SPRITE);
 #endif
 
-#if USE(OPENGL) || USE(OPENGL_ES)
     ::glClearColor(0, 0, 0, 0);
-#endif
 
     LOG(WebGL, "Created a GraphicsContext3D (%p).", this);
 }
@@ -473,14 +445,10 @@ GraphicsContext3D::~GraphicsContext3D()
         makeContextCurrent();
         [m_contextObj renderbufferStorage:GL_RENDERBUFFER fromDrawable:nil];
         ::glDeleteRenderbuffers(1, &m_texture);
-#elif USE(OPENGL)
+#else
         CGLSetCurrentContext(m_contextObj);
         ::glDeleteTextures(1, &m_texture);
-#elif USE(ANGLE)
-        // FIXME: make context current via ANGLE.
 #endif
-
-#if USE(OPENGL) || USE(OPENGL_ES)
         if (m_attrs.antialias) {
             ::glDeleteRenderbuffersEXT(1, &m_multisampleColorBuffer);
             if (m_attrs.stencil || m_attrs.depth)
@@ -491,16 +459,12 @@ GraphicsContext3D::~GraphicsContext3D()
                 ::glDeleteRenderbuffersEXT(1, &m_depthStencilBuffer);
         }
         ::glDeleteFramebuffersEXT(1, &m_fbo);
-#endif
-
 #if USE(OPENGL_ES)
         [EAGLContext setCurrentContext:0];
         [static_cast<EAGLContext*>(m_contextObj) release];
-#elif USE(OPENGL)
+#else
         CGLSetCurrentContext(0);
         CGLDestroyContext(m_contextObj);
-#elif USE(ANGLE)
-        // FIXME: implement context teardown via ANGLE.
 #endif
         [m_webGLLayer setContext:nullptr];
     }
@@ -532,12 +496,10 @@ bool GraphicsContext3D::makeContextCurrent()
 #if USE(OPENGL_ES)
     if ([EAGLContext currentContext] != m_contextObj)
         return [EAGLContext setCurrentContext:static_cast<EAGLContext*>(m_contextObj)];
-#elif USE(OPENGL)
+#else
     CGLContextObj currentContext = CGLGetCurrentContext();
     if (currentContext != m_contextObj)
         return CGLSetCurrentContext(m_contextObj) == kCGLNoError;
-#elif USE(ANGLE)
-    // FIXME: implement making context current via ANGLE.
 #endif
     return true;
 }
@@ -550,10 +512,8 @@ void GraphicsContext3D::checkGPUStatus()
         forceContextLost();
 #if USE(OPENGL)
         CGLSetCurrentContext(0);
-#elif USE(OPENGL_ES)
+#else
         [EAGLContext setCurrentContext:0];
-#elif USE(ANGLE)
-        // FIXME: implement forced context loss via ANGLE.
 #endif
         return;
     }
@@ -576,7 +536,7 @@ void GraphicsContext3D::checkGPUStatus()
         forceContextLost();
         CGLSetCurrentContext(0);
     }
-#elif USE(OPENGL_ES)
+#else
     EAGLContext* currentContext = static_cast<EAGLContext*>(PlatformGraphicsContext3D());
     [currentContext getParameter:kEAGLCPGPURestartStatus to:&restartStatus];
     if (restartStatus == kEAGLCPGPURestartStatusCaused || restartStatus == kEAGLCPGPURestartStatusBlacklisted) {
@@ -584,9 +544,6 @@ void GraphicsContext3D::checkGPUStatus()
         forceContextLost();
         [EAGLContext setCurrentContext:0];
     }
-#elif USE(ANGLE)
-    // FIXME: check via KHR_robustness.
-    restartStatus = 0;
 #endif
 }
 
@@ -703,19 +660,12 @@ void GraphicsContext3D::screenDidChange(PlatformDisplayID displayID)
 {
     if (!m_contextObj)
         return;
-#if USE(ANGLE)
-    UNUSED_PARAM(displayID);
-#else
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300
-    // FIXME: figure out whether to integrate more code into ANGLE to have this effect.
-#if USE(OPENGL)
     if (!m_hasSwitchedToHighPerformanceGPU)
         setGPUByRegistryID(m_contextObj, CGLGetPixelFormat(m_contextObj), gpuIDForDisplay(displayID));
-#endif
 #else
     setGPUByDisplayMask(m_contextObj, CGLGetPixelFormat(m_contextObj), displayMaskForDisplay(displayID));
-#endif // __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300
-#endif // USE(ANGLE)
+#endif
 }
 #endif // !PLATFORM(MAC)
 
index 234e8e1..609222a 100644 (file)
@@ -38,14 +38,8 @@ ALLOW_DEPRECATED_DECLARATIONS_BEGIN
 
 #if USE(OPENGL)
 @interface WebGLLayer : CALayer
-#elif USE(OPENGL_ES)
-@interface WebGLLayer : CAEAGLLayer
-#elif USE(ANGLE) && PLATFORM(MAC)
-@interface WebGLLayer : CALayer
-#elif USE(ANGLE) && PLATFORM(IOS_FAMILY)
-@interface WebGLLayer : CAEAGLLayer
 #else
-#error Unsupported platform
+@interface WebGLLayer : CAEAGLLayer
 #endif
 {
     WebCore::GraphicsContext3D* _context;
index f4d2d00..8cc9fc4 100644 (file)
@@ -136,10 +136,8 @@ static void freeData(void *, const void *data, size_t /* size */)
         [self reloadValueForKeyPath:@"contents"];
         [self bindFramebufferToNextAvailableSurface];
     }
-#elif USE(OPENGL_ES)
+#else
     _context->presentRenderbuffer();
-#elif USE(ANGLE)
-    // FIXME: display rendering results via ANGLE.
 #endif
 
     _context->markLayerComposited();
index 577ec28..cf95929 100644 (file)
@@ -39,12 +39,8 @@ std::unique_ptr<TextureCacheCV> TextureCacheCV::create(GraphicsContext3D& contex
     TextureCacheType cache = nullptr;
 #if USE(OPENGL_ES)
     CVReturn error = CVOpenGLESTextureCacheCreate(kCFAllocatorDefault, nullptr, context.platformGraphicsContext3D(), nullptr, &cache);
-#elif USE(OPENGL)
+#else
     CVReturn error = CVOpenGLTextureCacheCreate(kCFAllocatorDefault, nullptr, context.platformGraphicsContext3D(), CGLGetPixelFormat(context.platformGraphicsContext3D()), nullptr, &cache);
-#elif USE(ANGLE)
-    // FIXME: figure out how to do this integrating via ANGLE.
-    UNUSED_PARAM(context);
-    CVReturn error = kCVReturnSuccess + 1;
 #endif
     if (error != kCVReturnSuccess)
         return nullptr;
@@ -67,7 +63,7 @@ RetainPtr<TextureCacheCV::TextureType> TextureCacheCV::textureFromImage(CVPixelB
     size_t height = CVPixelBufferGetHeight(image);
     if (kCVReturnSuccess != CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault, m_cache.get(), image, nullptr, outputTarget, internalFormat, width, height, format, type, level, &bareVideoTexture))
         return nullptr;
-#elif USE(OPENGL)
+#else
     UNUSED_PARAM(outputTarget);
     UNUSED_PARAM(level);
     UNUSED_PARAM(internalFormat);
@@ -75,15 +71,6 @@ RetainPtr<TextureCacheCV::TextureType> TextureCacheCV::textureFromImage(CVPixelB
     UNUSED_PARAM(type);
     if (kCVReturnSuccess != CVOpenGLTextureCacheCreateTextureFromImage(kCFAllocatorDefault, m_cache.get(), image, nullptr, &bareVideoTexture))
         return nullptr;
-#elif USE(ANGLE)
-    // FIXME: figure out how to do this integrating via ANGLE.
-    UNUSED_PARAM(image);
-    UNUSED_PARAM(outputTarget);
-    UNUSED_PARAM(level);
-    UNUSED_PARAM(internalFormat);
-    UNUSED_PARAM(format);
-    UNUSED_PARAM(type);
-    return nullptr;
 #endif
     RetainPtr<TextureType> videoTexture = adoptCF(bareVideoTexture);
 
index d697654..ab59c08 100644 (file)
@@ -403,62 +403,62 @@ static StringMap& enumToStringMap()
     static NeverDestroyed<StringMap> map;
     if (map.get().empty()) {
         StringMap stringMap;
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::RGB));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::RGBA));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::LUMINANCE_ALPHA));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::LUMINANCE));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::ALPHA));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::R8));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::R16F));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::R32F));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::R8UI));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::R8I));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::R16UI));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::R16I));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::R32UI));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::R32I));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::RG8));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::RG16F));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::RG32F));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::RG8UI));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::RG8I));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::RG16UI));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::RG16I));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::RG32UI));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::RG32I));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::RGB8));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::SRGB8));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::RGBA8));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::SRGB8_ALPHA8));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::RGBA4));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::RGB10_A2));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::DEPTH_COMPONENT16));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::DEPTH_COMPONENT24));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::DEPTH_COMPONENT32F));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::DEPTH24_STENCIL8));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::DEPTH32F_STENCIL8));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::RGB));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::RGBA));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::LUMINANCE_ALPHA));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::LUMINANCE));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::ALPHA));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::RED));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::RG_INTEGER));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::DEPTH_STENCIL));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::UNSIGNED_BYTE));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::UNSIGNED_SHORT_5_6_5));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::UNSIGNED_SHORT_4_4_4_4));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::UNSIGNED_SHORT_5_5_5_1));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::BYTE));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::HALF_FLOAT));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::FLOAT));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::UNSIGNED_SHORT));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::SHORT));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::UNSIGNED_INT));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::INT));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::UNSIGNED_INT_2_10_10_10_REV));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::UNSIGNED_INT_24_8));
-        map.get().emplace(STRINGIFY_PAIR(GraphicsContext3D::FLOAT_32_UNSIGNED_INT_24_8_REV));
+        map.get().emplace(STRINGIFY_PAIR(GL_RGB));
+        map.get().emplace(STRINGIFY_PAIR(GL_RGBA));
+        map.get().emplace(STRINGIFY_PAIR(GL_LUMINANCE_ALPHA));
+        map.get().emplace(STRINGIFY_PAIR(GL_LUMINANCE));
+        map.get().emplace(STRINGIFY_PAIR(GL_ALPHA));
+        map.get().emplace(STRINGIFY_PAIR(GL_R8));
+        map.get().emplace(STRINGIFY_PAIR(GL_R16F));
+        map.get().emplace(STRINGIFY_PAIR(GL_R32F));
+        map.get().emplace(STRINGIFY_PAIR(GL_R8UI));
+        map.get().emplace(STRINGIFY_PAIR(GL_R8I));
+        map.get().emplace(STRINGIFY_PAIR(GL_R16UI));
+        map.get().emplace(STRINGIFY_PAIR(GL_R16I));
+        map.get().emplace(STRINGIFY_PAIR(GL_R32UI));
+        map.get().emplace(STRINGIFY_PAIR(GL_R32I));
+        map.get().emplace(STRINGIFY_PAIR(GL_RG8));
+        map.get().emplace(STRINGIFY_PAIR(GL_RG16F));
+        map.get().emplace(STRINGIFY_PAIR(GL_RG32F));
+        map.get().emplace(STRINGIFY_PAIR(GL_RG8UI));
+        map.get().emplace(STRINGIFY_PAIR(GL_RG8I));
+        map.get().emplace(STRINGIFY_PAIR(GL_RG16UI));
+        map.get().emplace(STRINGIFY_PAIR(GL_RG16I));
+        map.get().emplace(STRINGIFY_PAIR(GL_RG32UI));
+        map.get().emplace(STRINGIFY_PAIR(GL_RG32I));
+        map.get().emplace(STRINGIFY_PAIR(GL_RGB8));
+        map.get().emplace(STRINGIFY_PAIR(GL_SRGB8));
+        map.get().emplace(STRINGIFY_PAIR(GL_RGBA8));
+        map.get().emplace(STRINGIFY_PAIR(GL_SRGB8_ALPHA8));
+        map.get().emplace(STRINGIFY_PAIR(GL_RGBA4));
+        map.get().emplace(STRINGIFY_PAIR(GL_RGB10_A2));
+        map.get().emplace(STRINGIFY_PAIR(GL_DEPTH_COMPONENT16));
+        map.get().emplace(STRINGIFY_PAIR(GL_DEPTH_COMPONENT24));
+        map.get().emplace(STRINGIFY_PAIR(GL_DEPTH_COMPONENT32F));
+        map.get().emplace(STRINGIFY_PAIR(GL_DEPTH24_STENCIL8));
+        map.get().emplace(STRINGIFY_PAIR(GL_DEPTH32F_STENCIL8));
+        map.get().emplace(STRINGIFY_PAIR(GL_RGB));
+        map.get().emplace(STRINGIFY_PAIR(GL_RGBA));
+        map.get().emplace(STRINGIFY_PAIR(GL_LUMINANCE_ALPHA));
+        map.get().emplace(STRINGIFY_PAIR(GL_LUMINANCE));
+        map.get().emplace(STRINGIFY_PAIR(GL_ALPHA));
+        map.get().emplace(STRINGIFY_PAIR(GL_RED));
+        map.get().emplace(STRINGIFY_PAIR(GL_RG_INTEGER));
+        map.get().emplace(STRINGIFY_PAIR(GL_DEPTH_STENCIL));
+        map.get().emplace(STRINGIFY_PAIR(GL_UNSIGNED_BYTE));
+        map.get().emplace(STRINGIFY_PAIR(GL_UNSIGNED_SHORT_5_6_5));
+        map.get().emplace(STRINGIFY_PAIR(GL_UNSIGNED_SHORT_4_4_4_4));
+        map.get().emplace(STRINGIFY_PAIR(GL_UNSIGNED_SHORT_5_5_5_1));
+        map.get().emplace(STRINGIFY_PAIR(GL_BYTE));
+        map.get().emplace(STRINGIFY_PAIR(GL_HALF_FLOAT));
+        map.get().emplace(STRINGIFY_PAIR(GL_FLOAT));
+        map.get().emplace(STRINGIFY_PAIR(GL_UNSIGNED_SHORT));
+        map.get().emplace(STRINGIFY_PAIR(GL_SHORT));
+        map.get().emplace(STRINGIFY_PAIR(GL_UNSIGNED_INT));
+        map.get().emplace(STRINGIFY_PAIR(GL_INT));
+        map.get().emplace(STRINGIFY_PAIR(GL_UNSIGNED_INT_2_10_10_10_REV));
+        map.get().emplace(STRINGIFY_PAIR(GL_UNSIGNED_INT_24_8));
+        map.get().emplace(STRINGIFY_PAIR(GL_FLOAT_32_UNSIGNED_INT_24_8_REV));
 
 #if USE(OPENGL_ES)
         map.get().emplace(STRINGIFY_PAIR(GL_RED_INTEGER));
@@ -530,13 +530,8 @@ bool VideoTextureCopierCV::initializeContextObjects()
 #if USE(OPENGL_ES)
     fragmentShaderSource.appendLiteral("precision mediump float;\n");
     fragmentShaderSource.appendLiteral("uniform sampler2D u_texture;\n");
-#elif USE(OPENGL)
-    fragmentShaderSource.appendLiteral("uniform sampler2DRect u_texture;\n");
-#elif USE(ANGLE)
-    // FIXME: determine how to access rectangular textures via ANGLE.
-    ASSERT_NOT_REACHED();
 #else
-#error Unsupported configuration
+    fragmentShaderSource.appendLiteral("uniform sampler2DRect u_texture;\n");
 #endif
     fragmentShaderSource.appendLiteral("varying vec2 v_texturePosition;\n");
     fragmentShaderSource.appendLiteral("uniform int u_premultiply;\n");
@@ -546,13 +541,8 @@ bool VideoTextureCopierCV::initializeContextObjects()
     fragmentShaderSource.appendLiteral("    vec2 texPos = vec2(v_texturePosition.x * u_textureDimensions.x, v_texturePosition.y * u_textureDimensions.y);\n");
 #if USE(OPENGL_ES)
     fragmentShaderSource.appendLiteral("    vec4 color = texture2D(u_texture, texPos);\n");
-#elif USE(OPENGL)
-    fragmentShaderSource.appendLiteral("    vec4 color = texture2DRect(u_texture, texPos);\n");
-#elif USE(ANGLE)
-    // FIXME: determine how to access rectangular textures via ANGLE.
-    ASSERT_NOT_REACHED();
 #else
-#error Unsupported configuration
+    fragmentShaderSource.appendLiteral("    vec4 color = texture2DRect(u_texture, texPos);\n");
 #endif
     fragmentShaderSource.appendLiteral("    if (u_swapColorChannels == 1) {\n");
     fragmentShaderSource.appendLiteral("        color.rgba = color.bgra;\n");
@@ -633,13 +623,9 @@ bool VideoTextureCopierCV::initializeUVContextObjects()
 #if USE(OPENGL_ES)
         "   v_yTextureCoordinate = normalizedPosition;\n"
         "   v_uvTextureCoordinate = normalizedPosition;\n"
-#elif USE(OPENGL)
+#else
         "   v_yTextureCoordinate = normalizedPosition * u_yTextureSize;\n"
         "   v_uvTextureCoordinate = normalizedPosition * u_uvTextureSize;\n"
-#elif USE(ANGLE)
-        // FIXME: determine how to access rectangular textures via ANGLE.
-#else
-#error Unsupported configuration
 #endif
         "}\n"_s
     };
@@ -661,13 +647,9 @@ bool VideoTextureCopierCV::initializeUVContextObjects()
         "precision mediump float;\n"
         "#define SAMPLERTYPE sampler2D\n"
         "#define TEXTUREFUNC texture2D\n"
-#elif USE(OPENGL)
+#else
         "#define SAMPLERTYPE sampler2DRect\n"
         "#define TEXTUREFUNC texture2DRect\n"
-#elif USE(ANGLE)
-        // FIXME: determine how to access rectangular textures via ANGLE.
-#else
-#error Unsupported configuration
 #endif
         "uniform SAMPLERTYPE u_yTexture;\n"
         "uniform SAMPLERTYPE u_uvTexture;\n"
@@ -808,13 +790,8 @@ bool VideoTextureCopierCV::copyImageToPlatformTexture(CVPixelBufferRef image, si
 
 #if USE(OPENGL_ES)
     GC3Denum videoTextureTarget = GraphicsContext3D::TEXTURE_2D;
-#elif USE(OPENGL)
-    GC3Denum videoTextureTarget = GL_TEXTURE_RECTANGLE_ARB;
-#elif USE(ANGLE)
-    // FIXME: determine how to access rectangular textures via ANGLE.
-    GC3Denum videoTextureTarget = GraphicsContext3D::TEXTURE_2D;
 #else
-#error Unsupported configuration
+    GC3Denum videoTextureTarget = GL_TEXTURE_RECTANGLE_ARB;
 #endif
     auto uvTexture = m_context->createTexture();
     m_context->activeTexture(GraphicsContext3D::TEXTURE1);
@@ -823,7 +800,7 @@ bool VideoTextureCopierCV::copyImageToPlatformTexture(CVPixelBufferRef image, si
     m_context->texParameteri(videoTextureTarget, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::LINEAR);
     m_context->texParameteri(videoTextureTarget, GraphicsContext3D::TEXTURE_WRAP_S, GraphicsContext3D::CLAMP_TO_EDGE);
     m_context->texParameteri(videoTextureTarget, GraphicsContext3D::TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE);
-    if (!m_context->texImageIOSurface2D(videoTextureTarget, GraphicsContext3D::RG, uvPlaneWidth, uvPlaneHeight, GraphicsContext3D::RG, GraphicsContext3D::UNSIGNED_BYTE, surface, 1)) {
+    if (!m_context->texImageIOSurface2D(videoTextureTarget, GL_RG, uvPlaneWidth, uvPlaneHeight, GL_RG, GL_UNSIGNED_BYTE, surface, 1)) {
         m_context->deleteTexture(uvTexture);
         return false;
     }
@@ -835,7 +812,7 @@ bool VideoTextureCopierCV::copyImageToPlatformTexture(CVPixelBufferRef image, si
     m_context->texParameteri(videoTextureTarget, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::LINEAR);
     m_context->texParameteri(videoTextureTarget, GraphicsContext3D::TEXTURE_WRAP_S, GraphicsContext3D::CLAMP_TO_EDGE);
     m_context->texParameteri(videoTextureTarget, GraphicsContext3D::TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE);
-    if (!m_context->texImageIOSurface2D(videoTextureTarget, GraphicsContext3D::LUMINANCE, yPlaneWidth, yPlaneHeight, GraphicsContext3D::LUMINANCE, GraphicsContext3D::UNSIGNED_BYTE, surface, 0)) {
+    if (!m_context->texImageIOSurface2D(videoTextureTarget, GL_LUMINANCE, yPlaneWidth, yPlaneHeight, GL_LUMINANCE, GL_UNSIGNED_BYTE, surface, 0)) {
         m_context->deleteTexture(yTexture);
         m_context->deleteTexture(uvTexture);
         return false;
@@ -890,16 +867,10 @@ bool VideoTextureCopierCV::copyVideoTextureToPlatformTexture(TextureType inputVi
     Platform3DObject videoTextureName = CVOpenGLESTextureGetName(inputVideoTexture);
     GC3Denum videoTextureTarget = CVOpenGLESTextureGetTarget(inputVideoTexture);
     CVOpenGLESTextureGetCleanTexCoords(inputVideoTexture, lowerLeft, lowerRight, upperRight, upperLeft);
-#elif USE(OPENGL)
-    Platform3DObject videoTextureName = CVOpenGLTextureGetName(inputVideoTexture);
-    GC3Denum videoTextureTarget = CVOpenGLTextureGetTarget(inputVideoTexture);
-    CVOpenGLTextureGetCleanTexCoords(inputVideoTexture, lowerLeft, lowerRight, upperRight, upperLeft);
-#elif USE(ANGLE)
+#else
     Platform3DObject videoTextureName = CVOpenGLTextureGetName(inputVideoTexture);
     GC3Denum videoTextureTarget = CVOpenGLTextureGetTarget(inputVideoTexture);
     CVOpenGLTextureGetCleanTexCoords(inputVideoTexture, lowerLeft, lowerRight, upperRight, upperLeft);
-    // FIXME: determine how to access rectangular textures via ANGLE.
-    ASSERT_NOT_REACHED();
 #endif
 
     if (lowerLeft[1] < upperRight[1])
index 13119ff..f40fe6a 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "config.h"
 
-#if ENABLE(GRAPHICS_CONTEXT_3D) && (USE(OPENGL) || (PLATFORM(COCOA) && USE(OPENGL_ES)))
+#if ENABLE(GRAPHICS_CONTEXT_3D)
 
 #include "Extensions3DOpenGL.h"
 
@@ -308,4 +308,4 @@ bool Extensions3DOpenGL::isVertexArrayObjectSupported()
 
 } // namespace WebCore
 
-#endif // ENABLE(GRAPHICS_CONTEXT_3D) && (USE(OPENGL) || (PLATFORM(COCOA) && USE(OPENGL_ES)))
+#endif // ENABLE(GRAPHICS_CONTEXT_3D)
index b13ef58..bf91e72 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "config.h"
 
-#if ENABLE(GRAPHICS_CONTEXT_3D) && (USE(OPENGL) || USE(OPENGL_ES))
+#if ENABLE(GRAPHICS_CONTEXT_3D)
 #include "Extensions3DOpenGLCommon.h"
 
 #include "ANGLEWebKitBridge.h"
@@ -256,4 +256,4 @@ void Extensions3DOpenGLCommon::getnUniformivEXT(GC3Duint, int, GC3Dsizei, int *)
 
 } // namespace WebCore
 
-#endif // ENABLE(GRAPHICS_CONTEXT_3D) && (USE(OPENGL) || USE(OPENGL_ES))
+#endif // ENABLE(GRAPHICS_CONTEXT_3D)
index e6848fc..1dcf53b 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "config.h"
 
-#if ENABLE(GRAPHICS_CONTEXT_3D) && (USE(OPENGL) || (PLATFORM(COCOA) && USE(OPENGL_ES)))
+#if ENABLE(GRAPHICS_CONTEXT_3D)
 
 #include "GraphicsContext3D.h"
 
@@ -503,4 +503,4 @@ void GraphicsContext3D::readPixels(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsi
 
 }
 
-#endif // ENABLE(GRAPHICS_CONTEXT_3D) && (USE(OPENGL) || (PLATFORM(COCOA) && USE(OPENGL_ES)))
+#endif // ENABLE(GRAPHICS_CONTEXT_3D)
index b24df03..7366dfc 100644 (file)
@@ -28,7 +28,7 @@
 
 #include "config.h"
 
-#if ENABLE(GRAPHICS_CONTEXT_3D) && (USE(OPENGL) || USE(OPENGL_ES))
+#if ENABLE(GRAPHICS_CONTEXT_3D)
 
 #include "GraphicsContext3D.h"
 #if PLATFORM(IOS_FAMILY)
@@ -2079,4 +2079,4 @@ void GraphicsContext3D::primitiveRestartIndex(GC3Duint index)
 
 }
 
-#endif // ENABLE(GRAPHICS_CONTEXT_3D) && (USE(OPENGL) || USE(OPENGL_ES))
+#endif // ENABLE(GRAPHICS_CONTEXT_3D)
index ad5460b..0da2599 100644 (file)
@@ -28,7 +28,7 @@
 
 #include "config.h"
 
-#if ENABLE(GRAPHICS_CONTEXT_3D) && USE(OPENGL_ES) && !PLATFORM(IOS_FAMILY)
+#if ENABLE(GRAPHICS_CONTEXT_3D) && !PLATFORM(IOS_FAMILY)
 
 #include "GraphicsContext3D.h"
 
@@ -400,4 +400,4 @@ PlatformLayer* GraphicsContext3D::platformLayer() const
 
 }
 
-#endif // ENABLE(GRAPHICS_CONTEXT_3D) && USE(OPENGL_ES) && !PLATFORM(IOS_FAMILY)
+#endif // ENABLE(GRAPHICS_CONTEXT_3D) && !PLATFORM(IOS_FAMILY)