Backed out changeset 589752703e0c (Bug 1036068) for suspicion of breaking b2g linux debug builds on a CLOSED TREE
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 10 Sep 2014 12:55:27 +0200
changeset 204632 567b20eab429d46c450eafc29f843d2e689947cd
parent 204631 0e77e360354af024c5d71686cef63b593d522784
child 204633 9e6c2fe193c04e0b4a7638083059a6e1793d22c9
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
bugs1036068
milestone35.0a1
backs out589752703e0cc9c461dd61f786cacd483e298766
Backed out changeset 589752703e0c (Bug 1036068) for suspicion of breaking b2g linux debug builds on a CLOSED TREE
gfx/angle/BUILD.gn
gfx/angle/README.mozilla
gfx/angle/include/EGL/egl.h
gfx/angle/include/EGL/eglext.h
gfx/angle/include/EGL/eglplatform.h
gfx/angle/include/KHR/khrplatform.h
gfx/angle/include/angle_gl.h
gfx/angle/moz.build
gfx/angle/src/angle.gypi
gfx/angle/src/commit.h
gfx/angle/src/commit_id.bat
gfx/angle/src/commit_id.py
gfx/angle/src/common/RefCountObject.h
gfx/angle/src/common/angleutils.h
gfx/angle/src/common/blocklayout.cpp
gfx/angle/src/common/blocklayout.h
gfx/angle/src/common/debug.cpp
gfx/angle/src/common/debug.h
gfx/angle/src/common/event_tracer.h
gfx/angle/src/common/mathutil.h
gfx/angle/src/common/platform.h
gfx/angle/src/common/shadervars.h
gfx/angle/src/common/tls.cpp
gfx/angle/src/common/tls.h
gfx/angle/src/common/utilities.cpp
gfx/angle/src/common/utilities.h
gfx/angle/src/compiler.gypi
gfx/angle/src/compiler/preprocessor/generate_parser.sh
gfx/angle/src/compiler/translator/Compiler.cpp
gfx/angle/src/compiler/translator/Compiler.h
gfx/angle/src/compiler/translator/ConstantUnion.h
gfx/angle/src/compiler/translator/Initialize.cpp
gfx/angle/src/compiler/translator/Initialize.h
gfx/angle/src/compiler/translator/InitializeDll.cpp
gfx/angle/src/compiler/translator/InitializeParseContext.cpp
gfx/angle/src/compiler/translator/Intermediate.cpp
gfx/angle/src/compiler/translator/OutputGLSLBase.cpp
gfx/angle/src/compiler/translator/OutputGLSLBase.h
gfx/angle/src/compiler/translator/OutputHLSL.cpp
gfx/angle/src/compiler/translator/OutputHLSL.h
gfx/angle/src/compiler/translator/ParseContext.cpp
gfx/angle/src/compiler/translator/ParseContext.h
gfx/angle/src/compiler/translator/PoolAlloc.cpp
gfx/angle/src/compiler/translator/ShHandle.h
gfx/angle/src/compiler/translator/ShaderLang.cpp
gfx/angle/src/compiler/translator/StructureHLSL.cpp
gfx/angle/src/compiler/translator/StructureHLSL.h
gfx/angle/src/compiler/translator/SymbolTable.cpp
gfx/angle/src/compiler/translator/SymbolTable.h
gfx/angle/src/compiler/translator/TranslatorESSL.h
gfx/angle/src/compiler/translator/TranslatorGLSL.h
gfx/angle/src/compiler/translator/TranslatorHLSL.h
gfx/angle/src/compiler/translator/Types.cpp
gfx/angle/src/compiler/translator/Types.h
gfx/angle/src/compiler/translator/UnfoldShortCircuit.cpp
gfx/angle/src/compiler/translator/UniformHLSL.cpp
gfx/angle/src/compiler/translator/UniformHLSL.h
gfx/angle/src/compiler/translator/UtilsHLSL.cpp
gfx/angle/src/compiler/translator/UtilsHLSL.h
gfx/angle/src/compiler/translator/VariablePacker.cpp
gfx/angle/src/compiler/translator/VariablePacker.h
gfx/angle/src/compiler/translator/VersionGLSL.cpp
gfx/angle/src/compiler/translator/VersionGLSL.h
gfx/angle/src/compiler/translator/generate_parser.sh
gfx/angle/src/compiler/translator/glslang.y
gfx/angle/src/compiler/translator/glslang_tab.cpp
gfx/angle/src/compiler/translator/intermOut.cpp
gfx/angle/src/compiler/translator/intermediate.h
gfx/angle/src/compiler/translator/localintermediate.h
gfx/angle/src/compiler/translator/osinclude.h
gfx/angle/src/compiler/translator/ossource_posix.cpp
gfx/angle/src/compiler/translator/ossource_win.cpp
gfx/angle/src/compiler/translator/parseConst.cpp
gfx/angle/src/compiler/translator/util.cpp
gfx/angle/src/compiler/translator/util.h
gfx/angle/src/libEGL/Config.cpp
gfx/angle/src/libEGL/Display.cpp
gfx/angle/src/libEGL/Display.h
gfx/angle/src/libEGL/libEGL.cpp
gfx/angle/src/libEGL/libEGL.def
gfx/angle/src/libEGL/main.cpp
gfx/angle/src/libEGL/moz.build
gfx/angle/src/libGLESv2.gypi
gfx/angle/src/libGLESv2/Buffer.cpp
gfx/angle/src/libGLESv2/Buffer.h
gfx/angle/src/libGLESv2/Caps.cpp
gfx/angle/src/libGLESv2/Caps.h
gfx/angle/src/libGLESv2/Constants.h
gfx/angle/src/libGLESv2/Context.cpp
gfx/angle/src/libGLESv2/Context.h
gfx/angle/src/libGLESv2/DynamicHLSL.cpp
gfx/angle/src/libGLESv2/DynamicHLSL.h
gfx/angle/src/libGLESv2/Framebuffer.cpp
gfx/angle/src/libGLESv2/Framebuffer.h
gfx/angle/src/libGLESv2/FramebufferAttachment.cpp
gfx/angle/src/libGLESv2/FramebufferAttachment.h
gfx/angle/src/libGLESv2/HandleAllocator.h
gfx/angle/src/libGLESv2/ProgramBinary.cpp
gfx/angle/src/libGLESv2/ProgramBinary.h
gfx/angle/src/libGLESv2/Query.h
gfx/angle/src/libGLESv2/Renderbuffer.cpp
gfx/angle/src/libGLESv2/Renderbuffer.h
gfx/angle/src/libGLESv2/RenderbufferProxySet.cpp
gfx/angle/src/libGLESv2/RenderbufferProxySet.h
gfx/angle/src/libGLESv2/ResourceManager.cpp
gfx/angle/src/libGLESv2/ResourceManager.h
gfx/angle/src/libGLESv2/Shader.cpp
gfx/angle/src/libGLESv2/Shader.h
gfx/angle/src/libGLESv2/Texture.cpp
gfx/angle/src/libGLESv2/Texture.h
gfx/angle/src/libGLESv2/TransformFeedback.h
gfx/angle/src/libGLESv2/Uniform.cpp
gfx/angle/src/libGLESv2/Uniform.h
gfx/angle/src/libGLESv2/VertexArray.cpp
gfx/angle/src/libGLESv2/VertexArray.h
gfx/angle/src/libGLESv2/VertexAttribute.cpp
gfx/angle/src/libGLESv2/VertexAttribute.h
gfx/angle/src/libGLESv2/angletypes.cpp
gfx/angle/src/libGLESv2/angletypes.h
gfx/angle/src/libGLESv2/constants.h
gfx/angle/src/libGLESv2/formatutils.cpp
gfx/angle/src/libGLESv2/formatutils.h
gfx/angle/src/libGLESv2/libGLESv2.cpp
gfx/angle/src/libGLESv2/main.cpp
gfx/angle/src/libGLESv2/moz.build
gfx/angle/src/libGLESv2/precompiled.h
gfx/angle/src/libGLESv2/renderer/BufferImpl.h
gfx/angle/src/libGLESv2/renderer/BufferStorage.cpp
gfx/angle/src/libGLESv2/renderer/BufferStorage.h
gfx/angle/src/libGLESv2/renderer/IndexBuffer.cpp
gfx/angle/src/libGLESv2/renderer/IndexBuffer.h
gfx/angle/src/libGLESv2/renderer/IndexDataManager.cpp
gfx/angle/src/libGLESv2/renderer/IndexDataManager.h
gfx/angle/src/libGLESv2/renderer/Renderer.cpp
gfx/angle/src/libGLESv2/renderer/Renderer.h
gfx/angle/src/libGLESv2/renderer/VertexArrayImpl.h
gfx/angle/src/libGLESv2/renderer/VertexBuffer.cpp
gfx/angle/src/libGLESv2/renderer/VertexBuffer.h
gfx/angle/src/libGLESv2/renderer/VertexDataManager.cpp
gfx/angle/src/libGLESv2/renderer/VertexDataManager.h
gfx/angle/src/libGLESv2/renderer/d3d/BufferD3D.cpp
gfx/angle/src/libGLESv2/renderer/d3d/BufferD3D.h
gfx/angle/src/libGLESv2/renderer/d3d/HLSLCompiler.h
gfx/angle/src/libGLESv2/renderer/d3d/IndexBuffer.cpp
gfx/angle/src/libGLESv2/renderer/d3d/IndexBuffer.h
gfx/angle/src/libGLESv2/renderer/d3d/IndexDataManager.cpp
gfx/angle/src/libGLESv2/renderer/d3d/IndexDataManager.h
gfx/angle/src/libGLESv2/renderer/d3d/VertexBuffer.cpp
gfx/angle/src/libGLESv2/renderer/d3d/VertexBuffer.h
gfx/angle/src/libGLESv2/renderer/d3d/VertexDataManager.cpp
gfx/angle/src/libGLESv2/renderer/d3d/VertexDataManager.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/Blit11.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/Blit11.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/Buffer11.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/Buffer11.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/Clear11.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/Clear11.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/Fence11.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/Fence11.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/Image11.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/Image11.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/IndexBuffer11.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/IndexBuffer11.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/InputLayoutCache.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/InputLayoutCache.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/PixelTransfer11.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/PixelTransfer11.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/Query11.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/Query11.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/RenderStateCache.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/RenderStateCache.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/RenderTarget11.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/RenderTarget11.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/Renderer11.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/Renderer11.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/ShaderExecutable11.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/ShaderExecutable11.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/SwapChain11.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/SwapChain11.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/TextureStorage11.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/TextureStorage11.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/VertexArray11.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/VertexBuffer11.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/VertexBuffer11.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/formatutils11.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/formatutils11.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/renderer11_utils.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/renderer11_utils.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/BufferToTexture11.hlsl
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/Clear11.hlsl
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/Passthrough2D11.hlsl
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/Passthrough3D11.hlsl
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/Swizzle11.hlsl
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/buffertotexture11_gs.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/buffertotexture11_ps_4f.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/buffertotexture11_ps_4i.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/buffertotexture11_ps_4ui.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/buffertotexture11_vs.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/clearfloat11vs.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/clearsint11ps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/clearsint11vs.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/clearuint11ps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/clearuint11vs.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthrough2d11vs.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthrough3d11gs.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthrough3d11vs.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthroughdepth2d11ps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthroughlum2d11ps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthroughlum3d11ps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthroughlumalpha2d11ps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthroughlumalpha3d11ps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthroughr2d11ps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthroughr2di11ps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthroughr2dui11ps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthroughr3d11ps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthroughr3di11ps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthroughr3dui11ps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthroughrg2d11ps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthroughrg2di11ps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthroughrg2dui11ps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthroughrg3d11ps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthroughrg3di11ps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthroughrg3dui11ps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthroughrgb2d11ps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthroughrgb2di11ps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthroughrgb2dui11ps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthroughrgb3d11ps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthroughrgb3di11ps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthroughrgb3dui11ps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthroughrgba2d11ps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthroughrgba2di11ps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthroughrgba2dui11ps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthroughrgba3d11ps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthroughrgba3di11ps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/passthroughrgba3dui11ps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/swizzlef2darrayps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/swizzlef2dps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/swizzlef3dps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/swizzlei2darrayps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/swizzlei2dps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/swizzlei3dps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/swizzleui2darrayps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/swizzleui2dps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/swizzleui3dps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/generate_shaders.bat
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/Blit9.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/Blit9.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/Buffer9.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/Buffer9.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/Fence9.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/Fence9.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/Image9.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/Image9.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/IndexBuffer9.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/IndexBuffer9.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/Query9.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/Query9.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/RenderTarget9.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/RenderTarget9.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/Renderer9.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/Renderer9.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/ShaderCache.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/ShaderExecutable9.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/ShaderExecutable9.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/SwapChain9.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/SwapChain9.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/TextureStorage9.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/TextureStorage9.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/VertexArray9.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/VertexBuffer9.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/VertexBuffer9.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/VertexDeclarationCache.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/VertexDeclarationCache.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/formatutils9.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/formatutils9.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/renderer9_utils.cpp
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/renderer9_utils.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/shaders/Blit.ps
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/shaders/Blit.vs
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/shaders/compiled/componentmaskps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/shaders/compiled/flipyvs.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/shaders/compiled/luminanceps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/shaders/compiled/passthroughps.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/shaders/compiled/standardvs.h
gfx/angle/src/libGLESv2/renderer/d3d/d3d9/shaders/generate_shaders.bat
gfx/angle/src/libGLESv2/renderer/d3d11/Blit11.cpp
gfx/angle/src/libGLESv2/renderer/d3d11/Blit11.h
gfx/angle/src/libGLESv2/renderer/d3d11/BufferStorage11.cpp
gfx/angle/src/libGLESv2/renderer/d3d11/BufferStorage11.h
gfx/angle/src/libGLESv2/renderer/d3d11/Clear11.cpp
gfx/angle/src/libGLESv2/renderer/d3d11/Clear11.h
gfx/angle/src/libGLESv2/renderer/d3d11/Fence11.cpp
gfx/angle/src/libGLESv2/renderer/d3d11/Fence11.h
gfx/angle/src/libGLESv2/renderer/d3d11/Image11.cpp
gfx/angle/src/libGLESv2/renderer/d3d11/Image11.h
gfx/angle/src/libGLESv2/renderer/d3d11/IndexBuffer11.cpp
gfx/angle/src/libGLESv2/renderer/d3d11/IndexBuffer11.h
gfx/angle/src/libGLESv2/renderer/d3d11/InputLayoutCache.cpp
gfx/angle/src/libGLESv2/renderer/d3d11/InputLayoutCache.h
gfx/angle/src/libGLESv2/renderer/d3d11/PixelTransfer11.cpp
gfx/angle/src/libGLESv2/renderer/d3d11/PixelTransfer11.h
gfx/angle/src/libGLESv2/renderer/d3d11/Query11.cpp
gfx/angle/src/libGLESv2/renderer/d3d11/Query11.h
gfx/angle/src/libGLESv2/renderer/d3d11/RenderStateCache.cpp
gfx/angle/src/libGLESv2/renderer/d3d11/RenderStateCache.h
gfx/angle/src/libGLESv2/renderer/d3d11/RenderTarget11.cpp
gfx/angle/src/libGLESv2/renderer/d3d11/RenderTarget11.h
gfx/angle/src/libGLESv2/renderer/d3d11/Renderer11.cpp
gfx/angle/src/libGLESv2/renderer/d3d11/Renderer11.h
gfx/angle/src/libGLESv2/renderer/d3d11/ShaderExecutable11.cpp
gfx/angle/src/libGLESv2/renderer/d3d11/ShaderExecutable11.h
gfx/angle/src/libGLESv2/renderer/d3d11/SwapChain11.cpp
gfx/angle/src/libGLESv2/renderer/d3d11/SwapChain11.h
gfx/angle/src/libGLESv2/renderer/d3d11/TextureStorage11.cpp
gfx/angle/src/libGLESv2/renderer/d3d11/TextureStorage11.h
gfx/angle/src/libGLESv2/renderer/d3d11/VertexBuffer11.cpp
gfx/angle/src/libGLESv2/renderer/d3d11/VertexBuffer11.h
gfx/angle/src/libGLESv2/renderer/d3d11/formatutils11.cpp
gfx/angle/src/libGLESv2/renderer/d3d11/formatutils11.h
gfx/angle/src/libGLESv2/renderer/d3d11/renderer11_utils.cpp
gfx/angle/src/libGLESv2/renderer/d3d11/renderer11_utils.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/BufferToTexture11.hlsl
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/Clear11.hlsl
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/Passthrough2D11.hlsl
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/Passthrough3D11.hlsl
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/Swizzle11.hlsl
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/buffertotexture11_gs.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/buffertotexture11_ps_4f.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/buffertotexture11_ps_4i.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/buffertotexture11_ps_4ui.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/buffertotexture11_vs.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/clearfloat11ps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/clearfloat11vs.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/clearsint11ps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/clearsint11vs.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/clearuint11ps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/clearuint11vs.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/passthrough2d11vs.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/passthrough3d11gs.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/passthrough3d11vs.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughdepth2d11ps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughlum2d11ps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughlum3d11ps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughlumalpha2d11ps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughlumalpha3d11ps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughr2d11ps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughr2di11ps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughr2dui11ps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughr3d11ps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughr3di11ps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughr3dui11ps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrg2d11ps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrg2di11ps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrg2dui11ps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrg3d11ps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrg3di11ps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrg3dui11ps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrgb2d11ps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrgb2di11ps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrgb2dui11ps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrgb3d11ps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrgb3di11ps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrgb3dui11ps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrgba2d11ps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrgba2di11ps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrgba2dui11ps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrgba3d11ps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrgba3di11ps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrgba3dui11ps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/swizzlef2darrayps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/swizzlef2dps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/swizzlef3dps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/swizzlei2darrayps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/swizzlei2dps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/swizzlei3dps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/swizzleui2darrayps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/swizzleui2dps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/compiled/swizzleui3dps.h
gfx/angle/src/libGLESv2/renderer/d3d11/shaders/generate_shaders.bat
gfx/angle/src/libGLESv2/renderer/d3d9/Blit9.cpp
gfx/angle/src/libGLESv2/renderer/d3d9/Blit9.h
gfx/angle/src/libGLESv2/renderer/d3d9/BufferStorage9.cpp
gfx/angle/src/libGLESv2/renderer/d3d9/BufferStorage9.h
gfx/angle/src/libGLESv2/renderer/d3d9/Fence9.cpp
gfx/angle/src/libGLESv2/renderer/d3d9/Fence9.h
gfx/angle/src/libGLESv2/renderer/d3d9/Image9.cpp
gfx/angle/src/libGLESv2/renderer/d3d9/Image9.h
gfx/angle/src/libGLESv2/renderer/d3d9/IndexBuffer9.cpp
gfx/angle/src/libGLESv2/renderer/d3d9/IndexBuffer9.h
gfx/angle/src/libGLESv2/renderer/d3d9/Query9.cpp
gfx/angle/src/libGLESv2/renderer/d3d9/Query9.h
gfx/angle/src/libGLESv2/renderer/d3d9/RenderTarget9.cpp
gfx/angle/src/libGLESv2/renderer/d3d9/RenderTarget9.h
gfx/angle/src/libGLESv2/renderer/d3d9/Renderer9.cpp
gfx/angle/src/libGLESv2/renderer/d3d9/Renderer9.h
gfx/angle/src/libGLESv2/renderer/d3d9/ShaderCache.h
gfx/angle/src/libGLESv2/renderer/d3d9/ShaderExecutable9.cpp
gfx/angle/src/libGLESv2/renderer/d3d9/ShaderExecutable9.h
gfx/angle/src/libGLESv2/renderer/d3d9/SwapChain9.cpp
gfx/angle/src/libGLESv2/renderer/d3d9/SwapChain9.h
gfx/angle/src/libGLESv2/renderer/d3d9/TextureStorage9.cpp
gfx/angle/src/libGLESv2/renderer/d3d9/TextureStorage9.h
gfx/angle/src/libGLESv2/renderer/d3d9/VertexBuffer9.cpp
gfx/angle/src/libGLESv2/renderer/d3d9/VertexBuffer9.h
gfx/angle/src/libGLESv2/renderer/d3d9/VertexDeclarationCache.cpp
gfx/angle/src/libGLESv2/renderer/d3d9/VertexDeclarationCache.h
gfx/angle/src/libGLESv2/renderer/d3d9/formatutils9.cpp
gfx/angle/src/libGLESv2/renderer/d3d9/formatutils9.h
gfx/angle/src/libGLESv2/renderer/d3d9/renderer9_utils.cpp
gfx/angle/src/libGLESv2/renderer/d3d9/renderer9_utils.h
gfx/angle/src/libGLESv2/renderer/d3d9/shaders/Blit.ps
gfx/angle/src/libGLESv2/renderer/d3d9/shaders/Blit.vs
gfx/angle/src/libGLESv2/renderer/d3d9/shaders/compiled/componentmaskps.h
gfx/angle/src/libGLESv2/renderer/d3d9/shaders/compiled/flipyvs.h
gfx/angle/src/libGLESv2/renderer/d3d9/shaders/compiled/luminanceps.h
gfx/angle/src/libGLESv2/renderer/d3d9/shaders/compiled/passthroughps.h
gfx/angle/src/libGLESv2/renderer/d3d9/shaders/compiled/standardvs.h
gfx/angle/src/libGLESv2/renderer/d3d9/shaders/generate_shaders.bat
gfx/angle/src/libGLESv2/renderer/loadimage.cpp
gfx/angle/src/libGLESv2/renderer/loadimage.h
gfx/angle/src/libGLESv2/validationES.cpp
gfx/angle/src/libGLESv2/validationES.h
gfx/angle/src/libGLESv2/validationES2.cpp
gfx/angle/src/libGLESv2/validationES3.cpp
gfx/angle/src/libGLESv2/validationES3.h
deleted file mode 100644
--- a/gfx/angle/BUILD.gn
+++ /dev/null
@@ -1,638 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This config is applied to internal Angle targets (not pushed to dependents).
-config("internal_config") {
-  include_dirs = [
-    "include",
-    "src",
-  ]
-}
-
-component("translator") {
-  sources = [
-    "src/compiler/translator/ShaderLang.cpp",
-  ]
-
-  defines = [ "ANGLE_TRANSLATOR_IMPLEMENTATION" ]
-
-  configs -= [ "//build/config/compiler:chromium_code" ]
-  configs += [
-    ":internal_config",
-    "//build/config/compiler:no_chromium_code",
-  ]
-
-  deps = [
-    ":translator_lib",
-  ]
-}
-
-# Holds the shared includes so we only need to list them once.
-source_set("includes") {
-  sources = [
-    "include/EGL/egl.h",
-    "include/EGL/eglext.h",
-    "include/EGL/eglplatform.h",
-    "include/GLES2/gl2.h",
-    "include/GLES2/gl2ext.h",
-    "include/GLES2/gl2platform.h",
-    "include/GLES3/gl3.h",
-    "include/GLES3/gl3ext.h",
-    "include/GLES3/gl3platform.h",
-    "include/GLSLANG/ShaderLang.h",
-    "include/KHR/khrplatform.h",
-  ]
-}
-
-static_library("preprocessor") {
-  sources = [
-    "src/compiler/preprocessor/DiagnosticsBase.cpp",
-    "src/compiler/preprocessor/DiagnosticsBase.h",
-    "src/compiler/preprocessor/DirectiveHandlerBase.cpp",
-    "src/compiler/preprocessor/DirectiveHandlerBase.h",
-    "src/compiler/preprocessor/DirectiveParser.cpp",
-    "src/compiler/preprocessor/DirectiveParser.h",
-    "src/compiler/preprocessor/ExpressionParser.cpp",
-    "src/compiler/preprocessor/ExpressionParser.h",
-    "src/compiler/preprocessor/ExpressionParser.y",
-    "src/compiler/preprocessor/Input.cpp",
-    "src/compiler/preprocessor/Input.h",
-    "src/compiler/preprocessor/Lexer.cpp",
-    "src/compiler/preprocessor/Lexer.h",
-    "src/compiler/preprocessor/Macro.cpp",
-    "src/compiler/preprocessor/Macro.h",
-    "src/compiler/preprocessor/MacroExpander.cpp",
-    "src/compiler/preprocessor/MacroExpander.h",
-    "src/compiler/preprocessor/Preprocessor.cpp",
-    "src/compiler/preprocessor/Preprocessor.h",
-    "src/compiler/preprocessor/SourceLocation.h",
-    "src/compiler/preprocessor/Token.cpp",
-    "src/compiler/preprocessor/Token.h",
-    "src/compiler/preprocessor/Tokenizer.cpp",
-    "src/compiler/preprocessor/Tokenizer.h",
-    "src/compiler/preprocessor/Tokenizer.l",
-    "src/compiler/preprocessor/numeric_lex.h",
-    "src/compiler/preprocessor/pp_utils.h",
-  ]
-
-  configs -= [ "//build/config/compiler:chromium_code" ]
-  configs += [
-    ":internal_config",
-    "//build/config/compiler:no_chromium_code",
-  ]
-
-}
-
-static_library("translator_lib") {
-  sources = [
-    "src/common/RefCountObject.cpp",
-    "src/common/RefCountObject.h",
-    "src/common/angleutils.h",
-    "src/common/blocklayout.cpp",
-    "src/common/blocklayout.h",
-    "src/common/debug.cpp",
-    "src/common/debug.h",
-    "src/common/event_tracer.cpp",
-    "src/common/event_tracer.h",
-    "src/common/mathutil.cpp",
-    "src/common/mathutil.h",
-    "src/common/platform.h",
-    "src/common/shadervars.h",
-    "src/common/tls.cpp",
-    "src/common/tls.h",
-    "src/common/utilities.cpp",
-    "src/common/utilities.h",
-    "src/common/version.h",
-    "src/compiler/translator/BaseTypes.h",
-    "src/compiler/translator/BuiltInFunctionEmulator.cpp",
-    "src/compiler/translator/BuiltInFunctionEmulator.h",
-    "src/compiler/translator/CodeGen.cpp",
-    "src/compiler/translator/Common.h",
-    "src/compiler/translator/Compiler.cpp",
-    "src/compiler/translator/ConstantUnion.h",
-    "src/compiler/translator/DetectCallDepth.cpp",
-    "src/compiler/translator/DetectCallDepth.h",
-    "src/compiler/translator/DetectDiscontinuity.cpp",
-    "src/compiler/translator/DetectDiscontinuity.h",
-    "src/compiler/translator/Diagnostics.cpp",
-    "src/compiler/translator/Diagnostics.h",
-    "src/compiler/translator/DirectiveHandler.cpp",
-    "src/compiler/translator/DirectiveHandler.h",
-    "src/compiler/translator/ExtensionBehavior.h",
-    "src/compiler/translator/FlagStd140Structs.cpp",
-    "src/compiler/translator/FlagStd140Structs.h",
-    "src/compiler/translator/ForLoopUnroll.cpp",
-    "src/compiler/translator/ForLoopUnroll.h",
-    "src/compiler/translator/HashNames.h",
-    "src/compiler/translator/InfoSink.cpp",
-    "src/compiler/translator/InfoSink.h",
-    "src/compiler/translator/Initialize.cpp",
-    "src/compiler/translator/Initialize.h",
-    "src/compiler/translator/InitializeDll.cpp",
-    "src/compiler/translator/InitializeDll.h",
-    "src/compiler/translator/InitializeGlobals.h",
-    "src/compiler/translator/InitializeParseContext.cpp",
-    "src/compiler/translator/InitializeParseContext.h",
-    "src/compiler/translator/InitializeVariables.cpp",
-    "src/compiler/translator/InitializeVariables.h",
-    "src/compiler/translator/IntermTraverse.cpp",
-    "src/compiler/translator/Intermediate.cpp",
-    "src/compiler/translator/LoopInfo.cpp",
-    "src/compiler/translator/LoopInfo.h",
-    "src/compiler/translator/MMap.h",
-    "src/compiler/translator/NodeSearch.h",
-    "src/compiler/translator/OutputESSL.cpp",
-    "src/compiler/translator/OutputESSL.h",
-    "src/compiler/translator/OutputGLSL.cpp",
-    "src/compiler/translator/OutputGLSL.h",
-    "src/compiler/translator/OutputGLSLBase.cpp",
-    "src/compiler/translator/OutputGLSLBase.h",
-    "src/compiler/translator/OutputHLSL.cpp",
-    "src/compiler/translator/OutputHLSL.h",
-    "src/compiler/translator/ParseContext.cpp",
-    "src/compiler/translator/ParseContext.h",
-    "src/compiler/translator/PoolAlloc.cpp",
-    "src/compiler/translator/PoolAlloc.h",
-    "src/compiler/translator/Pragma.h",
-    "src/compiler/translator/QualifierAlive.cpp",
-    "src/compiler/translator/QualifierAlive.h",
-    "src/compiler/translator/RemoveTree.cpp",
-    "src/compiler/translator/RemoveTree.h",
-    "src/compiler/translator/RenameFunction.h",
-    "src/compiler/translator/RewriteElseBlocks.cpp",
-    "src/compiler/translator/RewriteElseBlocks.h",
-    "src/compiler/translator/SearchSymbol.cpp",
-    "src/compiler/translator/SearchSymbol.h",
-    "src/compiler/translator/ShHandle.h",
-    "src/compiler/translator/StructureHLSL.cpp",
-    "src/compiler/translator/StructureHLSL.h",
-    "src/compiler/translator/SymbolTable.cpp",
-    "src/compiler/translator/SymbolTable.h",
-    "src/compiler/translator/TranslatorESSL.cpp",
-    "src/compiler/translator/TranslatorESSL.h",
-    "src/compiler/translator/TranslatorGLSL.cpp",
-    "src/compiler/translator/TranslatorGLSL.h",
-    "src/compiler/translator/TranslatorHLSL.cpp",
-    "src/compiler/translator/TranslatorHLSL.h",
-    "src/compiler/translator/Types.cpp",
-    "src/compiler/translator/Types.h",
-    "src/compiler/translator/UnfoldShortCircuit.cpp",
-    "src/compiler/translator/UnfoldShortCircuit.h",
-    "src/compiler/translator/UnfoldShortCircuitAST.cpp",
-    "src/compiler/translator/UnfoldShortCircuitAST.h",
-    "src/compiler/translator/UniformHLSL.cpp",
-    "src/compiler/translator/UniformHLSL.h",
-    "src/compiler/translator/UtilsHLSL.cpp",
-    "src/compiler/translator/UtilsHLSL.h",
-    "src/compiler/translator/ValidateLimitations.cpp",
-    "src/compiler/translator/ValidateLimitations.h",
-    "src/compiler/translator/ValidateOutputs.cpp",
-    "src/compiler/translator/ValidateOutputs.h",
-    "src/compiler/translator/VariableInfo.cpp",
-    "src/compiler/translator/VariableInfo.h",
-    "src/compiler/translator/VariablePacker.cpp",
-    "src/compiler/translator/VariablePacker.h",
-    "src/compiler/translator/VersionGLSL.cpp",
-    "src/compiler/translator/VersionGLSL.h",
-    "src/compiler/translator/compilerdebug.cpp",
-    "src/compiler/translator/compilerdebug.h",
-    "src/compiler/translator/depgraph/DependencyGraph.cpp",
-    "src/compiler/translator/depgraph/DependencyGraph.h",
-    "src/compiler/translator/depgraph/DependencyGraphBuilder.cpp",
-    "src/compiler/translator/depgraph/DependencyGraphBuilder.h",
-    "src/compiler/translator/depgraph/DependencyGraphOutput.cpp",
-    "src/compiler/translator/depgraph/DependencyGraphOutput.h",
-    "src/compiler/translator/depgraph/DependencyGraphTraverse.cpp",
-    "src/compiler/translator/glslang.h",
-    "src/compiler/translator/glslang.l",
-    "src/compiler/translator/glslang.y",
-    "src/compiler/translator/glslang_lex.cpp",
-    "src/compiler/translator/glslang_tab.cpp",
-    "src/compiler/translator/glslang_tab.h",
-    "src/compiler/translator/intermOut.cpp",
-    "src/compiler/translator/intermediate.h",
-    "src/compiler/translator/length_limits.h",
-    "src/compiler/translator/localintermediate.h",
-    "src/compiler/translator/parseConst.cpp",
-    "src/compiler/translator/timing/RestrictFragmentShaderTiming.cpp",
-    "src/compiler/translator/timing/RestrictFragmentShaderTiming.h",
-    "src/compiler/translator/timing/RestrictVertexShaderTiming.cpp",
-    "src/compiler/translator/timing/RestrictVertexShaderTiming.h",
-    "src/compiler/translator/util.cpp",
-    "src/compiler/translator/util.h",
-    "src/third_party/compiler/ArrayBoundsClamper.cpp",
-    "src/third_party/compiler/ArrayBoundsClamper.h",
-  ]
-
-  configs -= [ "//build/config/compiler:chromium_code" ]
-  configs += [
-    ":internal_config",
-    "//build/config/compiler:no_chromium_code",
-  ]
-
-  deps = [
-    ":includes",
-    ":preprocessor",
-  ]
-}
-
-config("translator_static_config") {
-  defines = [ "ANGLE_TRANSLATOR_STATIC" ]
-}
-
-static_library("translator_static") {
-  sources = [
-    "src/compiler/translator/ShaderLang.cpp",
-  ]
-
-  configs -= [ "//build/config/compiler:chromium_code" ]
-  configs += [
-    ":internal_config",
-    "//build/config/compiler:no_chromium_code",
-  ]
-  direct_dependent_configs = [ ":translator_static_config" ]
-
-  deps = [
-    ":translator_lib",
-  ]
-}
-
-config("commit_id_config") {
-  include_dirs = [ "$root_gen_dir/angle" ]
-}
-
-action("commit_id") {
-  script = "src/commit_id.py"
-
-  output_file = "$root_gen_dir/angle/id/commit.h"
-  outputs = [ output_file ]
-
-  args = [
-    "gen",
-    rebase_path(".", root_build_dir),
-    rebase_path(output_file, root_build_dir),
-  ]
-
-  direct_dependent_configs = [ ":commit_id_config" ]
-}
-
-if (is_win) {
-  angle_enable_d3d9 = true
-  angle_enable_d3d11 = true
-
-  shared_library("libGLESv2") {
-    sources = [
-      "src/common/RefCountObject.cpp",
-      "src/common/RefCountObject.h",
-      "src/common/angleutils.h",
-      "src/common/blocklayout.cpp",
-      "src/common/blocklayout.h",
-      "src/common/debug.cpp",
-      "src/common/debug.h",
-      "src/common/event_tracer.cpp",
-      "src/common/event_tracer.h",
-      "src/common/mathutil.cpp",
-      "src/common/mathutil.h",
-      "src/common/platform.h",
-      "src/common/shadervars.h",
-      "src/common/tls.cpp",
-      "src/common/tls.h",
-      "src/common/utilities.cpp",
-      "src/common/utilities.h",
-      "src/common/version.h",
-      "src/libGLESv2/BinaryStream.h",
-      "src/libGLESv2/Buffer.cpp",
-      "src/libGLESv2/Buffer.h",
-      "src/libGLESv2/Caps.cpp",
-      "src/libGLESv2/Caps.h",
-      "src/libGLESv2/Context.cpp",
-      "src/libGLESv2/Context.h",
-      "src/libGLESv2/DynamicHLSL.cpp",
-      "src/libGLESv2/DynamicHLSL.h",
-      "src/libGLESv2/Fence.cpp",
-      "src/libGLESv2/Fence.h",
-      "src/libGLESv2/Float16ToFloat32.cpp",
-      "src/libGLESv2/Framebuffer.cpp",
-      "src/libGLESv2/Framebuffer.h",
-      "src/libGLESv2/FramebufferAttachment.cpp",
-      "src/libGLESv2/FramebufferAttachment.h",
-      "src/libGLESv2/HandleAllocator.cpp",
-      "src/libGLESv2/HandleAllocator.h",
-      "src/libGLESv2/Program.cpp",
-      "src/libGLESv2/Program.h",
-      "src/libGLESv2/ProgramBinary.cpp",
-      "src/libGLESv2/ProgramBinary.h",
-      "src/libGLESv2/Query.cpp",
-      "src/libGLESv2/Query.h",
-      "src/libGLESv2/Renderbuffer.cpp",
-      "src/libGLESv2/Renderbuffer.h",
-      "src/libGLESv2/RenderbufferProxySet.cpp",
-      "src/libGLESv2/RenderbufferProxySet.h",
-      "src/libGLESv2/ResourceManager.cpp",
-      "src/libGLESv2/ResourceManager.h",
-      "src/libGLESv2/Sampler.cpp",
-      "src/libGLESv2/Sampler.h",
-      "src/libGLESv2/Shader.cpp",
-      "src/libGLESv2/Shader.h",
-      "src/libGLESv2/Texture.cpp",
-      "src/libGLESv2/Texture.h",
-      "src/libGLESv2/TransformFeedback.cpp",
-      "src/libGLESv2/TransformFeedback.h",
-      "src/libGLESv2/Uniform.cpp",
-      "src/libGLESv2/Uniform.h",
-      "src/libGLESv2/VertexArray.cpp",
-      "src/libGLESv2/VertexArray.h",
-      "src/libGLESv2/VertexAttribute.h",
-      "src/libGLESv2/VertexAttribute.cpp",
-      "src/libGLESv2/angletypes.cpp",
-      "src/libGLESv2/angletypes.h",
-      "src/libGLESv2/constants.h",
-      "src/libGLESv2/formatutils.cpp",
-      "src/libGLESv2/formatutils.h",
-      "src/libGLESv2/libGLESv2.cpp",
-      "src/libGLESv2/libGLESv2.def",
-      "src/libGLESv2/libGLESv2.rc",
-      "src/libGLESv2/main.cpp",
-      "src/libGLESv2/main.h",
-      "src/libGLESv2/precompiled.cpp",
-      "src/libGLESv2/precompiled.h",
-      "src/libGLESv2/queryconversions.cpp",
-      "src/libGLESv2/queryconversions.h",
-      "src/libGLESv2/renderer/BufferStorage.cpp",
-      "src/libGLESv2/renderer/BufferStorage.h",
-      "src/libGLESv2/renderer/FenceImpl.h",
-      "src/libGLESv2/renderer/Image.cpp",
-      "src/libGLESv2/renderer/Image.h",
-      "src/libGLESv2/renderer/IndexBuffer.cpp",
-      "src/libGLESv2/renderer/IndexBuffer.h",
-      "src/libGLESv2/renderer/IndexDataManager.cpp",
-      "src/libGLESv2/renderer/IndexDataManager.h",
-      "src/libGLESv2/renderer/IndexRangeCache.cpp",
-      "src/libGLESv2/renderer/IndexRangeCache.h",
-      "src/libGLESv2/renderer/QueryImpl.h",
-      "src/libGLESv2/renderer/RenderTarget.h",
-      "src/libGLESv2/renderer/Renderer.cpp",
-      "src/libGLESv2/renderer/Renderer.h",
-      "src/libGLESv2/renderer/ShaderExecutable.h",
-      "src/libGLESv2/renderer/SwapChain.h",
-      "src/libGLESv2/renderer/TextureStorage.cpp",
-      "src/libGLESv2/renderer/TextureStorage.h",
-      "src/libGLESv2/renderer/VertexArrayImpl.h",
-      "src/libGLESv2/renderer/VertexBuffer.cpp",
-      "src/libGLESv2/renderer/VertexBuffer.h",
-      "src/libGLESv2/renderer/VertexDataManager.cpp",
-      "src/libGLESv2/renderer/VertexDataManager.h",
-      "src/libGLESv2/renderer/copyimage.cpp",
-      "src/libGLESv2/renderer/copyimage.h",
-      "src/libGLESv2/renderer/copyvertex.h",
-      "src/libGLESv2/renderer/generatemip.h",
-      "src/libGLESv2/renderer/imageformats.h",
-      "src/libGLESv2/renderer/loadimage.cpp",
-      "src/libGLESv2/renderer/loadimage.h",
-      "src/libGLESv2/renderer/loadimageSSE2.cpp",
-      "src/libGLESv2/renderer/vertexconversion.h",
-      "src/libGLESv2/resource.h",
-      "src/libGLESv2/validationES.cpp",
-      "src/libGLESv2/validationES.h",
-      "src/libGLESv2/validationES2.cpp",
-      "src/libGLESv2/validationES2.h",
-      "src/libGLESv2/validationES3.cpp",
-      "src/libGLESv2/validationES3.h",
-      "src/third_party/murmurhash/MurmurHash3.cpp",
-      "src/third_party/murmurhash/MurmurHash3.h",
-      "src/third_party/systeminfo/SystemInfo.cpp",
-      "src/third_party/systeminfo/SystemInfo.h",
-    ]
-
-    defines = [
-      "ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ " +
-        "TEXT(\"d3dcompiler_46.dll\"), TEXT(\"d3dcompiler_43.dll\") }",
-      "GL_APICALL=",
-      "GL_GLEXT_PROTOTYPES=",
-      "EGLAPI=",
-    ]
-    libs = []
-
-    # Shared D3dD sources.
-    if (angle_enable_d3d9 || angle_enable_d3d11) {
-      sources += [
-        "src/libGLESv2/renderer/d3d/HLSLCompiler.cpp",
-        "src/libGLESv2/renderer/d3d/HLSLCompiler.h",
-      ]
-    }
-
-    if (angle_enable_d3d9) {
-      sources += [
-        "src/libGLESv2/renderer/d3d9/Blit9.cpp",
-        "src/libGLESv2/renderer/d3d9/Blit9.h",
-        "src/libGLESv2/renderer/d3d9/BufferStorage9.cpp",
-        "src/libGLESv2/renderer/d3d9/BufferStorage9.h",
-        "src/libGLESv2/renderer/d3d9/Fence9.cpp",
-        "src/libGLESv2/renderer/d3d9/Fence9.h",
-        "src/libGLESv2/renderer/d3d9/Image9.cpp",
-        "src/libGLESv2/renderer/d3d9/Image9.h",
-        "src/libGLESv2/renderer/d3d9/IndexBuffer9.cpp",
-        "src/libGLESv2/renderer/d3d9/IndexBuffer9.h",
-        "src/libGLESv2/renderer/d3d9/Query9.cpp",
-        "src/libGLESv2/renderer/d3d9/Query9.h",
-        "src/libGLESv2/renderer/d3d9/RenderTarget9.cpp",
-        "src/libGLESv2/renderer/d3d9/RenderTarget9.h",
-        "src/libGLESv2/renderer/d3d9/Renderer9.cpp",
-        "src/libGLESv2/renderer/d3d9/Renderer9.h",
-        "src/libGLESv2/renderer/d3d9/ShaderCache.h",
-        "src/libGLESv2/renderer/d3d9/ShaderExecutable9.cpp",
-        "src/libGLESv2/renderer/d3d9/ShaderExecutable9.h",
-        "src/libGLESv2/renderer/d3d9/SwapChain9.cpp",
-        "src/libGLESv2/renderer/d3d9/SwapChain9.h",
-        "src/libGLESv2/renderer/d3d9/TextureStorage9.cpp",
-        "src/libGLESv2/renderer/d3d9/TextureStorage9.h",
-        "src/libGLESv2/renderer/d3d9/VertexArray9.h",
-        "src/libGLESv2/renderer/d3d9/VertexBuffer9.cpp",
-        "src/libGLESv2/renderer/d3d9/VertexBuffer9.h",
-        "src/libGLESv2/renderer/d3d9/VertexDeclarationCache.cpp",
-        "src/libGLESv2/renderer/d3d9/VertexDeclarationCache.h",
-        "src/libGLESv2/renderer/d3d9/formatutils9.cpp",
-        "src/libGLESv2/renderer/d3d9/formatutils9.h",
-        "src/libGLESv2/renderer/d3d9/renderer9_utils.cpp",
-        "src/libGLESv2/renderer/d3d9/renderer9_utils.h",
-        "src/libGLESv2/renderer/d3d9/shaders/compiled/componentmaskps.h",
-        "src/libGLESv2/renderer/d3d9/shaders/compiled/flipyvs.h",
-        "src/libGLESv2/renderer/d3d9/shaders/compiled/luminanceps.h",
-        "src/libGLESv2/renderer/d3d9/shaders/compiled/passthroughps.h",
-        "src/libGLESv2/renderer/d3d9/shaders/compiled/standardvs.h",
-      ]
-
-      defines += [ "ANGLE_ENABLE_D3D9" ]
-      libs += [ "d3d9.lib" ]
-    }
-
-    if (angle_enable_d3d11) {
-      sources += [
-        "src/libGLESv2/renderer/d3d11/Blit11.cpp",
-        "src/libGLESv2/renderer/d3d11/Blit11.h",
-        "src/libGLESv2/renderer/d3d11/BufferStorage11.cpp",
-        "src/libGLESv2/renderer/d3d11/BufferStorage11.h",
-        "src/libGLESv2/renderer/d3d11/Clear11.cpp",
-        "src/libGLESv2/renderer/d3d11/Clear11.h",
-        "src/libGLESv2/renderer/d3d11/Fence11.cpp",
-        "src/libGLESv2/renderer/d3d11/Fence11.h",
-        "src/libGLESv2/renderer/d3d11/Image11.cpp",
-        "src/libGLESv2/renderer/d3d11/Image11.h",
-        "src/libGLESv2/renderer/d3d11/IndexBuffer11.cpp",
-        "src/libGLESv2/renderer/d3d11/IndexBuffer11.h",
-        "src/libGLESv2/renderer/d3d11/InputLayoutCache.cpp",
-        "src/libGLESv2/renderer/d3d11/InputLayoutCache.h",
-        "src/libGLESv2/renderer/d3d11/PixelTransfer11.cpp",
-        "src/libGLESv2/renderer/d3d11/PixelTransfer11.h",
-        "src/libGLESv2/renderer/d3d11/Query11.cpp",
-        "src/libGLESv2/renderer/d3d11/Query11.h",
-        "src/libGLESv2/renderer/d3d11/RenderStateCache.cpp",
-        "src/libGLESv2/renderer/d3d11/RenderStateCache.h",
-        "src/libGLESv2/renderer/d3d11/RenderTarget11.cpp",
-        "src/libGLESv2/renderer/d3d11/RenderTarget11.h",
-        "src/libGLESv2/renderer/d3d11/Renderer11.cpp",
-        "src/libGLESv2/renderer/d3d11/Renderer11.h",
-        "src/libGLESv2/renderer/d3d11/ShaderExecutable11.cpp",
-        "src/libGLESv2/renderer/d3d11/ShaderExecutable11.h",
-        "src/libGLESv2/renderer/d3d11/SwapChain11.cpp",
-        "src/libGLESv2/renderer/d3d11/SwapChain11.h",
-        "src/libGLESv2/renderer/d3d11/TextureStorage11.cpp",
-        "src/libGLESv2/renderer/d3d11/TextureStorage11.h",
-        "src/libGLESv2/renderer/d3d11/VertexArray11.h",
-        "src/libGLESv2/renderer/d3d11/VertexBuffer11.cpp",
-        "src/libGLESv2/renderer/d3d11/VertexBuffer11.h",
-        "src/libGLESv2/renderer/d3d11/formatutils11.cpp",
-        "src/libGLESv2/renderer/d3d11/formatutils11.h",
-        "src/libGLESv2/renderer/d3d11/renderer11_utils.cpp",
-        "src/libGLESv2/renderer/d3d11/renderer11_utils.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/buffertotexture11_gs.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/buffertotexture11_ps_4f.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/buffertotexture11_ps_4i.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/buffertotexture11_ps_4ui.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/buffertotexture11_vs.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/clearfloat11ps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/clearfloat11vs.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/clearsint11ps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/clearsint11vs.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/clearuint11ps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/clearuint11vs.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/passthrough2d11vs.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/passthrough3d11gs.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/passthrough3d11vs.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughdepth2d11ps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughlum2d11ps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughlum3d11ps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughlumalpha2d11ps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughlumalpha3d11ps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughr2d11ps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughr2di11ps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughr2dui11ps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughr3d11ps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughr3di11ps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughr3dui11ps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrg2d11ps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrg2di11ps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrg2dui11ps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrg3d11ps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrg3di11ps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrg3dui11ps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrgb2d11ps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrgb2di11ps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrgb2dui11ps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrgb3d11ps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrgb3di11ps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrgb3dui11ps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrgba2d11ps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrgba2di11ps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrgba2dui11ps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrgba3d11ps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrgba3di11ps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/passthroughrgba3dui11ps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/swizzlef2darrayps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/swizzlef2dps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/swizzlef3dps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/swizzlei2darrayps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/swizzlei2dps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/swizzlei3dps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/swizzleui2darrayps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/swizzleui2dps.h",
-        "src/libGLESv2/renderer/d3d11/shaders/compiled/swizzleui3dps.h",
-      ]
-
-      defines += [ "ANGLE_ENABLE_D3D11" ]
-      libs += [ "dxguid.lib" ]
-    }
-
-    if (is_debug) {
-      defines += [ "ANGLE_ENABLE_PERF" ]
-      libs += [ "d3d9.lib" ]
-    }
-
-    configs -= [ "//build/config/compiler:chromium_code" ]
-    configs += [
-      ":internal_config",
-      "//build/config/compiler:no_chromium_code",
-    ]
-
-    include_dirs = [ "src/libGLESv2" ]
-
-    deps = [
-      ":commit_id",
-      ":includes",
-      ":translator",
-      #":copy_compiler_dll",  TODO(GYP)
-    ]
-  }
-
-  shared_library("libEGL") {
-    sources = [
-      "src/common/RefCountObject.cpp",
-      "src/common/RefCountObject.h",
-      "src/common/angleutils.h",
-      "src/common/blocklayout.cpp",
-      "src/common/blocklayout.h",
-      "src/common/debug.cpp",
-      "src/common/debug.h",
-      "src/common/event_tracer.cpp",
-      "src/common/event_tracer.h",
-      "src/common/mathutil.cpp",
-      "src/common/mathutil.h",
-      "src/common/shadervars.h",
-      "src/common/utilities.cpp",
-      "src/common/utilities.h",
-      "src/common/version.h",
-      "src/libEGL/Config.cpp",
-      "src/libEGL/Config.h",
-      "src/libEGL/Display.cpp",
-      "src/libEGL/Display.h",
-      "src/libEGL/Surface.cpp",
-      "src/libEGL/Surface.h",
-      "src/libEGL/libEGL.cpp",
-      "src/libEGL/libEGL.def",
-      "src/libEGL/libEGL.rc",
-      "src/libEGL/main.cpp",
-      "src/libEGL/main.h",
-      "src/libEGL/resource.h",
-    ]
-
-    configs -= [ "//build/config/compiler:chromium_code" ]
-    configs += [
-      ":internal_config",
-      "//build/config/compiler:no_chromium_code",
-    ]
-
-    if (is_debug) {
-      defines = [ "ANGLE_ENABLE_PERF" ]
-    }
-
-    include_dirs = [ "src/libGLESv2" ]
-    libs = [ "d3d9.lib" ]
-
-    deps = [
-      ":commit_id",
-      ":includes",
-      ":libGLESv2",
-    ]
-  }
-}  # is_win
--- a/gfx/angle/README.mozilla
+++ b/gfx/angle/README.mozilla
@@ -12,37 +12,24 @@ 2. Go into the angle dir, and add the go
 
 3. Fetch the new google upstream:
      git fetch google
 
 4. Switch to the mozilla branch
      git checkout mozilla
 
 5. Rebase the mozilla branch on top of the new google master.  Fix up patches along the way,
-   remove unneded commits.  Google seems to have "chromium/2059" branches as well, that I
-   assume are merges into the Chromium tree.  These might be a good point to rebase on
-   as well, instead of google/master:
+   remove unneded commits.
      git rebase -i google/master
-  or git rebase -i google/chromium/2081  (whatever the latest is in 'git branch -a')
 
 6. Re-generate moz.build files:
      ./gyp_mozbuild
 
 7. nuke mozilla-central/gfx/angle directory
 
 8. copy all the relevant files from the github checkout
      cd mozilla-central
      mkdir gfx/angle
      cp -r /c/proj/angle/[A-Z]* /c/proj/angle/{include,src,moz.build} gfx/angle
 
 9.  Build. Fix things until it builds.
 
 10. Try runs and reviews!
-
-11. Once reviews are done and checkin is ready, tag the equivalent git repo:
-    git tag -a mozilla-bug-123456 -m "ANGLE update for bug 123456"
-
-12. Push the new mozilla branch, along with the tags upstream:
-    git push --tags mozilla +mozilla
-
-The "mozilla" branch head will keep moving, since it will keep getting rebased.
-The tags will point to the topmost commit that was used for a particular bug number,
-so that we can see its history if needed.
--- a/gfx/angle/include/EGL/egl.h
+++ b/gfx/angle/include/EGL/egl.h
@@ -1,17 +1,16 @@
-#ifndef __egl_h_
-#define __egl_h_ 1
-
-#ifdef __cplusplus
-extern "C" {
-#endif
+/* -*- mode: c; tab-width: 8; -*- */
+/* vi: set sw=4 ts=8: */
+/* Reference version of egl.h for EGL 1.4.
+ * $Revision: 9356 $ on $Date: 2009-10-21 05:52:25 -0400 (Wed, 21 Oct 2009) $
+ */
 
 /*
-** Copyright (c) 2013-2014 The Khronos Group Inc.
+** Copyright (c) 2007-2009 The Khronos Group Inc.
 **
 ** Permission is hereby granted, free of charge, to any person obtaining a
 ** copy of this software and/or associated documentation files (the
 ** "Materials"), to deal in the Materials without restriction, including
 ** without limitation the rights to use, copy, modify, merge, publish,
 ** distribute, sublicense, and/or sell copies of the Materials, and to
 ** permit persons to whom the Materials are furnished to do so, subject to
 ** the following conditions:
@@ -22,277 +21,309 @@ extern "C" {
 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
 */
-/*
-** This header is generated from the Khronos OpenGL / OpenGL ES XML
-** API Registry. The current version of the Registry, generator scripts
-** used to make the header, and the header can be found at
-**   http://www.opengl.org/registry/
-**
-** Khronos $Revision: 27018 $ on $Date: 2014-06-10 08:06:12 -0700 (Tue, 10 Jun 2014) $
-*/
+
+#ifndef __egl_h_
+#define __egl_h_
 
+/* All platform-dependent types and macro boilerplate (such as EGLAPI
+ * and EGLAPIENTRY) should go in eglplatform.h.
+ */
 #include <EGL/eglplatform.h>
 
-/* Generated on date 20140610 */
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-/* Generated C header for:
- * API: egl
- * Versions considered: .*
- * Versions emitted: .*
- * Default extensions included: None
- * Additional extensions included: _nomatch_^
- * Extensions removed: _nomatch_^
+/* EGL Types */
+/* EGLint is defined in eglplatform.h */
+typedef unsigned int EGLBoolean;
+typedef unsigned int EGLenum;
+typedef void *EGLConfig;
+typedef void *EGLContext;
+typedef void *EGLDisplay;
+typedef void *EGLSurface;
+typedef void *EGLClientBuffer;
+
+/* EGL Versioning */
+#define EGL_VERSION_1_0			1
+#define EGL_VERSION_1_1			1
+#define EGL_VERSION_1_2			1
+#define EGL_VERSION_1_3			1
+#define EGL_VERSION_1_4			1
+
+/* EGL Enumerants. Bitmasks and other exceptional cases aside, most
+ * enums are assigned unique values starting at 0x3000.
  */
 
-#ifndef EGL_VERSION_1_0
-#define EGL_VERSION_1_0 1
-typedef unsigned int EGLBoolean;
-typedef void *EGLDisplay;
-#include <KHR/khrplatform.h>
-#include <EGL/eglplatform.h>
-typedef void *EGLConfig;
-typedef void *EGLSurface;
-typedef void *EGLContext;
-typedef void (*__eglMustCastToProperFunctionPointerType)(void);
-#define EGL_ALPHA_SIZE                    0x3021
-#define EGL_BAD_ACCESS                    0x3002
-#define EGL_BAD_ALLOC                     0x3003
-#define EGL_BAD_ATTRIBUTE                 0x3004
-#define EGL_BAD_CONFIG                    0x3005
-#define EGL_BAD_CONTEXT                   0x3006
-#define EGL_BAD_CURRENT_SURFACE           0x3007
-#define EGL_BAD_DISPLAY                   0x3008
-#define EGL_BAD_MATCH                     0x3009
-#define EGL_BAD_NATIVE_PIXMAP             0x300A
-#define EGL_BAD_NATIVE_WINDOW             0x300B
-#define EGL_BAD_PARAMETER                 0x300C
-#define EGL_BAD_SURFACE                   0x300D
-#define EGL_BLUE_SIZE                     0x3022
-#define EGL_BUFFER_SIZE                   0x3020
-#define EGL_CONFIG_CAVEAT                 0x3027
-#define EGL_CONFIG_ID                     0x3028
-#define EGL_CORE_NATIVE_ENGINE            0x305B
-#define EGL_DEPTH_SIZE                    0x3025
-#define EGL_DONT_CARE                     ((EGLint)-1)
-#define EGL_DRAW                          0x3059
-#define EGL_EXTENSIONS                    0x3055
-#define EGL_FALSE                         0
-#define EGL_GREEN_SIZE                    0x3023
-#define EGL_HEIGHT                        0x3056
-#define EGL_LARGEST_PBUFFER               0x3058
-#define EGL_LEVEL                         0x3029
-#define EGL_MAX_PBUFFER_HEIGHT            0x302A
-#define EGL_MAX_PBUFFER_PIXELS            0x302B
-#define EGL_MAX_PBUFFER_WIDTH             0x302C
-#define EGL_NATIVE_RENDERABLE             0x302D
-#define EGL_NATIVE_VISUAL_ID              0x302E
-#define EGL_NATIVE_VISUAL_TYPE            0x302F
-#define EGL_NONE                          0x3038
-#define EGL_NON_CONFORMANT_CONFIG         0x3051
-#define EGL_NOT_INITIALIZED               0x3001
-#define EGL_NO_CONTEXT                    ((EGLContext)0)
-#define EGL_NO_DISPLAY                    ((EGLDisplay)0)
-#define EGL_NO_SURFACE                    ((EGLSurface)0)
-#define EGL_PBUFFER_BIT                   0x0001
-#define EGL_PIXMAP_BIT                    0x0002
-#define EGL_READ                          0x305A
-#define EGL_RED_SIZE                      0x3024
-#define EGL_SAMPLES                       0x3031
-#define EGL_SAMPLE_BUFFERS                0x3032
-#define EGL_SLOW_CONFIG                   0x3050
-#define EGL_STENCIL_SIZE                  0x3026
-#define EGL_SUCCESS                       0x3000
-#define EGL_SURFACE_TYPE                  0x3033
-#define EGL_TRANSPARENT_BLUE_VALUE        0x3035
-#define EGL_TRANSPARENT_GREEN_VALUE       0x3036
-#define EGL_TRANSPARENT_RED_VALUE         0x3037
-#define EGL_TRANSPARENT_RGB               0x3052
-#define EGL_TRANSPARENT_TYPE              0x3034
-#define EGL_TRUE                          1
-#define EGL_VENDOR                        0x3053
-#define EGL_VERSION                       0x3054
-#define EGL_WIDTH                         0x3057
-#define EGL_WINDOW_BIT                    0x0004
-EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
-EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target);
-EGLAPI EGLContext EGLAPIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list);
-EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
-EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list);
-EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list);
-EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext (EGLDisplay dpy, EGLContext ctx);
-EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface (EGLDisplay dpy, EGLSurface surface);
-EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value);
-EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
-EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay (void);
-EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface (EGLint readdraw);
-EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay (EGLNativeDisplayType display_id);
-EGLAPI EGLint EGLAPIENTRY eglGetError (void);
-EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress (const char *procname);
-EGLAPI EGLBoolean EGLAPIENTRY eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor);
-EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
-EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value);
-EGLAPI const char *EGLAPIENTRY eglQueryString (EGLDisplay dpy, EGLint name);
-EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
-EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface surface);
-EGLAPI EGLBoolean EGLAPIENTRY eglTerminate (EGLDisplay dpy);
-EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL (void);
-EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative (EGLint engine);
-#endif /* EGL_VERSION_1_0 */
+/* EGL aliases */
+#define EGL_FALSE			0
+#define EGL_TRUE			1
+
+/* Out-of-band handle values */
+#define EGL_DEFAULT_DISPLAY		((EGLNativeDisplayType)0)
+#define EGL_NO_CONTEXT			((EGLContext)0)
+#define EGL_NO_DISPLAY			((EGLDisplay)0)
+#define EGL_NO_SURFACE			((EGLSurface)0)
+
+/* Out-of-band attribute value */
+#define EGL_DONT_CARE			((EGLint)-1)
+
+/* Errors / GetError return values */
+#define EGL_SUCCESS			0x3000
+#define EGL_NOT_INITIALIZED		0x3001
+#define EGL_BAD_ACCESS			0x3002
+#define EGL_BAD_ALLOC			0x3003
+#define EGL_BAD_ATTRIBUTE		0x3004
+#define EGL_BAD_CONFIG			0x3005
+#define EGL_BAD_CONTEXT			0x3006
+#define EGL_BAD_CURRENT_SURFACE		0x3007
+#define EGL_BAD_DISPLAY			0x3008
+#define EGL_BAD_MATCH			0x3009
+#define EGL_BAD_NATIVE_PIXMAP		0x300A
+#define EGL_BAD_NATIVE_WINDOW		0x300B
+#define EGL_BAD_PARAMETER		0x300C
+#define EGL_BAD_SURFACE			0x300D
+#define EGL_CONTEXT_LOST		0x300E	/* EGL 1.1 - IMG_power_management */
+
+/* Reserved 0x300F-0x301F for additional errors */
 
-#ifndef EGL_VERSION_1_1
-#define EGL_VERSION_1_1 1
-#define EGL_BACK_BUFFER                   0x3084
-#define EGL_BIND_TO_TEXTURE_RGB           0x3039
-#define EGL_BIND_TO_TEXTURE_RGBA          0x303A
-#define EGL_CONTEXT_LOST                  0x300E
-#define EGL_MIN_SWAP_INTERVAL             0x303B
-#define EGL_MAX_SWAP_INTERVAL             0x303C
-#define EGL_MIPMAP_TEXTURE                0x3082
-#define EGL_MIPMAP_LEVEL                  0x3083
-#define EGL_NO_TEXTURE                    0x305C
-#define EGL_TEXTURE_2D                    0x305F
-#define EGL_TEXTURE_FORMAT                0x3080
-#define EGL_TEXTURE_RGB                   0x305D
-#define EGL_TEXTURE_RGBA                  0x305E
-#define EGL_TEXTURE_TARGET                0x3081
-EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer);
-EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer);
-EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value);
-EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval (EGLDisplay dpy, EGLint interval);
-#endif /* EGL_VERSION_1_1 */
+/* Config attributes */
+#define EGL_BUFFER_SIZE			0x3020
+#define EGL_ALPHA_SIZE			0x3021
+#define EGL_BLUE_SIZE			0x3022
+#define EGL_GREEN_SIZE			0x3023
+#define EGL_RED_SIZE			0x3024
+#define EGL_DEPTH_SIZE			0x3025
+#define EGL_STENCIL_SIZE		0x3026
+#define EGL_CONFIG_CAVEAT		0x3027
+#define EGL_CONFIG_ID			0x3028
+#define EGL_LEVEL			0x3029
+#define EGL_MAX_PBUFFER_HEIGHT		0x302A
+#define EGL_MAX_PBUFFER_PIXELS		0x302B
+#define EGL_MAX_PBUFFER_WIDTH		0x302C
+#define EGL_NATIVE_RENDERABLE		0x302D
+#define EGL_NATIVE_VISUAL_ID		0x302E
+#define EGL_NATIVE_VISUAL_TYPE		0x302F
+#define EGL_SAMPLES			0x3031
+#define EGL_SAMPLE_BUFFERS		0x3032
+#define EGL_SURFACE_TYPE		0x3033
+#define EGL_TRANSPARENT_TYPE		0x3034
+#define EGL_TRANSPARENT_BLUE_VALUE	0x3035
+#define EGL_TRANSPARENT_GREEN_VALUE	0x3036
+#define EGL_TRANSPARENT_RED_VALUE	0x3037
+#define EGL_NONE			0x3038	/* Attrib list terminator */
+#define EGL_BIND_TO_TEXTURE_RGB		0x3039
+#define EGL_BIND_TO_TEXTURE_RGBA	0x303A
+#define EGL_MIN_SWAP_INTERVAL		0x303B
+#define EGL_MAX_SWAP_INTERVAL		0x303C
+#define EGL_LUMINANCE_SIZE		0x303D
+#define EGL_ALPHA_MASK_SIZE		0x303E
+#define EGL_COLOR_BUFFER_TYPE		0x303F
+#define EGL_RENDERABLE_TYPE		0x3040
+#define EGL_MATCH_NATIVE_PIXMAP		0x3041	/* Pseudo-attribute (not queryable) */
+#define EGL_CONFORMANT			0x3042
+
+/* Reserved 0x3041-0x304F for additional config attributes */
+
+/* Config attribute values */
+#define EGL_SLOW_CONFIG			0x3050	/* EGL_CONFIG_CAVEAT value */
+#define EGL_NON_CONFORMANT_CONFIG	0x3051	/* EGL_CONFIG_CAVEAT value */
+#define EGL_TRANSPARENT_RGB		0x3052	/* EGL_TRANSPARENT_TYPE value */
+#define EGL_RGB_BUFFER			0x308E	/* EGL_COLOR_BUFFER_TYPE value */
+#define EGL_LUMINANCE_BUFFER		0x308F	/* EGL_COLOR_BUFFER_TYPE value */
+
+/* More config attribute values, for EGL_TEXTURE_FORMAT */
+#define EGL_NO_TEXTURE			0x305C
+#define EGL_TEXTURE_RGB			0x305D
+#define EGL_TEXTURE_RGBA		0x305E
+#define EGL_TEXTURE_2D			0x305F
+
+/* Config attribute mask bits */
+#define EGL_PBUFFER_BIT			0x0001	/* EGL_SURFACE_TYPE mask bits */
+#define EGL_PIXMAP_BIT			0x0002	/* EGL_SURFACE_TYPE mask bits */
+#define EGL_WINDOW_BIT			0x0004	/* EGL_SURFACE_TYPE mask bits */
+#define EGL_VG_COLORSPACE_LINEAR_BIT	0x0020	/* EGL_SURFACE_TYPE mask bits */
+#define EGL_VG_ALPHA_FORMAT_PRE_BIT	0x0040	/* EGL_SURFACE_TYPE mask bits */
+#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200	/* EGL_SURFACE_TYPE mask bits */
+#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400	/* EGL_SURFACE_TYPE mask bits */
+
+#define EGL_OPENGL_ES_BIT		0x0001	/* EGL_RENDERABLE_TYPE mask bits */
+#define EGL_OPENVG_BIT			0x0002	/* EGL_RENDERABLE_TYPE mask bits */
+#define EGL_OPENGL_ES2_BIT		0x0004	/* EGL_RENDERABLE_TYPE mask bits */
+#define EGL_OPENGL_BIT			0x0008	/* EGL_RENDERABLE_TYPE mask bits */
+
+/* QueryString targets */
+#define EGL_VENDOR			0x3053
+#define EGL_VERSION			0x3054
+#define EGL_EXTENSIONS			0x3055
+#define EGL_CLIENT_APIS			0x308D
+
+/* QuerySurface / SurfaceAttrib / CreatePbufferSurface targets */
+#define EGL_HEIGHT			0x3056
+#define EGL_WIDTH			0x3057
+#define EGL_LARGEST_PBUFFER		0x3058
+#define EGL_TEXTURE_FORMAT		0x3080
+#define EGL_TEXTURE_TARGET		0x3081
+#define EGL_MIPMAP_TEXTURE		0x3082
+#define EGL_MIPMAP_LEVEL		0x3083
+#define EGL_RENDER_BUFFER		0x3086
+#define EGL_VG_COLORSPACE		0x3087
+#define EGL_VG_ALPHA_FORMAT		0x3088
+#define EGL_HORIZONTAL_RESOLUTION	0x3090
+#define EGL_VERTICAL_RESOLUTION		0x3091
+#define EGL_PIXEL_ASPECT_RATIO		0x3092
+#define EGL_SWAP_BEHAVIOR		0x3093
+#define EGL_MULTISAMPLE_RESOLVE		0x3099
+
+/* EGL_RENDER_BUFFER values / BindTexImage / ReleaseTexImage buffer targets */
+#define EGL_BACK_BUFFER			0x3084
+#define EGL_SINGLE_BUFFER		0x3085
+
+/* OpenVG color spaces */
+#define EGL_VG_COLORSPACE_sRGB		0x3089	/* EGL_VG_COLORSPACE value */
+#define EGL_VG_COLORSPACE_LINEAR	0x308A	/* EGL_VG_COLORSPACE value */
 
-#ifndef EGL_VERSION_1_2
-#define EGL_VERSION_1_2 1
-typedef unsigned int EGLenum;
-typedef void *EGLClientBuffer;
-#define EGL_ALPHA_FORMAT                  0x3088
-#define EGL_ALPHA_FORMAT_NONPRE           0x308B
-#define EGL_ALPHA_FORMAT_PRE              0x308C
-#define EGL_ALPHA_MASK_SIZE               0x303E
-#define EGL_BUFFER_PRESERVED              0x3094
-#define EGL_BUFFER_DESTROYED              0x3095
-#define EGL_CLIENT_APIS                   0x308D
-#define EGL_COLORSPACE                    0x3087
-#define EGL_COLORSPACE_sRGB               0x3089
-#define EGL_COLORSPACE_LINEAR             0x308A
-#define EGL_COLOR_BUFFER_TYPE             0x303F
-#define EGL_CONTEXT_CLIENT_TYPE           0x3097
-#define EGL_DISPLAY_SCALING               10000
-#define EGL_HORIZONTAL_RESOLUTION         0x3090
-#define EGL_LUMINANCE_BUFFER              0x308F
-#define EGL_LUMINANCE_SIZE                0x303D
-#define EGL_OPENGL_ES_BIT                 0x0001
-#define EGL_OPENVG_BIT                    0x0002
-#define EGL_OPENGL_ES_API                 0x30A0
-#define EGL_OPENVG_API                    0x30A1
-#define EGL_OPENVG_IMAGE                  0x3096
-#define EGL_PIXEL_ASPECT_RATIO            0x3092
-#define EGL_RENDERABLE_TYPE               0x3040
-#define EGL_RENDER_BUFFER                 0x3086
-#define EGL_RGB_BUFFER                    0x308E
-#define EGL_SINGLE_BUFFER                 0x3085
-#define EGL_SWAP_BEHAVIOR                 0x3093
-#define EGL_UNKNOWN                       ((EGLint)-1)
-#define EGL_VERTICAL_RESOLUTION           0x3091
-EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI (EGLenum api);
-EGLAPI EGLenum EGLAPIENTRY eglQueryAPI (void);
-EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list);
-EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread (void);
-EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient (void);
-#endif /* EGL_VERSION_1_2 */
+/* OpenVG alpha formats */
+#define EGL_VG_ALPHA_FORMAT_NONPRE	0x308B	/* EGL_ALPHA_FORMAT value */
+#define EGL_VG_ALPHA_FORMAT_PRE		0x308C	/* EGL_ALPHA_FORMAT value */
+
+/* Constant scale factor by which fractional display resolutions &
+ * aspect ratio are scaled when queried as integer values.
+ */
+#define EGL_DISPLAY_SCALING		10000
+
+/* Unknown display resolution/aspect ratio */
+#define EGL_UNKNOWN			((EGLint)-1)
+
+/* Back buffer swap behaviors */
+#define EGL_BUFFER_PRESERVED		0x3094	/* EGL_SWAP_BEHAVIOR value */
+#define EGL_BUFFER_DESTROYED		0x3095	/* EGL_SWAP_BEHAVIOR value */
+
+/* CreatePbufferFromClientBuffer buffer types */
+#define EGL_OPENVG_IMAGE		0x3096
+
+/* QueryContext targets */
+#define EGL_CONTEXT_CLIENT_TYPE		0x3097
+
+/* CreateContext attributes */
+#define EGL_CONTEXT_CLIENT_VERSION	0x3098
+
+/* Multisample resolution behaviors */
+#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A	/* EGL_MULTISAMPLE_RESOLVE value */
+#define EGL_MULTISAMPLE_RESOLVE_BOX	0x309B	/* EGL_MULTISAMPLE_RESOLVE value */
 
-#ifndef EGL_VERSION_1_3
-#define EGL_VERSION_1_3 1
-#define EGL_CONFORMANT                    0x3042
-#define EGL_CONTEXT_CLIENT_VERSION        0x3098
-#define EGL_MATCH_NATIVE_PIXMAP           0x3041
-#define EGL_OPENGL_ES2_BIT                0x0004
-#define EGL_VG_ALPHA_FORMAT               0x3088
-#define EGL_VG_ALPHA_FORMAT_NONPRE        0x308B
-#define EGL_VG_ALPHA_FORMAT_PRE           0x308C
-#define EGL_VG_ALPHA_FORMAT_PRE_BIT       0x0040
-#define EGL_VG_COLORSPACE                 0x3087
-#define EGL_VG_COLORSPACE_sRGB            0x3089
-#define EGL_VG_COLORSPACE_LINEAR          0x308A
-#define EGL_VG_COLORSPACE_LINEAR_BIT      0x0020
-#endif /* EGL_VERSION_1_3 */
+/* BindAPI/QueryAPI targets */
+#define EGL_OPENGL_ES_API		0x30A0
+#define EGL_OPENVG_API			0x30A1
+#define EGL_OPENGL_API			0x30A2
+
+/* GetCurrentSurface targets */
+#define EGL_DRAW			0x3059
+#define EGL_READ			0x305A
+
+/* WaitNative engines */
+#define EGL_CORE_NATIVE_ENGINE		0x305B
+
+/* EGL 1.2 tokens renamed for consistency in EGL 1.3 */
+#define EGL_COLORSPACE			EGL_VG_COLORSPACE
+#define EGL_ALPHA_FORMAT		EGL_VG_ALPHA_FORMAT
+#define EGL_COLORSPACE_sRGB		EGL_VG_COLORSPACE_sRGB
+#define EGL_COLORSPACE_LINEAR		EGL_VG_COLORSPACE_LINEAR
+#define EGL_ALPHA_FORMAT_NONPRE		EGL_VG_ALPHA_FORMAT_NONPRE
+#define EGL_ALPHA_FORMAT_PRE		EGL_VG_ALPHA_FORMAT_PRE
+
+/* EGL extensions must request enum blocks from the Khronos
+ * API Registrar, who maintains the enumerant registry. Submit
+ * a bug in Khronos Bugzilla against task "Registry".
+ */
+
+
+
+/* EGL Functions */
+
+EGLAPI EGLint EGLAPIENTRY eglGetError(void);
+
+EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id);
+EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor);
+EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy);
+
+EGLAPI const char * EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name);
 
-#ifndef EGL_VERSION_1_4
-#define EGL_VERSION_1_4 1
-#define EGL_DEFAULT_DISPLAY               ((EGLNativeDisplayType)0)
-#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT   0x0200
-#define EGL_MULTISAMPLE_RESOLVE           0x3099
-#define EGL_MULTISAMPLE_RESOLVE_DEFAULT   0x309A
-#define EGL_MULTISAMPLE_RESOLVE_BOX       0x309B
-#define EGL_OPENGL_API                    0x30A2
-#define EGL_OPENGL_BIT                    0x0008
-#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT   0x0400
-EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext (void);
-#endif /* EGL_VERSION_1_4 */
+EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs(EGLDisplay dpy, EGLConfig *configs,
+			 EGLint config_size, EGLint *num_config);
+EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list,
+			   EGLConfig *configs, EGLint config_size,
+			   EGLint *num_config);
+EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config,
+			      EGLint attribute, EGLint *value);
+
+EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config,
+				  EGLNativeWindowType win,
+				  const EGLint *attrib_list);
+EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config,
+				   const EGLint *attrib_list);
+EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config,
+				  EGLNativePixmapType pixmap,
+				  const EGLint *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay dpy, EGLSurface surface);
+EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface,
+			   EGLint attribute, EGLint *value);
+
+EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI(EGLenum api);
+EGLAPI EGLenum EGLAPIENTRY eglQueryAPI(void);
+
+EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient(void);
+
+EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread(void);
+
+EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer(
+	      EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer,
+	      EGLConfig config, const EGLint *attrib_list);
 
-#ifndef EGL_VERSION_1_5
-#define EGL_VERSION_1_5 1
-typedef void *EGLSync;
-typedef intptr_t EGLAttrib;
-typedef khronos_utime_nanoseconds_t EGLTime;
-#define EGL_CONTEXT_MAJOR_VERSION         0x3098
-#define EGL_CONTEXT_MINOR_VERSION         0x30FB
-#define EGL_CONTEXT_OPENGL_PROFILE_MASK   0x30FD
-#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY 0x31BD
-#define EGL_NO_RESET_NOTIFICATION         0x31BE
-#define EGL_LOSE_CONTEXT_ON_RESET         0x31BF
-#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT 0x00000001
-#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT 0x00000002
-#define EGL_CONTEXT_OPENGL_DEBUG          0x31B0
-#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE 0x31B1
-#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS  0x31B2
-#define EGL_OPENGL_ES3_BIT                0x00000040
-#define EGL_CL_EVENT_HANDLE               0x309C
-#define EGL_SYNC_CL_EVENT                 0x30FE
-#define EGL_SYNC_CL_EVENT_COMPLETE        0x30FF
-#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE  0x30F0
-#define EGL_SYNC_TYPE                     0x30F7
-#define EGL_SYNC_STATUS                   0x30F1
-#define EGL_SYNC_CONDITION                0x30F8
-#define EGL_SIGNALED                      0x30F2
-#define EGL_UNSIGNALED                    0x30F3
-#define EGL_SYNC_FLUSH_COMMANDS_BIT       0x0001
-#define EGL_FOREVER                       0xFFFFFFFFFFFFFFFFull
-#define EGL_TIMEOUT_EXPIRED               0x30F5
-#define EGL_CONDITION_SATISFIED           0x30F6
-#define EGL_NO_SYNC                       ((EGLSync)0)
-#define EGL_SYNC_FENCE                    0x30F9
-#define EGL_GL_COLORSPACE                 0x309D
-#define EGL_GL_COLORSPACE_SRGB            0x3089
-#define EGL_GL_COLORSPACE_LINEAR          0x308A
-#define EGL_GL_RENDERBUFFER               0x30B9
-#define EGL_GL_TEXTURE_2D                 0x30B1
-#define EGL_GL_TEXTURE_LEVEL              0x30BC
-#define EGL_GL_TEXTURE_3D                 0x30B2
-#define EGL_GL_TEXTURE_ZOFFSET            0x30BD
-#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x30B3
-#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x30B4
-#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x30B5
-#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x30B6
-#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x30B7
-#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x30B8
-EGLAPI EGLSync EGLAPIENTRY eglCreateSync (EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list);
-EGLAPI EGLBoolean EGLAPIENTRY eglDestroySync (EGLDisplay dpy, EGLSync sync);
-EGLAPI EGLint EGLAPIENTRY eglClientWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout);
-EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttrib (EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib *value);
-EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplay (EGLenum platform, void *native_display, const EGLAttrib *attrib_list);
-EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurface (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list);
-EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurface (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list);
-EGLAPI EGLBoolean EGLAPIENTRY eglWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags);
-#endif /* EGL_VERSION_1_5 */
+EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface,
+			    EGLint attribute, EGLint value);
+EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
+EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
+
+
+EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval);
+
+
+EGLAPI EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config,
+			    EGLContext share_context,
+			    const EGLint *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx);
+EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw,
+			  EGLSurface read, EGLContext ctx);
+
+EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext(void);
+EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface(EGLint readdraw);
+EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay(void);
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext(EGLDisplay dpy, EGLContext ctx,
+			   EGLint attribute, EGLint *value);
+
+EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL(void);
+EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative(EGLint engine);
+EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface);
+EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers(EGLDisplay dpy, EGLSurface surface,
+			  EGLNativePixmapType target);
+
+/* This is a generic function pointer type, whose name indicates it must
+ * be cast to the proper type *and calling convention* before use.
+ */
+typedef void (*__eglMustCastToProperFunctionPointerType)(void);
+
+/* Now, define eglGetProcAddress using the generic function ptr. type */
+EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY
+       eglGetProcAddress(const char *procname);
 
 #ifdef __cplusplus
 }
 #endif
 
-#endif
+#endif /* __egl_h_ */
--- a/gfx/angle/include/EGL/eglext.h
+++ b/gfx/angle/include/EGL/eglext.h
@@ -1,17 +1,17 @@
 #ifndef __eglext_h_
-#define __eglext_h_ 1
+#define __eglext_h_
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 /*
-** Copyright (c) 2013-2014 The Khronos Group Inc.
+** Copyright (c) 2007-2013 The Khronos Group Inc.
 **
 ** Permission is hereby granted, free of charge, to any person obtaining a
 ** copy of this software and/or associated documentation files (the
 ** "Materials"), to deal in the Materials without restriction, including
 ** without limitation the rights to use, copy, modify, merge, publish,
 ** distribute, sublicense, and/or sell copies of the Materials, and to
 ** permit persons to whom the Materials are furnished to do so, subject to
 ** the following conditions:
@@ -22,717 +22,560 @@ extern "C" {
 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
 */
-/*
-** This header is generated from the Khronos OpenGL / OpenGL ES XML
-** API Registry. The current version of the Registry, generator scripts
-** used to make the header, and the header can be found at
-**   http://www.opengl.org/registry/
-**
-** Khronos $Revision: 27018 $ on $Date: 2014-06-10 08:06:12 -0700 (Tue, 10 Jun 2014) $
-*/
 
 #include <EGL/eglplatform.h>
 
-#define EGL_EGLEXT_VERSION 20140610
-
-/* Generated C header for:
- * API: egl
- * Versions considered: .*
- * Versions emitted: _nomatch_^
- * Default extensions included: egl
- * Additional extensions included: _nomatch_^
- * Extensions removed: _nomatch_^
- */
+/*************************************************************/
 
-#ifndef EGL_KHR_cl_event
-#define EGL_KHR_cl_event 1
-#define EGL_CL_EVENT_HANDLE_KHR           0x309C
-#define EGL_SYNC_CL_EVENT_KHR             0x30FE
-#define EGL_SYNC_CL_EVENT_COMPLETE_KHR    0x30FF
-#endif /* EGL_KHR_cl_event */
-
-#ifndef EGL_KHR_cl_event2
-#define EGL_KHR_cl_event2 1
-typedef void *EGLSyncKHR;
-typedef intptr_t EGLAttribKHR;
-typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNC64KHRPROC) (EGLDisplay dpy, EGLenum type, const EGLAttribKHR *attrib_list);
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSync64KHR (EGLDisplay dpy, EGLenum type, const EGLAttribKHR *attrib_list);
-#endif
-#endif /* EGL_KHR_cl_event2 */
-
-#ifndef EGL_KHR_client_get_all_proc_addresses
-#define EGL_KHR_client_get_all_proc_addresses 1
-#endif /* EGL_KHR_client_get_all_proc_addresses */
+/* Header file version number */
+/* Current version at http://www.khronos.org/registry/egl/ */
+/* $Revision: 20690 $ on $Date: 2013-02-22 20:15:05 -0500 (Fri, 22 Feb 2013) $ */
+#define EGL_EGLEXT_VERSION 15
 
 #ifndef EGL_KHR_config_attribs
 #define EGL_KHR_config_attribs 1
-#define EGL_CONFORMANT_KHR                0x3042
-#define EGL_VG_COLORSPACE_LINEAR_BIT_KHR  0x0020
-#define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR   0x0040
-#endif /* EGL_KHR_config_attribs */
-
-#ifndef EGL_KHR_create_context
-#define EGL_KHR_create_context 1
-#define EGL_CONTEXT_MAJOR_VERSION_KHR     0x3098
-#define EGL_CONTEXT_MINOR_VERSION_KHR     0x30FB
-#define EGL_CONTEXT_FLAGS_KHR             0x30FC
-#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD
-#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD
-#define EGL_NO_RESET_NOTIFICATION_KHR     0x31BE
-#define EGL_LOSE_CONTEXT_ON_RESET_KHR     0x31BF
-#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR  0x00000001
-#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002
-#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004
-#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001
-#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002
-#define EGL_OPENGL_ES3_BIT_KHR            0x00000040
-#endif /* EGL_KHR_create_context */
+#define EGL_CONFORMANT_KHR			0x3042	/* EGLConfig attribute */
+#define EGL_VG_COLORSPACE_LINEAR_BIT_KHR	0x0020	/* EGL_SURFACE_TYPE bitfield */
+#define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR		0x0040	/* EGL_SURFACE_TYPE bitfield */
+#endif
 
-#ifndef EGL_KHR_fence_sync
-#define EGL_KHR_fence_sync 1
-#ifdef KHRONOS_SUPPORT_INT64
-#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0
-#define EGL_SYNC_CONDITION_KHR            0x30F8
-#define EGL_SYNC_FENCE_KHR                0x30F9
-#endif /* KHRONOS_SUPPORT_INT64 */
-#endif /* EGL_KHR_fence_sync */
+#ifndef EGL_KHR_lock_surface
+#define EGL_KHR_lock_surface 1
+#define EGL_READ_SURFACE_BIT_KHR		0x0001	/* EGL_LOCK_USAGE_HINT_KHR bitfield */
+#define EGL_WRITE_SURFACE_BIT_KHR		0x0002	/* EGL_LOCK_USAGE_HINT_KHR bitfield */
+#define EGL_LOCK_SURFACE_BIT_KHR		0x0080	/* EGL_SURFACE_TYPE bitfield */
+#define EGL_OPTIMAL_FORMAT_BIT_KHR		0x0100	/* EGL_SURFACE_TYPE bitfield */
+#define EGL_MATCH_FORMAT_KHR			0x3043	/* EGLConfig attribute */
+#define EGL_FORMAT_RGB_565_EXACT_KHR		0x30C0	/* EGL_MATCH_FORMAT_KHR value */
+#define EGL_FORMAT_RGB_565_KHR			0x30C1	/* EGL_MATCH_FORMAT_KHR value */
+#define EGL_FORMAT_RGBA_8888_EXACT_KHR		0x30C2	/* EGL_MATCH_FORMAT_KHR value */
+#define EGL_FORMAT_RGBA_8888_KHR		0x30C3	/* EGL_MATCH_FORMAT_KHR value */
+#define EGL_MAP_PRESERVE_PIXELS_KHR		0x30C4	/* eglLockSurfaceKHR attribute */
+#define EGL_LOCK_USAGE_HINT_KHR			0x30C5	/* eglLockSurfaceKHR attribute */
+#define EGL_BITMAP_POINTER_KHR			0x30C6	/* eglQuerySurface attribute */
+#define EGL_BITMAP_PITCH_KHR			0x30C7	/* eglQuerySurface attribute */
+#define EGL_BITMAP_ORIGIN_KHR			0x30C8	/* eglQuerySurface attribute */
+#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR		0x30C9	/* eglQuerySurface attribute */
+#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR	0x30CA	/* eglQuerySurface attribute */
+#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR	0x30CB	/* eglQuerySurface attribute */
+#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR	0x30CC	/* eglQuerySurface attribute */
+#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR	0x30CD	/* eglQuerySurface attribute */
+#define EGL_LOWER_LEFT_KHR			0x30CE	/* EGL_BITMAP_ORIGIN_KHR value */
+#define EGL_UPPER_LEFT_KHR			0x30CF	/* EGL_BITMAP_ORIGIN_KHR value */
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR (EGLDisplay display, EGLSurface surface);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface);
+#endif
 
-#ifndef EGL_KHR_get_all_proc_addresses
-#define EGL_KHR_get_all_proc_addresses 1
-#endif /* EGL_KHR_get_all_proc_addresses */
+#ifndef EGL_KHR_image
+#define EGL_KHR_image 1
+#define EGL_NATIVE_PIXMAP_KHR			0x30B0	/* eglCreateImageKHR target */
+typedef void *EGLImageKHR;
+#define EGL_NO_IMAGE_KHR			((EGLImageKHR)0)
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image);
+#endif
 
-#ifndef EGL_KHR_gl_colorspace
-#define EGL_KHR_gl_colorspace 1
-#define EGL_GL_COLORSPACE_KHR             0x309D
-#define EGL_GL_COLORSPACE_SRGB_KHR        0x3089
-#define EGL_GL_COLORSPACE_LINEAR_KHR      0x308A
-#endif /* EGL_KHR_gl_colorspace */
-
-#ifndef EGL_KHR_gl_renderbuffer_image
-#define EGL_KHR_gl_renderbuffer_image 1
-#define EGL_GL_RENDERBUFFER_KHR           0x30B9
-#endif /* EGL_KHR_gl_renderbuffer_image */
+#ifndef EGL_KHR_vg_parent_image
+#define EGL_KHR_vg_parent_image 1
+#define EGL_VG_PARENT_IMAGE_KHR			0x30BA	/* eglCreateImageKHR target */
+#endif
 
 #ifndef EGL_KHR_gl_texture_2D_image
 #define EGL_KHR_gl_texture_2D_image 1
-#define EGL_GL_TEXTURE_2D_KHR             0x30B1
-#define EGL_GL_TEXTURE_LEVEL_KHR          0x30BC
-#endif /* EGL_KHR_gl_texture_2D_image */
-
-#ifndef EGL_KHR_gl_texture_3D_image
-#define EGL_KHR_gl_texture_3D_image 1
-#define EGL_GL_TEXTURE_3D_KHR             0x30B2
-#define EGL_GL_TEXTURE_ZOFFSET_KHR        0x30BD
-#endif /* EGL_KHR_gl_texture_3D_image */
+#define EGL_GL_TEXTURE_2D_KHR			0x30B1	/* eglCreateImageKHR target */
+#define EGL_GL_TEXTURE_LEVEL_KHR		0x30BC	/* eglCreateImageKHR attribute */
+#endif
 
 #ifndef EGL_KHR_gl_texture_cubemap_image
 #define EGL_KHR_gl_texture_cubemap_image 1
-#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3
-#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4
-#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5
-#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6
-#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7
-#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8
-#endif /* EGL_KHR_gl_texture_cubemap_image */
-
-#ifndef EGL_KHR_image
-#define EGL_KHR_image 1
-typedef void *EGLImageKHR;
-#define EGL_NATIVE_PIXMAP_KHR             0x30B0
-#define EGL_NO_IMAGE_KHR                  ((EGLImageKHR)0)
-typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image);
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
-EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image);
+#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR	0x30B3	/* eglCreateImageKHR target */
+#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR	0x30B4	/* eglCreateImageKHR target */
+#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR	0x30B5	/* eglCreateImageKHR target */
+#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR	0x30B6	/* eglCreateImageKHR target */
+#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR	0x30B7	/* eglCreateImageKHR target */
+#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR	0x30B8	/* eglCreateImageKHR target */
 #endif
-#endif /* EGL_KHR_image */
-
-#ifndef EGL_KHR_image_base
-#define EGL_KHR_image_base 1
-#define EGL_IMAGE_PRESERVED_KHR           0x30D2
-#endif /* EGL_KHR_image_base */
-
-#ifndef EGL_KHR_image_pixmap
-#define EGL_KHR_image_pixmap 1
-#endif /* EGL_KHR_image_pixmap */
 
-#ifndef EGL_KHR_lock_surface
-#define EGL_KHR_lock_surface 1
-#define EGL_READ_SURFACE_BIT_KHR          0x0001
-#define EGL_WRITE_SURFACE_BIT_KHR         0x0002
-#define EGL_LOCK_SURFACE_BIT_KHR          0x0080
-#define EGL_OPTIMAL_FORMAT_BIT_KHR        0x0100
-#define EGL_MATCH_FORMAT_KHR              0x3043
-#define EGL_FORMAT_RGB_565_EXACT_KHR      0x30C0
-#define EGL_FORMAT_RGB_565_KHR            0x30C1
-#define EGL_FORMAT_RGBA_8888_EXACT_KHR    0x30C2
-#define EGL_FORMAT_RGBA_8888_KHR          0x30C3
-#define EGL_MAP_PRESERVE_PIXELS_KHR       0x30C4
-#define EGL_LOCK_USAGE_HINT_KHR           0x30C5
-#define EGL_BITMAP_POINTER_KHR            0x30C6
-#define EGL_BITMAP_PITCH_KHR              0x30C7
-#define EGL_BITMAP_ORIGIN_KHR             0x30C8
-#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR   0x30C9
-#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA
-#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR  0x30CB
-#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC
-#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD
-#define EGL_LOWER_LEFT_KHR                0x30CE
-#define EGL_UPPER_LEFT_KHR                0x30CF
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint *attrib_list);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay dpy, EGLSurface surface);
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR (EGLDisplay dpy, EGLSurface surface, const EGLint *attrib_list);
-EGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR (EGLDisplay dpy, EGLSurface surface);
+#ifndef EGL_KHR_gl_texture_3D_image
+#define EGL_KHR_gl_texture_3D_image 1
+#define EGL_GL_TEXTURE_3D_KHR			0x30B2	/* eglCreateImageKHR target */
+#define EGL_GL_TEXTURE_ZOFFSET_KHR		0x30BD	/* eglCreateImageKHR attribute */
 #endif
-#endif /* EGL_KHR_lock_surface */
 
-#ifndef EGL_KHR_lock_surface2
-#define EGL_KHR_lock_surface2 1
-#define EGL_BITMAP_PIXEL_SIZE_KHR         0x3110
-#endif /* EGL_KHR_lock_surface2 */
-
-#ifndef EGL_KHR_lock_surface3
-#define EGL_KHR_lock_surface3 1
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACE64KHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLAttribKHR *value);
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface64KHR (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLAttribKHR *value);
+#ifndef EGL_KHR_gl_renderbuffer_image
+#define EGL_KHR_gl_renderbuffer_image 1
+#define EGL_GL_RENDERBUFFER_KHR			0x30B9	/* eglCreateImageKHR target */
 #endif
-#endif /* EGL_KHR_lock_surface3 */
 
-#ifndef EGL_KHR_platform_android
-#define EGL_KHR_platform_android 1
-#define EGL_PLATFORM_ANDROID_KHR          0x3141
-#endif /* EGL_KHR_platform_android */
-
-#ifndef EGL_KHR_platform_gbm
-#define EGL_KHR_platform_gbm 1
-#define EGL_PLATFORM_GBM_KHR              0x31D7
-#endif /* EGL_KHR_platform_gbm */
-
-#ifndef EGL_KHR_platform_wayland
-#define EGL_KHR_platform_wayland 1
-#define EGL_PLATFORM_WAYLAND_KHR          0x31D8
-#endif /* EGL_KHR_platform_wayland */
-
-#ifndef EGL_KHR_platform_x11
-#define EGL_KHR_platform_x11 1
-#define EGL_PLATFORM_X11_KHR              0x31D5
-#define EGL_PLATFORM_X11_SCREEN_KHR       0x31D6
-#endif /* EGL_KHR_platform_x11 */
-
+#if KHRONOS_SUPPORT_INT64   /* EGLTimeKHR requires 64-bit uint support */
 #ifndef EGL_KHR_reusable_sync
 #define EGL_KHR_reusable_sync 1
+
+typedef void* EGLSyncKHR;
 typedef khronos_utime_nanoseconds_t EGLTimeKHR;
-#ifdef KHRONOS_SUPPORT_INT64
-#define EGL_SYNC_STATUS_KHR               0x30F1
-#define EGL_SIGNALED_KHR                  0x30F2
-#define EGL_UNSIGNALED_KHR                0x30F3
-#define EGL_TIMEOUT_EXPIRED_KHR           0x30F5
-#define EGL_CONDITION_SATISFIED_KHR       0x30F6
-#define EGL_SYNC_TYPE_KHR                 0x30F7
-#define EGL_SYNC_REUSABLE_KHR             0x30FA
-#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR   0x0001
-#define EGL_FOREVER_KHR                   0xFFFFFFFFFFFFFFFFull
-#define EGL_NO_SYNC_KHR                   ((EGLSyncKHR)0)
+
+#define EGL_SYNC_STATUS_KHR			0x30F1
+#define EGL_SIGNALED_KHR			0x30F2
+#define EGL_UNSIGNALED_KHR			0x30F3
+#define EGL_TIMEOUT_EXPIRED_KHR			0x30F5
+#define EGL_CONDITION_SATISFIED_KHR		0x30F6
+#define EGL_SYNC_TYPE_KHR			0x30F7
+#define EGL_SYNC_REUSABLE_KHR			0x30FA
+#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR		0x0001	/* eglClientWaitSyncKHR <flags> bitfield */
+#define EGL_FOREVER_KHR				0xFFFFFFFFFFFFFFFFull
+#define EGL_NO_SYNC_KHR				((EGLSyncKHR)0)
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync);
+EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
+EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);
+EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
+#endif /* EGL_EGLEXT_PROTOTYPES */
 typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
 typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync);
 typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);
 typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
-EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR (EGLDisplay dpy, EGLSyncKHR sync);
-EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
-EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);
-EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
-#endif
-#endif /* KHRONOS_SUPPORT_INT64 */
-#endif /* EGL_KHR_reusable_sync */
-
-#ifndef EGL_KHR_stream
-#define EGL_KHR_stream 1
-typedef void *EGLStreamKHR;
-typedef khronos_uint64_t EGLuint64KHR;
-#ifdef KHRONOS_SUPPORT_INT64
-#define EGL_NO_STREAM_KHR                 ((EGLStreamKHR)0)
-#define EGL_CONSUMER_LATENCY_USEC_KHR     0x3210
-#define EGL_PRODUCER_FRAME_KHR            0x3212
-#define EGL_CONSUMER_FRAME_KHR            0x3213
-#define EGL_STREAM_STATE_KHR              0x3214
-#define EGL_STREAM_STATE_CREATED_KHR      0x3215
-#define EGL_STREAM_STATE_CONNECTING_KHR   0x3216
-#define EGL_STREAM_STATE_EMPTY_KHR        0x3217
-#define EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR 0x3218
-#define EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR 0x3219
-#define EGL_STREAM_STATE_DISCONNECTED_KHR 0x321A
-#define EGL_BAD_STREAM_KHR                0x321B
-#define EGL_BAD_STATE_KHR                 0x321C
-typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMKHRPROC) (EGLDisplay dpy, const EGLint *attrib_list);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSTREAMKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMU64KHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value);
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamKHR (EGLDisplay dpy, const EGLint *attrib_list);
-EGLAPI EGLBoolean EGLAPIENTRY eglDestroyStreamKHR (EGLDisplay dpy, EGLStreamKHR stream);
-EGLAPI EGLBoolean EGLAPIENTRY eglStreamAttribKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value);
-EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value);
-EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamu64KHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value);
-#endif
-#endif /* KHRONOS_SUPPORT_INT64 */
-#endif /* EGL_KHR_stream */
-
-#ifndef EGL_KHR_stream_consumer_gltexture
-#define EGL_KHR_stream_consumer_gltexture 1
-#ifdef EGL_KHR_stream
-#define EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR 0x321E
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERACQUIREKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERRELEASEKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream);
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalKHR (EGLDisplay dpy, EGLStreamKHR stream);
-EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireKHR (EGLDisplay dpy, EGLStreamKHR stream);
-EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerReleaseKHR (EGLDisplay dpy, EGLStreamKHR stream);
-#endif
-#endif /* EGL_KHR_stream */
-#endif /* EGL_KHR_stream_consumer_gltexture */
-
-#ifndef EGL_KHR_stream_cross_process_fd
-#define EGL_KHR_stream_cross_process_fd 1
-typedef int EGLNativeFileDescriptorKHR;
-#ifdef EGL_KHR_stream
-#define EGL_NO_FILE_DESCRIPTOR_KHR        ((EGLNativeFileDescriptorKHR)(-1))
-typedef EGLNativeFileDescriptorKHR (EGLAPIENTRYP PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream);
-typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor);
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLNativeFileDescriptorKHR EGLAPIENTRY eglGetStreamFileDescriptorKHR (EGLDisplay dpy, EGLStreamKHR stream);
-EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamFromFileDescriptorKHR (EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor);
 #endif
-#endif /* EGL_KHR_stream */
-#endif /* EGL_KHR_stream_cross_process_fd */
-
-#ifndef EGL_KHR_stream_fifo
-#define EGL_KHR_stream_fifo 1
-#ifdef EGL_KHR_stream
-#define EGL_STREAM_FIFO_LENGTH_KHR        0x31FC
-#define EGL_STREAM_TIME_NOW_KHR           0x31FD
-#define EGL_STREAM_TIME_CONSUMER_KHR      0x31FE
-#define EGL_STREAM_TIME_PRODUCER_KHR      0x31FF
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMTIMEKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value);
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamTimeKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value);
 #endif
-#endif /* EGL_KHR_stream */
-#endif /* EGL_KHR_stream_fifo */
-
-#ifndef EGL_KHR_stream_producer_aldatalocator
-#define EGL_KHR_stream_producer_aldatalocator 1
-#ifdef EGL_KHR_stream
-#endif /* EGL_KHR_stream */
-#endif /* EGL_KHR_stream_producer_aldatalocator */
-
-#ifndef EGL_KHR_stream_producer_eglsurface
-#define EGL_KHR_stream_producer_eglsurface 1
-#ifdef EGL_KHR_stream
-#define EGL_STREAM_BIT_KHR                0x0800
-typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC) (EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list);
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLSurface EGLAPIENTRY eglCreateStreamProducerSurfaceKHR (EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list);
-#endif
-#endif /* EGL_KHR_stream */
-#endif /* EGL_KHR_stream_producer_eglsurface */
-
-#ifndef EGL_KHR_surfaceless_context
-#define EGL_KHR_surfaceless_context 1
-#endif /* EGL_KHR_surfaceless_context */
-
-#ifndef EGL_KHR_vg_parent_image
-#define EGL_KHR_vg_parent_image 1
-#define EGL_VG_PARENT_IMAGE_KHR           0x30BA
-#endif /* EGL_KHR_vg_parent_image */
-
-#ifndef EGL_KHR_wait_sync
-#define EGL_KHR_wait_sync 1
-typedef EGLint (EGLAPIENTRYP PFNEGLWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags);
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLint EGLAPIENTRY eglWaitSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags);
-#endif
-#endif /* EGL_KHR_wait_sync */
-
-#ifndef EGL_ANDROID_blob_cache
-#define EGL_ANDROID_blob_cache 1
-typedef khronos_ssize_t EGLsizeiANDROID;
-typedef void (*EGLSetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, const void *value, EGLsizeiANDROID valueSize);
-typedef EGLsizeiANDROID (*EGLGetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, void *value, EGLsizeiANDROID valueSize);
-typedef void (EGLAPIENTRYP PFNEGLSETBLOBCACHEFUNCSANDROIDPROC) (EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get);
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI void EGLAPIENTRY eglSetBlobCacheFuncsANDROID (EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get);
-#endif
-#endif /* EGL_ANDROID_blob_cache */
-
-#ifndef EGL_ANDROID_framebuffer_target
-#define EGL_ANDROID_framebuffer_target 1
-#define EGL_FRAMEBUFFER_TARGET_ANDROID    0x3147
-#endif /* EGL_ANDROID_framebuffer_target */
-
-#ifndef EGL_ANDROID_image_native_buffer
-#define EGL_ANDROID_image_native_buffer 1
-#define EGL_NATIVE_BUFFER_ANDROID         0x3140
-#endif /* EGL_ANDROID_image_native_buffer */
-
-#ifndef EGL_ANDROID_native_fence_sync
-#define EGL_ANDROID_native_fence_sync 1
-#define EGL_SYNC_NATIVE_FENCE_ANDROID     0x3144
-#define EGL_SYNC_NATIVE_FENCE_FD_ANDROID  0x3145
-#define EGL_SYNC_NATIVE_FENCE_SIGNALED_ANDROID 0x3146
-#define EGL_NO_NATIVE_FENCE_FD_ANDROID    -1
-typedef EGLint (EGLAPIENTRYP PFNEGLDUPNATIVEFENCEFDANDROIDPROC) (EGLDisplay dpy, EGLSyncKHR sync);
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLint EGLAPIENTRY eglDupNativeFenceFDANDROID (EGLDisplay dpy, EGLSyncKHR sync);
-#endif
-#endif /* EGL_ANDROID_native_fence_sync */
-
-#ifndef EGL_ANDROID_recordable
-#define EGL_ANDROID_recordable 1
-#define EGL_RECORDABLE_ANDROID            0x3142
-#endif /* EGL_ANDROID_recordable */
-
-#ifndef EGL_ANGLE_d3d_share_handle_client_buffer
-#define EGL_ANGLE_d3d_share_handle_client_buffer 1
-#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200
-#endif /* EGL_ANGLE_d3d_share_handle_client_buffer */
 
-#ifndef EGL_ANGLE_window_fixed_size
-#define EGL_ANGLE_window_fixed_size 1
-#define EGL_FIXED_SIZE_ANGLE        0x3201
-#endif /* EGL_ANGLE_window_fixed_size */
-
-#ifndef EGL_ANGLE_query_surface_pointer
-#define EGL_ANGLE_query_surface_pointer 1
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACEPOINTERANGLEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value);
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurfacePointerANGLE (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value);
+#ifndef EGL_KHR_image_base
+#define EGL_KHR_image_base 1
+/* Most interfaces defined by EGL_KHR_image_pixmap above */
+#define EGL_IMAGE_PRESERVED_KHR			0x30D2	/* eglCreateImageKHR attribute */
 #endif
-#endif /* EGL_ANGLE_query_surface_pointer */
-
-#ifndef EGL_ANGLE_software_display
-#define EGL_ANGLE_software_display 1
-#define EGL_SOFTWARE_DISPLAY_ANGLE ((EGLNativeDisplayType)-1)
-#endif /* EGL_ANGLE_software_display */
-
-#ifndef EGL_ANGLE_direct3d_display
-#define EGL_ANGLE_direct3d_display 1
-#define EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE ((EGLNativeDisplayType)-2)
-#define EGL_D3D11_ONLY_DISPLAY_ANGLE ((EGLNativeDisplayType)-3)
-#endif /* EGL_ANGLE_direct3d_display */
-
-#ifndef EGL_ANGLE_surface_d3d_texture_2d_share_handle
-#define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1
-#endif /* EGL_ANGLE_surface_d3d_texture_2d_share_handle */
-
-#ifndef EGL_ARM_pixmap_multisample_discard
-#define EGL_ARM_pixmap_multisample_discard 1
-#define EGL_DISCARD_SAMPLES_ARM           0x3286
-#endif /* EGL_ARM_pixmap_multisample_discard */
-
-#ifndef EGL_EXT_buffer_age
-#define EGL_EXT_buffer_age 1
-#define EGL_BUFFER_AGE_EXT                0x313D
-#endif /* EGL_EXT_buffer_age */
-
-#ifndef EGL_EXT_client_extensions
-#define EGL_EXT_client_extensions 1
-#endif /* EGL_EXT_client_extensions */
-
-#ifndef EGL_EXT_create_context_robustness
-#define EGL_EXT_create_context_robustness 1
-#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT 0x30BF
-#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT 0x3138
-#define EGL_NO_RESET_NOTIFICATION_EXT     0x31BE
-#define EGL_LOSE_CONTEXT_ON_RESET_EXT     0x31BF
-#endif /* EGL_EXT_create_context_robustness */
-
-#ifndef EGL_EXT_device_base
-#define EGL_EXT_device_base 1
-typedef void *EGLDeviceEXT;
-#define EGL_NO_DEVICE_EXT                 ((EGLDeviceEXT)(0))
-#define EGL_BAD_DEVICE_EXT                0x322B
-#define EGL_DEVICE_EXT                    0x322C
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDEVICEATTRIBEXTPROC) (EGLDeviceEXT device, EGLint attribute, EGLAttrib *value);
-typedef const char *(EGLAPIENTRYP PFNEGLQUERYDEVICESTRINGEXTPROC) (EGLDeviceEXT device, EGLint name);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDEVICESEXTPROC) (EGLint max_devices, EGLDeviceEXT *devices, EGLint *num_devices);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDISPLAYATTRIBEXTPROC) (EGLDisplay dpy, EGLint attribute, EGLAttrib *value);
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLBoolean EGLAPIENTRY eglQueryDeviceAttribEXT (EGLDeviceEXT device, EGLint attribute, EGLAttrib *value);
-EGLAPI const char *EGLAPIENTRY eglQueryDeviceStringEXT (EGLDeviceEXT device, EGLint name);
-EGLAPI EGLBoolean EGLAPIENTRY eglQueryDevicesEXT (EGLint max_devices, EGLDeviceEXT *devices, EGLint *num_devices);
-EGLAPI EGLBoolean EGLAPIENTRY eglQueryDisplayAttribEXT (EGLDisplay dpy, EGLint attribute, EGLAttrib *value);
-#endif
-#endif /* EGL_EXT_device_base */
 
-#ifndef EGL_EXT_image_dma_buf_import
-#define EGL_EXT_image_dma_buf_import 1
-#define EGL_LINUX_DMA_BUF_EXT             0x3270
-#define EGL_LINUX_DRM_FOURCC_EXT          0x3271
-#define EGL_DMA_BUF_PLANE0_FD_EXT         0x3272
-#define EGL_DMA_BUF_PLANE0_OFFSET_EXT     0x3273
-#define EGL_DMA_BUF_PLANE0_PITCH_EXT      0x3274
-#define EGL_DMA_BUF_PLANE1_FD_EXT         0x3275
-#define EGL_DMA_BUF_PLANE1_OFFSET_EXT     0x3276
-#define EGL_DMA_BUF_PLANE1_PITCH_EXT      0x3277
-#define EGL_DMA_BUF_PLANE2_FD_EXT         0x3278
-#define EGL_DMA_BUF_PLANE2_OFFSET_EXT     0x3279
-#define EGL_DMA_BUF_PLANE2_PITCH_EXT      0x327A
-#define EGL_YUV_COLOR_SPACE_HINT_EXT      0x327B
-#define EGL_SAMPLE_RANGE_HINT_EXT         0x327C
-#define EGL_YUV_CHROMA_HORIZONTAL_SITING_HINT_EXT 0x327D
-#define EGL_YUV_CHROMA_VERTICAL_SITING_HINT_EXT 0x327E
-#define EGL_ITU_REC601_EXT                0x327F
-#define EGL_ITU_REC709_EXT                0x3280
-#define EGL_ITU_REC2020_EXT               0x3281
-#define EGL_YUV_FULL_RANGE_EXT            0x3282
-#define EGL_YUV_NARROW_RANGE_EXT          0x3283
-#define EGL_YUV_CHROMA_SITING_0_EXT       0x3284
-#define EGL_YUV_CHROMA_SITING_0_5_EXT     0x3285
-#endif /* EGL_EXT_image_dma_buf_import */
-
-#ifndef EGL_EXT_multiview_window
-#define EGL_EXT_multiview_window 1
-#define EGL_MULTIVIEW_VIEW_COUNT_EXT      0x3134
-#endif /* EGL_EXT_multiview_window */
-
-#ifndef EGL_EXT_platform_base
-#define EGL_EXT_platform_base 1
-typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYEXTPROC) (EGLenum platform, void *native_display, const EGLint *attrib_list);
-typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list);
-typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLint *attrib_list);
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplayEXT (EGLenum platform, void *native_display, const EGLint *attrib_list);
-EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurfaceEXT (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list);
-EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurfaceEXT (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLint *attrib_list);
+#ifndef EGL_KHR_image_pixmap
+#define EGL_KHR_image_pixmap 1
+/* Interfaces defined by EGL_KHR_image above */
 #endif
-#endif /* EGL_EXT_platform_base */
-
-#ifndef EGL_EXT_platform_device
-#define EGL_EXT_platform_device 1
-#define EGL_PLATFORM_DEVICE_EXT           0x313F
-#endif /* EGL_EXT_platform_device */
-
-#ifndef EGL_EXT_platform_wayland
-#define EGL_EXT_platform_wayland 1
-#define EGL_PLATFORM_WAYLAND_EXT          0x31D8
-#endif /* EGL_EXT_platform_wayland */
-
-#ifndef EGL_EXT_platform_x11
-#define EGL_EXT_platform_x11 1
-#define EGL_PLATFORM_X11_EXT              0x31D5
-#define EGL_PLATFORM_X11_SCREEN_EXT       0x31D6
-#endif /* EGL_EXT_platform_x11 */
-
-#ifndef EGL_EXT_protected_surface
-#define EGL_EXT_protected_surface 1
-#define EGL_PROTECTED_CONTENT_EXT         0x32C0
-#endif /* EGL_EXT_protected_surface */
-
-#ifndef EGL_EXT_swap_buffers_with_damage
-#define EGL_EXT_swap_buffers_with_damage 1
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageEXT (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
-#endif
-#endif /* EGL_EXT_swap_buffers_with_damage */
-
-#ifndef EGL_HI_clientpixmap
-#define EGL_HI_clientpixmap 1
-struct EGLClientPixmapHI {
-    void  *pData;
-    EGLint iWidth;
-    EGLint iHeight;
-    EGLint iStride;
-};
-#define EGL_CLIENT_PIXMAP_POINTER_HI      0x8F74
-typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEHIPROC) (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI *pixmap);
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurfaceHI (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI *pixmap);
-#endif
-#endif /* EGL_HI_clientpixmap */
-
-#ifndef EGL_HI_colorformats
-#define EGL_HI_colorformats 1
-#define EGL_COLOR_FORMAT_HI               0x8F70
-#define EGL_COLOR_RGB_HI                  0x8F71
-#define EGL_COLOR_RGBA_HI                 0x8F72
-#define EGL_COLOR_ARGB_HI                 0x8F73
-#endif /* EGL_HI_colorformats */
 
 #ifndef EGL_IMG_context_priority
 #define EGL_IMG_context_priority 1
-#define EGL_CONTEXT_PRIORITY_LEVEL_IMG    0x3100
-#define EGL_CONTEXT_PRIORITY_HIGH_IMG     0x3101
-#define EGL_CONTEXT_PRIORITY_MEDIUM_IMG   0x3102
-#define EGL_CONTEXT_PRIORITY_LOW_IMG      0x3103
-#endif /* EGL_IMG_context_priority */
-
-#ifndef EGL_MESA_drm_image
-#define EGL_MESA_drm_image 1
-#define EGL_DRM_BUFFER_FORMAT_MESA        0x31D0
-#define EGL_DRM_BUFFER_USE_MESA           0x31D1
-#define EGL_DRM_BUFFER_FORMAT_ARGB32_MESA 0x31D2
-#define EGL_DRM_BUFFER_MESA               0x31D3
-#define EGL_DRM_BUFFER_STRIDE_MESA        0x31D4
-#define EGL_DRM_BUFFER_USE_SCANOUT_MESA   0x00000001
-#define EGL_DRM_BUFFER_USE_SHARE_MESA     0x00000002
-typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEDRMIMAGEMESAPROC) (EGLDisplay dpy, const EGLint *attrib_list);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDRMIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride);
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLImageKHR EGLAPIENTRY eglCreateDRMImageMESA (EGLDisplay dpy, const EGLint *attrib_list);
-EGLAPI EGLBoolean EGLAPIENTRY eglExportDRMImageMESA (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride);
+#define EGL_CONTEXT_PRIORITY_LEVEL_IMG		0x3100
+#define EGL_CONTEXT_PRIORITY_HIGH_IMG		0x3101
+#define EGL_CONTEXT_PRIORITY_MEDIUM_IMG		0x3102
+#define EGL_CONTEXT_PRIORITY_LOW_IMG		0x3103
 #endif
-#endif /* EGL_MESA_drm_image */
 
-#ifndef EGL_MESA_platform_gbm
-#define EGL_MESA_platform_gbm 1
-#define EGL_PLATFORM_GBM_MESA             0x31D7
-#endif /* EGL_MESA_platform_gbm */
-
-#ifndef EGL_NOK_swap_region
-#define EGL_NOK_swap_region 1
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGIONNOKPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects);
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersRegionNOK (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects);
+#ifndef EGL_KHR_lock_surface2
+#define EGL_KHR_lock_surface2 1
+#define EGL_BITMAP_PIXEL_SIZE_KHR		0x3110
 #endif
-#endif /* EGL_NOK_swap_region */
-
-#ifndef EGL_NOK_swap_region2
-#define EGL_NOK_swap_region2 1
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGION2NOKPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects);
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersRegion2NOK (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects);
-#endif
-#endif /* EGL_NOK_swap_region2 */
-
-#ifndef EGL_NOK_texture_from_pixmap
-#define EGL_NOK_texture_from_pixmap 1
-#define EGL_Y_INVERTED_NOK                0x307F
-#endif /* EGL_NOK_texture_from_pixmap */
-
-#ifndef EGL_NV_3dvision_surface
-#define EGL_NV_3dvision_surface 1
-#define EGL_AUTO_STEREO_NV                0x3136
-#endif /* EGL_NV_3dvision_surface */
 
 #ifndef EGL_NV_coverage_sample
 #define EGL_NV_coverage_sample 1
-#define EGL_COVERAGE_BUFFERS_NV           0x30E0
-#define EGL_COVERAGE_SAMPLES_NV           0x30E1
-#endif /* EGL_NV_coverage_sample */
-
-#ifndef EGL_NV_coverage_sample_resolve
-#define EGL_NV_coverage_sample_resolve 1
-#define EGL_COVERAGE_SAMPLE_RESOLVE_NV    0x3131
-#define EGL_COVERAGE_SAMPLE_RESOLVE_DEFAULT_NV 0x3132
-#define EGL_COVERAGE_SAMPLE_RESOLVE_NONE_NV 0x3133
-#endif /* EGL_NV_coverage_sample_resolve */
+#define EGL_COVERAGE_BUFFERS_NV			0x30E0
+#define EGL_COVERAGE_SAMPLES_NV			0x30E1
+#endif
 
 #ifndef EGL_NV_depth_nonlinear
 #define EGL_NV_depth_nonlinear 1
-#define EGL_DEPTH_ENCODING_NV             0x30E2
-#define EGL_DEPTH_ENCODING_NONE_NV        0
-#define EGL_DEPTH_ENCODING_NONLINEAR_NV   0x30E3
-#endif /* EGL_NV_depth_nonlinear */
-
-#ifndef EGL_NV_native_query
-#define EGL_NV_native_query 1
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEDISPLAYNVPROC) (EGLDisplay dpy, EGLNativeDisplayType *display_id);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEWINDOWNVPROC) (EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType *window);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEPIXMAPNVPROC) (EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType *pixmap);
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeDisplayNV (EGLDisplay dpy, EGLNativeDisplayType *display_id);
-EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeWindowNV (EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType *window);
-EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativePixmapNV (EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType *pixmap);
+#define EGL_DEPTH_ENCODING_NV			0x30E2
+#define EGL_DEPTH_ENCODING_NONE_NV 0
+#define EGL_DEPTH_ENCODING_NONLINEAR_NV		0x30E3
 #endif
-#endif /* EGL_NV_native_query */
 
-#ifndef EGL_NV_post_convert_rounding
-#define EGL_NV_post_convert_rounding 1
-#endif /* EGL_NV_post_convert_rounding */
-
-#ifndef EGL_NV_post_sub_buffer
-#define EGL_NV_post_sub_buffer 1
-#define EGL_POST_SUB_BUFFER_SUPPORTED_NV  0x30BE
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLPOSTSUBBUFFERNVPROC) (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height);
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height);
-#endif
-#endif /* EGL_NV_post_sub_buffer */
-
-#ifndef EGL_NV_stream_sync
-#define EGL_NV_stream_sync 1
-#define EGL_SYNC_NEW_FRAME_NV             0x321F
-typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESTREAMSYNCNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum type, const EGLint *attrib_list);
-#ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateStreamSyncNV (EGLDisplay dpy, EGLStreamKHR stream, EGLenum type, const EGLint *attrib_list);
-#endif
-#endif /* EGL_NV_stream_sync */
-
+#if KHRONOS_SUPPORT_INT64   /* EGLTimeNV requires 64-bit uint support */
 #ifndef EGL_NV_sync
 #define EGL_NV_sync 1
-typedef void *EGLSyncNV;
+#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV	0x30E6
+#define EGL_SYNC_STATUS_NV			0x30E7
+#define EGL_SIGNALED_NV				0x30E8
+#define EGL_UNSIGNALED_NV			0x30E9
+#define EGL_SYNC_FLUSH_COMMANDS_BIT_NV		0x0001
+#define EGL_FOREVER_NV				0xFFFFFFFFFFFFFFFFull
+#define EGL_ALREADY_SIGNALED_NV			0x30EA
+#define EGL_TIMEOUT_EXPIRED_NV			0x30EB
+#define EGL_CONDITION_SATISFIED_NV		0x30EC
+#define EGL_SYNC_TYPE_NV			0x30ED
+#define EGL_SYNC_CONDITION_NV			0x30EE
+#define EGL_SYNC_FENCE_NV			0x30EF
+#define EGL_NO_SYNC_NV				((EGLSyncNV)0)
+typedef void* EGLSyncNV;
 typedef khronos_utime_nanoseconds_t EGLTimeNV;
-#ifdef KHRONOS_SUPPORT_INT64
-#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV 0x30E6
-#define EGL_SYNC_STATUS_NV                0x30E7
-#define EGL_SIGNALED_NV                   0x30E8
-#define EGL_UNSIGNALED_NV                 0x30E9
-#define EGL_SYNC_FLUSH_COMMANDS_BIT_NV    0x0001
-#define EGL_FOREVER_NV                    0xFFFFFFFFFFFFFFFFull
-#define EGL_ALREADY_SIGNALED_NV           0x30EA
-#define EGL_TIMEOUT_EXPIRED_NV            0x30EB
-#define EGL_CONDITION_SATISFIED_NV        0x30EC
-#define EGL_SYNC_TYPE_NV                  0x30ED
-#define EGL_SYNC_CONDITION_NV             0x30EE
-#define EGL_SYNC_FENCE_NV                 0x30EF
-#define EGL_NO_SYNC_NV                    ((EGLSyncNV)0)
-typedef EGLSyncNV (EGLAPIENTRYP PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLFENCENVPROC) (EGLSyncNV sync);
-typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode);
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint *value);
 #ifdef EGL_EGLEXT_PROTOTYPES
 EGLAPI EGLSyncNV EGLAPIENTRY eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
 EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncNV (EGLSyncNV sync);
 EGLAPI EGLBoolean EGLAPIENTRY eglFenceNV (EGLSyncNV sync);
 EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncNV (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
 EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncNV (EGLSyncNV sync, EGLenum mode);
 EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribNV (EGLSyncNV sync, EGLint attribute, EGLint *value);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLSyncNV (EGLAPIENTRYP PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLFENCENVPROC) (EGLSyncNV sync);
+typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint *value);
 #endif
-#endif /* KHRONOS_SUPPORT_INT64 */
-#endif /* EGL_NV_sync */
+#endif
+
+#if KHRONOS_SUPPORT_INT64   /* Dependent on EGL_KHR_reusable_sync which requires 64-bit uint support */
+#ifndef EGL_KHR_fence_sync
+#define EGL_KHR_fence_sync 1
+/* Reuses most tokens and entry points from EGL_KHR_reusable_sync */
+#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR	0x30F0
+#define EGL_SYNC_CONDITION_KHR			0x30F8
+#define EGL_SYNC_FENCE_KHR			0x30F9
+#endif
+#endif
+
+#ifndef EGL_HI_clientpixmap
+#define EGL_HI_clientpixmap 1
+
+/* Surface Attribute */
+#define EGL_CLIENT_PIXMAP_POINTER_HI		0x8F74
+/*
+ * Structure representing a client pixmap
+ * (pixmap's data is in client-space memory).
+ */
+struct EGLClientPixmapHI
+{
+	void*		pData;
+	EGLint		iWidth;
+	EGLint		iHeight;
+	EGLint		iStride;
+};
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurfaceHI(EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI* pixmap);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEHIPROC) (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI* pixmap);
+#endif	/* EGL_HI_clientpixmap */
+
+#ifndef EGL_HI_colorformats
+#define EGL_HI_colorformats 1
+/* Config Attribute */
+#define EGL_COLOR_FORMAT_HI			0x8F70
+/* Color Formats */
+#define EGL_COLOR_RGB_HI			0x8F71
+#define EGL_COLOR_RGBA_HI			0x8F72
+#define EGL_COLOR_ARGB_HI			0x8F73
+#endif /* EGL_HI_colorformats */
 
+#ifndef EGL_MESA_drm_image
+#define EGL_MESA_drm_image 1
+#define EGL_DRM_BUFFER_FORMAT_MESA		0x31D0	    /* CreateDRMImageMESA attribute */
+#define EGL_DRM_BUFFER_USE_MESA			0x31D1	    /* CreateDRMImageMESA attribute */
+#define EGL_DRM_BUFFER_FORMAT_ARGB32_MESA	0x31D2	    /* EGL_IMAGE_FORMAT_MESA attribute value */
+#define EGL_DRM_BUFFER_MESA			0x31D3	    /* eglCreateImageKHR target */
+#define EGL_DRM_BUFFER_STRIDE_MESA		0x31D4
+#define EGL_DRM_BUFFER_USE_SCANOUT_MESA		0x00000001  /* EGL_DRM_BUFFER_USE_MESA bits */
+#define EGL_DRM_BUFFER_USE_SHARE_MESA		0x00000002  /* EGL_DRM_BUFFER_USE_MESA bits */
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLImageKHR EGLAPIENTRY eglCreateDRMImageMESA (EGLDisplay dpy, const EGLint *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglExportDRMImageMESA (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEDRMIMAGEMESAPROC) (EGLDisplay dpy, const EGLint *attrib_list);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDRMIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride);
+#endif
+
+#ifndef EGL_NV_post_sub_buffer
+#define EGL_NV_post_sub_buffer 1
+#define EGL_POST_SUB_BUFFER_SUPPORTED_NV	0x30BE
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLPOSTSUBBUFFERNVPROC) (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height);
+#endif
+
+#ifndef EGL_ANGLE_query_surface_pointer
+#define EGL_ANGLE_query_surface_pointer 1
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean eglQuerySurfacePointerANGLE(EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value);
+#endif
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACEPOINTERANGLEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value);
+#endif
+
+#ifndef EGL_ANGLE_software_display
+#define EGL_ANGLE_software_display 1
+#define EGL_SOFTWARE_DISPLAY_ANGLE ((EGLNativeDisplayType)-1)
+#endif
+
+#ifndef EGL_ANGLE_direct3d_display
+#define EGL_ANGLE_direct3d_display 1
+#define EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE ((EGLNativeDisplayType)-2)
+#define EGL_D3D11_ONLY_DISPLAY_ANGLE ((EGLNativeDisplayType)-3)
+#endif
+
+#ifndef EGL_ANGLE_surface_d3d_texture_2d_share_handle
+#define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1
+#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE	0x3200
+#endif
+
+#ifndef EGL_NV_coverage_sample_resolve
+#define EGL_NV_coverage_sample_resolve 1
+#define EGL_COVERAGE_SAMPLE_RESOLVE_NV		0x3131
+#define EGL_COVERAGE_SAMPLE_RESOLVE_DEFAULT_NV	0x3132
+#define EGL_COVERAGE_SAMPLE_RESOLVE_NONE_NV	0x3133
+#endif
+
+#if KHRONOS_SUPPORT_INT64   /* EGLuint64NV requires 64-bit uint support */
 #ifndef EGL_NV_system_time
 #define EGL_NV_system_time 1
 typedef khronos_utime_nanoseconds_t EGLuint64NV;
-#ifdef KHRONOS_SUPPORT_INT64
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeFrequencyNV(void);
+EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV(void);
+#endif /* EGL_EGLEXT_PROTOTYPES */
 typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC) (void);
 typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC) (void);
+#endif
+#endif
+
+#if KHRONOS_SUPPORT_INT64 /* EGLuint64KHR requires 64-bit uint support */
+#ifndef EGL_KHR_stream
+#define EGL_KHR_stream 1
+typedef void* EGLStreamKHR;
+typedef khronos_uint64_t EGLuint64KHR;
+#define EGL_NO_STREAM_KHR			((EGLStreamKHR)0)
+#define EGL_CONSUMER_LATENCY_USEC_KHR		0x3210
+#define EGL_PRODUCER_FRAME_KHR			0x3212
+#define EGL_CONSUMER_FRAME_KHR			0x3213
+#define EGL_STREAM_STATE_KHR			0x3214
+#define EGL_STREAM_STATE_CREATED_KHR		0x3215
+#define EGL_STREAM_STATE_CONNECTING_KHR		0x3216
+#define EGL_STREAM_STATE_EMPTY_KHR		0x3217
+#define EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR    0x3218
+#define EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR    0x3219
+#define EGL_STREAM_STATE_DISCONNECTED_KHR	0x321A
+#define EGL_BAD_STREAM_KHR			0x321B
+#define EGL_BAD_STATE_KHR			0x321C
 #ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeFrequencyNV (void);
-EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV (void);
+EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamKHR(EGLDisplay dpy, const EGLint *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroyStreamKHR(EGLDisplay dpy, EGLStreamKHR stream);
+EGLAPI EGLBoolean EGLAPIENTRY eglStreamAttribKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value);
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value);
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamu64KHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMKHRPROC)(EGLDisplay dpy, const EGLint *attrib_list);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSTREAMKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMATTRIBKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMU64KHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value);
+#endif
+#endif
+
+#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
+#ifndef EGL_KHR_stream_consumer_gltexture
+#define EGL_KHR_stream_consumer_gltexture 1
+#define EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR	0x321E
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalKHR(EGLDisplay dpy, EGLStreamKHR stream);
+EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireKHR(EGLDisplay dpy, EGLStreamKHR stream);
+EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerReleaseKHR(EGLDisplay dpy, EGLStreamKHR stream);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERACQUIREKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERRELEASEKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
+#endif
+#endif
+
+#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
+#ifndef EGL_KHR_stream_producer_eglsurface
+#define EGL_KHR_stream_producer_eglsurface 1
+#define EGL_STREAM_BIT_KHR			0x0800
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLSurface EGLAPIENTRY eglCreateStreamProducerSurfaceKHR(EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC)(EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list);
+#endif
+#endif
+
+#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
+#ifndef EGL_KHR_stream_producer_aldatalocator
+#define EGL_KHR_stream_producer_aldatalocator 1
+#endif
+#endif
+
+#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
+#ifndef EGL_KHR_stream_fifo
+#define EGL_KHR_stream_fifo 1
+/* reuse EGLTimeKHR */
+#define EGL_STREAM_FIFO_LENGTH_KHR		0x31FC
+#define EGL_STREAM_TIME_NOW_KHR			0x31FD
+#define EGL_STREAM_TIME_CONSUMER_KHR		0x31FE
+#define EGL_STREAM_TIME_PRODUCER_KHR		0x31FF
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamTimeKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMTIMEKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value);
+#endif
+#endif
+
+#ifndef EGL_EXT_create_context_robustness
+#define EGL_EXT_create_context_robustness 1
+#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT	0x30BF
+#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT 0x3138
+#define EGL_NO_RESET_NOTIFICATION_EXT		0x31BE
+#define EGL_LOSE_CONTEXT_ON_RESET_EXT		0x31BF
+#endif
+
+#ifndef EGL_ANGLE_d3d_share_handle_client_buffer
+#define EGL_ANGLE_d3d_share_handle_client_buffer 1
+/* reuse EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE */
+#endif
+
+#ifndef EGL_ANGLE_window_fixed_size
+#define EGL_ANGLE_window_fixed_size 1
+#define EGL_FIXED_SIZE_ANGLE        0x3201
+#endif
+
+#ifndef EGL_KHR_create_context
+#define EGL_KHR_create_context 1
+#define EGL_CONTEXT_MAJOR_VERSION_KHR			    EGL_CONTEXT_CLIENT_VERSION
+#define EGL_CONTEXT_MINOR_VERSION_KHR			    0x30FB
+#define EGL_CONTEXT_FLAGS_KHR				    0x30FC
+#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR		    0x30FD
+#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR  0x31BD
+#define EGL_NO_RESET_NOTIFICATION_KHR			    0x31BE
+#define EGL_LOSE_CONTEXT_ON_RESET_KHR			    0x31BF
+#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR		    0x00000001
+#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR	    0x00000002
+#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR	    0x00000004
+#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR		    0x00000001
+#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR    0x00000002
+#define EGL_OPENGL_ES3_BIT_KHR				    0x00000040
+#endif
+
+#ifndef EGL_KHR_surfaceless_context
+#define EGL_KHR_surfaceless_context 1
+/* No tokens/entry points, just relaxes an error condition */
 #endif
-#endif /* KHRONOS_SUPPORT_INT64 */
-#endif /* EGL_NV_system_time */
+
+#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
+#ifndef EGL_KHR_stream_cross_process_fd
+#define EGL_KHR_stream_cross_process_fd 1
+typedef int EGLNativeFileDescriptorKHR;
+#define EGL_NO_FILE_DESCRIPTOR_KHR		((EGLNativeFileDescriptorKHR)(-1))
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLNativeFileDescriptorKHR EGLAPIENTRY eglGetStreamFileDescriptorKHR(EGLDisplay dpy, EGLStreamKHR stream);
+EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamFromFileDescriptorKHR(EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLNativeFileDescriptorKHR (EGLAPIENTRYP PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
+typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC)(EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor);
+#endif
+#endif
+
+#ifndef EGL_EXT_multiview_window
+#define EGL_EXT_multiview_window 1
+#define EGL_MULTIVIEW_VIEW_COUNT_EXT		0x3134
+#endif
+
+#ifndef EGL_KHR_wait_sync
+#define EGL_KHR_wait_sync 1
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLint EGLAPIENTRY eglWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLint (EGLAPIENTRYP PFNEGLWAITSYNCKHRPROC)(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags);
+#endif
+
+#ifndef EGL_NV_post_convert_rounding
+#define EGL_NV_post_convert_rounding 1
+/* No tokens or entry points, just relaxes behavior of SwapBuffers */
+#endif
+
+#ifndef EGL_NV_native_query
+#define EGL_NV_native_query 1
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeDisplayNV( EGLDisplay dpy, EGLNativeDisplayType* display_id);
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeWindowNV( EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType* window);
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativePixmapNV( EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType* pixmap);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEDISPLAYNVPROC)(EGLDisplay dpy, EGLNativeDisplayType *display_id);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEWINDOWNVPROC)(EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType *window);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEPIXMAPNVPROC)(EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType *pixmap);
+#endif
+
+#ifndef EGL_NV_3dvision_surface
+#define EGL_NV_3dvision_surface 1
+#define EGL_AUTO_STEREO_NV			0x3136
+#endif
+
+#ifndef EGL_ANDROID_framebuffer_target
+#define EGL_ANDROID_framebuffer_target 1
+#define EGL_FRAMEBUFFER_TARGET_ANDROID		0x3147
+#endif
+
+#ifndef EGL_ANDROID_blob_cache
+#define EGL_ANDROID_blob_cache 1
+typedef khronos_ssize_t EGLsizeiANDROID;
+typedef void (*EGLSetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, const void *value, EGLsizeiANDROID valueSize);
+typedef EGLsizeiANDROID (*EGLGetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, void *value, EGLsizeiANDROID valueSize);
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI void EGLAPIENTRY eglSetBlobCacheFuncsANDROID(EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef void (EGLAPIENTRYP PFNEGLSETBLOBCACHEFUNCSANDROIDPROC)(EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get);
+#endif
+
+#ifndef EGL_ANDROID_image_native_buffer
+#define EGL_ANDROID_image_native_buffer 1
+#define EGL_NATIVE_BUFFER_ANDROID		0x3140
+#endif
+
+#ifndef EGL_ANDROID_native_fence_sync
+#define EGL_ANDROID_native_fence_sync 1
+#define EGL_SYNC_NATIVE_FENCE_ANDROID		0x3144
+#define EGL_SYNC_NATIVE_FENCE_FD_ANDROID	0x3145
+#define EGL_SYNC_NATIVE_FENCE_SIGNALED_ANDROID	0x3146
+#define EGL_NO_NATIVE_FENCE_FD_ANDROID		-1
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLint EGLAPIENTRY eglDupNativeFenceFDANDROID( EGLDisplay dpy, EGLSyncKHR);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLint (EGLAPIENTRYP PFNEGLDUPNATIVEFENCEFDANDROIDPROC)(EGLDisplay dpy, EGLSyncKHR);
+#endif
+
+#ifndef EGL_ANDROID_recordable
+#define EGL_ANDROID_recordable 1
+#define EGL_RECORDABLE_ANDROID			0x3142
+#endif
+
+#ifndef EGL_EXT_buffer_age
+#define EGL_EXT_buffer_age 1
+#define EGL_BUFFER_AGE_EXT			0x313D
+#endif
+
+#ifndef EGL_EXT_image_dma_buf_import
+#define EGL_EXT_image_dma_buf_import 1
+#define EGL_LINUX_DMA_BUF_EXT			0x3270
+#define EGL_LINUX_DRM_FOURCC_EXT		0x3271
+#define EGL_DMA_BUF_PLANE0_FD_EXT		0x3272
+#define EGL_DMA_BUF_PLANE0_OFFSET_EXT		0x3273
+#define EGL_DMA_BUF_PLANE0_PITCH_EXT		0x3274
+#define EGL_DMA_BUF_PLANE1_FD_EXT		0x3275
+#define EGL_DMA_BUF_PLANE1_OFFSET_EXT		0x3276
+#define EGL_DMA_BUF_PLANE1_PITCH_EXT		0x3277
+#define EGL_DMA_BUF_PLANE2_FD_EXT		0x3278
+#define EGL_DMA_BUF_PLANE2_OFFSET_EXT		0x3279
+#define EGL_DMA_BUF_PLANE2_PITCH_EXT		0x327A
+#define EGL_YUV_COLOR_SPACE_HINT_EXT		0x327B
+#define EGL_SAMPLE_RANGE_HINT_EXT		0x327C
+#define EGL_YUV_CHROMA_HORIZONTAL_SITING_HINT_EXT 0x327D
+#define EGL_YUV_CHROMA_VERTICAL_SITING_HINT_EXT 0x327E
+#define EGL_ITU_REC601_EXT			0x327F
+#define EGL_ITU_REC709_EXT			0x3280
+#define EGL_ITU_REC2020_EXT			0x3281
+#define EGL_YUV_FULL_RANGE_EXT			0x3282
+#define EGL_YUV_NARROW_RANGE_EXT		0x3283
+#define EGL_YUV_CHROMA_SITING_0_EXT		0x3284
+#define EGL_YUV_CHROMA_SITING_0_5_EXT		0x3285
+#endif
 
 #ifdef __cplusplus
 }
 #endif
 
-#endif
+#endif /* __eglext_h_ */
--- a/gfx/angle/include/EGL/eglplatform.h
+++ b/gfx/angle/include/EGL/eglplatform.h
@@ -1,13 +1,13 @@
 #ifndef __eglplatform_h_
 #define __eglplatform_h_
 
 /*
-** Copyright (c) 2007-2013 The Khronos Group Inc.
+** Copyright (c) 2007-2009 The Khronos Group Inc.
 **
 ** Permission is hereby granted, free of charge, to any person obtaining a
 ** copy of this software and/or associated documentation files (the
 ** "Materials"), to deal in the Materials without restriction, including
 ** without limitation the rights to use, copy, modify, merge, publish,
 ** distribute, sublicense, and/or sell copies of the Materials, and to
 ** permit persons to whom the Materials are furnished to do so, subject to
 ** the following conditions:
@@ -20,17 +20,17 @@
 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
 */
 
 /* Platform-specific types and definitions for egl.h
- * $Revision: 23432 $ on $Date: 2013-10-09 00:57:24 -0700 (Wed, 09 Oct 2013) $
+ * $Revision: 12306 $ on $Date: 2010-08-25 12:51:28 -0400 (Wed, 25 Aug 2010) $
  *
  * Adopters may modify khrplatform.h and this file to suit their platform.
  * You are encouraged to submit all modifications to the Khronos group so that
  * they can be included in future versions of this file.  Please submit changes
  * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
  * by filing a bug against product "EGL" component "Registry".
  */
 
@@ -78,26 +78,16 @@ typedef HBITMAP EGLNativePixmapType;
 typedef HWND    EGLNativeWindowType;
 
 #elif defined(__WINSCW__) || defined(__SYMBIAN32__)  /* Symbian */
 
 typedef int   EGLNativeDisplayType;
 typedef void *EGLNativeWindowType;
 typedef void *EGLNativePixmapType;
 
-#elif defined(__ANDROID__) || defined(ANDROID)
-
-#include <android/native_window.h>
-
-struct egl_native_pixmap_t;
-
-typedef struct ANativeWindow*           EGLNativeWindowType;
-typedef struct egl_native_pixmap_t*     EGLNativePixmapType;
-typedef void*                           EGLNativeDisplayType;
-
 #elif defined(__unix__)
 
 /* X11 (tentative)  */
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 
 typedef Display *EGLNativeDisplayType;
 typedef Pixmap   EGLNativePixmapType;
old mode 100755
new mode 100644
deleted file mode 100644
--- a/gfx/angle/include/angle_gl.h
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// angle_gl.h:
-//   Includes all necessary GL headers and definitions for ANGLE.
-//
-
-#ifndef ANGLE_GL_H_
-#define ANGLE_GL_H_
-
-#include "GLES2/gl2.h"
-#include "GLES2/gl2ext.h"
-#include "GLES3/gl3.h"
-#include "GLES3/gl3ext.h"
-
-// The following enum is used in ANGLE, but is from desktop GL
-#ifndef GL_SAMPLER_2D_RECT_ARB
-#define GL_SAMPLER_2D_RECT_ARB 0x8B63
-#endif
-
-#endif // ANGLE_GL_H_
--- a/gfx/angle/moz.build
+++ b/gfx/angle/moz.build
@@ -2,17 +2,16 @@
 # Please note this file is autogenerated from generate_mozbuild.py, so do not modify it directly
 
 UNIFIED_SOURCES += [
     'src/common/blocklayout.cpp',
     'src/common/debug.cpp',
     'src/common/event_tracer.cpp',
     'src/common/mathutil.cpp',
     'src/common/RefCountObject.cpp',
-    'src/common/tls.cpp',
     'src/common/utilities.cpp',
     'src/compiler/preprocessor/DiagnosticsBase.cpp',
     'src/compiler/preprocessor/DirectiveHandlerBase.cpp',
     'src/compiler/preprocessor/DirectiveParser.cpp',
     'src/compiler/preprocessor/ExpressionParser.cpp',
     'src/compiler/preprocessor/Input.cpp',
     'src/compiler/preprocessor/Lexer.cpp',
     'src/compiler/preprocessor/Macro.cpp',
@@ -50,40 +49,57 @@ UNIFIED_SOURCES += [
     'src/compiler/translator/parseConst.cpp',
     'src/compiler/translator/ParseContext.cpp',
     'src/compiler/translator/PoolAlloc.cpp',
     'src/compiler/translator/QualifierAlive.cpp',
     'src/compiler/translator/RemoveTree.cpp',
     'src/compiler/translator/RewriteElseBlocks.cpp',
     'src/compiler/translator/SearchSymbol.cpp',
     'src/compiler/translator/ShaderLang.cpp',
-    'src/compiler/translator/StructureHLSL.cpp',
     'src/compiler/translator/SymbolTable.cpp',
     'src/compiler/translator/timing/RestrictFragmentShaderTiming.cpp',
     'src/compiler/translator/timing/RestrictVertexShaderTiming.cpp',
     'src/compiler/translator/TranslatorESSL.cpp',
     'src/compiler/translator/TranslatorGLSL.cpp',
     'src/compiler/translator/TranslatorHLSL.cpp',
     'src/compiler/translator/Types.cpp',
     'src/compiler/translator/UnfoldShortCircuit.cpp',
     'src/compiler/translator/UnfoldShortCircuitAST.cpp',
-    'src/compiler/translator/UniformHLSL.cpp',
     'src/compiler/translator/util.cpp',
-    'src/compiler/translator/UtilsHLSL.cpp',
     'src/compiler/translator/ValidateLimitations.cpp',
     'src/compiler/translator/ValidateOutputs.cpp',
     'src/compiler/translator/VariableInfo.cpp',
     'src/compiler/translator/VariablePacker.cpp',
     'src/compiler/translator/VersionGLSL.cpp',
     'src/third_party/compiler/ArrayBoundsClamper.cpp',
 ]
 SOURCES += [
     'src/compiler/translator/glslang_lex.cpp',
     'src/compiler/translator/glslang_tab.cpp',
 ]
+if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gonk'):
+    UNIFIED_SOURCES += [
+        'src/compiler/translator/ossource_posix.cpp',
+    ]
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
+    UNIFIED_SOURCES += [
+        'src/compiler/translator/ossource_posix.cpp',
+    ]
+if CONFIG['MOZ_WIDGET_GTK']:
+    UNIFIED_SOURCES += [
+        'src/compiler/translator/ossource_posix.cpp',
+    ]
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt':
+    UNIFIED_SOURCES += [
+        'src/compiler/translator/ossource_posix.cpp',
+    ]
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
+    UNIFIED_SOURCES += [
+        'src/compiler/translator/ossource_win.cpp',
+    ]
 
 
 if CONFIG['GNU_CXX']:
     CXXFLAGS += [
         '-Wno-attributes',
         '-Wno-sign-compare',
         '-Wno-unknown-pragmas',
     ]
--- a/gfx/angle/src/angle.gypi
+++ b/gfx/angle/src/angle.gypi
@@ -2,123 +2,103 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
 {
     'variables':
     {
         'angle_code': 1,
         'angle_post_build_script%': 0,
-        'angle_gen_path': '<(SHARED_INTERMEDIATE_DIR)/angle',
-        'angle_id_script_base': 'commit_id.py',
-        'angle_id_script': '<(angle_gen_path)/<(angle_id_script_base)',
-        'angle_id_header_base': 'commit.h',
-        'angle_id_header': '<(angle_gen_path)/id/<(angle_id_header_base)',
-        'angle_use_commit_id%': '<!(python <(angle_id_script_base) check ..)',
     },
     'includes':
     [
         'compiler.gypi',
         'libGLESv2.gypi',
         'libEGL.gypi'
     ],
 
     'targets':
     [
         {
             'target_name': 'copy_scripts',
             'type': 'none',
             'copies':
             [
                 {
-                    'destination': '<(angle_gen_path)',
-                    'files': [ 'copy_compiler_dll.bat', '<(angle_id_script_base)' ],
+                    'destination': '<(SHARED_INTERMEDIATE_DIR)',
+                    'files': [ 'commit_id.bat', 'copy_compiler_dll.bat', 'commit_id.py' ],
                 },
             ],
         },
+
+        {
+            'target_name': 'commit_id',
+            'type': 'none',
+            'includes': [ '../build/common_defines.gypi', ],
+            'dependencies': [ 'copy_scripts', ],
+            'conditions':
+            [
+                ['OS=="win"',
+                {
+                    'actions':
+                    [
+                        {
+                            'action_name': 'Generate Commit ID Header',
+                            'message': 'Generating commit ID header...',
+                            'msvs_cygwin_shell': 0,
+                            'inputs': [ '<(SHARED_INTERMEDIATE_DIR)/commit_id.bat', '<(angle_path)/.git/index' ],
+                            'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/commit.h' ],
+                            'action': [ '<(SHARED_INTERMEDIATE_DIR)/commit_id.bat', '<(SHARED_INTERMEDIATE_DIR)' ],
+                        },
+                    ],
+                },
+                { # OS != win
+                    'actions':
+                    [
+                        {
+                            'action_name': 'Generate Commit ID Header',
+                            'message': 'Generating commit ID header...',
+                            'inputs': [ '<(SHARED_INTERMEDIATE_DIR)/commit_id.py', '<(angle_path)/.git/index' ],
+                            'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/commit.h' ],
+                            'action': [ 'python', '<(SHARED_INTERMEDIATE_DIR)/commit_id.py', '<(SHARED_INTERMEDIATE_DIR)/commit.h' ],
+                        },
+                    ],
+                }],
+            ],
+            'direct_dependent_settings':
+            {
+                'include_dirs':
+                [
+                    '<(SHARED_INTERMEDIATE_DIR)',
+                ],
+            },
+        },
     ],
     'conditions':
     [
-        ['angle_use_commit_id!=0',
-        {
-            'targets':
-            [
-                {
-                    'target_name': 'commit_id',
-                    'type': 'none',
-                    'includes': [ '../build/common_defines.gypi', ],
-                    'dependencies': [ 'copy_scripts', ],
-                    'actions':
-                    [
-                        {
-                            'action_name': 'Generate ANGLE Commit ID Header',
-                            'message': 'Generating ANGLE Commit ID',
-                            # reference the git index as an input, so we rebuild on changes to the index
-                            'inputs': [ '<(angle_id_script)', '<(angle_path)/.git/index' ],
-                            'outputs': [ '<(angle_id_header)' ],
-                            'msvs_cygwin_shell': 0,
-                            'action':
-                            [
-                                'python', '<(angle_id_script)', 'gen', '<(angle_path)', '<(angle_id_header)'
-                            ],
-                        },
-                    ],
-                    'direct_dependent_settings':
-                    {
-                        'include_dirs':
-                        [
-                            '<(angle_gen_path)',
-                        ],
-                    },
-                }
-            ]
-        },
-        { # angle_use_commit_id==0
-            'targets':
-            [
-                {
-                    'target_name': 'commit_id',
-                    'type': 'none',
-                    'copies':
-                    [
-                        {
-                            'destination': '<(angle_gen_path)/id',
-                            'files': [ '<(angle_id_header_base)' ]
-                        }
-                    ],
-                    'direct_dependent_settings':
-                    {
-                        'include_dirs':
-                        [
-                            '<(angle_gen_path)',
-                        ],
-                    },
-                }
-            ]
-        }],
         ['OS=="win"',
         {
             'targets':
             [
                 {
                     'target_name': 'copy_compiler_dll',
                     'type': 'none',
                     'dependencies': [ 'copy_scripts', ],
                     'includes': [ '../build/common_defines.gypi', ],
                     'actions':
                     [
                         {
                             'action_name': 'copy_dll',
                             'message': 'Copying D3D Compiler DLL...',
                             'msvs_cygwin_shell': 0,
                             'inputs': [ 'copy_compiler_dll.bat' ],
-                            'outputs': [ '<(PRODUCT_DIR)/d3dcompiler_46.dll' ],
+                            'outputs': [ '<(PRODUCT_DIR)/D3DCompiler_46.dll' ],
                             'action':
                             [
-                                "<(angle_gen_path)/copy_compiler_dll.bat",
+                                "<(SHARED_INTERMEDIATE_DIR)/copy_compiler_dll.bat",
                                 "$(PlatformName)",
                                 "<(windows_sdk_path)",
                                 "<(PRODUCT_DIR)"
                             ],
                         },
                     ], #actions
                 },
             ], # targets
--- a/gfx/angle/src/commit.h
+++ b/gfx/angle/src/commit.h
@@ -1,3 +1,3 @@
-#define ANGLE_COMMIT_HASH "1adcf82f4713"
-#define ANGLE_COMMIT_HASH_SIZE 12
-#define ANGLE_COMMIT_DATE "2014-09-09 10:32:27 -0700"
+#define ANGLE_COMMIT_HASH "f2c46459366d"
+#define ANGLE_COMMIT_HASH_SIZE 12
+#define ANGLE_COMMIT_DATE "2014-07-04 09:58:21 -0400"
new file mode 100644
--- /dev/null
+++ b/gfx/angle/src/commit_id.bat
@@ -0,0 +1,15 @@
+@echo off
+
+REM commit hash
+(FOR /F "delims=" %%i IN ('call git rev-parse --short^=12 HEAD') DO set _Str=%%i) || (set _Str=badf00dbad00)
+set _Str=#define ANGLE_COMMIT_HASH "%_Str%"
+echo %_Str% > %1%\commit.h
+
+REM commit hash size
+set _Str=#define ANGLE_COMMIT_HASH_SIZE 12
+echo %_Str% >> %1%\commit.h
+
+REM commit date
+(FOR /F "delims=" %%i IN ('call git show -s --format^="%%ci" HEAD') DO set _Str=%%i) || (set _Str=Unknown Date)
+set _Str=#define ANGLE_COMMIT_DATE "%_Str%"
+echo %_Str% >> %1%\commit.h
--- a/gfx/angle/src/commit_id.py
+++ b/gfx/angle/src/commit_id.py
@@ -1,38 +1,22 @@
 import subprocess as sp
 import sys
-import os
-
-# Usage: commit_id.py check <angle_dir> (checks if git is present)
-# Usage: commit_id.py gen <angle_dir> <file_to_write> (generates commit id)
-
-def grab_output(command, cwd):
-    return sp.Popen(command, stdout=sp.PIPE, shell=True, cwd=cwd).communicate()[0].strip()
 
-operation = sys.argv[1]
-cwd = sys.argv[2]
+def grab_output(*command):
+    return sp.Popen(command, stdout=sp.PIPE).communicate()[0].strip()
 
-if operation == 'check':
-    index_path = os.path.join(cwd, '.git', 'index')
-    if os.path.exists(index_path):
-        print("1")
-    else:
-        print("0")
-    sys.exit(0)
-
-output_file = sys.argv[3]
 commit_id_size = 12
 
 try:
-    commit_id = grab_output('git rev-parse --short=%d HEAD' % commit_id_size, cwd)
-    commit_date = grab_output('git show -s --format=%ci HEAD', cwd)
+    commit_id = grab_output('git', 'rev-parse', '--short=%d' % commit_id_size, 'HEAD')
+    commit_date = grab_output('git', 'show', '-s', '--format=%ci', 'HEAD')
 except:
     commit_id = 'invalid-hash'
     commit_date = 'invalid-date'
 
-hfile = open(output_file, 'w')
+hfile = open(sys.argv[1], 'w')
 
 hfile.write('#define ANGLE_COMMIT_HASH "%s"\n'    % commit_id)
 hfile.write('#define ANGLE_COMMIT_HASH_SIZE %d\n' % commit_id_size)
 hfile.write('#define ANGLE_COMMIT_DATE "%s"\n'    % commit_date)
 
 hfile.close()
--- a/gfx/angle/src/common/RefCountObject.h
+++ b/gfx/angle/src/common/RefCountObject.h
@@ -9,17 +9,18 @@
 // that need to be reference counted for correct cross-context deletion.
 // (Concretely, textures, buffers and renderbuffers.)
 
 #ifndef COMMON_REFCOUNTOBJECT_H_
 #define COMMON_REFCOUNTOBJECT_H_
 
 #include <cstddef>
 
-#include "angle_gl.h"
+#include <GLES3/gl3.h>
+#include <GLES2/gl2.h>
 
 #include "common/debug.h"
 
 class RefCountObject
 {
   public:
     explicit RefCountObject(GLuint id);
     virtual ~RefCountObject();
@@ -57,16 +58,43 @@ class BindingPointer : public RefCountOb
 {
   public:
     void set(ObjectType *newObject) { RefCountObjectBindingPointer::set(newObject); }
     ObjectType *get() const { return static_cast<ObjectType*>(RefCountObjectBindingPointer::get()); }
     ObjectType *operator->() const { return get(); }
 };
 
 template <class ObjectType>
+class FramebufferTextureBindingPointer : public RefCountObjectBindingPointer
+{
+public:
+    FramebufferTextureBindingPointer() : mType(GL_NONE), mMipLevel(0), mLayer(0) { }
+
+    void set(ObjectType *newObject, GLenum type, GLint mipLevel, GLint layer)
+    {
+        RefCountObjectBindingPointer::set(newObject);
+        mType = type;
+        mMipLevel = mipLevel;
+        mLayer = layer;
+    }
+
+    ObjectType *get() const { return static_cast<ObjectType*>(RefCountObjectBindingPointer::get()); }
+    ObjectType *operator->() const { return get(); }
+
+    GLenum type() const { return mType; }
+    GLint mipLevel() const { return mMipLevel; }
+    GLint layer() const { return mLayer; }
+
+private:
+    GLenum mType;
+    GLint mMipLevel;
+    GLint mLayer;
+};
+
+template <class ObjectType>
 class OffsetBindingPointer : public RefCountObjectBindingPointer
 {
   public:
     OffsetBindingPointer() : mOffset(0), mSize(0) { }
 
     void set(ObjectType *newObject)
     {
         RefCountObjectBindingPointer::set(newObject);
--- a/gfx/angle/src/common/angleutils.h
+++ b/gfx/angle/src/common/angleutils.h
@@ -1,24 +1,20 @@
 //
-// Copyright (c) 2002-2014 The ANGLE Project Authors. All rights reserved.
+// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 
 // angleutils.h: Common ANGLE utilities.
 
 #ifndef COMMON_ANGLEUTILS_H_
 #define COMMON_ANGLEUTILS_H_
 
-#include "common/platform.h"
-
 #include <stddef.h>
-#include <string>
-#include <set>
 
 // A macro to disallow the copy constructor and operator= functions
 // This must be used in the private: declarations for a class
 #define DISALLOW_COPY_AND_ASSIGN(TypeName) \
   TypeName(const TypeName&);               \
   void operator=(const TypeName&)
 
 // Macros for writing try catch blocks. Defining ANGLE_NO_EXCEPTIONS
@@ -60,26 +56,16 @@ void SafeRelease(T& resource)
 template <typename T>
 void SafeDelete(T*& resource)
 {
     delete resource;
     resource = NULL;
 }
 
 template <typename T>
-void SafeDeleteContainer(T& resource)
-{
-    for (typename T::iterator i = resource.begin(); i != resource.end(); i++)
-    {
-        SafeDelete(*i);
-    }
-    resource.clear();
-}
-
-template <typename T>
 void SafeDeleteArray(T*& resource)
 {
     delete[] resource;
     resource = NULL;
 }
 
 // Provide a less-than function for comparing structs
 // Note: struct memory must be initialized to zero, because of packing gaps
@@ -98,28 +84,16 @@ inline bool StructEquals(const T &a, con
 }
 
 template <typename T>
 inline void StructZero(T *obj)
 {
     memset(obj, 0, sizeof(T));
 }
 
-inline const char* MakeStaticString(const std::string &str)
-{
-    static std::set<std::string> strings;
-    std::set<std::string>::iterator it = strings.find(str);
-    if (it != strings.end())
-    {
-        return it->c_str();
-    }
-
-    return strings.insert(str).first->c_str();
-}
-
 #if defined(_MSC_VER)
 #define snprintf _snprintf
 #endif
 
 #define VENDOR_ID_AMD 0x1002
 #define VENDOR_ID_INTEL 0x8086
 #define VENDOR_ID_NVIDIA 0x10DE
 
--- a/gfx/angle/src/common/blocklayout.cpp
+++ b/gfx/angle/src/common/blocklayout.cpp
@@ -7,17 +7,17 @@
 //   Implementation for block layout classes and methods.
 //
 
 #include "common/blocklayout.h"
 #include "common/shadervars.h"
 #include "common/mathutil.h"
 #include "common/utilities.h"
 
-namespace sh
+namespace gl
 {
 
 BlockLayoutEncoder::BlockLayoutEncoder(std::vector<BlockMemberInfo> *blockInfoOut)
     : mCurrentOffset(0),
       mBlockInfoOut(blockInfoOut)
 {
 }
 
@@ -98,17 +98,17 @@ void Std140BlockEncoder::enterAggregateT
 void Std140BlockEncoder::exitAggregateType()
 {
     nextRegister();
 }
 
 void Std140BlockEncoder::getBlockLayoutInfo(GLenum type, unsigned int arraySize, bool isRowMajorMatrix, int *arrayStrideOut, int *matrixStrideOut)
 {
     // We assume we are only dealing with 4 byte components (no doubles or half-words currently)
-    ASSERT(gl::VariableComponentSize(gl::VariableComponentType(type)) == BytesPerComponent);
+    ASSERT(gl::UniformComponentSize(gl::UniformComponentType(type)) == BytesPerComponent);
 
     size_t baseAlignment = 0;
     int matrixStride = 0;
     int arrayStride = 0;
 
     if (gl::IsMatrixType(type))
     {
         baseAlignment = ComponentsPerRegister;
@@ -122,17 +122,17 @@ void Std140BlockEncoder::getBlockLayoutI
     }
     else if (arraySize > 0)
     {
         baseAlignment = ComponentsPerRegister;
         arrayStride = ComponentsPerRegister;
     }
     else
     {
-        const int numComponents = gl::VariableComponentCount(type);
+        const int numComponents = gl::UniformComponentCount(type);
         baseAlignment = (numComponents == 3 ? 4u : static_cast<size_t>(numComponents));
     }
 
     mCurrentOffset = rx::roundUp(mCurrentOffset, baseAlignment);
 
     *matrixStrideOut = matrixStride;
     *arrayStrideOut = arrayStride;
 }
@@ -146,17 +146,17 @@ void Std140BlockEncoder::advanceOffset(G
     else if (gl::IsMatrixType(type))
     {
         ASSERT(matrixStride == ComponentsPerRegister);
         const int numRegisters = gl::MatrixRegisterCount(type, isRowMajorMatrix);
         mCurrentOffset += ComponentsPerRegister * numRegisters;
     }
     else
     {
-        mCurrentOffset += gl::VariableComponentCount(type);
+        mCurrentOffset += gl::UniformComponentCount(type);
     }
 }
 
 HLSLBlockEncoder::HLSLBlockEncoder(std::vector<BlockMemberInfo> *blockInfoOut, HLSLBlockEncoderStrategy strategy)
     : BlockLayoutEncoder(blockInfoOut),
       mEncoderStrategy(strategy)
 {
 }
@@ -168,17 +168,17 @@ void HLSLBlockEncoder::enterAggregateTyp
 
 void HLSLBlockEncoder::exitAggregateType()
 {
 }
 
 void HLSLBlockEncoder::getBlockLayoutInfo(GLenum type, unsigned int arraySize, bool isRowMajorMatrix, int *arrayStrideOut, int *matrixStrideOut)
 {
     // We assume we are only dealing with 4 byte components (no doubles or half-words currently)
-    ASSERT(gl::VariableComponentSize(gl::VariableComponentType(type)) == BytesPerComponent);
+    ASSERT(gl::UniformComponentSize(gl::UniformComponentType(type)) == BytesPerComponent);
 
     int matrixStride = 0;
     int arrayStride = 0;
 
     // if variables are not to be packed, or we're about to
     // pack a matrix or array, skip to the start of the next
     // register
     if (!isPacked() ||
@@ -199,17 +199,17 @@ void HLSLBlockEncoder::getBlockLayoutInf
         }
     }
     else if (arraySize > 0)
     {
         arrayStride = ComponentsPerRegister;
     }
     else if (isPacked())
     {
-        int numComponents = gl::VariableComponentCount(type);
+        int numComponents = gl::UniformComponentCount(type);
         if ((numComponents + (mCurrentOffset % ComponentsPerRegister)) > ComponentsPerRegister)
         {
             nextRegister();
         }
     }
 
     *matrixStrideOut = matrixStride;
     *arrayStrideOut = arrayStride;
@@ -227,31 +227,31 @@ void HLSLBlockEncoder::advanceOffset(GLe
         ASSERT(matrixStride == ComponentsPerRegister);
         const int numRegisters = gl::MatrixRegisterCount(type, isRowMajorMatrix);
         const int numComponents = gl::MatrixComponentCount(type, isRowMajorMatrix);
         mCurrentOffset += ComponentsPerRegister * (numRegisters - 1);
         mCurrentOffset += numComponents;
     }
     else if (isPacked())
     {
-        mCurrentOffset += gl::VariableComponentCount(type);
+        mCurrentOffset += gl::UniformComponentCount(type);
     }
     else
     {
         mCurrentOffset += ComponentsPerRegister;
     }
 }
 
 void HLSLBlockEncoder::skipRegisters(unsigned int numRegisters)
 {
     mCurrentOffset += (numRegisters * ComponentsPerRegister);
 }
 
-void HLSLVariableGetRegisterInfo(unsigned int baseRegisterIndex, Uniform *variable, HLSLBlockEncoder *encoder,
-                                 const std::vector<BlockMemberInfo> &blockInfo, ShShaderOutput outputType)
+void HLSLVariableGetRegisterInfo(unsigned int baseRegisterIndex, gl::Uniform *variable, HLSLBlockEncoder *encoder,
+                                 const std::vector<gl::BlockMemberInfo> &blockInfo, ShShaderOutput outputType)
 {
     // because this method computes offsets (element indexes) instead of any total sizes,
     // we can ignore the array size of the variable
 
     if (variable->isStruct())
     {
         encoder->enterAggregateType();
 
@@ -277,17 +277,17 @@ void HLSLVariableGetRegisterInfo(unsigne
         encoder->encodeType(variable->type, variable->arraySize, false);
 
         const size_t registerBytes = (encoder->BytesPerComponent * encoder->ComponentsPerRegister);
         variable->registerIndex = baseRegisterIndex + (blockInfo.back().offset / registerBytes);
         variable->elementIndex = (blockInfo.back().offset % registerBytes) / sizeof(float);
     }
 }
 
-void HLSLVariableGetRegisterInfo(unsigned int baseRegisterIndex, Uniform *variable, ShShaderOutput outputType)
+void HLSLVariableGetRegisterInfo(unsigned int baseRegisterIndex, gl::Uniform *variable, ShShaderOutput outputType)
 {
     std::vector<BlockMemberInfo> blockInfo;
     HLSLBlockEncoder encoder(&blockInfo,
                              outputType == SH_HLSL9_OUTPUT ? HLSLBlockEncoder::ENCODE_LOOSE
                                                            : HLSLBlockEncoder::ENCODE_PACKED);
     HLSLVariableGetRegisterInfo(baseRegisterIndex, variable, &encoder, blockInfo, outputType);
 }
 
--- a/gfx/angle/src/common/blocklayout.h
+++ b/gfx/angle/src/common/blocklayout.h
@@ -6,22 +6,24 @@
 // blocklayout.h:
 //   Methods and classes related to uniform layout and packing in GLSL and HLSL.
 //
 
 #ifndef COMMON_BLOCKLAYOUT_H_
 #define COMMON_BLOCKLAYOUT_H_
 
 #include <vector>
-#include "angle_gl.h"
+#include <GLES3/gl3.h>
+#include <GLES2/gl2.h>
 #include <GLSLANG/ShaderLang.h>
 #include <cstddef>
 
-namespace sh
+namespace gl
 {
+
 struct ShaderVariable;
 struct InterfaceBlockField;
 struct BlockMemberInfo;
 struct Uniform;
 struct Varying;
 
 class BlockLayoutEncoder
 {
@@ -62,17 +64,17 @@ class Std140BlockEncoder : public BlockL
     virtual void enterAggregateType();
     virtual void exitAggregateType();
     virtual void getBlockLayoutInfo(GLenum type, unsigned int arraySize, bool isRowMajorMatrix, int *arrayStrideOut, int *matrixStrideOut);
     virtual void advanceOffset(GLenum type, unsigned int arraySize, bool isRowMajorMatrix, int arrayStride, int matrixStride);
 };
 
 // Block layout packed according to the D3D9 or default D3D10+ register packing rules
 // See http://msdn.microsoft.com/en-us/library/windows/desktop/bb509632(v=vs.85).aspx
-// The strategy should be ENCODE_LOOSE for D3D9 constant blocks, and ENCODE_PACKED
+// The strategy should be ENCODE_LOOSE for D3D9 constnat blocks, and ENCODE_PACKED
 // for everything else (D3D10+ constant blocks and all attributes/varyings).
 
 class HLSLBlockEncoder : public BlockLayoutEncoder
 {
   public:
     enum HLSLBlockEncoderStrategy
     {
         ENCODE_PACKED,
--- a/gfx/angle/src/common/debug.cpp
+++ b/gfx/angle/src/common/debug.cpp
@@ -2,23 +2,25 @@
 // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 
 // debug.cpp: Debugging utilities.
 
 #include "common/debug.h"
-#include "common/platform.h"
-
 #include <stdarg.h>
 #include <vector>
 #include <fstream>
 #include <cstdio>
 
+#if defined(ANGLE_ENABLE_PERF)
+#include <d3d9.h>
+#endif
+
 namespace gl
 {
 #if defined(ANGLE_ENABLE_PERF)
 typedef void (WINAPI *PerfOutputFunction)(D3DCOLOR, LPCWSTR);
 #else
 typedef void (*PerfOutputFunction)(unsigned int, const wchar_t*);
 #endif
 
--- a/gfx/angle/src/common/debug.h
+++ b/gfx/angle/src/common/debug.h
@@ -78,22 +78,16 @@ namespace gl
         assert(expression); \
     } while(0)
 #define UNUSED_ASSERTION_VARIABLE(variable)
 #else
 #define ASSERT(expression) (void(0))
 #define UNUSED_ASSERTION_VARIABLE(variable) ((void)variable)
 #endif
 
-#ifndef ANGLE_ENABLE_TRACE
-#define UNUSED_TRACE_VARIABLE(variable) ((void)variable)
-#else
-#define UNUSED_TRACE_VARIABLE(variable)
-#endif
-
 // A macro to indicate unimplemented functionality
 
 // Define NOASSERT_UNIMPLEMENTED to non zero to skip the assert fail in the unimplemented checks
 // This will allow us to test with some automated test suites (eg dEQP) without crashing
 #ifndef NOASSERT_UNIMPLEMENTED
 #define NOASSERT_UNIMPLEMENTED 0
 #endif
 
--- a/gfx/angle/src/common/event_tracer.h
+++ b/gfx/angle/src/common/event_tracer.h
@@ -1,23 +1,21 @@
 // Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
 #ifndef COMMON_EVENT_TRACER_H_
 #define COMMON_EVENT_TRACER_H_
 
-#include "common/platform.h"
-
 #if !defined(TRACE_ENTRY)
-#   ifdef ANGLE_PLATFORM_WINDOWS
-#       define TRACE_ENTRY __stdcall
-#   else
-#       define TRACE_ENTRY
-#   endif // ANGLE_PLATFORM_WINDOWS
+#if defined(_WIN32)
+#define TRACE_ENTRY __stdcall
+#else
+#define TRACE_ENTRY
+#endif // // _WIN32
 #endif //TRACE_ENTRY
 
 extern "C" {
 
 typedef const unsigned char* (*GetCategoryEnabledFlagFunc)(const char* name);
 typedef void (*AddTraceEventFunc)(char phase, const unsigned char* categoryGroupEnabled, const char* name,
                                   unsigned long long id, int numArgs, const char** argNames,
                                   const unsigned char* argTypes, const unsigned long long* argValues,
--- a/gfx/angle/src/common/mathutil.h
+++ b/gfx/angle/src/common/mathutil.h
@@ -5,17 +5,20 @@
 //
 
 // mathutil.h: Math and bit manipulation functions.
 
 #ifndef LIBGLESV2_MATHUTIL_H_
 #define LIBGLESV2_MATHUTIL_H_
 
 #include "common/debug.h"
-#include "common/platform.h"
+
+#if defined(_WIN32)
+#include <intrin.h>
+#endif
 
 #include <limits>
 #include <algorithm>
 #include <string.h>
 
 namespace gl
 {
 
@@ -104,17 +107,17 @@ inline unsigned int unorm(float x)
     else
     {
         return (unsigned int)(max * x + 0.5f);
     }
 }
 
 inline bool supportsSSE2()
 {
-#ifdef ANGLE_PLATFORM_WINDOWS
+#if defined(_WIN32)
     static bool checked = false;
     static bool supports = false;
 
     if (checked)
     {
         return supports;
     }
 
deleted file mode 100644
--- a/gfx/angle/src/common/platform.h
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-
-// platform.h: Operating system specific includes and defines.
-
-#ifndef COMMON_PLATFORM_H_
-#define COMMON_PLATFORM_H_
-
-#if defined(_WIN32) || defined(_WIN64)
-#   define ANGLE_PLATFORM_WINDOWS 1
-#elif defined(__APPLE__)
-#   define ANGLE_PLATFORM_APPLE 1
-#   define ANGLE_PLATFORM_POSIX 1
-#elif defined(__linux__)
-#   define ANGLE_PLATFORM_LINUX 1
-#   define ANGLE_PLATFORM_POSIX 1
-#elif defined(ANDROID)
-#   define ANGLE_PLATFORM_ANDROID 1
-#   define ANGLE_PLATFORM_POSIX 1
-#elif defined(__FreeBSD__) || \
-      defined(__OpenBSD__) || \
-      defined(__NetBSD__) || \
-      defined(__DragonFly__) || \
-      defined(__sun) || \
-      defined(__GLIBC__) || \
-      defined(__GNU__) || \
-      defined(__QNX__)
-#   define ANGLE_PLATFORM_POSIX 1
-#else
-#   error Unsupported platform.
-#endif
-
-#ifdef ANGLE_PLATFORM_WINDOWS
-#   ifndef STRICT
-#       define STRICT 1
-#   endif
-#   ifndef WIN32_LEAN_AND_MEAN
-#       define WIN32_LEAN_AND_MEAN 1
-#   endif
-#   ifndef NOMINMAX
-#       define NOMINMAX 1
-#   endif
-
-#   include <windows.h>
-#   include <intrin.h>
-
-#   if defined(ANGLE_ENABLE_D3D9) || defined(ANGLE_ENABLE_PERF)
-#       include <d3d9.h>
-#       include <d3dcompiler.h>
-#   endif
-
-#   if defined(ANGLE_ENABLE_D3D11)
-#       include <d3d10_1.h>
-#       include <d3d11.h>
-#       include <dxgi.h>
-#       include <dxgi1_2.h>
-#       include <d3dcompiler.h>
-#   endif
-
-#   undef near
-#   undef far
-#endif
-
-#endif // COMMON_PLATFORM_H_
--- a/gfx/angle/src/common/shadervars.h
+++ b/gfx/angle/src/common/shadervars.h
@@ -8,24 +8,23 @@
 //
 
 #ifndef COMMON_SHADERVARIABLE_H_
 #define COMMON_SHADERVARIABLE_H_
 
 #include <string>
 #include <vector>
 #include <algorithm>
-#include "GLSLANG/ShaderLang.h"
 
-namespace sh
+#include <GLES3/gl3.h>
+#include <GLES2/gl2.h>
+
+namespace gl
 {
 
-// GLenum alias
-typedef unsigned int GLenum;
-
 // Varying interpolation qualifier, see section 4.3.9 of the ESSL 3.00.4 spec
 enum InterpolationType
 {
     INTERPOLATION_SMOOTH,
     INTERPOLATION_CENTROID,
     INTERPOLATION_FLAT
 };
 
@@ -35,132 +34,129 @@ enum BlockLayoutType
     BLOCKLAYOUT_STANDARD,
     BLOCKLAYOUT_PACKED,
     BLOCKLAYOUT_SHARED
 };
 
 // Base class for all variables defined in shaders, including Varyings, Uniforms, etc
 struct ShaderVariable
 {
+    GLenum type;
+    GLenum precision;
+    std::string name;
+    unsigned int arraySize;
+
     ShaderVariable(GLenum typeIn, GLenum precisionIn, const char *nameIn, unsigned int arraySizeIn)
-        : type(typeIn),
-          precision(precisionIn),
-          name(nameIn),
-          arraySize(arraySizeIn)
+      : type(typeIn),
+        precision(precisionIn),
+        name(nameIn),
+        arraySize(arraySizeIn)
     {}
 
     bool isArray() const { return arraySize > 0; }
     unsigned int elementCount() const { return std::max(1u, arraySize); }
-
-    GLenum type;
-    GLenum precision;
-    std::string name;
-    unsigned int arraySize;
 };
 
 // Uniform registers (and element indices) are assigned when outputting shader code
 struct Uniform : public ShaderVariable
 {
+    unsigned int registerIndex;
+    unsigned int elementIndex; // Offset within a register, for struct members
+    std::vector<Uniform> fields;
+
     Uniform(GLenum typeIn, GLenum precisionIn, const char *nameIn, unsigned int arraySizeIn,
             unsigned int registerIndexIn, unsigned int elementIndexIn)
-        : ShaderVariable(typeIn, precisionIn, nameIn, arraySizeIn),
-          registerIndex(registerIndexIn),
-          elementIndex(elementIndexIn)
+      : ShaderVariable(typeIn, precisionIn, nameIn, arraySizeIn),
+        registerIndex(registerIndexIn),
+        elementIndex(elementIndexIn)
     {}
 
     bool isStruct() const { return !fields.empty(); }
-
-    std::vector<Uniform> fields;
-
-    // HLSL-specific members
-    unsigned int registerIndex;
-    unsigned int elementIndex; // Offset within a register, for struct members
 };
 
 struct Attribute : public ShaderVariable
 {
+    int location;
+
     Attribute()
-        : ShaderVariable((GLenum)0, (GLenum)0, "", 0),
-          location(-1)
+      : ShaderVariable(GL_NONE, GL_NONE, "", 0),
+        location(-1)
     {}
 
     Attribute(GLenum typeIn, GLenum precisionIn, const char *nameIn, unsigned int arraySizeIn, int locationIn)
       : ShaderVariable(typeIn, precisionIn, nameIn, arraySizeIn),
         location(locationIn)
     {}
-
-    int location;
 };
 
 struct InterfaceBlockField : public ShaderVariable
 {
+    bool isRowMajorMatrix;
+    std::vector<InterfaceBlockField> fields;
+
     InterfaceBlockField(GLenum typeIn, GLenum precisionIn, const char *nameIn, unsigned int arraySizeIn, bool isRowMajorMatrix)
-        : ShaderVariable(typeIn, precisionIn, nameIn, arraySizeIn),
-          isRowMajorMatrix(isRowMajorMatrix)
+      : ShaderVariable(typeIn, precisionIn, nameIn, arraySizeIn),
+        isRowMajorMatrix(isRowMajorMatrix)
     {}
 
     bool isStruct() const { return !fields.empty(); }
-
-    bool isRowMajorMatrix;
-    std::vector<InterfaceBlockField> fields;
 };
 
 struct Varying : public ShaderVariable
 {
+    InterpolationType interpolation;
+    std::vector<Varying> fields;
+    std::string structName;
+
     Varying(GLenum typeIn, GLenum precisionIn, const char *nameIn, unsigned int arraySizeIn, InterpolationType interpolationIn)
-        : ShaderVariable(typeIn, precisionIn, nameIn, arraySizeIn),
-          interpolation(interpolationIn)
+      : ShaderVariable(typeIn, precisionIn, nameIn, arraySizeIn),
+        interpolation(interpolationIn)
     {}
 
     bool isStruct() const { return !fields.empty(); }
-
-    InterpolationType interpolation;
-    std::vector<Varying> fields;
-    std::string structName;
 };
 
 struct BlockMemberInfo
 {
-    BlockMemberInfo(int offset, int arrayStride, int matrixStride, bool isRowMajorMatrix)
-        : offset(offset),
-          arrayStride(arrayStride),
-          matrixStride(matrixStride),
-          isRowMajorMatrix(isRowMajorMatrix)
-    {}
+    int offset;
+    int arrayStride;
+    int matrixStride;
+    bool isRowMajorMatrix;
 
     static BlockMemberInfo getDefaultBlockInfo()
     {
         return BlockMemberInfo(-1, -1, -1, false);
     }
 
-    int offset;
-    int arrayStride;
-    int matrixStride;
-    bool isRowMajorMatrix;
+    BlockMemberInfo(int offset, int arrayStride, int matrixStride, bool isRowMajorMatrix)
+      : offset(offset),
+        arrayStride(arrayStride),
+        matrixStride(matrixStride),
+        isRowMajorMatrix(isRowMajorMatrix)
+    {}
 };
 
 typedef std::vector<BlockMemberInfo> BlockMemberInfoArray;
 
 struct InterfaceBlock
 {
-    InterfaceBlock(const char *name, unsigned int arraySize, unsigned int registerIndex)
-        : name(name),
-          arraySize(arraySize),
-          layout(BLOCKLAYOUT_SHARED),
-          registerIndex(registerIndex),
-          isRowMajorLayout(false)
-    {}
-
     std::string name;
     unsigned int arraySize;
     size_t dataSize;
     BlockLayoutType layout;
     bool isRowMajorLayout;
     std::vector<InterfaceBlockField> fields;
     std::vector<BlockMemberInfo> blockInfo;
 
-    // HLSL-specific members
     unsigned int registerIndex;
+
+    InterfaceBlock(const char *name, unsigned int arraySize, unsigned int registerIndex)
+      : name(name),
+        arraySize(arraySize),
+        layout(BLOCKLAYOUT_SHARED),
+        registerIndex(registerIndex),
+        isRowMajorLayout(false)
+    {}
 };
 
 }
 
 #endif // COMMON_SHADERVARIABLE_H_
deleted file mode 100644
--- a/gfx/angle/src/common/tls.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-// Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-
-// tls.cpp: Simple cross-platform interface for thread local storage.
-
-#include "common/tls.h"
-
-#include <assert.h>
-
-TLSIndex CreateTLSIndex()
-{
-    TLSIndex index;
-
-#ifdef ANGLE_PLATFORM_WINDOWS
-    index = TlsAlloc();
-#elif defined(ANGLE_PLATFORM_POSIX)
-    // Create global pool key
-    if ((pthread_key_create(&index, NULL)) != 0)
-    {
-        index = TLS_INVALID_INDEX;
-    }
-#endif
-
-    assert(index != TLS_INVALID_INDEX && "CreateTLSIndex(): Unable to allocate Thread Local Storage");
-    return index;
-}
-
-bool DestroyTLSIndex(TLSIndex index)
-{
-    assert(index != TLS_INVALID_INDEX && "DestroyTLSIndex(): Invalid TLS Index");
-    if (index == TLS_INVALID_INDEX)
-    {
-        return false;
-    }
-
-#ifdef ANGLE_PLATFORM_WINDOWS
-    return (TlsFree(index) == TRUE);
-#elif defined(ANGLE_PLATFORM_POSIX)
-    return (pthread_key_delete(index) == 0);
-#endif
-}
-
-bool SetTLSValue(TLSIndex index, void *value)
-{
-    assert(index != TLS_INVALID_INDEX && "SetTLSValue(): Invalid TLS Index");
-    if (index == TLS_INVALID_INDEX)
-    {
-        return false;
-    }
-
-#ifdef ANGLE_PLATFORM_WINDOWS
-    return (TlsSetValue(index, value) == TRUE);
-#elif defined(ANGLE_PLATFORM_POSIX)
-    return (pthread_setspecific(index, value) == 0);
-#endif
-}
-
-void *GetTLSValue(TLSIndex index)
-{
-    assert(index != TLS_INVALID_INDEX && "GetTLSValue(): Invalid TLS Index");
-    if (index == TLS_INVALID_INDEX)
-    {
-        return NULL;
-    }
-
-#ifdef ANGLE_PLATFORM_WINDOWS
-    return TlsGetValue(index);
-#elif defined(ANGLE_PLATFORM_POSIX)
-    return pthread_getspecific(index);
-#endif
-}
deleted file mode 100644
--- a/gfx/angle/src/common/tls.h
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-
-// tls.h: Simple cross-platform interface for thread local storage.
-
-#ifndef COMMON_TLS_H_
-#define COMMON_TLS_H_
-
-#include "common/platform.h"
-
-#ifdef ANGLE_PLATFORM_WINDOWS
-    typedef DWORD TLSIndex;
-#   define TLS_INVALID_INDEX (TLS_OUT_OF_INDEXES)
-#elif defined(ANGLE_PLATFORM_POSIX)
-#   include <pthread.h>
-#   include <semaphore.h>
-#   include <errno.h>
-    typedef pthread_key_t TLSIndex;
-#   define TLS_INVALID_INDEX (static_cast<TLSIndex>(-1))
-#else
-#   error Unsupported platform.
-#endif
-
-TLSIndex CreateTLSIndex();
-bool DestroyTLSIndex(TLSIndex index);
-
-bool SetTLSValue(TLSIndex index, void *value);
-void *GetTLSValue(TLSIndex index);
-
-#endif // COMMON_TLS_H_
--- a/gfx/angle/src/common/utilities.cpp
+++ b/gfx/angle/src/common/utilities.cpp
@@ -3,24 +3,27 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 
 // utilities.cpp: Conversion functions and other utility routines.
 
 #include "common/utilities.h"
 #include "common/mathutil.h"
-#include "common/platform.h"
+
+#if defined(_WIN32)
+#include <windows.h>
+#endif
 
 #include <set>
 
 namespace gl
 {
 
-int VariableComponentCount(GLenum type)
+int UniformComponentCount(GLenum type)
 {
     switch (type)
     {
       case GL_BOOL:
       case GL_FLOAT:
       case GL_INT:
       case GL_SAMPLER_2D:
       case GL_SAMPLER_3D:
@@ -70,17 +73,17 @@ int VariableComponentCount(GLenum type)
         return 16;
       default:
         UNREACHABLE();
     }
 
     return 0;
 }
 
-GLenum VariableComponentType(GLenum type)
+GLenum UniformComponentType(GLenum type)
 {
     switch(type)
     {
       case GL_BOOL:
       case GL_BOOL_VEC2:
       case GL_BOOL_VEC3:
       case GL_BOOL_VEC4:
         return GL_BOOL;
@@ -125,42 +128,42 @@ GLenum VariableComponentType(GLenum type
         return GL_UNSIGNED_INT;
       default:
         UNREACHABLE();
     }
 
     return GL_NONE;
 }
 
-size_t VariableComponentSize(GLenum type)
+size_t UniformComponentSize(GLenum type)
 {
     switch(type)
     {
       case GL_BOOL:         return sizeof(GLint);
       case GL_FLOAT:        return sizeof(GLfloat);
       case GL_INT:          return sizeof(GLint);
       case GL_UNSIGNED_INT: return sizeof(GLuint);
       default:       UNREACHABLE();
     }
 
     return 0;
 }
 
-size_t VariableInternalSize(GLenum type)
+size_t UniformInternalSize(GLenum type)
 {
     // Expanded to 4-element vectors
-    return VariableComponentSize(VariableComponentType(type)) * VariableRowCount(type) * 4;
+    return UniformComponentSize(UniformComponentType(type)) * VariableRowCount(type) * 4;
 }
 
-size_t VariableExternalSize(GLenum type)
+size_t UniformExternalSize(GLenum type)
 {
-    return VariableComponentSize(VariableComponentType(type)) * VariableComponentCount(type);
+    return UniformComponentSize(UniformComponentType(type)) * UniformComponentCount(type);
 }
 
-GLenum VariableBoolVectorType(GLenum type)
+GLenum UniformBoolVectorType(GLenum type)
 {
     switch (type)
     {
       case GL_FLOAT:
       case GL_INT:
       case GL_UNSIGNED_INT:
         return GL_BOOL;
       case GL_FLOAT_VEC2:
@@ -357,17 +360,17 @@ int MatrixRegisterCount(GLenum type, boo
 }
 
 int MatrixComponentCount(GLenum type, bool isRowMajorMatrix)
 {
     ASSERT(IsMatrixType(type));
     return isRowMajorMatrix ? VariableColumnCount(type) : VariableRowCount(type);
 }
 
-int VariableRegisterCount(GLenum type)
+int AttributeRegisterCount(GLenum type)
 {
     return IsMatrixType(type) ? VariableColumnCount(type) : 1;
 }
 
 int AllocateFirstFreeBits(unsigned int *bits, unsigned int allocationSize, unsigned int bitsSize)
 {
     ASSERT(allocationSize <= bitsSize);
 
@@ -387,16 +390,34 @@ int AllocateFirstFreeBits(unsigned int *
     return -1;
 }
 
 bool IsCubemapTextureTarget(GLenum target)
 {
     return (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X && target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z);
 }
 
+bool IsInternalTextureTarget(GLenum target, GLuint clientVersion)
+{
+    if (clientVersion == 2)
+    {
+        return target == GL_TEXTURE_2D || IsCubemapTextureTarget(target);
+    }
+    else if (clientVersion == 3)
+    {
+        return target == GL_TEXTURE_2D || IsCubemapTextureTarget(target) ||
+               target == GL_TEXTURE_3D || target == GL_TEXTURE_2D_ARRAY;
+    }
+    else
+    {
+        UNREACHABLE();
+        return false;
+    }
+}
+
 bool IsTriangleMode(GLenum drawMode)
 {
     switch (drawMode)
     {
       case GL_TRIANGLES:
       case GL_TRIANGLE_FAN:
       case GL_TRIANGLE_STRIP:
         return true;
@@ -410,17 +431,17 @@ bool IsTriangleMode(GLenum drawMode)
 
     return false;
 }
 
 }
 
 std::string getTempPath()
 {
-#ifdef ANGLE_PLATFORM_WINDOWS
+#if defined (_WIN32)
     char path[MAX_PATH];
     DWORD pathLen = GetTempPathA(sizeof(path) / sizeof(path[0]), path);
     if (pathLen == 0)
     {
         UNREACHABLE();
         return std::string();
     }
 
--- a/gfx/angle/src/common/utilities.h
+++ b/gfx/angle/src/common/utilities.h
@@ -4,41 +4,46 @@
 // found in the LICENSE file.
 //
 
 // utilities.h: Conversion functions and other utility routines.
 
 #ifndef LIBGLESV2_UTILITIES_H
 #define LIBGLESV2_UTILITIES_H
 
-#include "angle_gl.h"
+#include <GLES3/gl3.h>
+#include <GLES3/gl3ext.h>
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+
 #include <string>
 #include <math.h>
 
 namespace gl
 {
 
-int VariableComponentCount(GLenum type);
-GLenum VariableComponentType(GLenum type);
-size_t VariableComponentSize(GLenum type);
-size_t VariableInternalSize(GLenum type);
-size_t VariableExternalSize(GLenum type);
-GLenum VariableBoolVectorType(GLenum type);
+int UniformComponentCount(GLenum type);
+GLenum UniformComponentType(GLenum type);
+size_t UniformComponentSize(GLenum type);
+size_t UniformInternalSize(GLenum type);
+size_t UniformExternalSize(GLenum type);
+GLenum UniformBoolVectorType(GLenum type);
 int VariableRowCount(GLenum type);
 int VariableColumnCount(GLenum type);
 bool IsSampler(GLenum type);
 bool IsMatrixType(GLenum type);
 GLenum TransposeMatrixType(GLenum type);
-int VariableRegisterCount(GLenum type);
+int AttributeRegisterCount(GLenum type);
 int MatrixRegisterCount(GLenum type, bool isRowMajorMatrix);
 int MatrixComponentCount(GLenum type, bool isRowMajorMatrix);
 
 int AllocateFirstFreeBits(unsigned int *bits, unsigned int allocationSize, unsigned int bitsSize);
 
 bool IsCubemapTextureTarget(GLenum target);
+bool IsInternalTextureTarget(GLenum target, GLuint clientVersion);
 
 bool IsTriangleMode(GLenum drawMode);
 
 // [OpenGL ES 3.0.2] Section 2.3.1 page 14
 // Data Conversion For State-Setting Commands
 // Floating-point values are rounded to the nearest integer, instead of truncated, as done by static_cast.
 template <typename outT> outT iround(GLfloat value) { return static_cast<outT>(value > 0.0f ? floor(value + 0.5f) : ceil(value - 0.5f)); }
 template <typename outT> outT uiround(GLfloat value) { return static_cast<outT>(value + 0.5f); }
--- a/gfx/angle/src/compiler.gypi
+++ b/gfx/angle/src/compiler.gypi
@@ -23,16 +23,28 @@
             ],
             'sources':
             [
                 '<!@(python <(angle_path)/enumerate_files.py \
                      -dirs compiler/translator third_party/compiler common ../include \
                      -excludes compiler/translator/ShaderLang.cpp \
                      -types *.cpp *.h *.y *.l)',
             ],
+            'conditions':
+            [
+                ['OS=="win"',
+                    {
+                        'msvs_disabled_warnings': [ 4267 ],
+                        'sources/': [ [ 'exclude', 'compiler/translator/ossource_posix.cpp' ], ],
+                    },
+                    { # else: posix
+                        'sources/': [ [ 'exclude', 'compiler/translator/ossource_win.cpp' ], ],
+                    }
+                ],
+            ],
             'msvs_settings':
             {
               'VCLibrarianTool':
               {
                 'AdditionalOptions': ['/ignore:4221']
               },
             },
         },
old mode 100755
new mode 100644
--- a/gfx/angle/src/compiler/translator/Compiler.cpp
+++ b/gfx/angle/src/compiler/translator/Compiler.cpp
@@ -1,23 +1,23 @@
 //
 // Copyright (c) 2002-2014 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 
 #include "compiler/translator/BuiltInFunctionEmulator.h"
-#include "compiler/translator/Compiler.h"
 #include "compiler/translator/DetectCallDepth.h"
 #include "compiler/translator/ForLoopUnroll.h"
 #include "compiler/translator/Initialize.h"
 #include "compiler/translator/InitializeParseContext.h"
 #include "compiler/translator/InitializeVariables.h"
 #include "compiler/translator/ParseContext.h"
 #include "compiler/translator/RenameFunction.h"
+#include "compiler/translator/ShHandle.h"
 #include "compiler/translator/UnfoldShortCircuitAST.h"
 #include "compiler/translator/ValidateLimitations.h"
 #include "compiler/translator/ValidateOutputs.h"
 #include "compiler/translator/VariablePacker.h"
 #include "compiler/translator/depgraph/DependencyGraph.h"
 #include "compiler/translator/depgraph/DependencyGraphOutput.h"
 #include "compiler/translator/timing/RestrictFragmentShaderTiming.h"
 #include "compiler/translator/timing/RestrictVertexShaderTiming.h"
deleted file mode 100644
--- a/gfx/angle/src/compiler/translator/Compiler.h
+++ /dev/null
@@ -1,180 +0,0 @@
-//
-// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-
-#ifndef _SHHANDLE_INCLUDED_
-#define _SHHANDLE_INCLUDED_
-
-//
-// Machine independent part of the compiler private objects
-// sent as ShHandle to the driver.
-//
-// This should not be included by driver code.
-//
-
-#include "compiler/translator/BuiltInFunctionEmulator.h"
-#include "compiler/translator/ExtensionBehavior.h"
-#include "compiler/translator/HashNames.h"
-#include "compiler/translator/InfoSink.h"
-#include "compiler/translator/SymbolTable.h"
-#include "compiler/translator/VariableInfo.h"
-#include "third_party/compiler/ArrayBoundsClamper.h"
-
-class TCompiler;
-class TDependencyGraph;
-class TranslatorHLSL;
-
-//
-// Helper function to identify specs that are based on the WebGL spec,
-// like the CSS Shaders spec.
-//
-bool IsWebGLBasedSpec(ShShaderSpec spec);
-
-//
-// The base class used to back handles returned to the driver.
-//
-class TShHandleBase {
-public:
-    TShHandleBase();
-    virtual ~TShHandleBase();
-    virtual TCompiler* getAsCompiler() { return 0; }
-    virtual TranslatorHLSL* getAsTranslatorHLSL() { return 0; }
-
-protected:
-    // Memory allocator. Allocates and tracks memory required by the compiler.
-    // Deallocates all memory when compiler is destructed.
-    TPoolAllocator allocator;
-};
-
-//
-// The base class for the machine dependent compiler to derive from
-// for managing object code from the compile.
-//
-class TCompiler : public TShHandleBase {
-public:
-    TCompiler(ShShaderType type, ShShaderSpec spec, ShShaderOutput output);
-    virtual ~TCompiler();
-    virtual TCompiler* getAsCompiler() { return this; }
-
-    bool Init(const ShBuiltInResources& resources);
-    bool compile(const char* const shaderStrings[],
-                 size_t numStrings,
-                 int compileOptions);
-
-    // Get results of the last compilation.
-    int getShaderVersion() const { return shaderVersion; }
-    TInfoSink& getInfoSink() { return infoSink; }
-    const TVariableInfoList& getAttribs() const { return attribs; }
-    const TVariableInfoList& getUniforms() const { return uniforms; }
-    const TVariableInfoList& getVaryings() const { return varyings; }
-
-    ShHashFunction64 getHashFunction() const { return hashFunction; }
-    NameMap& getNameMap() { return nameMap; }
-    TSymbolTable& getSymbolTable() { return symbolTable; }
-    ShShaderSpec getShaderSpec() const { return shaderSpec; }
-    ShShaderOutput getOutputType() const { return outputType; }
-    std::string getBuiltInResourcesString() const { return builtInResourcesString; }
-
-protected:
-    ShShaderType getShaderType() const { return shaderType; }
-    // Initialize symbol-table with built-in symbols.
-    bool InitBuiltInSymbolTable(const ShBuiltInResources& resources);
-    // Compute the string representation of the built-in resources
-    void setResourceString();
-    // Clears the results from the previous compilation.
-    void clearResults();
-    // Return true if function recursion is detected or call depth exceeded.
-    bool detectCallDepth(TIntermNode* root, TInfoSink& infoSink, bool limitCallStackDepth);
-    // Returns true if a program has no conflicting or missing fragment outputs
-    bool validateOutputs(TIntermNode* root);
-    // Rewrites a shader's intermediate tree according to the CSS Shaders spec.
-    void rewriteCSSShader(TIntermNode* root);
-    // Returns true if the given shader does not exceed the minimum
-    // functionality mandated in GLSL 1.0 spec Appendix A.
-    bool validateLimitations(TIntermNode* root);
-    // Collect info for all attribs, uniforms, varyings.
-    void collectVariables(TIntermNode* root);
-    // Translate to object code.
-    virtual void translate(TIntermNode* root) = 0;
-    // Returns true if, after applying the packing rules in the GLSL 1.017 spec
-    // Appendix A, section 7, the shader does not use too many uniforms.
-    bool enforcePackingRestrictions();
-    // Insert statements to initialize varyings without static use in the beginning
-    // of main(). It is to work around a Mac driver where such varyings in a vertex
-    // shader may be optimized out incorrectly at compile time, causing a link failure.
-    // This function should only be applied to vertex shaders.
-    void initializeVaryingsWithoutStaticUse(TIntermNode* root);
-    // Insert gl_Position = vec4(0,0,0,0) to the beginning of main().
-    // It is to work around a Linux driver bug where missing this causes compile failure
-    // while spec says it is allowed.
-    // This function should only be applied to vertex shaders.
-    void initializeGLPosition(TIntermNode* root);
-    // Returns true if the shader passes the restrictions that aim to prevent timing attacks.
-    bool enforceTimingRestrictions(TIntermNode* root, bool outputGraph);
-    // Returns true if the shader does not use samplers.
-    bool enforceVertexShaderTimingRestrictions(TIntermNode* root);
-    // Returns true if the shader does not use sampler dependent values to affect control
-    // flow or in operations whose time can depend on the input values.
-    bool enforceFragmentShaderTimingRestrictions(const TDependencyGraph& graph);
-    // Return true if the maximum expression complexity is below the limit.
-    bool limitExpressionComplexity(TIntermNode* root);
-    // Get built-in extensions with default behavior.
-    const TExtensionBehavior& getExtensionBehavior() const;
-    // Get the resources set by InitBuiltInSymbolTable
-    const ShBuiltInResources& getResources() const;
-
-    const ArrayBoundsClamper& getArrayBoundsClamper() const;
-    ShArrayIndexClampingStrategy getArrayIndexClampingStrategy() const;
-    const BuiltInFunctionEmulator& getBuiltInFunctionEmulator() const;
-
-private:
-    ShShaderType shaderType;
-    ShShaderSpec shaderSpec;
-    ShShaderOutput outputType;
-
-    int maxUniformVectors;
-    int maxExpressionComplexity;
-    int maxCallStackDepth;
-
-    ShBuiltInResources compileResources;
-    std::string builtInResourcesString;
-
-    // Built-in symbol table for the given language, spec, and resources.
-    // It is preserved from compile-to-compile.
-    TSymbolTable symbolTable;
-    // Built-in extensions with default behavior.
-    TExtensionBehavior extensionBehavior;
-    bool fragmentPrecisionHigh;
-
-    ArrayBoundsClamper arrayBoundsClamper;
-    ShArrayIndexClampingStrategy clampingStrategy;
-    BuiltInFunctionEmulator builtInFunctionEmulator;
-
-    // Results of compilation.
-    int shaderVersion;
-    TInfoSink infoSink;  // Output sink.
-    TVariableInfoList attribs;  // Active attributes in the compiled shader.
-    TVariableInfoList uniforms;  // Active uniforms in the compiled shader.
-    TVariableInfoList varyings;  // Varyings in the compiled shader.
-
-    // name hashing.
-    ShHashFunction64 hashFunction;
-    NameMap nameMap;
-};
-
-//
-// This is the interface between the machine independent code
-// and the machine dependent code.
-//
-// The machine dependent code should derive from the classes
-// above. Then Construct*() and Delete*() will create and
-// destroy the machine dependent objects, which contain the
-// above machine independent information.
-//
-TCompiler* ConstructCompiler(
-    ShShaderType type, ShShaderSpec spec, ShShaderOutput output);
-void DeleteCompiler(TCompiler*);
-
-#endif // _SHHANDLE_INCLUDED_
--- a/gfx/angle/src/compiler/translator/ConstantUnion.h
+++ b/gfx/angle/src/compiler/translator/ConstantUnion.h
@@ -1,10 +1,10 @@
 //
-// Copyright (c) 2002-2014 The ANGLE Project Authors. All rights reserved.
+// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 
 #ifndef _CONSTANT_UNION_INCLUDED_
 #define _CONSTANT_UNION_INCLUDED_
 
 #include <assert.h>
@@ -13,77 +13,16 @@ class ConstantUnion {
 public:
     POOL_ALLOCATOR_NEW_DELETE();
     ConstantUnion()
     {
         iConst = 0;
         type = EbtVoid;
     }
 
-    bool cast(TBasicType newType, const ConstantUnion &constant)
-    {
-        switch (newType)
-        {
-          case EbtFloat:
-            switch (constant.type)
-            {
-              case EbtInt:   setFConst(static_cast<float>(constant.getIConst())); break;
-              case EbtUInt:  setFConst(static_cast<float>(constant.getUConst())); break;
-              case EbtBool:  setFConst(static_cast<float>(constant.getBConst())); break;
-              case EbtFloat: setFConst(static_cast<float>(constant.getFConst())); break;
-              default:       return false;
-            }
-            break;
-          case EbtInt:
-            switch (constant.type)
-            {
-              case EbtInt:   setIConst(static_cast<int>(constant.getIConst())); break;
-              case EbtUInt:  setIConst(static_cast<int>(constant.getUConst())); break;
-              case EbtBool:  setIConst(static_cast<int>(constant.getBConst())); break;
-              case EbtFloat: setIConst(static_cast<int>(constant.getFConst())); break;
-              default:       return false;
-            }
-            break;
-          case EbtUInt:
-            switch (constant.type)
-            {
-              case EbtInt:   setUConst(static_cast<unsigned int>(constant.getIConst())); break;
-              case EbtUInt:  setUConst(static_cast<unsigned int>(constant.getUConst())); break;
-              case EbtBool:  setUConst(static_cast<unsigned int>(constant.getBConst())); break;
-              case EbtFloat: setUConst(static_cast<unsigned int>(constant.getFConst())); break;
-              default:       return false;
-            }
-            break;
-          case EbtBool:
-            switch (constant.type)
-            {
-              case EbtInt:   setBConst(constant.getIConst() != 0);    break;
-              case EbtUInt:  setBConst(constant.getUConst() != 0);    break;
-              case EbtBool:  setBConst(constant.getBConst());         break;
-              case EbtFloat: setBConst(constant.getFConst() != 0.0f); break;
-              default:       return false;
-            }
-            break;
-          case EbtStruct:    // Struct fields don't get cast
-            switch (constant.type)
-            {
-              case EbtInt:   setIConst(constant.getIConst()); break;
-              case EbtUInt:  setUConst(constant.getUConst()); break;
-              case EbtBool:  setBConst(constant.getBConst()); break;
-              case EbtFloat: setFConst(constant.getFConst()); break;
-              default:       return false;
-            }
-            break;
-          default:
-            return false;
-        }
-
-        return true;
-    }
-
     void setIConst(int i) {iConst = i; type = EbtInt; }
     void setUConst(unsigned int u) { uConst = u; type = EbtUInt; }
     void setFConst(float f) {fConst = f; type = EbtFloat; }
     void setBConst(bool b) {bConst = b; type = EbtBool; }
 
     int getIConst() const { return iConst; }
     unsigned int getUConst() const { return uConst; }
     float getFConst() const { return fConst; }
--- a/gfx/angle/src/compiler/translator/Initialize.cpp
+++ b/gfx/angle/src/compiler/translator/Initialize.cpp
@@ -561,20 +561,20 @@ void InsertBuiltInFunctions(ShShaderType
     TField *near = new TField(new TType(EbtFloat, EbpHigh, EvqGlobal, 1), NewPoolTString("near"), zeroSourceLoc);
     TField *far = new TField(new TType(EbtFloat, EbpHigh, EvqGlobal, 1), NewPoolTString("far"), zeroSourceLoc);
     TField *diff = new TField(new TType(EbtFloat, EbpHigh, EvqGlobal, 1), NewPoolTString("diff"), zeroSourceLoc);
     fields->push_back(near);
     fields->push_back(far);
     fields->push_back(diff);
     TStructure *depthRangeStruct = new TStructure(NewPoolTString("gl_DepthRangeParameters"), fields);
     TVariable *depthRangeParameters = new TVariable(&depthRangeStruct->name(), depthRangeStruct, true);
-    symbolTable.insert(COMMON_BUILTINS, depthRangeParameters);
+    symbolTable.insert(COMMON_BUILTINS, *depthRangeParameters);
     TVariable *depthRange = new TVariable(NewPoolTString("gl_DepthRange"), TType(depthRangeStruct));
     depthRange->setQualifier(EvqUniform);
-    symbolTable.insert(COMMON_BUILTINS, depthRange);
+    symbolTable.insert(COMMON_BUILTINS, *depthRange);
 
     //
     // Implementation dependent built-in constants.
     //
     symbolTable.insertConstInt(COMMON_BUILTINS, "gl_MaxVertexAttribs", resources.MaxVertexAttribs);
     symbolTable.insertConstInt(COMMON_BUILTINS, "gl_MaxVertexUniformVectors", resources.MaxVertexUniformVectors);
     symbolTable.insertConstInt(COMMON_BUILTINS, "gl_MaxVertexTextureImageUnits", resources.MaxVertexTextureImageUnits);
     symbolTable.insertConstInt(COMMON_BUILTINS, "gl_MaxCombinedTextureImageUnits", resources.MaxCombinedTextureImageUnits);
@@ -599,41 +599,41 @@ void IdentifyBuiltIns(ShShaderType type,
                       TSymbolTable &symbolTable)
 {
     //
     // First, insert some special built-in variables that are not in 
     // the built-in header files.
     //
     switch(type) {
     case SH_FRAGMENT_SHADER:
-        symbolTable.insert(COMMON_BUILTINS, new TVariable(NewPoolTString("gl_FragCoord"), TType(EbtFloat, EbpMedium, EvqFragCoord,   4)));
-        symbolTable.insert(COMMON_BUILTINS, new TVariable(NewPoolTString("gl_FrontFacing"), TType(EbtBool,  EbpUndefined, EvqFrontFacing, 1)));
-        symbolTable.insert(COMMON_BUILTINS, new TVariable(NewPoolTString("gl_PointCoord"), TType(EbtFloat, EbpMedium, EvqPointCoord,  2)));
+        symbolTable.insert(COMMON_BUILTINS, *new TVariable(NewPoolTString("gl_FragCoord"), TType(EbtFloat, EbpMedium, EvqFragCoord,   4)));
+        symbolTable.insert(COMMON_BUILTINS, *new TVariable(NewPoolTString("gl_FrontFacing"), TType(EbtBool,  EbpUndefined, EvqFrontFacing, 1)));
+        symbolTable.insert(COMMON_BUILTINS, *new TVariable(NewPoolTString("gl_PointCoord"), TType(EbtFloat, EbpMedium, EvqPointCoord,  2)));
 
         //
         // In CSS Shaders, gl_FragColor, gl_FragData, and gl_MaxDrawBuffers are not available.
         // Instead, css_MixColor and css_ColorMatrix are available.
         //
         if (spec != SH_CSS_SHADERS_SPEC) {
-            symbolTable.insert(ESSL1_BUILTINS, new TVariable(NewPoolTString("gl_FragColor"), TType(EbtFloat, EbpMedium, EvqFragColor,   4)));
-            symbolTable.insert(ESSL1_BUILTINS, new TVariable(NewPoolTString("gl_FragData[gl_MaxDrawBuffers]"), TType(EbtFloat, EbpMedium, EvqFragData,    4)));
+            symbolTable.insert(ESSL1_BUILTINS, *new TVariable(NewPoolTString("gl_FragColor"), TType(EbtFloat, EbpMedium, EvqFragColor,   4)));
+            symbolTable.insert(ESSL1_BUILTINS, *new TVariable(NewPoolTString("gl_FragData[gl_MaxDrawBuffers]"), TType(EbtFloat, EbpMedium, EvqFragData,    4)));
             if (resources.EXT_frag_depth) {
-                symbolTable.insert(ESSL1_BUILTINS, new TVariable(NewPoolTString("gl_FragDepthEXT"), TType(EbtFloat, resources.FragmentPrecisionHigh ? EbpHigh : EbpMedium, EvqFragDepth, 1)));
+                symbolTable.insert(ESSL1_BUILTINS, *new TVariable(NewPoolTString("gl_FragDepthEXT"), TType(EbtFloat, resources.FragmentPrecisionHigh ? EbpHigh : EbpMedium, EvqFragDepth, 1)));
                 symbolTable.relateToExtension(ESSL1_BUILTINS, "gl_FragDepthEXT", "GL_EXT_frag_depth");
             }
         } else {
-            symbolTable.insert(ESSL1_BUILTINS, new TVariable(NewPoolTString("css_MixColor"), TType(EbtFloat, EbpMedium, EvqGlobal,      4)));
-            symbolTable.insert(ESSL1_BUILTINS, new TVariable(NewPoolTString("css_ColorMatrix"), TType(EbtFloat, EbpMedium, EvqGlobal,      4, 4)));
+            symbolTable.insert(ESSL1_BUILTINS, *new TVariable(NewPoolTString("css_MixColor"), TType(EbtFloat, EbpMedium, EvqGlobal,      4)));
+            symbolTable.insert(ESSL1_BUILTINS, *new TVariable(NewPoolTString("css_ColorMatrix"), TType(EbtFloat, EbpMedium, EvqGlobal,      4, 4)));
         }
 
         break;
 
     case SH_VERTEX_SHADER:
-        symbolTable.insert(COMMON_BUILTINS, new TVariable(NewPoolTString("gl_Position"), TType(EbtFloat, EbpHigh, EvqPosition,    4)));
-        symbolTable.insert(COMMON_BUILTINS, new TVariable(NewPoolTString("gl_PointSize"), TType(EbtFloat, EbpMedium, EvqPointSize,   1)));
+        symbolTable.insert(COMMON_BUILTINS, *new TVariable(NewPoolTString("gl_Position"), TType(EbtFloat, EbpHigh, EvqPosition,    4)));
+        symbolTable.insert(COMMON_BUILTINS, *new TVariable(NewPoolTString("gl_PointSize"), TType(EbtFloat, EbpMedium, EvqPointSize,   1)));
         break;
 
     default: assert(false && "Language not supported");
     }
 
     //
     // Next, identify which built-ins from the already loaded headers have
     // a mapping to an operator.  Those that are not identified as such are
@@ -730,17 +730,17 @@ void IdentifyBuiltIns(ShShaderType type,
 
     // Finally add resource-specific variables.
     switch(type) {
     case SH_FRAGMENT_SHADER:
         if (spec != SH_CSS_SHADERS_SPEC) {
             // Set up gl_FragData.  The array size.
             TType fragData(EbtFloat, EbpMedium, EvqFragData, 4, 1, true);
             fragData.setArraySize(resources.MaxDrawBuffers);
-            symbolTable.insert(ESSL1_BUILTINS, new TVariable(NewPoolTString("gl_FragData"), fragData));
+            symbolTable.insert(ESSL1_BUILTINS, *new TVariable(NewPoolTString("gl_FragData"), fragData));
         }
         break;
     default: break;
     }
 }
 
 void InitExtensionBehavior(const ShBuiltInResources& resources,
                            TExtensionBehavior& extBehavior)
--- a/gfx/angle/src/compiler/translator/Initialize.h
+++ b/gfx/angle/src/compiler/translator/Initialize.h
@@ -3,17 +3,17 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 
 #ifndef _INITIALIZE_INCLUDED_
 #define _INITIALIZE_INCLUDED_
 
 #include "compiler/translator/Common.h"
-#include "compiler/translator/Compiler.h"
+#include "compiler/translator/ShHandle.h"
 #include "compiler/translator/SymbolTable.h"
 
 void InsertBuiltInFunctions(ShShaderType type, ShShaderSpec spec, const ShBuiltInResources &resources, TSymbolTable &table);
 
 void IdentifyBuiltIns(ShShaderType type, ShShaderSpec spec,
                       const ShBuiltInResources& resources,
                       TSymbolTable& symbolTable);
 
--- a/gfx/angle/src/compiler/translator/InitializeDll.cpp
+++ b/gfx/angle/src/compiler/translator/InitializeDll.cpp
@@ -1,21 +1,19 @@
 //
 // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 
 #include "compiler/translator/InitializeDll.h"
+
 #include "compiler/translator/InitializeGlobals.h"
 #include "compiler/translator/InitializeParseContext.h"
-
-#include "common/platform.h"
-
-#include <assert.h>
+#include "compiler/translator/osinclude.h"
 
 bool InitProcess()
 {
     if (!InitializePoolIndex()) {
         assert(0 && "InitProcess(): Failed to initalize global pool");
         return false;
     }
 
--- a/gfx/angle/src/compiler/translator/InitializeParseContext.cpp
+++ b/gfx/angle/src/compiler/translator/InitializeParseContext.cpp
@@ -1,42 +1,40 @@
 //
 // Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 
 #include "compiler/translator/InitializeParseContext.h"
 
-#include "common/tls.h"
+#include "compiler/translator/osinclude.h"
 
-#include <assert.h>
-
-TLSIndex GlobalParseContextIndex = TLS_INVALID_INDEX;
+OS_TLSIndex GlobalParseContextIndex = OS_INVALID_TLS_INDEX;
 
 bool InitializeParseContextIndex()
 {
-    assert(GlobalParseContextIndex == TLS_INVALID_INDEX);
+    assert(GlobalParseContextIndex == OS_INVALID_TLS_INDEX);
 
-    GlobalParseContextIndex = CreateTLSIndex();
-    return GlobalParseContextIndex != TLS_INVALID_INDEX;
+    GlobalParseContextIndex = OS_AllocTLSIndex();
+    return GlobalParseContextIndex != OS_INVALID_TLS_INDEX;
 }
 
 void FreeParseContextIndex()
 {
-    assert(GlobalParseContextIndex != TLS_INVALID_INDEX);
+    assert(GlobalParseContextIndex != OS_INVALID_TLS_INDEX);
 
-    DestroyTLSIndex(GlobalParseContextIndex);
-    GlobalParseContextIndex = TLS_INVALID_INDEX;
+    OS_FreeTLSIndex(GlobalParseContextIndex);
+    GlobalParseContextIndex = OS_INVALID_TLS_INDEX;
 }
 
 void SetGlobalParseContext(TParseContext* context)
 {
-    assert(GlobalParseContextIndex != TLS_INVALID_INDEX);
-    SetTLSValue(GlobalParseContextIndex, context);
+    assert(GlobalParseContextIndex != OS_INVALID_TLS_INDEX);
+    OS_SetTLSValue(GlobalParseContextIndex, context);
 }
 
 TParseContext* GetGlobalParseContext()
 {
-    assert(GlobalParseContextIndex != TLS_INVALID_INDEX);
-    return static_cast<TParseContext*>(GetTLSValue(GlobalParseContextIndex));
+    assert(GlobalParseContextIndex != OS_INVALID_TLS_INDEX);
+    return static_cast<TParseContext*>(OS_GetTLSValue(GlobalParseContextIndex));
 }
 
--- a/gfx/angle/src/compiler/translator/Intermediate.cpp
+++ b/gfx/angle/src/compiler/translator/Intermediate.cpp
@@ -1,10 +1,10 @@
 //
-// Copyright (c) 2002-2014 The ANGLE Project Authors. All rights reserved.
+// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 
 //
 // Build the intermediate representation.
 //
 
@@ -73,16 +73,36 @@ const char* getOperatorString(TOperator 
       case EOpNegative: return "-";
       case EOpVectorLogicalNot: return "not";
       case EOpLogicalNot: return "!";
       case EOpPostIncrement: return "++";
       case EOpPostDecrement: return "--";
       case EOpPreIncrement: return "++";
       case EOpPreDecrement: return "--";
 
+      // Fall-through.
+      case EOpConvIntToBool:
+      case EOpConvUIntToBool:
+      case EOpConvFloatToBool: return "bool";
+ 
+      // Fall-through.
+      case EOpConvBoolToFloat:
+      case EOpConvUIntToFloat:
+      case EOpConvIntToFloat: return "float";
+ 
+      // Fall-through.
+      case EOpConvFloatToInt:
+      case EOpConvUIntToInt:
+      case EOpConvBoolToInt: return "int";
+
+      // Fall-through.
+      case EOpConvIntToUInt:
+      case EOpConvFloatToUInt:
+      case EOpConvBoolToUInt: return "uint";
+
       case EOpRadians: return "radians";
       case EOpDegrees: return "degrees";
       case EOpSin: return "sin";
       case EOpCos: return "cos";
       case EOpTan: return "tan";
       case EOpAsin: return "asin";
       case EOpAcos: return "acos";
       case EOpAtan: return "atan";
@@ -163,19 +183,33 @@ TIntermTyped* TIntermediate::addBinaryMa
         case EOpSub:
         case EOpDiv:
         case EOpMul:
             if (left->getBasicType() == EbtStruct || left->getBasicType() == EbtBool)
                 return 0;
         default: break;
     }
 
-    if (left->getBasicType() != right->getBasicType())
-    {
-        return 0;
+    //
+    // First try converting the children to compatible types.
+    //
+    if (left->getType().getStruct() && right->getType().getStruct()) {
+        if (left->getType() != right->getType())
+            return 0;
+    } else {
+        TIntermTyped* child = addConversion(op, left->getType(), right);
+        if (child)
+            right = child;
+        else {
+            child = addConversion(op, right->getType(), left);
+            if (child)
+                left = child;
+            else
+                return 0;
+        }
     }
 
     //
     // Need a new node holding things together then.  Make
     // one and promote it to the right type.
     //
     TIntermBinary* node = new TIntermBinary(op);
     node->setLine(line);
@@ -202,29 +236,29 @@ TIntermTyped* TIntermediate::addBinaryMa
 
 //
 // Connect two nodes through an assignment.
 //
 // Returns the added node.
 //
 TIntermTyped* TIntermediate::addAssign(TOperator op, TIntermTyped* left, TIntermTyped* right, const TSourceLoc& line)
 {
-    if (left->getType().getStruct() || right->getType().getStruct())
-    {
-        if (left->getType() != right->getType())
-        {
-            return 0;
-        }
-    }
-
+    //
+    // Like adding binary math, except the conversion can only go
+    // from right to left.
+    //
     TIntermBinary* node = new TIntermBinary(op);
     node->setLine(line);
 
+    TIntermTyped* child = addConversion(op, left->getType(), right);
+    if (child == 0)
+        return 0;
+
     node->setLeft(left);
-    node->setRight(right);
+    node->setRight(child);
     if (! node->promote(infoSink))
         return 0;
 
     return node;
 }
 
 //
 // Connect two nodes through an index operator, where the left node is the base
@@ -272,16 +306,52 @@ TIntermTyped* TIntermediate::addUnaryMat
         case EOpPostDecrement:
         case EOpPreDecrement:
         case EOpNegative:
             if (child->getType().getBasicType() == EbtStruct || child->getType().isArray())
                 return 0;
         default: break;
     }
 
+    //
+    // Do we need to promote the operand?
+    //
+    // Note: Implicit promotions were removed from the language.
+    //
+    TBasicType newType = EbtVoid;
+    switch (op) {
+        case EOpConstructInt:   newType = EbtInt;   break;
+        case EOpConstructUInt:  newType = EbtUInt;  break;
+        case EOpConstructBool:  newType = EbtBool;  break;
+        case EOpConstructFloat: newType = EbtFloat; break;
+        default: break;
+    }
+
+    if (newType != EbtVoid) {
+        child = addConversion(op, TType(newType, child->getPrecision(), EvqTemporary,
+            child->getNominalSize(),
+            child->getSecondarySize(),
+            child->isArray()),
+            child);
+        if (child == 0)
+            return 0;
+    }
+
+    //
+    // For constructors, we are now done, it's all in the conversion.
+    //
+    switch (op) {
+        case EOpConstructInt:
+        case EOpConstructUInt:
+        case EOpConstructBool:
+        case EOpConstructFloat:
+            return child;
+        default: break;
+    }
+
     TIntermConstantUnion *childTempConstant = 0;
     if (child->getAsConstantUnion())
         childTempConstant = child->getAsConstantUnion();
 
     //
     // Make a new node for the operator.
     //
     node = new TIntermUnary(op);
@@ -335,16 +405,150 @@ TIntermAggregate* TIntermediate::setAggr
     //
     aggNode->setOp(op);
     aggNode->setLine(line);
 
     return aggNode;
 }
 
 //
+// Convert one type to another.
+//
+// Returns the node representing the conversion, which could be the same
+// node passed in if no conversion was needed.
+//
+// Return 0 if a conversion can't be done.
+//
+TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TIntermTyped* node)
+{
+    //
+    // Does the base type allow operation?
+    //
+    if (node->getBasicType() == EbtVoid ||
+        IsSampler(node->getBasicType()))
+    {
+        return 0;
+    }
+
+    //
+    // Otherwise, if types are identical, no problem
+    //
+    if (type == node->getType())
+        return node;
+
+    //
+    // If one's a structure, then no conversions.
+    //
+    if (type.getStruct() || node->getType().getStruct())
+        return 0;
+
+    //
+    // If one's an array, then no conversions.
+    //
+    if (type.isArray() || node->getType().isArray())
+        return 0;
+
+    TBasicType promoteTo;
+
+    switch (op) {
+        //
+        // Explicit conversions
+        //
+        case EOpConstructBool:
+            promoteTo = EbtBool;
+            break;
+        case EOpConstructFloat:
+            promoteTo = EbtFloat;
+            break;
+        case EOpConstructInt:
+            promoteTo = EbtInt;
+            break;
+        case EOpConstructUInt:
+            promoteTo = EbtUInt;
+            break;
+        default:
+            //
+            // implicit conversions were removed from the language.
+            //
+            if (type.getBasicType() != node->getType().getBasicType())
+                return 0;
+            //
+            // Size and structure could still differ, but that's
+            // handled by operator promotion.
+            //
+            return node;
+    }
+
+    if (node->getAsConstantUnion()) {
+
+        return (promoteConstantUnion(promoteTo, node->getAsConstantUnion()));
+    } else {
+
+        //
+        // Add a new newNode for the conversion.
+        //
+        TIntermUnary* newNode = 0;
+
+        TOperator newOp = EOpNull;
+        switch (promoteTo) {
+            case EbtFloat:
+                switch (node->getBasicType()) {
+                    case EbtInt:    newOp = EOpConvIntToFloat;  break;
+                    case EbtUInt:   newOp = EOpConvFloatToUInt; break;
+                    case EbtBool:   newOp = EOpConvBoolToFloat; break;
+                    default:
+                        infoSink.info.message(EPrefixInternalError, node->getLine(), "Bad promotion node");
+                        return 0;
+                }
+                break;
+            case EbtBool:
+                switch (node->getBasicType()) {
+                    case EbtInt:    newOp = EOpConvIntToBool;   break;
+                    case EbtUInt:   newOp = EOpConvBoolToUInt;  break;
+                    case EbtFloat:  newOp = EOpConvFloatToBool; break;
+                    default:
+                        infoSink.info.message(EPrefixInternalError, node->getLine(), "Bad promotion node");
+                        return 0;
+                }
+                break;
+            case EbtInt:
+                switch (node->getBasicType()) {
+                    case EbtUInt:   newOp = EOpConvUIntToInt;  break;
+                    case EbtBool:   newOp = EOpConvBoolToInt;  break;
+                    case EbtFloat:  newOp = EOpConvFloatToInt; break;
+                    default:
+                        infoSink.info.message(EPrefixInternalError, node->getLine(), "Bad promotion node");
+                        return 0;
+                }
+                break;
+            case EbtUInt:
+                switch (node->getBasicType()) {
+                    case EbtInt:    newOp = EOpConvIntToUInt;   break;
+                    case EbtBool:   newOp = EOpConvBoolToUInt;  break;
+                    case EbtFloat:  newOp = EOpConvFloatToUInt; break;
+                    default:
+                        infoSink.info.message(EPrefixInternalError, node->getLine(), "Bad promotion node");
+                        return 0;
+                }
+                break;
+            default:
+                infoSink.info.message(EPrefixInternalError, node->getLine(), "Bad promotion type");
+                return 0;
+        }
+
+        TType type(promoteTo, node->getPrecision(), EvqTemporary, node->getNominalSize(), node->getSecondarySize(), node->isArray());
+        newNode = new TIntermUnary(newOp, type);
+        newNode->setLine(node->getLine());
+        newNode->setOperand(node);
+
+        return newNode;
+    }
+}
+
+//
 // Safe way to combine two nodes into an aggregate.  Works with null pointers,
 // a node that's not a aggregate yet, etc.
 //
 // Returns the resulting aggregate, unless 0 was passed in for
 // both existing nodes.
 //
 TIntermAggregate* TIntermediate::growAggregate(TIntermNode* left, TIntermNode* right, const TSourceLoc& line)
 {
@@ -431,19 +635,28 @@ TIntermTyped* TIntermediate::addComma(TI
 // For "?:" test nodes.  There are three children; a condition,
 // a true path, and a false path.  The two paths are specified
 // as separate parameters.
 //
 // Returns the selection node created, or 0 if one could not be.
 //
 TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* trueBlock, TIntermTyped* falseBlock, const TSourceLoc& line)
 {
-    if (trueBlock->getType() != falseBlock->getType())
-    {
-        return 0;
+    //
+    // Get compatible types.
+    //
+    TIntermTyped* child = addConversion(EOpSequence, trueBlock->getType(), falseBlock);
+    if (child)
+        falseBlock = child;
+    else {
+        child = addConversion(EOpSequence, falseBlock->getType(), trueBlock);
+        if (child)
+            trueBlock = child;
+        else
+            return 0;
     }
 
     //
     // See if all the operands are constant, then fold it otherwise not.
     //
 
     if (cond->getAsConstantUnion() && trueBlock->getAsConstantUnion() && falseBlock->getAsConstantUnion()) {
         if (cond->getAsConstantUnion()->getBConst(0))
@@ -825,19 +1038,17 @@ bool TIntermBinary::promote(TInfoSink& i
     {
         infoSink.info.message(EPrefixInternalError, getLine(), "Invalid operation for arrays");
         return false;
     }
 
     // GLSL ES 2.0 does not support implicit type casting.
     // So the basic type should always match.
     if (left->getBasicType() != right->getBasicType())
-    {
         return false;
-    }
 
     //
     // Base assumption:  just make the type the same as the left
     // operand.  Then only deviations from this need be coded.
     //
     setType(left->getType());
 
     // The result gets promoted to the highest precision.
@@ -1508,16 +1719,114 @@ TIntermTyped* TIntermConstantUnion::fold
             }
         }
         newNode = new TIntermConstantUnion(tempConstArray, getType());
         newNode->setLine(getLine());
         return newNode;
     }
 }
 
+TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermConstantUnion* node)
+{
+    size_t size = node->getType().getObjectSize();
+
+    ConstantUnion *leftUnionArray = new ConstantUnion[size];
+
+    for (size_t i=0; i < size; i++) {
+
+        switch (promoteTo) {
+            case EbtFloat:
+                switch (node->getType().getBasicType()) {
+                    case EbtInt:
+                        leftUnionArray[i].setFConst(static_cast<float>(node->getIConst(i)));
+                        break;
+                    case EbtUInt:
+                        leftUnionArray[i].setFConst(static_cast<float>(node->getUConst(i)));
+                        break;
+                    case EbtBool:
+                        leftUnionArray[i].setFConst(static_cast<float>(node->getBConst(i)));
+                        break;
+                    case EbtFloat:
+                        leftUnionArray[i].setFConst(static_cast<float>(node->getFConst(i)));
+                        break;
+                    default:
+                        infoSink.info.message(EPrefixInternalError, node->getLine(), "Cannot promote");
+                        return 0;
+                }
+                break;
+            case EbtInt:
+                switch (node->getType().getBasicType()) {
+                    case EbtInt:
+                        leftUnionArray[i].setIConst(static_cast<int>(node->getIConst(i)));
+                        break;
+                    case EbtUInt:
+                        leftUnionArray[i].setIConst(static_cast<int>(node->getUConst(i)));
+                        break;
+                    case EbtBool:
+                        leftUnionArray[i].setIConst(static_cast<int>(node->getBConst(i)));
+                        break;
+                    case EbtFloat:
+                        leftUnionArray[i].setIConst(static_cast<int>(node->getFConst(i)));
+                        break;
+                    default:
+                        infoSink.info.message(EPrefixInternalError, node->getLine(), "Cannot promote");
+                        return 0;
+                }
+                break;
+            case EbtUInt:
+                switch (node->getType().getBasicType()) {
+                    case EbtInt:
+                        leftUnionArray[i].setUConst(static_cast<unsigned int>(node->getIConst(i)));
+                        break;
+                    case EbtUInt:
+                        leftUnionArray[i].setUConst(static_cast<unsigned int>(node->getUConst(i)));
+                        break;
+                    case EbtBool:
+                        leftUnionArray[i].setUConst(static_cast<unsigned int>(node->getBConst(i)));
+                        break;
+                    case EbtFloat:
+                        leftUnionArray[i].setUConst(static_cast<unsigned int>(node->getFConst(i)));
+                        break;
+                    default:
+                        infoSink.info.message(EPrefixInternalError, node->getLine(), "Cannot promote");
+                        return 0;
+                }
+                break;
+            case EbtBool:
+                switch (node->getType().getBasicType()) {
+                    case EbtInt:
+                        leftUnionArray[i].setBConst(node->getIConst(i) != 0);
+                        break;
+                    case EbtUInt:
+                        leftUnionArray[i].setBConst(node->getUConst(i) != 0);
+                        break;
+                    case EbtBool:
+                        leftUnionArray[i].setBConst(node->getBConst(i));
+                        break;
+                    case EbtFloat:
+                        leftUnionArray[i].setBConst(node->getFConst(i) != 0.0f);
+                        break;
+                    default:
+                        infoSink.info.message(EPrefixInternalError, node->getLine(), "Cannot promote");
+                        return 0;
+                }
+
+                break;
+            default:
+                infoSink.info.message(EPrefixInternalError, node->getLine(), "Incorrect data type found");
+                return 0;
+        }
+
+    }
+
+    const TType& t = node->getType();
+
+    return addConstantUnion(leftUnionArray, TType(promoteTo, t.getPrecision(), t.getQualifier(), t.getNominalSize(), t.getSecondarySize(), t.isArray()), node->getLine());
+}
+
 // static
 TString TIntermTraverser::hash(const TString& name, ShHashFunction64 hashFunction)
 {
     if (hashFunction == NULL || name.empty())
         return name;
     khronos_uint64_t number = (*hashFunction)(name.c_str(), name.length());
     TStringStream stream;
     stream << HASHED_NAME_PREFIX << std::hex << number;
--- a/gfx/angle/src/compiler/translator/OutputGLSLBase.cpp
+++ b/gfx/angle/src/compiler/translator/OutputGLSLBase.cpp
@@ -1,10 +1,10 @@
 //
-// Copyright (c) 2002-2014 The ANGLE Project Authors. All rights reserved.
+// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 
 #include "compiler/translator/OutputGLSLBase.h"
 #include "compiler/translator/compilerdebug.h"
 
 #include <cfloat>
@@ -50,16 +50,18 @@ TOutputGLSLBase::TOutputGLSLBase(TInfoSi
       mObjSink(objSink),
       mDeclaringVariables(false),
       mClampingStrategy(clampingStrategy),
       mHashFunction(hashFunction),
       mNameMap(nameMap),
       mSymbolTable(symbolTable),
       mShaderVersion(shaderVersion)
 {
+    // Set up global scope.
+    mDeclaredStructs.push_back(ScopedDeclaredStructs());
 }
 
 void TOutputGLSLBase::writeTriplet(
     Visit visit, const char *preStr, const char *inStr, const char *postStr)
 {
     TInfoSinkBase &out = objSink();
     if (visit == PreVisit && preStr)
         out << preStr;
@@ -82,24 +84,18 @@ void TOutputGLSLBase::writeVariableType(
     TInfoSinkBase &out = objSink();
     TQualifier qualifier = type.getQualifier();
     // TODO(alokp): Validate qualifier for variable declarations.
     if (qualifier != EvqTemporary && qualifier != EvqGlobal)
         out << type.getQualifierString() << " ";
     // Declare the struct if we have not done so already.
     if (type.getBasicType() == EbtStruct && !structDeclared(type.getStruct()))
     {
-        TStructure *structure = type.getStruct();
-
-        declareStruct(structure);
-
-        if (!structure->name().empty())
-        {
-            mDeclaredStructs.insert(structure->uniqueId());
-        }
+        declareStruct(type.getStruct());
+        mDeclaredStructs[mDeclaredStructs.size() - 1].push_back(type.getStruct());
     }
     else
     {
         if (writeVariablePrecision(type.getPrecision()))
             out << " ";
         out << getTypeName(type);
     }
 }
@@ -397,16 +393,77 @@ bool TOutputGLSLBase::visitUnary(Visit v
       case EOpVectorLogicalNot: preString = "not("; break;
       case EOpLogicalNot: preString = "(!"; break;
 
       case EOpPostIncrement: preString = "("; postString = "++)"; break;
       case EOpPostDecrement: preString = "("; postString = "--)"; break;
       case EOpPreIncrement: preString = "(++"; break;
       case EOpPreDecrement: preString = "(--"; break;
 
+      case EOpConvIntToBool:
+      case EOpConvFloatToBool:
+        switch (node->getOperand()->getType().getNominalSize())
+        {
+          case 1:
+            preString =  "bool(";
+            break;
+          case 2:
+            preString = "bvec2(";
+            break;
+          case 3:
+            preString = "bvec3(";
+            break;
+          case 4:
+            preString = "bvec4(";
+            break;
+          default:
+            UNREACHABLE();
+        }
+        break;
+      case EOpConvBoolToFloat:
+      case EOpConvIntToFloat:
+        switch (node->getOperand()->getType().getNominalSize())
+        {
+          case 1:
+            preString = "float(";
+            break;
+          case 2:
+            preString = "vec2(";
+            break;
+          case 3:
+            preString = "vec3(";
+            break;
+          case 4:
+            preString = "vec4(";
+            break;
+          default:
+            UNREACHABLE();
+        }
+        break;
+      case EOpConvFloatToInt:
+      case EOpConvBoolToInt:
+        switch (node->getOperand()->getType().getNominalSize())
+        {
+          case 1:
+            preString = "int(";
+            break;
+          case 2:
+            preString = "ivec2(";
+            break;
+          case 3:
+            preString = "ivec3(";
+            break;
+          case 4:
+            preString = "ivec4(";
+            break;
+          default:
+            UNREACHABLE();
+        }
+        break;
+
       case EOpRadians:
         preString = "radians(";
         break;
       case EOpDegrees:
         preString = "degrees(";
         break;
       case EOpSin:
         preString = "sin(";
@@ -542,16 +599,17 @@ bool TOutputGLSLBase::visitAggregate(Vis
     bool useEmulatedFunction = (visit == PreVisit && node->getUseEmulatedFunction());
     switch (node->getOp())
     {
       case EOpSequence:
         // Scope the sequences except when at the global scope.
         if (depth > 0)
         {
             out << "{\n";
+            pushDeclaredStructsScope();
         }
 
         incrementDepth(node);
         for (TIntermSequence::const_iterator iter = node->getSequence().begin();
              iter != node->getSequence().end(); ++iter)
         {
             TIntermNode *node = *iter;
             ASSERT(node != NULL);
@@ -560,16 +618,17 @@ bool TOutputGLSLBase::visitAggregate(Vis
             if (isSingleStatement(node))
                 out << ";\n";
         }
         decrementDepth();
 
         // Scope the sequences except when at the global scope.
         if (depth > 0)
         {
+            popDeclaredStructsScope();
             out << "}\n";
         }
         visitChildren = false;
         break;
       case EOpPrototype:
         // Function declaration.
         ASSERT(visit == PreVisit);
         writeVariableType(node->getType());
@@ -971,22 +1030,27 @@ TString TOutputGLSLBase::hashFunctionNam
     if (mSymbolTable.findBuiltIn(mangled_name, mShaderVersion) != NULL || name == "main")
         return translateTextureFunction(name);
     return hashName(name);
 }
 
 bool TOutputGLSLBase::structDeclared(const TStructure *structure) const
 {
     ASSERT(structure);
-    if (structure->name().empty())
+    ASSERT(mDeclaredStructs.size() > 0);
+    for (size_t ii = mDeclaredStructs.size(); ii > 0; --ii)
     {
-        return false;
+        const ScopedDeclaredStructs &scope = mDeclaredStructs[ii - 1];
+        for (size_t jj = 0; jj < scope.size(); ++jj)
+        {
+            if (scope[jj]->equals(*structure))
+                return true;
+        }
     }
-
-    return (mDeclaredStructs.count(structure->uniqueId()) > 0);
+    return false;
 }
 
 void TOutputGLSLBase::declareStruct(const TStructure *structure)
 {
     TInfoSinkBase &out = objSink();
 
     out << "struct " << hashName(structure->name()) << "{\n";
     const TFieldList &fields = structure->fields();
@@ -998,8 +1062,19 @@ void TOutputGLSLBase::declareStruct(cons
         out << getTypeName(*field->type()) << " " << hashName(field->name());
         if (field->type()->isArray())
             out << arrayBrackets(*field->type());
         out << ";\n";
     }
     out << "}";
 }
 
+void TOutputGLSLBase::pushDeclaredStructsScope()
+{
+    mDeclaredStructs.push_back(ScopedDeclaredStructs());
+}
+
+void TOutputGLSLBase::popDeclaredStructsScope()
+{
+    // We should never pop the global scope.
+    ASSERT(mDeclaredStructs.size() >= 2);
+    mDeclaredStructs.pop_back();
+}
--- a/gfx/angle/src/compiler/translator/OutputGLSLBase.h
+++ b/gfx/angle/src/compiler/translator/OutputGLSLBase.h
@@ -2,17 +2,17 @@
 // Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 
 #ifndef CROSSCOMPILERGLSL_OUTPUTGLSLBASE_H_
 #define CROSSCOMPILERGLSL_OUTPUTGLSLBASE_H_
 
-#include <set>
+#include <vector>
 
 #include "compiler/translator/intermediate.h"
 #include "compiler/translator/LoopInfo.h"
 #include "compiler/translator/ParseContext.h"
 
 class TOutputGLSLBase : public TIntermTraverser
 {
   public:
@@ -51,24 +51,32 @@ class TOutputGLSLBase : public TIntermTr
     // Same as hashName(), but without hashing built-in functions.
     TString hashFunctionName(const TString &mangled_name);
     // Used to translate function names for differences between ESSL and GLSL
     virtual TString translateTextureFunction(TString &name) { return name; }
 
   private:
     bool structDeclared(const TStructure *structure) const;
     void declareStruct(const TStructure *structure);
+    void pushDeclaredStructsScope();
+    void popDeclaredStructsScope();
 
     void writeBuiltInFunctionTriplet(Visit visit, const char *preStr, bool useEmulatedFunction);
 
     TInfoSinkBase &mObjSink;
     bool mDeclaringVariables;
 
-    // This set contains all the ids of the structs from every scope.
-    std::set<int> mDeclaredStructs;
+    // Structs are declared as the tree is traversed. This list contains all
+    // the structs already declared within a scope. It is maintained so that
+    // a struct is declared only once within a scope.
+    typedef std::vector<TStructure *> ScopedDeclaredStructs;
+    // This vector contains all the structs from the global scope to the
+    // current scope.  When the traverser exits a scope, the scope is discarded. 
+    typedef std::vector<ScopedDeclaredStructs> DeclaredStructs;
+    DeclaredStructs mDeclaredStructs;
 
     // Stack of loops that need to be unrolled.
     TLoopStack mLoopUnrollStack;
 
     ShArrayIndexClampingStrategy mClampingStrategy;
 
     // name hashing.
     ShHashFunction64 mHashFunction;
--- a/gfx/angle/src/compiler/translator/OutputHLSL.cpp
+++ b/gfx/angle/src/compiler/translator/OutputHLSL.cpp
@@ -12,20 +12,16 @@
 #include "compiler/translator/compilerdebug.h"
 #include "compiler/translator/InfoSink.h"
 #include "compiler/translator/DetectDiscontinuity.h"
 #include "compiler/translator/SearchSymbol.h"
 #include "compiler/translator/UnfoldShortCircuit.h"
 #include "compiler/translator/FlagStd140Structs.h"
 #include "compiler/translator/NodeSearch.h"
 #include "compiler/translator/RewriteElseBlocks.h"
-#include "compiler/translator/UtilsHLSL.h"
-#include "compiler/translator/util.h"
-#include "compiler/translator/UniformHLSL.h"
-#include "compiler/translator/StructureHLSL.h"
 
 #include <algorithm>
 #include <cfloat>
 #include <stdio.h>
 
 namespace sh
 {
 
@@ -68,16 +64,28 @@ TString OutputHLSL::TextureFunction::nam
       case FETCH:    name += "Fetch"; break;
       case GRAD:     name += "Grad";  break;
       default: UNREACHABLE();
     }
 
     return name + "(";
 }
 
+const char *RegisterPrefix(const TType &type)
+{
+    if (IsSampler(type.getBasicType()))
+    {
+        return "s";
+    }
+    else
+    {
+        return "c";
+    }
+}
+
 bool OutputHLSL::TextureFunction::operator<(const TextureFunction &rhs) const
 {
     if (sampler < rhs.sampler) return true;
     if (sampler > rhs.sampler) return false;
 
     if (coords < rhs.coords)   return true;
     if (coords > rhs.coords)   return false;
 
@@ -123,51 +131,51 @@ OutputHLSL::OutputHLSL(TParseContext &co
     mUsesAtan2_2 = false;
     mUsesAtan2_3 = false;
     mUsesAtan2_4 = false;
     mUsesDiscardRewriting = false;
     mUsesNestedBreak = false;
 
     mNumRenderTargets = resources.EXT_draw_buffers ? resources.MaxDrawBuffers : 1;
 
+    mScopeDepth = 0;
+
     mUniqueIndex = 0;
 
     mContainsLoopDiscontinuity = false;
     mOutputLod0Function = false;
     mInsideDiscontinuousLoop = false;
     mNestedLoopDepth = 0;
 
     mExcessiveLoopIndex = NULL;
 
-    mStructureHLSL = new StructureHLSL;
-    mUniformHLSL = new UniformHLSL(mStructureHLSL, mOutputType);
-
     if (mOutputType == SH_HLSL9_OUTPUT)
     {
         if (mContext.shaderType == SH_FRAGMENT_SHADER)
         {
-            // Reserve registers for dx_DepthRange, dx_ViewCoords and dx_DepthFront
-            mUniformHLSL->reserveUniformRegisters(3);
+            mUniformRegister = 3;   // Reserve registers for dx_DepthRange, dx_ViewCoords and dx_DepthFront
         }
         else
         {
-            // Reserve registers for dx_DepthRange and dx_ViewAdjust
-            mUniformHLSL->reserveUniformRegisters(2);
+            mUniformRegister = 2;   // Reserve registers for dx_DepthRange and dx_ViewAdjust
         }
     }
-
-    // Reserve registers for the default uniform block and driver constants
-    mUniformHLSL->reserveInterfaceBlockRegisters(2);
+    else
+    {
+        mUniformRegister = 0;
+    }
+
+    mSamplerRegister = 0;
+    mInterfaceBlockRegister = 2; // Reserve registers for the default uniform block and driver constants
+    mPaddingCounter = 0;
 }
 
 OutputHLSL::~OutputHLSL()
 {
-    SafeDelete(mUnfoldShortCircuit);
-    SafeDelete(mStructureHLSL);
-    SafeDelete(mUniformHLSL);
+    delete mUnfoldShortCircuit;
 }
 
 void OutputHLSL::output()
 {
     mContainsLoopDiscontinuity = mContext.shaderType == SH_FRAGMENT_SHADER && containsLoopDiscontinuity(mContext.treeRoot);
     const std::vector<TIntermTyped*> &flaggedStructs = FlagStd140ValueStructs(mContext.treeRoot);
     makeFlaggedStructMaps(flaggedStructs);
 
@@ -207,49 +215,310 @@ void OutputHLSL::makeFlaggedStructMaps(c
     }
 }
 
 TInfoSinkBase &OutputHLSL::getBodyStream()
 {
     return mBody;
 }
 
-const std::vector<sh::Uniform> &OutputHLSL::getUniforms()
+const std::vector<gl::Uniform> &OutputHLSL::getUniforms()
 {
-    return mUniformHLSL->getUniforms();
+    return mActiveUniforms;
 }
 
-const std::vector<sh::InterfaceBlock> &OutputHLSL::getInterfaceBlocks() const
+const std::vector<gl::InterfaceBlock> &OutputHLSL::getInterfaceBlocks() const
 {
-    return mUniformHLSL->getInterfaceBlocks();
+    return mActiveInterfaceBlocks;
 }
 
-const std::vector<sh::Attribute> &OutputHLSL::getOutputVariables() const
+const std::vector<gl::Attribute> &OutputHLSL::getOutputVariables() const
 {
     return mActiveOutputVariables;
 }
 
-const std::vector<sh::Attribute> &OutputHLSL::getAttributes() const
+const std::vector<gl::Attribute> &OutputHLSL::getAttributes() const
 {
     return mActiveAttributes;
 }
 
-const std::vector<sh::Varying> &OutputHLSL::getVaryings() const
+const std::vector<gl::Varying> &OutputHLSL::getVaryings() const
 {
     return mActiveVaryings;
 }
 
 int OutputHLSL::vectorSize(const TType &type) const
 {
     int elementSize = type.isMatrix() ? type.getCols() : 1;
     int arraySize = type.isArray() ? type.getArraySize() : 1;
 
     return elementSize * arraySize;
 }
 
+TString OutputHLSL::interfaceBlockFieldString(const TInterfaceBlock &interfaceBlock, const TField &field)
+{
+    if (interfaceBlock.hasInstanceName())
+    {
+        return interfaceBlock.name() + "." + field.name();
+    }
+    else
+    {
+        return field.name();
+    }
+}
+
+TString OutputHLSL::decoratePrivate(const TString &privateText)
+{
+    return "dx_" + privateText;
+}
+
+TString OutputHLSL::interfaceBlockStructNameString(const TInterfaceBlock &interfaceBlock)
+{
+    return decoratePrivate(interfaceBlock.name()) + "_type";
+}
+
+TString OutputHLSL::interfaceBlockInstanceString(const TInterfaceBlock& interfaceBlock, unsigned int arrayIndex)
+{
+    if (!interfaceBlock.hasInstanceName())
+    {
+        return "";
+    }
+    else if (interfaceBlock.isArray())
+    {
+        return decoratePrivate(interfaceBlock.instanceName()) + "_" + str(arrayIndex);
+    }
+    else
+    {
+        return decorate(interfaceBlock.instanceName());
+    }
+}
+
+TString OutputHLSL::interfaceBlockFieldTypeString(const TField &field, TLayoutBlockStorage blockStorage)
+{
+    const TType &fieldType = *field.type();
+    const TLayoutMatrixPacking matrixPacking = fieldType.getLayoutQualifier().matrixPacking;
+    ASSERT(matrixPacking != EmpUnspecified);
+
+    if (fieldType.isMatrix())
+    {
+        // Use HLSL row-major packing for GLSL column-major matrices
+        const TString &matrixPackString = (matrixPacking == EmpRowMajor ? "column_major" : "row_major");
+        return matrixPackString + " " + typeString(fieldType);
+    }
+    else if (fieldType.getStruct())
+    {
+        // Use HLSL row-major packing for GLSL column-major matrices
+        return structureTypeName(*fieldType.getStruct(), matrixPacking == EmpColumnMajor, blockStorage == EbsStd140);
+    }
+    else
+    {
+        return typeString(fieldType);
+    }
+}
+
+TString OutputHLSL::interfaceBlockFieldString(const TInterfaceBlock &interfaceBlock, TLayoutBlockStorage blockStorage)
+{
+    TString hlsl;
+
+    int elementIndex = 0;
+
+    for (unsigned int typeIndex = 0; typeIndex < interfaceBlock.fields().size(); typeIndex++)
+    {
+        const TField &field = *interfaceBlock.fields()[typeIndex];
+        const TType &fieldType = *field.type();
+
+        if (blockStorage == EbsStd140)
+        {
+            // 2 and 3 component vector types in some cases need pre-padding
+            hlsl += std140PrePaddingString(fieldType, &elementIndex);
+        }
+
+        hlsl += "    " + interfaceBlockFieldTypeString(field, blockStorage) +
+                " " + decorate(field.name()) + arrayString(fieldType) + ";\n";
+
+        // must pad out after matrices and arrays, where HLSL usually allows itself room to pack stuff
+        if (blockStorage == EbsStd140)
+        {
+            const bool useHLSLRowMajorPacking = (fieldType.getLayoutQualifier().matrixPacking == EmpColumnMajor);
+            hlsl += std140PostPaddingString(fieldType, useHLSLRowMajorPacking);
+        }
+    }
+
+    return hlsl;
+}
+
+TString OutputHLSL::interfaceBlockStructString(const TInterfaceBlock &interfaceBlock)
+{
+    const TLayoutBlockStorage blockStorage = interfaceBlock.blockStorage();
+
+    return "struct " + interfaceBlockStructNameString(interfaceBlock) + "\n"
+           "{\n" +
+           interfaceBlockFieldString(interfaceBlock, blockStorage) +
+           "};\n\n";
+}
+
+TString OutputHLSL::interfaceBlockString(const TInterfaceBlock &interfaceBlock, unsigned int registerIndex, unsigned int arrayIndex)
+{
+    const TString &arrayIndexString =  (arrayIndex != GL_INVALID_INDEX ? decorate(str(arrayIndex)) : "");
+    const TString &blockName = interfaceBlock.name() + arrayIndexString;
+    TString hlsl;
+
+    hlsl += "cbuffer " + blockName + " : register(b" + str(registerIndex) + ")\n"
+            "{\n";
+
+    if (interfaceBlock.hasInstanceName())
+    {
+        hlsl += "    " + interfaceBlockStructNameString(interfaceBlock) + " " + interfaceBlockInstanceString(interfaceBlock, arrayIndex) + ";\n";
+    }
+    else
+    {
+        const TLayoutBlockStorage blockStorage = interfaceBlock.blockStorage();
+        hlsl += interfaceBlockFieldString(interfaceBlock, blockStorage);
+    }
+
+    hlsl += "};\n\n";
+
+    return hlsl;
+}
+
+TString OutputHLSL::std140PrePaddingString(const TType &type, int *elementIndex)
+{
+    if (type.getBasicType() == EbtStruct || type.isMatrix() || type.isArray())
+    {
+        // no padding needed, HLSL will align the field to a new register
+        *elementIndex = 0;
+        return "";
+    }
+
+    const GLenum glType = glVariableType(type);
+    const int numComponents = gl::UniformComponentCount(glType);
+
+    if (numComponents >= 4)
+    {
+        // no padding needed, HLSL will align the field to a new register
+        *elementIndex = 0;
+        return "";
+    }
+
+    if (*elementIndex + numComponents > 4)
+    {
+        // no padding needed, HLSL will align the field to a new register
+        *elementIndex = numComponents;
+        return "";
+    }
+
+    TString padding;
+
+    const int alignment = numComponents == 3 ? 4 : numComponents;
+    const int paddingOffset = (*elementIndex % alignment);
+
+    if (paddingOffset != 0)
+    {
+        // padding is neccessary
+        for (int paddingIndex = paddingOffset; paddingIndex < alignment; paddingIndex++)
+        {
+            padding += "    float pad_" + str(mPaddingCounter++) + ";\n";
+        }
+
+        *elementIndex += (alignment - paddingOffset);
+    }
+
+    *elementIndex += numComponents;
+    *elementIndex %= 4;
+
+    return padding;
+}
+
+TString OutputHLSL::std140PostPaddingString(const TType &type, bool useHLSLRowMajorPacking)
+{
+    if (!type.isMatrix() && !type.isArray() && type.getBasicType() != EbtStruct)
+    {
+        return "";
+    }
+
+    int numComponents = 0;
+
+    if (type.isMatrix())
+    {
+        // This method can also be called from structureString, which does not use layout qualifiers.
+        // Thus, use the method parameter for determining the matrix packing.
+        //
+        // Note HLSL row major packing corresponds to GL API column-major, and vice-versa, since we
+        // wish to always transpose GL matrices to play well with HLSL's matrix array indexing.
+        //
+        const bool isRowMajorMatrix = !useHLSLRowMajorPacking;
+        const GLenum glType = glVariableType(type);
+        numComponents = gl::MatrixComponentCount(glType, isRowMajorMatrix);
+    }
+    else if (type.getStruct())
+    {
+        const TString &structName = structureTypeName(*type.getStruct(), useHLSLRowMajorPacking, true);
+        numComponents = mStd140StructElementIndexes[structName];
+
+        if (numComponents == 0)
+        {
+            return "";
+        }
+    }
+    else
+    {
+        const GLenum glType = glVariableType(type);
+        numComponents = gl::UniformComponentCount(glType);
+    }
+
+    TString padding;
+    for (int paddingOffset = numComponents; paddingOffset < 4; paddingOffset++)
+    {
+        padding += "    float pad_" + str(mPaddingCounter++) + ";\n";
+    }
+    return padding;
+}
+
+// Use the same layout for packed and shared
+void setBlockLayout(gl::InterfaceBlock *interfaceBlock, gl::BlockLayoutType newLayout)
+{
+    interfaceBlock->layout = newLayout;
+    interfaceBlock->blockInfo.clear();
+
+    switch (newLayout)
+    {
+      case gl::BLOCKLAYOUT_SHARED:
+      case gl::BLOCKLAYOUT_PACKED:
+        {
+            gl::HLSLBlockEncoder hlslEncoder(&interfaceBlock->blockInfo, gl::HLSLBlockEncoder::ENCODE_PACKED);
+            hlslEncoder.encodeInterfaceBlockFields(interfaceBlock->fields);
+            interfaceBlock->dataSize = hlslEncoder.getBlockSize();
+        }
+        break;
+
+      case gl::BLOCKLAYOUT_STANDARD:
+        {
+            gl::Std140BlockEncoder stdEncoder(&interfaceBlock->blockInfo);
+            stdEncoder.encodeInterfaceBlockFields(interfaceBlock->fields);
+            interfaceBlock->dataSize = stdEncoder.getBlockSize();
+        }
+        break;
+
+      default:
+        UNREACHABLE();
+        break;
+    }
+}
+
+gl::BlockLayoutType convertBlockLayoutType(TLayoutBlockStorage blockStorage)
+{
+    switch (blockStorage)
+    {
+      case EbsPacked: return gl::BLOCKLAYOUT_PACKED;
+      case EbsShared: return gl::BLOCKLAYOUT_SHARED;
+      case EbsStd140: return gl::BLOCKLAYOUT_STANDARD;
+      default: UNREACHABLE(); return gl::BLOCKLAYOUT_SHARED;
+    }
+}
+
 TString OutputHLSL::structInitializerString(int indent, const TStructure &structure, const TString &rhsStructName)
 {
     TString init;
 
     TString preIndentString;
     TString fullIndentString;
 
     for (int spaces = 0; spaces < (indent * 4); spaces++)
@@ -263,17 +532,17 @@ TString OutputHLSL::structInitializerStr
     }
 
     init += preIndentString + "{\n";
 
     const TFieldList &fields = structure.fields();
     for (unsigned int fieldIndex = 0; fieldIndex < fields.size(); fieldIndex++)
     {
         const TField &field = *fields[fieldIndex];
-        const TString &fieldName = rhsStructName + "." + Decorate(field.name());
+        const TString &fieldName = rhsStructName + "." + decorate(field.name());
         const TType &fieldType = *field.type();
 
         if (fieldType.getStruct())
         {
             init += structInitializerString(indent + 1, *fieldType.getStruct(), fieldName);
         }
         else
         {
@@ -285,60 +554,139 @@ TString OutputHLSL::structInitializerStr
 
     return init;
 }
 
 void OutputHLSL::header()
 {
     TInfoSinkBase &out = mHeader;
 
+    TString uniforms;
+    TString interfaceBlocks;
     TString varyings;
     TString attributes;
     TString flaggedStructs;
 
+    for (ReferencedSymbols::const_iterator uniformIt = mReferencedUniforms.begin(); uniformIt != mReferencedUniforms.end(); uniformIt++)
+    {
+        const TIntermSymbol &uniform = *uniformIt->second;
+        const TType &type = uniform.getType();
+        const TString &name = uniform.getSymbol();
+
+        int registerIndex = declareUniformAndAssignRegister(type, name);
+
+        if (mOutputType == SH_HLSL11_OUTPUT && IsSampler(type.getBasicType()))   // Also declare the texture
+        {
+            uniforms += "uniform " + samplerString(type) + " sampler_" + decorateUniform(name, type) + arrayString(type) + 
+                        " : register(s" + str(registerIndex) + ");\n";
+
+            uniforms += "uniform " + textureString(type) + " texture_" + decorateUniform(name, type) + arrayString(type) +
+                        " : register(t" + str(registerIndex) + ");\n";
+        }
+        else
+        {
+            const TStructure *structure = type.getStruct();
+            const TString &typeName = (structure ? structureTypeName(*structure, false, false) : typeString(type));
+
+            const TString &registerString = TString("register(") + RegisterPrefix(type) + str(registerIndex) + ")";
+
+            uniforms += "uniform " + typeName + " " + decorateUniform(name, type) + arrayString(type) + " : " + registerString + ";\n";
+        }
+    }
+
+    for (ReferencedSymbols::const_iterator interfaceBlockIt = mReferencedInterfaceBlocks.begin(); interfaceBlockIt != mReferencedInterfaceBlocks.end(); interfaceBlockIt++)
+    {
+        const TType &nodeType = interfaceBlockIt->second->getType();
+        const TInterfaceBlock &interfaceBlock = *nodeType.getInterfaceBlock();
+        const TFieldList &fieldList = interfaceBlock.fields();
+
+        unsigned int arraySize = static_cast<unsigned int>(interfaceBlock.arraySize());
+        gl::InterfaceBlock activeBlock(interfaceBlock.name().c_str(), arraySize, mInterfaceBlockRegister);
+        for (unsigned int typeIndex = 0; typeIndex < fieldList.size(); typeIndex++)
+        {
+            const TField &field = *fieldList[typeIndex];
+            const TString &fullUniformName = interfaceBlockFieldString(interfaceBlock, field);
+            declareInterfaceBlockField(*field.type(), fullUniformName, activeBlock.fields);
+        }
+
+        mInterfaceBlockRegister += std::max(1u, arraySize);
+
+        gl::BlockLayoutType blockLayoutType = convertBlockLayoutType(interfaceBlock.blockStorage());
+        setBlockLayout(&activeBlock, blockLayoutType);
+
+        if (interfaceBlock.matrixPacking() == EmpRowMajor)
+        {
+            activeBlock.isRowMajorLayout = true;
+        }
+
+        mActiveInterfaceBlocks.push_back(activeBlock);
+
+        if (interfaceBlock.hasInstanceName())
+        {
+            interfaceBlocks += interfaceBlockStructString(interfaceBlock);
+        }
+
+        if (arraySize > 0)
+        {
+            for (unsigned int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++)
+            {
+                interfaceBlocks += interfaceBlockString(interfaceBlock, activeBlock.registerIndex + arrayIndex, arrayIndex);
+            }
+        }
+        else
+        {
+            interfaceBlocks += interfaceBlockString(interfaceBlock, activeBlock.registerIndex, GL_INVALID_INDEX);
+        }
+    }
+
     for (std::map<TIntermTyped*, TString>::const_iterator flaggedStructIt = mFlaggedStructMappedNames.begin(); flaggedStructIt != mFlaggedStructMappedNames.end(); flaggedStructIt++)
     {
         TIntermTyped *structNode = flaggedStructIt->first;
         const TString &mappedName = flaggedStructIt->second;
         const TStructure &structure = *structNode->getType().getStruct();
         const TString &originalName = mFlaggedStructOriginalNames[structNode];
 
-        flaggedStructs += "static " + Decorate(structure.name()) + " " + mappedName + " =\n";
+        flaggedStructs += "static " + decorate(structure.name()) + " " + mappedName + " =\n";
         flaggedStructs += structInitializerString(0, structure, originalName);
         flaggedStructs += "\n";
     }
 
     for (ReferencedSymbols::const_iterator varying = mReferencedVaryings.begin(); varying != mReferencedVaryings.end(); varying++)
     {
         const TType &type = varying->second->getType();
         const TString &name = varying->second->getSymbol();
 
         // Program linking depends on this exact format
-        varyings += "static " + InterpolationString(type.getQualifier()) + " " + TypeString(type) + " " +
-                    Decorate(name) + ArrayString(type) + " = " + initializer(type) + ";\n";
+        varyings += "static " + interpolationString(type.getQualifier()) + " " + typeString(type) + " " +
+                    decorate(name) + arrayString(type) + " = " + initializer(type) + ";\n";
 
         declareVaryingToList(type, type.getQualifier(), name, mActiveVaryings);
     }
 
     for (ReferencedSymbols::const_iterator attribute = mReferencedAttributes.begin(); attribute != mReferencedAttributes.end(); attribute++)
     {
         const TType &type = attribute->second->getType();
         const TString &name = attribute->second->getSymbol();
 
-        attributes += "static " + TypeString(type) + " " + Decorate(name) + ArrayString(type) + " = " + initializer(type) + ";\n";
-
-        sh::Attribute attributeVar(GLVariableType(type), GLVariablePrecision(type), name.c_str(),
+        attributes += "static " + typeString(type) + " " + decorate(name) + arrayString(type) + " = " + initializer(type) + ";\n";
+
+        gl::Attribute attributeVar(glVariableType(type), glVariablePrecision(type), name.c_str(),
                                (unsigned int)type.getArraySize(), type.getLayoutQualifier().location);
         mActiveAttributes.push_back(attributeVar);
     }
 
-    out << mStructureHLSL->structsHeader();
-
-    out << mUniformHLSL->uniformsHeader(mOutputType, mReferencedUniforms);
-    out << mUniformHLSL->interfaceBlocksHeader(mReferencedInterfaceBlocks);
+    for (StructDeclarations::iterator structDeclaration = mStructDeclarations.begin(); structDeclaration != mStructDeclarations.end(); structDeclaration++)
+    {
+        out << *structDeclaration;
+    }
+
+    for (Constructors::iterator constructor = mConstructors.begin(); constructor != mConstructors.end(); constructor++)
+    {
+        out << *constructor;
+    }
 
     if (mUsesDiscardRewriting)
     {
         out << "#define ANGLE_USES_DISCARD_REWRITING" << "\n";
     }
 
     if (mUsesNestedBreak)
     {
@@ -357,20 +705,20 @@ void OutputHLSL::header()
         if (mContext.getShaderVersion() >= 300)
         {
             for (ReferencedSymbols::const_iterator outputVariableIt = mReferencedOutputVariables.begin(); outputVariableIt != mReferencedOutputVariables.end(); outputVariableIt++)
             {
                 const TString &variableName = outputVariableIt->first;
                 const TType &variableType = outputVariableIt->second->getType();
                 const TLayoutQualifier &layoutQualifier = variableType.getLayoutQualifier();
 
-                out << "static " + TypeString(variableType) + " out_" + variableName + ArrayString(variableType) +
+                out << "static " + typeString(variableType) + " out_" + variableName + arrayString(variableType) +
                        " = " + initializer(variableType) + ";\n";
 
-                sh::Attribute outputVar(GLVariableType(variableType), GLVariablePrecision(variableType), variableName.c_str(),
+                gl::Attribute outputVar(glVariableType(variableType), glVariablePrecision(variableType), variableName.c_str(),
                                     (unsigned int)variableType.getArraySize(), layoutQualifier.location);
                 mActiveOutputVariables.push_back(outputVar);
             }
         }
         else
         {
             const unsigned int numColorValues = usingMRTExtension ? mNumRenderTargets : 1;
 
@@ -464,23 +812,32 @@ void OutputHLSL::header()
 
         out << "\n";
 
         if (mUsesDepthRange)
         {
             out << "static gl_DepthRangeParameters gl_DepthRange = {dx_DepthRange.x, dx_DepthRange.y, dx_DepthRange.z};\n"
                    "\n";
         }
-
-        if (!flaggedStructs.empty())
+        
+        out <<  uniforms;
+        out << "\n";
+
+        if (!interfaceBlocks.empty())
         {
-            out << "// Std140 Structures accessed by value\n";
+            out << interfaceBlocks;
             out << "\n";
-            out << flaggedStructs;
-            out << "\n";
+
+            if (!flaggedStructs.empty())
+            {
+                out << "// Std140 Structures accessed by value\n";
+                out << "\n";
+                out << flaggedStructs;
+                out << "\n";
+            }
         }
 
         if (usingMRTExtension && mNumRenderTargets > 1)
         {
             out << "#define GL_USES_MRT\n";
         }
 
         if (mUsesFragColor)
@@ -494,17 +851,17 @@ void OutputHLSL::header()
         }
     }
     else   // Vertex shader
     {
         out << "// Attributes\n";
         out <<  attributes;
         out << "\n"
                "static float4 gl_Position = float4(0, 0, 0, 0);\n";
-
+        
         if (mUsesPointSize)
         {
             out << "static float gl_PointSize = float(1);\n";
         }
 
         out << "\n"
                "// Varyings\n";
         out <<  varyings;
@@ -544,22 +901,31 @@ void OutputHLSL::header()
         }
 
         if (mUsesDepthRange)
         {
             out << "static gl_DepthRangeParameters gl_DepthRange = {dx_DepthRange.x, dx_DepthRange.y, dx_DepthRange.z};\n"
                    "\n";
         }
 
-        if (!flaggedStructs.empty())
+        out << uniforms;
+        out << "\n";
+        
+        if (!interfaceBlocks.empty())
         {
-            out << "// Std140 Structures accessed by value\n";
+            out << interfaceBlocks;
             out << "\n";
-            out << flaggedStructs;
-            out << "\n";
+
+            if (!flaggedStructs.empty())
+            {
+                out << "// Std140 Structures accessed by value\n";
+                out << "\n";
+                out << flaggedStructs;
+                out << "\n";
+            }
         }
     }
 
     for (TextureFunctionSet::const_iterator textureFunction = mUsesTexture.begin(); textureFunction != mUsesTexture.end(); textureFunction++)
     {
         // Return type
         if (textureFunction->method == TextureFunction::SIZE)
         {
@@ -1019,17 +1385,17 @@ void OutputHLSL::header()
                 textureFunction->method == TextureFunction::FETCH)
             {
                 switch(hlslCoords)
                 {
                   case 2: out << "int3("; break;
                   case 3: out << "int4("; break;
                   default: UNREACHABLE();
                 }
-
+            
                 // Convert from normalized floating-point to integer
                 if (textureFunction->method != TextureFunction::FETCH)
                 {
                     addressx = "int(floor(width * frac((";
                     addressy = "int(floor(height * frac((";
 
                     if (IsSamplerArray(textureFunction->sampler))
                     {
@@ -1054,17 +1420,17 @@ void OutputHLSL::header()
                   case 2: out << "float2("; break;
                   case 3: out << "float3("; break;
                   case 4: out << "float4("; break;
                   default: UNREACHABLE();
                 }
             }
 
             TString proj = "";   // Only used for projected textures
-
+        
             if (textureFunction->proj)
             {
                 switch(textureFunction->coords)
                 {
                   case 3: proj = " / t.z"; break;
                   case 4: proj = " / t.w"; break;
                   default: UNREACHABLE();
                 }
@@ -1238,17 +1604,17 @@ void OutputHLSL::header()
     if (mUsesMod2f)
     {
         out << "float2 mod(float2 x, float y)\n"
                "{\n"
                "    return x - y * floor(x / y);\n"
                "}\n"
                "\n";
     }
-
+    
     if (mUsesMod3v)
     {
         out << "float3 mod(float3 x, float3 y)\n"
                "{\n"
                "    return x - y * floor(x / y);\n"
                "}\n"
                "\n";
     }
@@ -1418,27 +1784,27 @@ void OutputHLSL::visitSymbol(TIntermSymb
             {
                 mReferencedInterfaceBlocks[interfaceBlock->name()] = node;
             }
             else
             {
                 mReferencedUniforms[name] = node;
             }
 
-            out << DecorateUniform(name, nodeType);
+            out << decorateUniform(name, nodeType);
         }
         else if (qualifier == EvqAttribute || qualifier == EvqVertexIn)
         {
             mReferencedAttributes[name] = node;
-            out << Decorate(name);
+            out << decorate(name);
         }
-        else if (IsVarying(qualifier))
+        else if (isVarying(qualifier))
         {
             mReferencedVaryings[name] = node;
-            out << Decorate(name);
+            out << decorate(name);
         }
         else if (qualifier == EvqFragmentOut)
         {
             mReferencedOutputVariables[name] = node;
             out << "out_" << name;
         }
         else if (qualifier == EvqFragColor)
         {
@@ -1476,17 +1842,17 @@ void OutputHLSL::visitSymbol(TIntermSymb
             out << "gl_Depth";
         }
         else if (qualifier == EvqInternal)
         {
             out << name;
         }
         else
         {
-            out << Decorate(name);
+            out << decorate(name);
         }
     }
 }
 
 bool OutputHLSL::visitBinary(Visit visit, TIntermBinary *node)
 {
     TInfoSinkBase &out = mBody;
 
@@ -1542,51 +1908,53 @@ bool OutputHLSL::visitBinary(Visit visit
         if (visit == PreVisit)
         {
             out << "(";
         }
         else if (visit == InVisit)
         {
             out << " = mul(";
             node->getLeft()->traverse(this);
-            out << ", transpose(";
+            out << ", transpose(";   
         }
         else
         {
             out << ")))";
         }
         break;
       case EOpMatrixTimesMatrixAssign:
         if (visit == PreVisit)
         {
             out << "(";
         }
         else if (visit == InVisit)
         {
             out << " = mul(";
             node->getLeft()->traverse(this);
-            out << ", ";
+            out << ", ";   
         }
         else
         {
             out << "))";
         }
         break;
       case EOpDivAssign:               outputTriplet(visit, "(", " /= ", ")");          break;
       case EOpIndexDirect:
         {
             const TType& leftType = node->getLeft()->getType();
             if (leftType.isInterfaceBlock())
             {
                 if (visit == PreVisit)
                 {
                     TInterfaceBlock* interfaceBlock = leftType.getInterfaceBlock();
                     const int arrayIndex = node->getRight()->getAsConstantUnion()->getIConst(0);
+
                     mReferencedInterfaceBlocks[interfaceBlock->instanceName()] = node->getLeft()->getAsSymbolNode();
-                    out << mUniformHLSL->interfaceBlockInstanceString(*interfaceBlock, arrayIndex);
+                    out << interfaceBlockInstanceString(*interfaceBlock, arrayIndex);
+
                     return false;
                 }
             }
             else
             {
                 outputTriplet(visit, "", "[", "]");
             }
         }
@@ -1597,28 +1965,28 @@ bool OutputHLSL::visitBinary(Visit visit
         outputTriplet(visit, "", "[", "]");
         break;
       case EOpIndexDirectStruct:
         if (visit == InVisit)
         {
             const TStructure* structure = node->getLeft()->getType().getStruct();
             const TIntermConstantUnion* index = node->getRight()->getAsConstantUnion();
             const TField* field = structure->fields()[index->getIConst(0)];
-            out << "." + DecorateField(field->name(), *structure);
+            out << "." + decorateField(field->name(), *structure);
 
             return false;
         }
         break;
       case EOpIndexDirectInterfaceBlock:
         if (visit == InVisit)
         {
             const TInterfaceBlock* interfaceBlock = node->getLeft()->getType().getInterfaceBlock();
             const TIntermConstantUnion* index = node->getRight()->getAsConstantUnion();
             const TField* field = interfaceBlock->fields()[index->getIConst(0)];
-            out << "." + Decorate(field->name());
+            out << "." + decorate(field->name());
 
             return false;
         }
         break;
       case EOpVectorSwizzle:
         if (visit == InVisit)
         {
             out << ".";
@@ -1685,19 +2053,19 @@ bool OutputHLSL::visitBinary(Visit visit
             const TStructure &structure = *node->getLeft()->getType().getStruct();
             const TFieldList &fields = structure.fields();
 
             for (size_t i = 0; i < fields.size(); i++)
             {
                 const TField *field = fields[i];
 
                 node->getLeft()->traverse(this);
-                out << "." + DecorateField(field->name(), structure) + " == ";
+                out << "." + decorateField(field->name(), structure) + " == ";
                 node->getRight()->traverse(this);
-                out << "." + DecorateField(field->name(), structure);
+                out << "." + decorateField(field->name(), structure);
 
                 if (i < fields.size() - 1)
                 {
                     out << " && ";
                 }
             }
 
             out << ")";
@@ -1758,23 +2126,71 @@ bool OutputHLSL::visitBinary(Visit visit
 
     return true;
 }
 
 bool OutputHLSL::visitUnary(Visit visit, TIntermUnary *node)
 {
     switch (node->getOp())
     {
-      case EOpNegative:         outputTriplet(visit, "(-", "", ")");         break;
-      case EOpVectorLogicalNot: outputTriplet(visit, "(!", "", ")");         break;
-      case EOpLogicalNot:       outputTriplet(visit, "(!", "", ")");         break;
-      case EOpPostIncrement:    outputTriplet(visit, "(", "", "++)");        break;
-      case EOpPostDecrement:    outputTriplet(visit, "(", "", "--)");        break;
-      case EOpPreIncrement:     outputTriplet(visit, "(++", "", ")");        break;
-      case EOpPreDecrement:     outputTriplet(visit, "(--", "", ")");        break;
+      case EOpNegative:         outputTriplet(visit, "(-", "", ")");  break;
+      case EOpVectorLogicalNot: outputTriplet(visit, "(!", "", ")");  break;
+      case EOpLogicalNot:       outputTriplet(visit, "(!", "", ")");  break;
+      case EOpPostIncrement:    outputTriplet(visit, "(", "", "++)"); break;
+      case EOpPostDecrement:    outputTriplet(visit, "(", "", "--)"); break;
+      case EOpPreIncrement:     outputTriplet(visit, "(++", "", ")"); break;
+      case EOpPreDecrement:     outputTriplet(visit, "(--", "", ")"); break;
+      case EOpConvIntToBool:
+      case EOpConvUIntToBool:
+      case EOpConvFloatToBool:
+        switch (node->getOperand()->getType().getNominalSize())
+        {
+          case 1:    outputTriplet(visit, "bool(", "", ")");  break;
+          case 2:    outputTriplet(visit, "bool2(", "", ")"); break;
+          case 3:    outputTriplet(visit, "bool3(", "", ")"); break;
+          case 4:    outputTriplet(visit, "bool4(", "", ")"); break;
+          default: UNREACHABLE();
+        }
+        break;
+      case EOpConvBoolToFloat:
+      case EOpConvIntToFloat:
+      case EOpConvUIntToFloat:
+        switch (node->getOperand()->getType().getNominalSize())
+        {
+          case 1:    outputTriplet(visit, "float(", "", ")");  break;
+          case 2:    outputTriplet(visit, "float2(", "", ")"); break;
+          case 3:    outputTriplet(visit, "float3(", "", ")"); break;
+          case 4:    outputTriplet(visit, "float4(", "", ")"); break;
+          default: UNREACHABLE();
+        }
+        break;
+      case EOpConvFloatToInt:
+      case EOpConvBoolToInt:
+      case EOpConvUIntToInt:
+        switch (node->getOperand()->getType().getNominalSize())
+        {
+          case 1:    outputTriplet(visit, "int(", "", ")");  break;
+          case 2:    outputTriplet(visit, "int2(", "", ")"); break;
+          case 3:    outputTriplet(visit, "int3(", "", ")"); break;
+          case 4:    outputTriplet(visit, "int4(", "", ")"); break;
+          default: UNREACHABLE();
+        }
+        break;
+      case EOpConvFloatToUInt:
+      case EOpConvBoolToUInt:
+      case EOpConvIntToUInt:
+        switch (node->getOperand()->getType().getNominalSize())
+        {
+          case 1:    outputTriplet(visit, "uint(", "", ")");  break;
+          case 2:    outputTriplet(visit, "uint2(", "", ")");  break;
+          case 3:    outputTriplet(visit, "uint3(", "", ")");  break;
+          case 4:    outputTriplet(visit, "uint4(", "", ")");  break;
+          default: UNREACHABLE();
+        }
+        break;
       case EOpRadians:          outputTriplet(visit, "radians(", "", ")");   break;
       case EOpDegrees:          outputTriplet(visit, "degrees(", "", ")");   break;
       case EOpSin:              outputTriplet(visit, "sin(", "", ")");       break;
       case EOpCos:              outputTriplet(visit, "cos(", "", ")");       break;
       case EOpTan:              outputTriplet(visit, "tan(", "", ")");       break;
       case EOpAsin:             outputTriplet(visit, "asin(", "", ")");      break;
       case EOpAcos:             outputTriplet(visit, "acos(", "", ")");      break;
       case EOpAtan:             outputTriplet(visit, "atan(", "", ")");      break;
@@ -1836,67 +2252,78 @@ bool OutputHLSL::visitAggregate(Visit vi
     switch (node->getOp())
     {
       case EOpSequence:
         {
             if (mInsideFunction)
             {
                 outputLineDirective(node->getLine().first_line);
                 out <