Bug 1319004 - Update to ANGLE/2924. r=jgilbert
authorEthan Lin <ethlin@mozilla.com>
Wed, 23 Nov 2016 02:15:00 +0100
changeset 324288 fcf8c42bf382cd0e25fa47e16819072577f153e5
parent 324287 0b6635a4c87d88ac36f88073839e5d7191da798b
child 324289 797ee4b5a94885a83851e5e45233a714ddfa0434
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersjgilbert
bugs1319004
milestone53.0a1
Bug 1319004 - Update to ANGLE/2924. r=jgilbert
gfx/angle/BUILD.gn
gfx/angle/CONTRIBUTORS
gfx/angle/DEPS
gfx/angle/include/EGL/eglext.h
gfx/angle/include/GLES2/gl2ext.h
gfx/angle/include/GLSLANG/ShaderLang.h
gfx/angle/include/GLSLANG/ShaderVars.h
gfx/angle/moz.build
gfx/angle/src/angle.gyp
gfx/angle/src/commit.h
gfx/angle/src/common/BitSetIterator.h
gfx/angle/src/common/angleutils.h
gfx/angle/src/common/debug.cpp
gfx/angle/src/common/debug.h
gfx/angle/src/common/mathutil.cpp
gfx/angle/src/common/mathutil.h
gfx/angle/src/common/third_party/numerics/base/logging.h
gfx/angle/src/common/third_party/numerics/base/numerics/safe_conversions_impl.h
gfx/angle/src/common/utilities.cpp
gfx/angle/src/common/utilities.h
gfx/angle/src/compiler.gypi
gfx/angle/src/compiler/fuzz/translator_fuzzer.cpp
gfx/angle/src/compiler/preprocessor/64bit-tokenizer-safety.patch
gfx/angle/src/compiler/preprocessor/DiagnosticsBase.cpp
gfx/angle/src/compiler/preprocessor/DiagnosticsBase.h
gfx/angle/src/compiler/preprocessor/DirectiveHandlerBase.cpp
gfx/angle/src/compiler/preprocessor/DirectiveParser.cpp
gfx/angle/src/compiler/preprocessor/DirectiveParser.h
gfx/angle/src/compiler/preprocessor/ExpressionParser.cpp
gfx/angle/src/compiler/preprocessor/ExpressionParser.h
gfx/angle/src/compiler/preprocessor/ExpressionParser.y
gfx/angle/src/compiler/preprocessor/Input.cpp
gfx/angle/src/compiler/preprocessor/Input.h
gfx/angle/src/compiler/preprocessor/Lexer.cpp
gfx/angle/src/compiler/preprocessor/Lexer.h
gfx/angle/src/compiler/preprocessor/Macro.cpp
gfx/angle/src/compiler/preprocessor/Macro.h
gfx/angle/src/compiler/preprocessor/MacroExpander.cpp
gfx/angle/src/compiler/preprocessor/MacroExpander.h
gfx/angle/src/compiler/preprocessor/Preprocessor.cpp
gfx/angle/src/compiler/preprocessor/Preprocessor.h
gfx/angle/src/compiler/preprocessor/Token.cpp
gfx/angle/src/compiler/preprocessor/Token.h
gfx/angle/src/compiler/preprocessor/Tokenizer.cpp
gfx/angle/src/compiler/preprocessor/Tokenizer.h
gfx/angle/src/compiler/preprocessor/Tokenizer.l
gfx/angle/src/compiler/preprocessor/numeric_lex.h
gfx/angle/src/compiler/preprocessor/pp_utils.h
gfx/angle/src/compiler/translator/64bit-lexer-safety.patch
gfx/angle/src/compiler/translator/ASTMetadataHLSL.cpp
gfx/angle/src/compiler/translator/ASTMetadataHLSL.h
gfx/angle/src/compiler/translator/AddDefaultReturnStatements.cpp
gfx/angle/src/compiler/translator/ArrayReturnValueToOutParameter.cpp
gfx/angle/src/compiler/translator/ArrayReturnValueToOutParameter.h
gfx/angle/src/compiler/translator/BaseTypes.h
gfx/angle/src/compiler/translator/BreakVariableAliasingInInnerLoops.cpp
gfx/angle/src/compiler/translator/BuiltInFunctionEmulator.cpp
gfx/angle/src/compiler/translator/BuiltInFunctionEmulator.h
gfx/angle/src/compiler/translator/BuiltInFunctionEmulatorGLSL.cpp
gfx/angle/src/compiler/translator/BuiltInFunctionEmulatorGLSL.h
gfx/angle/src/compiler/translator/BuiltInFunctionEmulatorHLSL.cpp
gfx/angle/src/compiler/translator/BuiltInFunctionEmulatorHLSL.h
gfx/angle/src/compiler/translator/Cache.cpp
gfx/angle/src/compiler/translator/Cache.h
gfx/angle/src/compiler/translator/CallDAG.cpp
gfx/angle/src/compiler/translator/CallDAG.h
gfx/angle/src/compiler/translator/CodeGen.cpp
gfx/angle/src/compiler/translator/Common.h
gfx/angle/src/compiler/translator/Compiler.cpp
gfx/angle/src/compiler/translator/Compiler.h
gfx/angle/src/compiler/translator/ConstantUnion.cpp
gfx/angle/src/compiler/translator/ConstantUnion.h
gfx/angle/src/compiler/translator/DeferGlobalInitializers.cpp
gfx/angle/src/compiler/translator/DeferGlobalInitializers.h
gfx/angle/src/compiler/translator/Diagnostics.cpp
gfx/angle/src/compiler/translator/Diagnostics.h
gfx/angle/src/compiler/translator/DirectiveHandler.cpp
gfx/angle/src/compiler/translator/DirectiveHandler.h
gfx/angle/src/compiler/translator/EmulateGLFragColorBroadcast.cpp
gfx/angle/src/compiler/translator/EmulateGLFragColorBroadcast.h
gfx/angle/src/compiler/translator/EmulatePrecision.cpp
gfx/angle/src/compiler/translator/EmulatePrecision.h
gfx/angle/src/compiler/translator/ExpandIntegerPowExpressions.cpp
gfx/angle/src/compiler/translator/ExtensionGLSL.cpp
gfx/angle/src/compiler/translator/ExtensionGLSL.h
gfx/angle/src/compiler/translator/ForLoopUnroll.cpp
gfx/angle/src/compiler/translator/ForLoopUnroll.h
gfx/angle/src/compiler/translator/InfoSink.cpp
gfx/angle/src/compiler/translator/InfoSink.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/InitializeDll.h
gfx/angle/src/compiler/translator/InitializeParseContext.cpp
gfx/angle/src/compiler/translator/InitializeParseContext.h
gfx/angle/src/compiler/translator/InitializeVariables.cpp
gfx/angle/src/compiler/translator/InitializeVariables.h
gfx/angle/src/compiler/translator/IntermNode.cpp
gfx/angle/src/compiler/translator/IntermNode.h
gfx/angle/src/compiler/translator/IntermNodePatternMatcher.cpp
gfx/angle/src/compiler/translator/IntermNodePatternMatcher.h
gfx/angle/src/compiler/translator/IntermTraverse.cpp
gfx/angle/src/compiler/translator/Intermediate.cpp
gfx/angle/src/compiler/translator/Intermediate.h
gfx/angle/src/compiler/translator/LoopInfo.cpp
gfx/angle/src/compiler/translator/LoopInfo.h
gfx/angle/src/compiler/translator/Operator.cpp
gfx/angle/src/compiler/translator/Operator.h
gfx/angle/src/compiler/translator/OutputESSL.cpp
gfx/angle/src/compiler/translator/OutputESSL.h
gfx/angle/src/compiler/translator/OutputGLSL.cpp
gfx/angle/src/compiler/translator/OutputGLSL.h
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/PoolAlloc.h
gfx/angle/src/compiler/translator/PruneEmptyDeclarations.cpp
gfx/angle/src/compiler/translator/PruneEmptyDeclarations.h
gfx/angle/src/compiler/translator/QualifierTypes.cpp
gfx/angle/src/compiler/translator/QualifierTypes.h
gfx/angle/src/compiler/translator/RecordConstantPrecision.cpp
gfx/angle/src/compiler/translator/RecordConstantPrecision.h
gfx/angle/src/compiler/translator/RegenerateStructNames.cpp
gfx/angle/src/compiler/translator/RegenerateStructNames.h
gfx/angle/src/compiler/translator/RemoveDynamicIndexing.cpp
gfx/angle/src/compiler/translator/RemoveDynamicIndexing.h
gfx/angle/src/compiler/translator/RemoveInvariantDeclaration.cpp
gfx/angle/src/compiler/translator/RemoveInvariantDeclaration.h
gfx/angle/src/compiler/translator/RemovePow.cpp
gfx/angle/src/compiler/translator/RemovePow.h
gfx/angle/src/compiler/translator/RemoveSwitchFallThrough.cpp
gfx/angle/src/compiler/translator/RemoveSwitchFallThrough.h
gfx/angle/src/compiler/translator/RewriteDoWhile.cpp
gfx/angle/src/compiler/translator/RewriteDoWhile.h
gfx/angle/src/compiler/translator/RewriteElseBlocks.cpp
gfx/angle/src/compiler/translator/RewriteTexelFetchOffset.cpp
gfx/angle/src/compiler/translator/RewriteTexelFetchOffset.h
gfx/angle/src/compiler/translator/RewriteUnaryMinusOperatorInt.cpp
gfx/angle/src/compiler/translator/RewriteUnaryMinusOperatorInt.h
gfx/angle/src/compiler/translator/ScalarizeVecAndMatConstructorArgs.cpp
gfx/angle/src/compiler/translator/ScalarizeVecAndMatConstructorArgs.h
gfx/angle/src/compiler/translator/SeparateArrayInitialization.cpp
gfx/angle/src/compiler/translator/SeparateArrayInitialization.h
gfx/angle/src/compiler/translator/SeparateDeclarations.cpp
gfx/angle/src/compiler/translator/SeparateDeclarations.h
gfx/angle/src/compiler/translator/SeparateExpressionsReturningArrays.cpp
gfx/angle/src/compiler/translator/SeparateExpressionsReturningArrays.h
gfx/angle/src/compiler/translator/ShaderLang.cpp
gfx/angle/src/compiler/translator/SimplifyLoopConditions.cpp
gfx/angle/src/compiler/translator/SimplifyLoopConditions.h
gfx/angle/src/compiler/translator/SplitSequenceOperator.cpp
gfx/angle/src/compiler/translator/SplitSequenceOperator.h
gfx/angle/src/compiler/translator/SymbolTable.cpp
gfx/angle/src/compiler/translator/SymbolTable.h
gfx/angle/src/compiler/translator/TextureFunctionHLSL.cpp
gfx/angle/src/compiler/translator/TranslatorESSL.cpp
gfx/angle/src/compiler/translator/TranslatorESSL.h
gfx/angle/src/compiler/translator/TranslatorGLSL.cpp
gfx/angle/src/compiler/translator/TranslatorGLSL.h
gfx/angle/src/compiler/translator/TranslatorHLSL.cpp
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/UnfoldShortCircuitAST.cpp
gfx/angle/src/compiler/translator/UnfoldShortCircuitAST.h
gfx/angle/src/compiler/translator/UnfoldShortCircuitToIf.cpp
gfx/angle/src/compiler/translator/UnfoldShortCircuitToIf.h
gfx/angle/src/compiler/translator/UseInterfaceBlockFields.cpp
gfx/angle/src/compiler/translator/UseInterfaceBlockFields.h
gfx/angle/src/compiler/translator/UtilsHLSL.cpp
gfx/angle/src/compiler/translator/ValidateGlobalInitializer.cpp
gfx/angle/src/compiler/translator/ValidateGlobalInitializer.h
gfx/angle/src/compiler/translator/ValidateLimitations.cpp
gfx/angle/src/compiler/translator/ValidateLimitations.h
gfx/angle/src/compiler/translator/ValidateMaxParameters.cpp
gfx/angle/src/compiler/translator/ValidateMaxParameters.h
gfx/angle/src/compiler/translator/ValidateOutputs.cpp
gfx/angle/src/compiler/translator/ValidateOutputs.h
gfx/angle/src/compiler/translator/ValidateSwitch.cpp
gfx/angle/src/compiler/translator/ValidateSwitch.h
gfx/angle/src/compiler/translator/VariableInfo.cpp
gfx/angle/src/compiler/translator/VariableInfo.h
gfx/angle/src/compiler/translator/VersionGLSL.cpp
gfx/angle/src/compiler/translator/VersionGLSL.h
gfx/angle/src/compiler/translator/blocklayout.h
gfx/angle/src/compiler/translator/blocklayoutHLSL.h
gfx/angle/src/compiler/translator/glslang.h
gfx/angle/src/compiler/translator/glslang.l
gfx/angle/src/compiler/translator/glslang.y
gfx/angle/src/compiler/translator/glslang_lex.cpp
gfx/angle/src/compiler/translator/glslang_tab.cpp
gfx/angle/src/compiler/translator/glslang_tab.h
gfx/angle/src/compiler/translator/intermOut.cpp
gfx/angle/src/compiler/translator/length_limits.h
gfx/angle/src/compiler/translator/util.cpp
gfx/angle/src/compiler/translator/util.h
gfx/angle/src/image_util/loadimage_etc.cpp
gfx/angle/src/libANGLE/Buffer.cpp
gfx/angle/src/libANGLE/Buffer.h
gfx/angle/src/libANGLE/Caps.cpp
gfx/angle/src/libANGLE/Caps.h
gfx/angle/src/libANGLE/Compiler.cpp
gfx/angle/src/libANGLE/Context.cpp
gfx/angle/src/libANGLE/Context.h
gfx/angle/src/libANGLE/ContextState.cpp
gfx/angle/src/libANGLE/ContextState.h
gfx/angle/src/libANGLE/Display.cpp
gfx/angle/src/libANGLE/Display.h
gfx/angle/src/libANGLE/HandleAllocator.cpp
gfx/angle/src/libANGLE/HandleAllocator.h
gfx/angle/src/libANGLE/HandleAllocator_unittest.cpp
gfx/angle/src/libANGLE/HandleRangeAllocator.cpp
gfx/angle/src/libANGLE/Path.h
gfx/angle/src/libANGLE/Program.cpp
gfx/angle/src/libANGLE/Program.h
gfx/angle/src/libANGLE/Renderbuffer.cpp
gfx/angle/src/libANGLE/Renderbuffer.h
gfx/angle/src/libANGLE/ResourceManager.cpp
gfx/angle/src/libANGLE/ResourceManager.h
gfx/angle/src/libANGLE/ResourceManager_unittest.cpp
gfx/angle/src/libANGLE/Sampler.cpp
gfx/angle/src/libANGLE/Sampler.h
gfx/angle/src/libANGLE/Shader.cpp
gfx/angle/src/libANGLE/Shader.h
gfx/angle/src/libANGLE/State.cpp
gfx/angle/src/libANGLE/State.h
gfx/angle/src/libANGLE/Surface.cpp
gfx/angle/src/libANGLE/Surface.h
gfx/angle/src/libANGLE/Surface_unittest.cpp
gfx/angle/src/libANGLE/Texture.cpp
gfx/angle/src/libANGLE/Texture.h
gfx/angle/src/libANGLE/Thread.cpp
gfx/angle/src/libANGLE/Thread.h
gfx/angle/src/libANGLE/TransformFeedback_unittest.cpp
gfx/angle/src/libANGLE/Uniform.cpp
gfx/angle/src/libANGLE/Uniform.h
gfx/angle/src/libANGLE/Version.h
gfx/angle/src/libANGLE/Version.inl
gfx/angle/src/libANGLE/VertexArray.h
gfx/angle/src/libANGLE/VertexAttribute.h
gfx/angle/src/libANGLE/VertexAttribute.inl
gfx/angle/src/libANGLE/Workarounds.h
gfx/angle/src/libANGLE/angletypes.cpp
gfx/angle/src/libANGLE/angletypes.h
gfx/angle/src/libANGLE/es3_copy_conversion_formats.json
gfx/angle/src/libANGLE/es3_copy_conversion_table_autogen.cpp
gfx/angle/src/libANGLE/es3_format_type_combinations.json
gfx/angle/src/libANGLE/format_map_autogen.cpp
gfx/angle/src/libANGLE/format_map_data.json
gfx/angle/src/libANGLE/formatutils.cpp
gfx/angle/src/libANGLE/formatutils.h
gfx/angle/src/libANGLE/gen_copy_conversion_table.py
gfx/angle/src/libANGLE/gen_format_map.py
gfx/angle/src/libANGLE/moz.build
gfx/angle/src/libANGLE/queryutils.cpp
gfx/angle/src/libANGLE/queryutils.h
gfx/angle/src/libANGLE/renderer/BufferImpl.h
gfx/angle/src/libANGLE/renderer/BufferImpl_mock.h
gfx/angle/src/libANGLE/renderer/DisplayImpl.cpp
gfx/angle/src/libANGLE/renderer/DisplayImpl.h
gfx/angle/src/libANGLE/renderer/EGLImplFactory.h
gfx/angle/src/libANGLE/renderer/Format.cpp
gfx/angle/src/libANGLE/renderer/Format.h
gfx/angle/src/libANGLE/renderer/Format_autogen.cpp
gfx/angle/src/libANGLE/renderer/Format_table_autogen.cpp
gfx/angle/src/libANGLE/renderer/FramebufferAttachmentObjectImpl.h
gfx/angle/src/libANGLE/renderer/GLImplFactory.h
gfx/angle/src/libANGLE/renderer/ProgramImpl.h
gfx/angle/src/libANGLE/renderer/ShaderImpl.h
gfx/angle/src/libANGLE/renderer/SurfaceImpl.cpp
gfx/angle/src/libANGLE/renderer/SurfaceImpl.h
gfx/angle/src/libANGLE/renderer/TextureImpl.cpp
gfx/angle/src/libANGLE/renderer/TextureImpl.h
gfx/angle/src/libANGLE/renderer/TextureImpl_mock.h
gfx/angle/src/libANGLE/renderer/d3d/BufferD3D.cpp
gfx/angle/src/libANGLE/renderer/d3d/BufferD3D.h
gfx/angle/src/libANGLE/renderer/d3d/DisplayD3D.cpp
gfx/angle/src/libANGLE/renderer/d3d/DisplayD3D.h
gfx/angle/src/libANGLE/renderer/d3d/DynamicHLSL.cpp
gfx/angle/src/libANGLE/renderer/d3d/FramebufferD3D.cpp
gfx/angle/src/libANGLE/renderer/d3d/ProgramD3D.cpp
gfx/angle/src/libANGLE/renderer/d3d/RendererD3D.h
gfx/angle/src/libANGLE/renderer/d3d/ShaderD3D.cpp
gfx/angle/src/libANGLE/renderer/d3d/SurfaceD3D.cpp
gfx/angle/src/libANGLE/renderer/d3d/SurfaceD3D.h
gfx/angle/src/libANGLE/renderer/d3d/SwapChainD3D.cpp
gfx/angle/src/libANGLE/renderer/d3d/SwapChainD3D.h
gfx/angle/src/libANGLE/renderer/d3d/TextureD3D.cpp
gfx/angle/src/libANGLE/renderer/d3d/TextureD3D.h
gfx/angle/src/libANGLE/renderer/d3d/VaryingPacking.cpp
gfx/angle/src/libANGLE/renderer/d3d/VertexDataManager.cpp
gfx/angle/src/libANGLE/renderer/d3d/WorkaroundsD3D.h
gfx/angle/src/libANGLE/renderer/d3d/d3d11/Blit11.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d11/Buffer11.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d11/Buffer11.h
gfx/angle/src/libANGLE/renderer/d3d/d3d11/Clear11.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d11/Context11.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d11/Context11.h
gfx/angle/src/libANGLE/renderer/d3d/d3d11/Fence11.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d11/Image11.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d11/RenderStateCache.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d11/RenderTarget11.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.h
gfx/angle/src/libANGLE/renderer/d3d/d3d11/ShaderExecutable11.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.h
gfx/angle/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d11/VertexArray11.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d11/VertexBuffer11.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d11/dxgi_format_data.json
gfx/angle/src/libANGLE/renderer/d3d/d3d11/dxgi_format_map_autogen.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d11/dxgi_support_data.json
gfx/angle/src/libANGLE/renderer/d3d/d3d11/dxgi_support_table.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d11/formatutils11.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d11/formatutils11.h
gfx/angle/src/libANGLE/renderer/d3d/d3d11/gen_dxgi_format_table.py
gfx/angle/src/libANGLE/renderer/d3d/d3d11/gen_dxgi_support_tables.py
gfx/angle/src/libANGLE/renderer/d3d/d3d11/gen_texture_format_table.py
gfx/angle/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.h
gfx/angle/src/libANGLE/renderer/d3d/d3d11/texture_format_table.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d11/texture_format_table.h
gfx/angle/src/libANGLE/renderer/d3d/d3d11/texture_format_table_autogen.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d9/Blit9.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d9/Buffer9.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d9/Buffer9.h
gfx/angle/src/libANGLE/renderer/d3d/d3d9/Context9.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d9/Context9.h
gfx/angle/src/libANGLE/renderer/d3d/d3d9/Framebuffer9.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d9/Image9.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.h
gfx/angle/src/libANGLE/renderer/d3d/d3d9/StateManager9.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d9/SwapChain9.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d9/SwapChain9.h
gfx/angle/src/libANGLE/renderer/d3d/d3d9/TextureStorage9.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d9/formatutils9.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d9/formatutils9.h
gfx/angle/src/libANGLE/renderer/d3d/d3d9/renderer9_utils.cpp
gfx/angle/src/libANGLE/renderer/driver_utils.cpp
gfx/angle/src/libANGLE/renderer/driver_utils.h
gfx/angle/src/libANGLE/renderer/gen_angle_format_table.py
gfx/angle/src/libANGLE/renderer/gl/BlitGL.cpp
gfx/angle/src/libANGLE/renderer/gl/BlitGL.h
gfx/angle/src/libANGLE/renderer/gl/BufferGL.cpp
gfx/angle/src/libANGLE/renderer/gl/BufferGL.h
gfx/angle/src/libANGLE/renderer/gl/ContextGL.cpp
gfx/angle/src/libANGLE/renderer/gl/ContextGL.h
gfx/angle/src/libANGLE/renderer/gl/DisplayGL.cpp
gfx/angle/src/libANGLE/renderer/gl/DisplayGL.h
gfx/angle/src/libANGLE/renderer/gl/FramebufferGL.cpp
gfx/angle/src/libANGLE/renderer/gl/FramebufferGL.h
gfx/angle/src/libANGLE/renderer/gl/FunctionsGL.cpp
gfx/angle/src/libANGLE/renderer/gl/FunctionsGL.h
gfx/angle/src/libANGLE/renderer/gl/ProgramGL.cpp
gfx/angle/src/libANGLE/renderer/gl/RenderbufferGL.h
gfx/angle/src/libANGLE/renderer/gl/SamplerGL.cpp
gfx/angle/src/libANGLE/renderer/gl/ShaderGL.cpp
gfx/angle/src/libANGLE/renderer/gl/StateManagerGL.cpp
gfx/angle/src/libANGLE/renderer/gl/StateManagerGL.h
gfx/angle/src/libANGLE/renderer/gl/SurfaceGL.cpp
gfx/angle/src/libANGLE/renderer/gl/SurfaceGL.h
gfx/angle/src/libANGLE/renderer/gl/TextureGL.cpp
gfx/angle/src/libANGLE/renderer/gl/TextureGL.h
gfx/angle/src/libANGLE/renderer/gl/WorkaroundsGL.h
gfx/angle/src/libANGLE/renderer/gl/cgl/DisplayCGL.h
gfx/angle/src/libANGLE/renderer/gl/cgl/DisplayCGL.mm
gfx/angle/src/libANGLE/renderer/gl/cgl/PbufferSurfaceCGL.h
gfx/angle/src/libANGLE/renderer/gl/cgl/PbufferSurfaceCGL.mm
gfx/angle/src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.h
gfx/angle/src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.mm
gfx/angle/src/libANGLE/renderer/gl/egl/SurfaceEGL.cpp
gfx/angle/src/libANGLE/renderer/gl/egl/android/DisplayAndroid.cpp
gfx/angle/src/libANGLE/renderer/gl/egl/android/DisplayAndroid.h
gfx/angle/src/libANGLE/renderer/gl/egl/ozone/DisplayOzone.cpp
gfx/angle/src/libANGLE/renderer/gl/egl/ozone/DisplayOzone.h
gfx/angle/src/libANGLE/renderer/gl/formatutilsgl.cpp
gfx/angle/src/libANGLE/renderer/gl/formatutilsgl.h
gfx/angle/src/libANGLE/renderer/gl/glx/DisplayGLX.cpp
gfx/angle/src/libANGLE/renderer/gl/glx/DisplayGLX.h
gfx/angle/src/libANGLE/renderer/gl/renderergl_utils.cpp
gfx/angle/src/libANGLE/renderer/gl/renderergl_utils.h
gfx/angle/src/libANGLE/renderer/gl/wgl/D3DTextureSurfaceWGL.cpp
gfx/angle/src/libANGLE/renderer/gl/wgl/D3DTextureSurfaceWGL.h
gfx/angle/src/libANGLE/renderer/gl/wgl/DXGISwapChainWindowSurfaceWGL.cpp
gfx/angle/src/libANGLE/renderer/gl/wgl/DXGISwapChainWindowSurfaceWGL.h
gfx/angle/src/libANGLE/renderer/gl/wgl/DisplayWGL.cpp
gfx/angle/src/libANGLE/renderer/gl/wgl/DisplayWGL.h
gfx/angle/src/libANGLE/renderer/null/BufferNULL.cpp
gfx/angle/src/libANGLE/renderer/null/BufferNULL.h
gfx/angle/src/libANGLE/renderer/null/CompilerNULL.cpp
gfx/angle/src/libANGLE/renderer/null/CompilerNULL.h
gfx/angle/src/libANGLE/renderer/null/ContextNULL.cpp
gfx/angle/src/libANGLE/renderer/null/ContextNULL.h
gfx/angle/src/libANGLE/renderer/null/DeviceNULL.cpp
gfx/angle/src/libANGLE/renderer/null/DeviceNULL.h
gfx/angle/src/libANGLE/renderer/null/DisplayNULL.cpp
gfx/angle/src/libANGLE/renderer/null/DisplayNULL.h
gfx/angle/src/libANGLE/renderer/null/FenceNVNULL.cpp
gfx/angle/src/libANGLE/renderer/null/FenceNVNULL.h
gfx/angle/src/libANGLE/renderer/null/FenceSyncNULL.cpp
gfx/angle/src/libANGLE/renderer/null/FenceSyncNULL.h
gfx/angle/src/libANGLE/renderer/null/FramebufferNULL.cpp
gfx/angle/src/libANGLE/renderer/null/FramebufferNULL.h
gfx/angle/src/libANGLE/renderer/null/ImageNULL.cpp
gfx/angle/src/libANGLE/renderer/null/ImageNULL.h
gfx/angle/src/libANGLE/renderer/null/PathNULL.cpp
gfx/angle/src/libANGLE/renderer/null/PathNULL.h
gfx/angle/src/libANGLE/renderer/null/ProgramNULL.cpp
gfx/angle/src/libANGLE/renderer/null/ProgramNULL.h
gfx/angle/src/libANGLE/renderer/null/QueryNULL.cpp
gfx/angle/src/libANGLE/renderer/null/QueryNULL.h
gfx/angle/src/libANGLE/renderer/null/RenderbufferNULL.cpp
gfx/angle/src/libANGLE/renderer/null/RenderbufferNULL.h
gfx/angle/src/libANGLE/renderer/null/SamplerNULL.cpp
gfx/angle/src/libANGLE/renderer/null/SamplerNULL.h
gfx/angle/src/libANGLE/renderer/null/ShaderNULL.cpp
gfx/angle/src/libANGLE/renderer/null/ShaderNULL.h
gfx/angle/src/libANGLE/renderer/null/SurfaceNULL.cpp
gfx/angle/src/libANGLE/renderer/null/SurfaceNULL.h
gfx/angle/src/libANGLE/renderer/null/TextureNULL.cpp
gfx/angle/src/libANGLE/renderer/null/TextureNULL.h
gfx/angle/src/libANGLE/renderer/null/TransformFeedbackNULL.cpp
gfx/angle/src/libANGLE/renderer/null/TransformFeedbackNULL.h
gfx/angle/src/libANGLE/renderer/null/VertexArrayNULL.cpp
gfx/angle/src/libANGLE/renderer/null/VertexArrayNULL.h
gfx/angle/src/libANGLE/renderer/renderer_utils.cpp
gfx/angle/src/libANGLE/renderer/renderer_utils.h
gfx/angle/src/libANGLE/renderer/vulkan/BufferVk.cpp
gfx/angle/src/libANGLE/renderer/vulkan/BufferVk.h
gfx/angle/src/libANGLE/renderer/vulkan/ContextVk.cpp
gfx/angle/src/libANGLE/renderer/vulkan/ContextVk.h
gfx/angle/src/libANGLE/renderer/vulkan/DisplayVk.cpp
gfx/angle/src/libANGLE/renderer/vulkan/DisplayVk.h
gfx/angle/src/libANGLE/renderer/vulkan/ProgramVk.cpp
gfx/angle/src/libANGLE/renderer/vulkan/ShaderVk.h
gfx/angle/src/libANGLE/renderer/vulkan/TextureVk.cpp
gfx/angle/src/libANGLE/renderer/vulkan/TextureVk.h
gfx/angle/src/libANGLE/validationEGL.cpp
gfx/angle/src/libANGLE/validationEGL.h
gfx/angle/src/libANGLE/validationES.cpp
gfx/angle/src/libANGLE/validationES.h
gfx/angle/src/libANGLE/validationES2.cpp
gfx/angle/src/libANGLE/validationES2.h
gfx/angle/src/libANGLE/validationES3.cpp
gfx/angle/src/libANGLE/validationES3.h
gfx/angle/src/libANGLE/validationES31.cpp
gfx/angle/src/libANGLE/validationES31.h
gfx/angle/src/libANGLE/validationES_unittest.cpp
gfx/angle/src/libEGL.gypi
gfx/angle/src/libEGL/libEGL.cpp
gfx/angle/src/libEGL/libEGL.def
gfx/angle/src/libGLESv2.gypi
gfx/angle/src/libGLESv2/entry_points_egl.cpp
gfx/angle/src/libGLESv2/entry_points_egl_ext.cpp
gfx/angle/src/libGLESv2/entry_points_egl_ext.h
gfx/angle/src/libGLESv2/entry_points_gles_2_0.cpp
gfx/angle/src/libGLESv2/entry_points_gles_2_0_ext.cpp
gfx/angle/src/libGLESv2/entry_points_gles_2_0_ext.h
gfx/angle/src/libGLESv2/entry_points_gles_3_0.cpp
gfx/angle/src/libGLESv2/global_state.cpp
gfx/angle/src/libGLESv2/global_state.h
gfx/angle/src/tests/BUILD.gn
gfx/angle/src/tests/angle_end2end_tests.gypi
gfx/angle/src/tests/angle_perftests.gypi
gfx/angle/src/tests/angle_unittests.gypi
gfx/angle/src/tests/angle_unittests_main.cpp
gfx/angle/src/tests/angle_unittests_utils.h
gfx/angle/src/tests/compiler_tests/API_test.cpp
gfx/angle/src/tests/compiler_tests/CollectVariables_test.cpp
gfx/angle/src/tests/compiler_tests/ConstantFolding_test.cpp
gfx/angle/src/tests/compiler_tests/DebugShaderPrecision_test.cpp
gfx/angle/src/tests/compiler_tests/EXT_blend_func_extended_test.cpp
gfx/angle/src/tests/compiler_tests/EmulateGLFragColorBroadcast_test.cpp
gfx/angle/src/tests/compiler_tests/ExpressionLimit_test.cpp
gfx/angle/src/tests/compiler_tests/FragDepth_test.cpp
gfx/angle/src/tests/compiler_tests/GLSLCompatibilityOutput_test.cpp
gfx/angle/src/tests/compiler_tests/IntermNode_test.cpp
gfx/angle/src/tests/compiler_tests/MalformedShader_test.cpp
gfx/angle/src/tests/compiler_tests/NV_draw_buffers_test.cpp
gfx/angle/src/tests/compiler_tests/Pack_Unpack_test.cpp
gfx/angle/src/tests/compiler_tests/PruneEmptyDeclarations_test.cpp
gfx/angle/src/tests/compiler_tests/PruneUnusedFunctions_test.cpp
gfx/angle/src/tests/compiler_tests/QualificationOrderESSL31_test.cpp
gfx/angle/src/tests/compiler_tests/QualificationOrder_test.cpp
gfx/angle/src/tests/compiler_tests/RecordConstantPrecision_test.cpp
gfx/angle/src/tests/compiler_tests/RemovePow_test.cpp
gfx/angle/src/tests/compiler_tests/ShCompile_test.cpp
gfx/angle/src/tests/compiler_tests/ShaderExtension_test.cpp
gfx/angle/src/tests/compiler_tests/ShaderImage_test.cpp
gfx/angle/src/tests/compiler_tests/ShaderVariable_test.cpp
gfx/angle/src/tests/compiler_tests/TypeTracking_test.cpp
gfx/angle/src/tests/compiler_tests/UnrollFlatten_test.cpp
gfx/angle/src/tests/compiler_tests/WorkGroupSize_test.cpp
gfx/angle/src/tests/deqp.gypi
gfx/angle/src/tests/deqp_support/angle_deqp_gtest.cpp
gfx/angle/src/tests/deqp_support/angle_deqp_gtest_main.cpp
gfx/angle/src/tests/deqp_support/angle_deqp_libtester.h
gfx/angle/src/tests/deqp_support/angle_deqp_libtester_main.cpp
gfx/angle/src/tests/deqp_support/deqp_egl_test_expectations.txt
gfx/angle/src/tests/deqp_support/deqp_gles2_test_expectations.txt
gfx/angle/src/tests/deqp_support/deqp_gles31_test_expectations.txt
gfx/angle/src/tests/gl_tests/BindGeneratesResourceTest.cpp
gfx/angle/src/tests/gl_tests/BlendMinMaxTest.cpp
gfx/angle/src/tests/gl_tests/BufferDataTest.cpp
gfx/angle/src/tests/gl_tests/CopyCompressedTextureTest.cpp
gfx/angle/src/tests/gl_tests/D3D11EmulatedIndexedBufferTest.cpp
gfx/angle/src/tests/gl_tests/D3D11FormatTablesTest.cpp
gfx/angle/src/tests/gl_tests/D3DTextureTest.cpp
gfx/angle/src/tests/gl_tests/DrawBuffersTest.cpp
gfx/angle/src/tests/gl_tests/ETCTextureTest.cpp
gfx/angle/src/tests/gl_tests/GLSLTest.cpp
gfx/angle/src/tests/gl_tests/MipmapTest.cpp
gfx/angle/src/tests/gl_tests/MultisampleCompatibilityTest.cpp
gfx/angle/src/tests/gl_tests/ReadPixelsTest.cpp
gfx/angle/src/tests/gl_tests/RobustClientMemoryTest.cpp
gfx/angle/src/tests/gl_tests/SRGBFramebufferTest.cpp
gfx/angle/src/tests/gl_tests/SRGBTextureTest.cpp
gfx/angle/src/tests/gl_tests/TextureTest.cpp
gfx/angle/src/tests/gl_tests/TimerQueriesTest.cpp
gfx/angle/src/tests/gl_tests/TransformFeedbackTest.cpp
gfx/angle/src/tests/gl_tests/UniformBufferTest.cpp
gfx/angle/src/tests/gl_tests/UniformTest.cpp
gfx/angle/src/tests/gl_tests/VertexAttributeTest.cpp
gfx/angle/src/tests/gl_tests/WebGLCompatibilityTest.cpp
gfx/angle/src/tests/perf_tests/IndexDataManagerTest.cpp
gfx/angle/src/tests/perf_tests/TexturesPerf.cpp
gfx/angle/src/tests/preprocessor_tests/define_test.cpp
gfx/angle/src/tests/preprocessor_tests/if_test.cpp
gfx/angle/src/tests/test_utils/ANGLETest.cpp
gfx/angle/src/tests/test_utils/ANGLETest.h
gfx/angle/src/tests/test_utils/compiler_test.cpp
gfx/angle/src/tests/test_utils/compiler_test.h
gfx/angle/src/tests/test_utils/gl_raii.h
gfx/angle/src/tests/tests.gyp
gfx/angle/src/third_party/compiler/ArrayBoundsClamper.cpp
gfx/angle/src/third_party/compiler/ArrayBoundsClamper.h
--- a/gfx/angle/BUILD.gn
+++ b/gfx/angle/BUILD.gn
@@ -1,17 +1,18 @@
 # Copyright 2014-2015 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.
 
 # import the use_x11 variable
 import("//build/config/dcheck_always_on.gni")
 import("//build/config/linux/pkg_config.gni")
 import("//build/config/ui.gni")
-import("//third_party/angle/build/angle_common.gni")
+import("//testing/libfuzzer/fuzzer_test.gni")
+import("//third_party/angle/gni/angle.gni")
 import("//ui/ozone/ozone.gni")
 
 if (ozone_platform_gbm) {
   pkg_config("libdrm") {
     packages = [ "libdrm" ]
   }
 }
 
@@ -49,16 +50,17 @@ config("internal_config") {
 }
 
 config("extra_warnings") {
   # Enable more default warnings on Windows.
   if (is_win) {
     cflags = [
       "/we4244",  # Conversion: possible loss of data.
       "/we4456",  # Variable shadowing.
+      "/we4458",  # declaration hides class member.
     ]
   }
 }
 
 if (is_win) {
   copy("copy_compiler_dll") {
     sources = [
       "$windows_sdk_path/Redist/D3D/$target_cpu/d3dcompiler_47.dll",
@@ -66,32 +68,16 @@ if (is_win) {
     outputs = [
       "$root_out_dir/d3dcompiler_47.dll",
     ]
   }
 }
 
 angle_undefine_configs = [ "//build/config/compiler:default_include_dirs" ]
 
-component("translator") {
-  sources = [
-    "src/compiler/translator/ShaderLang.cpp",
-    "src/compiler/translator/ShaderVars.cpp",
-  ]
-
-  defines = [ "ANGLE_TRANSLATOR_IMPLEMENTATION" ]
-
-  configs -= angle_undefine_configs
-  configs += [ ":internal_config" ]
-
-  public_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",
@@ -105,20 +91,24 @@ source_set("includes") {
   ]
 }
 
 static_library("preprocessor") {
   sources = rebase_path(compiler_gypi.angle_preprocessor_sources, ".", "src")
 
   configs -= angle_undefine_configs
   configs += [ ":internal_config" ]
+
+  public_deps = [
+    ":angle_common",
+  ]
 }
 
-config("translator_static_config") {
-  defines = [ "ANGLE_TRANSLATOR_STATIC" ]
+config("translator_disable_pool_alloc") {
+  defines = [ "ANGLE_TRANSLATOR_DISABLE_POOL_ALLOC" ]
 }
 
 config("debug_annotations_config") {
   if (is_debug) {
     defines = [ "ANGLE_ENABLE_DEBUG_ANNOTATIONS" ]
   }
 }
 
@@ -167,43 +157,43 @@ static_library("angle_image_util") {
 
   public_configs = [ ":angle_image_util_config" ]
 
   public_deps = [
     ":angle_common",
   ]
 }
 
-static_library("translator_lib") {
-  sources = rebase_path(compiler_gypi.angle_translator_lib_sources, ".", "src")
+static_library("translator") {
+  sources = rebase_path(compiler_gypi.angle_translator_sources, ".", "src")
   defines = []
 
-  if (angle_enable_essl) {
+  if (angle_enable_essl || use_libfuzzer) {
     sources +=
-        rebase_path(compiler_gypi.angle_translator_lib_essl_sources, ".", "src")
+        rebase_path(compiler_gypi.angle_translator_essl_sources, ".", "src")
     defines += [ "ANGLE_ENABLE_ESSL" ]
   }
 
-  if (angle_enable_glsl) {
+  if (angle_enable_glsl || use_libfuzzer) {
     sources +=
-        rebase_path(compiler_gypi.angle_translator_lib_glsl_sources, ".", "src")
+        rebase_path(compiler_gypi.angle_translator_glsl_sources, ".", "src")
     defines += [ "ANGLE_ENABLE_GLSL" ]
   }
 
-  if (angle_enable_hlsl) {
+  if (angle_enable_hlsl || use_libfuzzer) {
     sources +=
-        rebase_path(compiler_gypi.angle_translator_lib_hlsl_sources, ".", "src")
+        rebase_path(compiler_gypi.angle_translator_hlsl_sources, ".", "src")
     defines += [ "ANGLE_ENABLE_HLSL" ]
   }
   configs -= angle_undefine_configs
-  configs += [
-    ":internal_config",
-    ":translator_static_config",
-  ]
+  configs += [ ":internal_config" ]
   public_configs = [ ":external_config" ]
+  if (use_libfuzzer) {
+    all_dependent_configs = [ ":translator_disable_pool_alloc" ]
+  }
 
   deps = [
     ":includes",
     ":preprocessor",
   ]
 
   public_deps = [
     ":angle_common",
@@ -211,32 +201,28 @@ static_library("translator_lib") {
 
   if (is_win) {
     # Necessary to suppress some system header xtree warnigns in Release.
     # For some reason this warning doesn't get triggered in Chromium
     cflags = [ "/wd4718" ]
   }
 }
 
-static_library("translator_static") {
+source_set("translator_fuzzer") {
   sources = [
-    "src/compiler/translator/ShaderLang.cpp",
-    "src/compiler/translator/ShaderVars.cpp",
+    "src/compiler/fuzz/translator_fuzzer.cpp",
   ]
 
-  if (angle_enable_hlsl) {
-    defines = [ "ANGLE_ENABLE_HLSL" ]
-  }
+  include_dirs = [
+    "include",
+    "src",
+  ]
 
-  configs -= angle_undefine_configs
-  configs += [ ":internal_config" ]
-  public_configs = [ ":translator_static_config" ]
-
-  public_deps = [
-    ":translator_lib",
+  deps = [
+    ":translator",
   ]
 }
 
 config("commit_id_config") {
   include_dirs = [ "$root_gen_dir/angle" ]
 }
 
 commit_id_output_file = "$root_gen_dir/angle/id/commit.h"
@@ -280,19 +266,23 @@ config("libANGLE_config") {
     defines += [ "ANGLE_ENABLE_OPENGL" ]
     if (use_x11) {
       defines += [ "ANGLE_USE_X11" ]
     }
   }
   if (angle_enable_vulkan) {
     defines += [ "ANGLE_ENABLE_VULKAN" ]
   }
+  if (angle_enable_null) {
+    defines += [ "ANGLE_ENABLE_NULL" ]
+  }
   defines += [
     "GL_GLEXT_PROTOTYPES",
     "EGL_EGLEXT_PROTOTYPES",
+    "LIBANGLE_IMPLEMENTATION",
   ]
 
   if (is_win) {
     defines += [
       "GL_APICALL=",
       "EGLAPI=",
     ]
   } else {
@@ -306,25 +296,25 @@ config("libANGLE_config") {
   }
 }
 
 static_library("libANGLE") {
   sources = rebase_path(gles_gypi.libangle_sources, ".", "src")
 
   include_dirs = []
   libs = []
-  defines = [ "LIBANGLE_IMPLEMENTATION" ]
+  defines = []
   public_deps = [
     ":angle_common",
   ]
   deps = [
     ":angle_image_util",
     ":commit_id",
     ":includes",
-    ":translator_static",
+    ":translator",
   ]
 
   # Shared D3D sources.
   if (angle_enable_d3d9 || angle_enable_d3d11) {
     sources += rebase_path(gles_gypi.libangle_d3d_shared_sources, ".", "src")
 
     defines += [ "ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ " + "\"d3dcompiler_47.dll\", \"d3dcompiler_46.dll\", \"d3dcompiler_43.dll\" }" ]
   }
@@ -384,16 +374,20 @@ static_library("libANGLE") {
       sources += rebase_path(gles_gypi.libangle_gl_ozone_sources, ".", "src")
     }
   }
 
   if (angle_enable_vulkan) {
     sources += rebase_path(gles_gypi.libangle_vulkan_sources, ".", "src")
   }
 
+  if (angle_enable_null) {
+    sources += rebase_path(gles_gypi.libangle_null_sources, ".", "src")
+  }
+
   if (is_debug) {
     defines += [ "ANGLE_GENERATE_SHADER_DEBUG_INFO" ]
   }
 
   configs -= angle_undefine_configs
 
   configs += [
     ":commit_id_config",
--- a/gfx/angle/CONTRIBUTORS
+++ b/gfx/angle/CONTRIBUTORS
@@ -59,22 +59,28 @@ The Qt Company Ltd.
 Imagination Technologies Ltd.
  Gregoire Payen de La Garanderie
 
 Intel Corporation
  Jin Yang
  Andy Chen
  Josh Triplett
  Sudarsana Nagineni
+ Jiajia Qin
+ Jiawei Shao
+ Jie Chen
+ Qiankun Miao
+ Bryan Bernhart
 
 Klarälvdalens Datakonsult AB
  Milian Wolff
 
 Mozilla Corp.
  Ehsan Akhgari
+ Edwin Flores
  Jeff Gilbert
  Mike Hommey
  Benoit Jacob
  Makoto Kato
  Vladimir Vukicevic
 
 Turbulenz
  Michael Braithwaite
--- a/gfx/angle/DEPS
+++ b/gfx/angle/DEPS
@@ -1,39 +1,37 @@
 vars = {
   'chromium_git': 'https://chromium.googlesource.com',
 }
 
 deps = {
-  "third_party/gyp":
-      Var('chromium_git') + "/external/gyp@81c2e5ff92af29bab61c982808076ddce3d200a2",
+  'third_party/gyp':
+      Var('chromium_git') + '/external/gyp' + '@' + '81c2e5ff92af29bab61c982808076ddce3d200a2',
 
-  # TODO(kbr): figure out how to better stay in sync with Chromium's
-  # versions of googletest and googlemock.
-  "src/tests/third_party/googletest":
-      Var('chromium_git') + "/external/googletest.git@9855a87157778d39b95eccfb201a9dc90f6d61c6",
+  'testing/gtest':
+    Var('chromium_git') + '/external/github.com/google/googletest.git' + '@' + '6f8a66431cb592dad629028a50b3dd418a408c87',
 
-  "src/tests/third_party/googlemock":
-      Var('chromium_git') + "/external/googlemock.git@b2cb211e49d872101d991201362d7b97d7d69910",
+  'testing/gmock':
+    Var('chromium_git') + '/external/googlemock.git' + '@' + '0421b6f358139f02e102c9c332ce19a33faf75be', # from svn revision 566
 
   # Cherry is a dEQP management GUI written in Go. We use it for viewing test results.
-  "third_party/cherry":
-      "https://android.googlesource.com/platform/external/cherry@d2e26b4d864ec2a6757e7f1174e464949ca5bf73",
+  'third_party/cherry':
+      'https://android.googlesource.com/platform/external/cherry' + '@' + 'd2e26b4d864ec2a6757e7f1174e464949ca5bf73',
 
-  "third_party/deqp/src":
-      "https://android.googlesource.com/platform/external/deqp@f4f3d8079e7a37d7675ab93583e6438d0bca0e58",
+  'third_party/deqp/src':
+      'https://android.googlesource.com/platform/external/deqp' + '@' + 'f4f3d8079e7a37d7675ab93583e6438d0bca0e58',
 
-  "third_party/libpng":
-      "https://android.googlesource.com/platform/external/libpng@094e181e79a3d6c23fd005679025058b7df1ad6c",
+  'third_party/libpng':
+      'https://android.googlesource.com/platform/external/libpng' + '@' + '094e181e79a3d6c23fd005679025058b7df1ad6c',
 
-  "third_party/zlib":
-      Var('chromium_git') + "/chromium/src/third_party/zlib@afd8c4593c010c045902f6c0501718f1823064a3",
+  'third_party/zlib':
+      Var('chromium_git') + '/chromium/src/third_party/zlib' + '@' + 'afd8c4593c010c045902f6c0501718f1823064a3',
 
-  "buildtools":
-      Var('chromium_git') + '/chromium/buildtools.git@06e80a0e17319868d4a9b13f9bb6a248dc8d8b20',
+  'buildtools':
+      Var('chromium_git') + '/chromium/buildtools.git' + '@' + '39b1db2ab4aa4b2ccaa263c29bdf63e7c1ee28aa',
 }
 
 hooks = [
   # Pull clang-format binaries using checked-in hashes.
   {
     'name': 'clang_format_win',
     'pattern': '.',
     'action': [ 'download_from_google_storage',
@@ -97,12 +95,17 @@ hooks = [
                 '--platform=linux*',
                 '--no_auth',
                 '--bucket', 'chromium-gn',
                 '-s', 'buildtools/linux64/gn.sha1',
     ],
   },
   {
     # A change to a .gyp, .gypi, or to GYP itself should run the generator.
-    "pattern": ".",
-    "action": ["python", "build/gyp_angle"],
+    'pattern': '.',
+    'action': ['python', 'gyp/gyp_angle'],
   },
 ]
+
+recursedeps = [
+  # buildtools provides clang_format.
+  'buildtools',
+]
--- a/gfx/angle/include/EGL/eglext.h
+++ b/gfx/angle/include/EGL/eglext.h
@@ -467,16 +467,21 @@ EGLAPI EGLint EGLAPIENTRY eglDupNativeFe
 #define EGL_D3D11_DEVICE_ANGLE            0x33A1
 #endif /* EGL_ANGLE_device_d3d */
 
 #ifndef EGL_ANGLE_keyed_mutex
 #define EGL_ANGLE_keyed_mutex 1
 #define EGL_DXGI_KEYED_MUTEX_ANGLE        0x33A2
 #endif /* EGL_ANGLE_keyed_mutex */
 
+#ifndef EGL_ANGLE_d3d_texture_client_buffer
+#define EGL_ANGLE_d3d_texture_client_buffer 1
+#define EGL_D3D_TEXTURE_ANGLE             0x33A3
+#endif /* EGL_ANGLE_d3d_texture_client_buffer */
+
 #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);
 #endif
 #endif /* EGL_ANGLE_query_surface_pointer */
 
@@ -521,16 +526,21 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQuerySu
 #endif /* EGL_ANGLE_platform_angle_d3d */
 
 #ifndef EGL_ANGLE_platform_angle_opengl
 #define EGL_ANGLE_platform_angle_opengl 1
 #define EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE 0x320D
 #define EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE 0x320E
 #endif /* EGL_ANGLE_platform_angle_opengl */
 
+#ifndef EGL_ANGLE_platform_angle_null
+#define EGL_ANGLE_platform_angle_null 1
+#define EGL_PLATFORM_ANGLE_TYPE_NULL_ANGLE 0x33AE
+#endif /* EGL_ANGLE_platform_angle_null */
+
 #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_x11_visual
 #define EGL_ANGLE_x11_visual
 #define EGL_X11_VISUAL_ID_ANGLE 0x33A3
@@ -553,25 +563,35 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQuerySu
 #define EGL_ANGLE_experimental_present_path
 #define EGL_EXPERIMENTAL_PRESENT_PATH_ANGLE 0x33A4
 #define EGL_EXPERIMENTAL_PRESENT_PATH_FAST_ANGLE 0x33A9
 #define EGL_EXPERIMENTAL_PRESENT_PATH_COPY_ANGLE 0x33AA
 #endif /* EGL_ANGLE_experimental_present_path */
 
 #ifndef EGL_ANGLE_stream_producer_d3d_texture_nv12
 #define EGL_ANGLE_stream_producer_d3d_texture_nv12
-#define EGL_D3D_TEXTURE_SUBRESOURCE_ID_ANGLE 0x3AAB
+#define EGL_D3D_TEXTURE_SUBRESOURCE_ID_ANGLE 0x33AB
 typedef EGLBoolean(EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERD3DTEXTURENV12ANGLEPROC)(EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib *attrib_list);
 typedef EGLBoolean(EGLAPIENTRYP PFNEGLSTREAMPOSTD3DTEXTURENV12ANGLEPROC)(EGLDisplay dpy, EGLStreamKHR stream, void *texture, const EGLAttrib *attrib_list);
 #ifdef EGL_EGLEXT_PROTOTYPES
 EGLAPI EGLBoolean EGLAPIENTRY eglCreateStreamProducerD3DTextureNV12ANGLE(EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib *attrib_list);
 EGLAPI EGLBoolean EGLAPIENTRY eglStreamPostD3DTextureNV12ANGLE(EGLDisplay dpy, EGLStreamKHR stream, void *texture, const EGLAttrib *attrib_list);
 #endif
 #endif /* EGL_ANGLE_stream_producer_d3d_texture_nv12 */
 
+#ifndef EGL_ANGLE_create_context_webgl_compatibility
+#define EGL_ANGLE_create_context_webgl_compatibility 1
+#define EGL_CONTEXT_WEBGL_COMPATIBILITY_ANGLE 0x3AAC
+#endif /* EGL_ANGLE_create_context_webgl_compatibility */
+
+#ifndef EGL_CHROMIUM_create_context_bind_generates_resource
+#define EGL_CHROMIUM_create_context_bind_generates_resource 1
+#define EGL_CONTEXT_BIND_GENERATES_RESOURCE_CHROMIUM 0x3AAD
+#endif /* EGL_CHROMIUM_create_context_bind_generates_resource */
+
 #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
--- a/gfx/angle/include/GLES2/gl2ext.h
+++ b/gfx/angle/include/GLES2/gl2ext.h
@@ -816,25 +816,38 @@ GL_APICALL void GL_APIENTRY glGetPerfMon
 #define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6
 #define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA
 typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
 #ifdef GL_GLEXT_PROTOTYPES
 GL_APICALL void GL_APIENTRY glBlitFramebufferANGLE (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
 #endif
 #endif /* GL_ANGLE_framebuffer_blit */
 
+#ifndef GL_ANGLE_webgl_compatibility
+#define GL_ANGLE_webgl_compatibility 1
+typedef GLboolean(GL_APIENTRYP PFNGLENABLEEXTENSIONANGLEPROC) (const GLchar *name);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL GLboolean GL_APIENTRY glEnableExtensionANGLE (const GLchar *name);
+#endif
+#endif /* GL_ANGLE_webgl_compatibility */
+
 #ifndef GL_CHROMIUM_framebuffer_mixed_samples
 #define GL_CHROMIUM_frambuffer_mixed_samples 1
 #define GL_COVERAGE_MODULATION_CHROMIUM 0x9332
 typedef void (GL_APIENTRYP PFNGLCOVERAGEMODULATIONCHROMIUMPROC) (GLenum components);
 #ifdef GL_GLEXT_PROTOTYPES
 GL_APICALL void GL_APIENTRY glCoverageModulationCHROMIUM(GLenum components);
 #endif
 #endif /* GL_CHROMIUM_framebuffer_mixed_samples */
 
+#ifndef GL_CHROMIUM_bind_generates_resource
+#define GL_CHROMIUM_bind_generates_resource 1
+#define GL_BIND_GENERATES_RESOURCE_CHROMIUM 0x9244
+#endif /* GL_CHROMIUM_bind_generates_resource */
+
 // needed by NV_path_rendering (and thus CHROMIUM_path_rendering)
 // but CHROMIUM_path_rendering only needs MatrixLoadfEXT, MatrixLoadIdentityEXT
 #ifndef GL_EXT_direct_state_access
 #define GL_EXT_direct_state_access 1
 typedef void(GL_APIENTRYP PFNGLMATRIXLOADFEXTPROC)(GLenum matrixMode, const GLfloat *m);
 typedef void(GL_APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC)(GLenum matrixMode);
 #ifdef GL_GLEXT_PROTOTYPES
 GL_APICALL void GL_APIENTRY glMatrixLoadfEXT(GLenum matrixMode, const GLfloat *m);
@@ -1298,16 +1311,24 @@ GL_APICALL void GL_APIENTRY glCopySubTex
                                                      GLsizei width,
                                                      GLsizei height,
                                                      GLboolean unpackFlipY,
                                                      GLboolean unpackPremultiplyAlpha,
                                                      GLboolean unpackUnmultiplyAlpha);
 #endif
 #endif /* GL_CHROMIUM_copy_texture */
 
+#ifndef GL_CHROMIUM_compressed_copy_texture
+#define GL_CHROMIUM_compressed_copy_texture 1
+typedef void(GL_APIENTRYP PFNGLCOMPRESSEDCOPYTEXTURECHROMIUMPROC)(GLuint sourceId, GLuint destId);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glCompressedCopyTextureCHROMIUM(GLuint sourceId, GLuint destId);
+#endif
+#endif /* GL_CHROMIUM_compressed_copy_texture */
+
 #ifndef GL_CHROMIUM_sync_query
 #define GL_CHROMIUM_sync_query 1
 #define GL_COMMANDS_COMPLETED_CHROMIUM    0x84F7
 #endif  /* GL_CHROMIUM_sync_query */
 
 #ifndef GL_DMP_program_binary
 #define GL_DMP_program_binary 1
 #define GL_SMAPHS30_PROGRAM_BINARY_DMP    0x9251
@@ -3229,13 +3250,139 @@ GL_APICALL void GL_APIENTRY glEndTilingQ
 #define GL_COMPRESSED_RGB8_LOSSY_DECODE_ETC2_ANGLE                       0x9695
 #define GL_COMPRESSED_SRGB8_LOSSY_DECODE_ETC2_ANGLE                      0x9696
 #define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE   0x9697
 #define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE  0x9698
 #define GL_COMPRESSED_RGBA8_LOSSY_DECODE_ETC2_EAC_ANGLE                  0x9699
 #define GL_COMPRESSED_SRGB8_ALPHA8_LOSSY_DECODE_ETC2_EAC_ANGLE           0x969A
 #endif /* GL_ANGLE_lossy_etc_decode */
 
+#ifndef GL_ANGLE_robust_client_memory
+#define GL_ANGLE_robust_client_memory 1
+typedef void (GL_APIENTRYP PFNGLGETBOOLEANVROBUSTANGLE) (GLenum pname, GLsizei bufSize, GLsizei *length, GLboolean *data);
+typedef void (GL_APIENTRYP PFNGLGETBUFFERPARAMETERIVROBUSTANGLE) (GLenum target, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETFLOATVROBUSTANGLE) (GLenum pname, GLsizei bufSize, GLsizei *length, GLfloat *data);
+typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVROBUSTANGLE) (GLenum target, GLenum attachment, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETINTEGERVROBUSTANGLE) (GLenum pname, GLsizei bufSize, GLsizei *length, GLint *data);
+typedef void (GL_APIENTRYP PFNGLGETPROGRAMIVROBUSTANGLE) (GLuint program, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVROBUSTANGLE) (GLenum target, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETSHADERIVROBUSTANGLE) (GLuint shader, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERFVROBUSTANGLE) (GLenum target, GLenum pname, GLsizei bufSize, GLsizei *length, GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIVROBUSTANGLE) (GLenum target, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETUNIFORMFVROBUSTANGLE) (GLuint program, GLint location, GLsizei bufSize, GLsizei *length, GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLGETUNIFORMIVROBUSTANGLE) (GLuint program, GLint location, GLsizei bufSize, GLsizei *length, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBFVROBUSTANGLE) (GLuint index, GLenum pname, GLsizei bufSize, GLsizei *length, GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBIVROBUSTANGLE) (GLuint index, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVROBUSTANGLE) (GLuint index, GLenum pname, GLsizei bufSize, GLsizei *length, void **pointer);
+typedef void (GL_APIENTRYP PFNGLREADPIXELSROBUSTANGLE) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLsizei *length, void *pixels);
+typedef void (GL_APIENTRYP PFNGLTEXIMAGE2DROBUSTANGLE) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLsizei bufSize, const void *pixels);
+typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFVROBUSTANGLE) (GLenum target, GLenum pname, GLsizei bufSize, const GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIVROBUSTANGLE) (GLenum target, GLenum pname, GLsizei bufSize, const GLint *params);
+typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE2DROBUSTANGLE) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, const void *pixels);
+typedef void (GL_APIENTRYP PFNGLTEXIMAGE3DROBUSTANGLE) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLsizei bufSize, const void *pixels);
+typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DROBUSTANGLE) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, const void *pixels);
+typedef void (GL_APIENTRYP PFNGLGETQUERYIVROBUSTANGLE) (GLenum target, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUIVROBUSTANGLE) (GLuint id, GLenum pname, GLsizei bufSize, GLsizei *length, GLuint *params);
+typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVROBUSTANGLE) (GLenum target, GLenum pname, GLsizei bufSize, GLsizei *length, void **params);
+typedef void (GL_APIENTRYP PFNGLGETINTEGERI_VROBUSTANGLE) (GLenum target, GLuint index, GLsizei bufSize, GLsizei *length, GLint *data);
+typedef void (GL_APIENTRYP PFNGETINTERNALFORMATIVROBUSTANGLE) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBIIVROBUSTANGLE) (GLuint index, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBIUIVROBUSTANGLE) (GLuint index, GLenum pname, GLsizei bufSize, GLsizei *length, GLuint *params);
+typedef void (GL_APIENTRYP PFNGLGETUNIFORMUIVROBUSTANGLE) (GLuint program, GLint location, GLsizei bufSize, GLsizei *length, GLuint *params);
+typedef void (GL_APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVROBUSTANGLE) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETINTEGER64VROBUSTANGLE) (GLenum pname, GLsizei bufSize, GLsizei *length, GLint64 *data);
+typedef void (GL_APIENTRYP PFNGLGETINTEGER64I_VROBUSTANGLE) (GLenum target, GLuint index, GLsizei bufSize, GLsizei *length, GLint64 *data);
+typedef void (GL_APIENTRYP PFNGLGETBUFFERPARAMETERI64VROBUSTANGLE) (GLenum target, GLenum pname, GLsizei bufSize, GLsizei *length, GLint64 *params);
+typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIVROBUSTANGLE) (GLuint sampler, GLenum pname, GLsizei bufSize, const GLint *param);
+typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERFVROBUSTANGLE) (GLuint sampler, GLenum pname, GLsizei bufSize, const GLfloat *param);
+typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIVROBUSTANGLE) (GLuint sampler, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERFVROBUSTANGLE) (GLuint sampler, GLenum pname, GLsizei bufSize, GLsizei *length, GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVROBUSTANGLE) (GLenum target, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETPROGRAMINTERFACEIVROBUSTANGLE) (GLuint program, GLenum programInterface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETBOOLEANI_VROBUSTANGLE) (GLenum target, GLuint index, GLsizei bufSize, GLsizei *length, GLboolean *data);
+typedef void (GL_APIENTRYP PFNGLGETMULTISAMPLEFVROBUSTANGLE) (GLenum pname, GLuint index, GLsizei bufSize, GLsizei *length, GLfloat *val);
+typedef void (GL_APIENTRYP PFNGLGETTEXLEVELPARAMETERIVROBUSTANGLE) (GLenum target, GLint level, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXLEVELPARAMETERFVROBUSTANGLE) (GLenum target, GLint level, GLenum pname, GLsizei bufSize, GLsizei *length, GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLGETPOINTERVROBUSTANGLEROBUSTANGLE) (GLenum pname, GLsizei bufSize, GLsizei *length, void **params);
+typedef void (GL_APIENTRYP PFNGLREADNPIXELSROBUSTANGLE) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLsizei *length, void *data);
+typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVROBUSTANGLE) (GLuint program, GLint location, GLsizei bufSize, GLsizei *length, GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVROBUSTANGLE) (GLuint program, GLint location, GLsizei bufSize, GLsizei *length, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETNUNIFORMUIVROBUSTANGLE) (GLuint program, GLint location, GLsizei bufSize, GLsizei *length, GLuint *params);
+typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIIVROBUSTANGLE) (GLenum target, GLenum pname, GLsizei bufSize, const GLint *params);
+typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIUIVROBUSTANGLE) (GLenum target, GLenum pname, GLsizei bufSize, const GLuint *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIIVROBUSTANGLE) (GLenum target, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIUIVROBUSTANGLE) (GLenum target, GLenum pname, GLsizei bufSize, GLsizei *length, GLuint *params);
+typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIIVROBUSTANGLE) (GLuint sampler, GLenum pname, GLsizei bufSize, const GLint *param);
+typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIUIVROBUSTANGLE) (GLuint sampler, GLenum pname, GLsizei bufSize, const GLuint *param);
+typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIIVROBUSTANGLE) (GLuint sampler, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVROBUSTANGLE) (GLuint sampler, GLenum pname, GLsizei bufSize, GLsizei *length, GLuint *params);
+typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTIVROBUSTANGLE)(GLuint id, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTI64VROBUSTANGLE)(GLuint id, GLenum pname, GLsizei bufSize, GLsizei *length, GLint64 *params);
+typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUI64VROBUSTANGLE)(GLuint id, GLenum pname, GLsizei bufSize, GLsizei *length, GLuint64 *params);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glGetBooleanvRobustANGLE (GLenum pname, GLsizei bufSize, GLsizei *length, GLboolean *data);
+GL_APICALL void GL_APIENTRY glGetBufferParameterivRobustANGLE (GLenum target, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+GL_APICALL void GL_APIENTRY glGetFloatvRobustANGLE (GLenum pname, GLsizei bufSize, GLsizei *length, GLfloat *data);
+GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameterivRobustANGLE (GLenum target, GLenum attachment, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+GL_APICALL void GL_APIENTRY glGetIntegervRobustANGLE (GLenum pname, GLsizei bufSize, GLsizei *length, GLint *data);
+GL_APICALL void GL_APIENTRY glGetProgramivRobustANGLE (GLuint program, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+GL_APICALL void GL_APIENTRY glGetRenderbufferParameterivRobustANGLE (GLenum target, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+GL_APICALL void GL_APIENTRY glGetShaderivRobustANGLE (GLuint shader, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+GL_APICALL void GL_APIENTRY glGetTexParameterfvRobustANGLE (GLenum target, GLenum pname, GLsizei bufSize, GLsizei *length, GLfloat *params);
+GL_APICALL void GL_APIENTRY glGetTexParameterivRobustANGLE (GLenum target, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+GL_APICALL void GL_APIENTRY glGetUniformfvRobustANGLE (GLuint program, GLint location, GLsizei bufSize, GLsizei *length, GLfloat *params);
+GL_APICALL void GL_APIENTRY glGetUniformivRobustANGLE (GLuint program, GLint location, GLsizei bufSize, GLsizei *length, GLint *params);
+GL_APICALL void GL_APIENTRY glGetVertexAttribfvRobustANGLE (GLuint index, GLenum pname, GLsizei bufSize, GLsizei *length, GLfloat *params);
+GL_APICALL void GL_APIENTRY glGetVertexAttribivRobustANGLE (GLuint index, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+GL_APICALL void GL_APIENTRY glGetVertexAttribPointervRobustANGLE (GLuint index, GLenum pname, GLsizei bufSize, GLsizei *length, void **pointer);
+GL_APICALL void GL_APIENTRY glReadPixelsRobustANGLE (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLsizei *length, void *pixels);
+GL_APICALL void GL_APIENTRY glTexImage2DRobustANGLE (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLsizei bufSize, const void *pixels);
+GL_APICALL void GL_APIENTRY glTexParameterfvRobustANGLE (GLenum target, GLenum pname, GLsizei bufSize, const GLfloat *params);
+GL_APICALL void GL_APIENTRY glTexParameterivRobustANGLE (GLenum target, GLenum pname, GLsizei bufSize, const GLint *params);
+GL_APICALL void GL_APIENTRY glTexSubImage2DRobustANGLE (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, const void *pixels);
+GL_APICALL void GL_APIENTRY glTexImage3DRobustANGLE (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLsizei bufSize, const void *pixels);
+GL_APICALL void GL_APIENTRY glTexSubImage3DRobustANGLE (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, const void *pixels);
+GL_APICALL void GL_APIENTRY glGetQueryivRobustANGLE (GLenum target, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+GL_APICALL void GL_APIENTRY glGetQueryObjectuivRobustANGLE (GLuint id, GLenum pname, GLsizei bufSize, GLsizei *length, GLuint *params);
+GL_APICALL void GL_APIENTRY glGetBufferPointervRobustANGLE (GLenum target, GLenum pname, GLsizei bufSize, GLsizei *length, void **params);
+GL_APICALL void GL_APIENTRY glGetIntegeri_vRobustANGLE (GLenum target, GLuint index, GLsizei bufSize, GLsizei *length, GLint *data);
+GL_APICALL void GL_APIENTRY glGetInternalformativRobustANGLE (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+GL_APICALL void GL_APIENTRY glGetVertexAttribIivRobustANGLE (GLuint index, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+GL_APICALL void GL_APIENTRY glGetVertexAttribIuivRobustANGLE (GLuint index, GLenum pname, GLsizei bufSize, GLsizei *length, GLuint *params);
+GL_APICALL void GL_APIENTRY glGetUniformuivRobustANGLE (GLuint program, GLint location, GLsizei bufSize, GLsizei *length, GLuint *params);
+GL_APICALL void GL_APIENTRY glGetActiveUniformBlockivRobustANGLE (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+GL_APICALL void GL_APIENTRY glGetInteger64vRobustANGLE (GLenum pname, GLsizei bufSize, GLsizei *length, GLint64 *data);
+GL_APICALL void GL_APIENTRY glGetInteger64i_vRobustANGLE (GLenum target, GLuint index, GLsizei bufSize, GLsizei *length, GLint64 *data);
+GL_APICALL void GL_APIENTRY glGetBufferParameteri64vRobustANGLE (GLenum target, GLenum pname, GLsizei bufSize, GLsizei *length, GLint64 *params);
+GL_APICALL void GL_APIENTRY glSamplerParameterivRobustANGLE (GLuint sampler, GLenum pname, GLsizei bufSize, const GLint *param);
+GL_APICALL void GL_APIENTRY glSamplerParameterfvRobustANGLE (GLuint sampler, GLenum pname, GLsizei bufSize, const GLfloat *param);
+GL_APICALL void GL_APIENTRY glGetSamplerParameterivRobustANGLE (GLuint sampler, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+GL_APICALL void GL_APIENTRY glGetSamplerParameterfvRobustANGLE (GLuint sampler, GLenum pname, GLsizei bufSize, GLsizei *length, GLfloat *params);
+GL_APICALL void GL_APIENTRY glGetFramebufferParameterivRobustANGLE (GLenum target, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+GL_APICALL void GL_APIENTRY glGetProgramInterfaceivRobustANGLE (GLuint program, GLenum programInterface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+GL_APICALL void GL_APIENTRY glGetBooleani_vRobustANGLE (GLenum target, GLuint index, GLsizei bufSize, GLsizei *length, GLboolean *data);
+GL_APICALL void GL_APIENTRY glGetMultisamplefvRobustANGLE (GLenum pname, GLuint index, GLsizei bufSize, GLsizei *length, GLfloat *val);
+GL_APICALL void GL_APIENTRY glGetTexLevelParameterivRobustANGLE (GLenum target, GLint level, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+GL_APICALL void GL_APIENTRY glGetTexLevelParameterfvRobustANGLE (GLenum target, GLint level, GLenum pname, GLsizei bufSize, GLsizei *length, GLfloat *params);
+GL_APICALL void GL_APIENTRY glGetPointervRobustANGLERobustANGLE (GLenum pname, GLsizei bufSize, GLsizei *length, void **params);
+GL_APICALL void GL_APIENTRY glReadnPixelsRobustANGLE (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLsizei *length, void *data);
+GL_APICALL void GL_APIENTRY glGetnUniformfvRobustANGLE (GLuint program, GLint location, GLsizei bufSize, GLsizei *length, GLfloat *params);
+GL_APICALL void GL_APIENTRY glGetnUniformivRobustANGLE (GLuint program, GLint location, GLsizei bufSize, GLsizei *length, GLint *params);
+GL_APICALL void GL_APIENTRY glGetnUniformuivRobustANGLE (GLuint program, GLint location, GLsizei bufSize, GLsizei *length, GLuint *params);
+GL_APICALL void GL_APIENTRY glTexParameterIivRobustANGLE (GLenum target, GLenum pname, GLsizei bufSize, const GLint *params);
+GL_APICALL void GL_APIENTRY glTexParameterIuivRobustANGLE (GLenum target, GLenum pname, GLsizei bufSize, const GLuint *params);
+GL_APICALL void GL_APIENTRY glGetTexParameterIivRobustANGLE (GLenum target, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+GL_APICALL void GL_APIENTRY glGetTexParameterIuivRobustANGLE (GLenum target, GLenum pname, GLsizei bufSize, GLsizei *length, GLuint *params);
+GL_APICALL void GL_APIENTRY glSamplerParameterIivRobustANGLE (GLuint sampler, GLenum pname, GLsizei bufSize, const GLint *param);
+GL_APICALL void GL_APIENTRY glSamplerParameterIuivRobustANGLE (GLuint sampler, GLenum pname, GLsizei bufSize, const GLuint *param);
+GL_APICALL void GL_APIENTRY glGetSamplerParameterIivRobustANGLE (GLuint sampler, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+GL_APICALL void GL_APIENTRY glGetSamplerParameterIuivRobustANGLE (GLuint sampler, GLenum pname, GLsizei bufSize, GLsizei *length, GLuint *params);
+GL_APICALL void GL_APIENTRY glGetQueryObjectivRobustANGLE(GLuint id, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
+GL_APICALL void GL_APIENTRY glGetQueryObjecti64vRobustANGLE(GLuint id, GLenum pname, GLsizei bufSize, GLsizei *length, GLint64 *params);
+GL_APICALL void GL_APIENTRY glGetQueryObjectui64vRobustANGLE(GLuint id, GLenum pname, GLsizei bufSize, GLsizei *length, GLuint64 *params);
+#endif
+#endif /* GL_ANGLE_robust_client_memory */
+
 #ifdef __cplusplus
 }
 #endif
 
 #endif
--- a/gfx/angle/include/GLSLANG/ShaderLang.h
+++ b/gfx/angle/include/GLSLANG/ShaderLang.h
@@ -1,33 +1,16 @@
 //
 // 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 GLSLANG_SHADERLANG_H_
 #define GLSLANG_SHADERLANG_H_
 
-#if defined(COMPONENT_BUILD) && !defined(ANGLE_TRANSLATOR_STATIC)
-#if defined(_WIN32) || defined(_WIN64)
-
-#if defined(ANGLE_TRANSLATOR_IMPLEMENTATION)
-#define COMPILER_EXPORT __declspec(dllexport)
-#else
-#define COMPILER_EXPORT __declspec(dllimport)
-#endif  // defined(ANGLE_TRANSLATOR_IMPLEMENTATION)
-
-#else  // defined(_WIN32) || defined(_WIN64)
-#define COMPILER_EXPORT __attribute__((visibility("default")))
-#endif
-
-#else  // defined(COMPONENT_BUILD) && !defined(ANGLE_TRANSLATOR_STATIC)
-#define COMPILER_EXPORT
-#endif
-
 #include <stddef.h>
 
 #include "KHR/khrplatform.h"
 
 #include <array>
 #include <map>
 #include <string>
 #include <vector>
@@ -44,31 +27,31 @@ typedef unsigned int GLenum;
 }
 
 // Must be included after GLenum proxy typedef
 // Note: make sure to increment ANGLE_SH_VERSION when changing ShaderVars.h
 #include "ShaderVars.h"
 
 // Version number for shader translation API.
 // It is incremented every time the API changes.
-#define ANGLE_SH_VERSION 161
+#define ANGLE_SH_VERSION 167
 
-typedef enum {
+enum ShShaderSpec
+{
     SH_GLES2_SPEC,
     SH_WEBGL_SPEC,
 
     SH_GLES3_SPEC,
     SH_WEBGL2_SPEC,
 
     SH_GLES3_1_SPEC,
     SH_WEBGL3_SPEC,
+};
 
-} ShShaderSpec;
-
-typedef enum
+enum ShShaderOutput
 {
     // ESSL output only supported in some configurations.
     SH_ESSL_OUTPUT = 0x8B45,
 
     // GLSL output only supported in some configurations.
     SH_GLSL_COMPATIBILITY_OUTPUT = 0x8B46,
     // Note: GL introduced core profiles in 1.5.
     SH_GLSL_130_OUTPUT      = 0x8B47,
@@ -77,30 +60,25 @@ typedef enum
     SH_GLSL_330_CORE_OUTPUT = 0x8B82,
     SH_GLSL_400_CORE_OUTPUT = 0x8B83,
     SH_GLSL_410_CORE_OUTPUT = 0x8B84,
     SH_GLSL_420_CORE_OUTPUT = 0x8B85,
     SH_GLSL_430_CORE_OUTPUT = 0x8B86,
     SH_GLSL_440_CORE_OUTPUT = 0x8B87,
     SH_GLSL_450_CORE_OUTPUT = 0x8B88,
 
-    // HLSL output only supported in some configurations.
-    // Deprecated:
-    SH_HLSL_OUTPUT   = 0x8B48,
-    SH_HLSL9_OUTPUT  = 0x8B48,
-    SH_HLSL11_OUTPUT = 0x8B49,
-
     // Prefer using these to specify HLSL output type:
     SH_HLSL_3_0_OUTPUT       = 0x8B48,  // D3D 9
     SH_HLSL_4_1_OUTPUT       = 0x8B49,  // D3D 11
     SH_HLSL_4_0_FL9_3_OUTPUT = 0x8B4A   // D3D 11 feature level 9_3
-} ShShaderOutput;
+};
 
 // Compile options.
-typedef uint64_t ShCompileOptions;
+
+using ShCompileOptions = uint64_t;
 
 const ShCompileOptions SH_VALIDATE                           = 0;
 const ShCompileOptions SH_VALIDATE_LOOP_INDEXING             = UINT64_C(1) << 0;
 const ShCompileOptions SH_INTERMEDIATE_TREE                  = UINT64_C(1) << 1;
 const ShCompileOptions SH_OBJECT_CODE                        = UINT64_C(1) << 2;
 const ShCompileOptions SH_VARIABLES                          = UINT64_C(1) << 3;
 const ShCompileOptions SH_LINE_DIRECTIVES                    = UINT64_C(1) << 4;
 const ShCompileOptions SH_SOURCE_PATH                        = UINT64_C(1) << 5;
@@ -194,46 +172,69 @@ const ShCompileOptions SH_HLSL_GET_DIMEN
 // This flag works around an issue in translating GLSL function texelFetchOffset on
 // INTEL drivers. It works by translating texelFetchOffset into texelFetch.
 const ShCompileOptions SH_REWRITE_TEXELFETCHOFFSET_TO_TEXELFETCH = UINT64_C(1) << 24;
 
 // This flag works around condition bug of for and while loops in Intel Mac OSX drivers.
 // Condition calculation is not correct. Rewrite it from "CONDITION" to "CONDITION && true".
 const ShCompileOptions SH_ADD_AND_TRUE_TO_LOOP_CONDITION = UINT64_C(1) << 25;
 
-// Defines alternate strategies for implementing array index clamping.
-typedef enum {
-  // Use the clamp intrinsic for array index clamping.
-  SH_CLAMP_WITH_CLAMP_INTRINSIC = 1,
+// This flag works around a bug in evaluating unary minus operator on integer on some INTEL
+// drivers. It works by translating -(int) into ~(int) + 1.
+const ShCompileOptions SH_REWRITE_INTEGER_UNARY_MINUS_OPERATOR = UINT64_C(1) << 26;
+
+// This flag works around a bug in evaluating isnan() on some INTEL D3D and Mac OSX drivers.
+// It works by using an expression to emulate this function.
+const ShCompileOptions SH_EMULATE_ISNAN_FLOAT_FUNCTION = UINT64_C(1) << 27;
 
-  // Use a user-defined function for array index clamping.
-  SH_CLAMP_WITH_USER_DEFINED_INT_CLAMP_FUNCTION
-} ShArrayIndexClampingStrategy;
+// This flag will use all uniforms of unused std140 and shared uniform blocks at the
+// beginning of the vertex/fragment shader's main(). It is intended as a workaround for Mac
+// drivers with shader version 4.10. In those drivers, they will treat unused
+// std140 and shared uniform blocks' members as inactive. However, WebGL2.0 based on
+// OpenGL ES3.0.4 requires all members of a named uniform block declared with a shared or std140
+// layout qualifier to be considered active. The uniform block itself is also considered active.
+const ShCompileOptions SH_USE_UNUSED_STANDARD_SHARED_BLOCKS = UINT64_C(1) << 28;
 
-//
-// Driver must call this first, once, before doing any other
-// compiler operations.
-// If the function succeeds, the return value is true, else false.
-//
-COMPILER_EXPORT bool ShInitialize();
-//
-// Driver should call this at shutdown.
-// If the function succeeds, the return value is true, else false.
-//
-COMPILER_EXPORT bool ShFinalize();
+// This flag will keep invariant declaration for input in fragment shader for GLSL >=4.20 on AMD.
+// From GLSL >= 4.20, it's optional to add invariant for fragment input, but GPU vendors have
+// different implementations about this. Some drivers forbid invariant in fragment for GLSL>= 4.20,
+// e.g. Linux Mesa, some drivers treat that as optional, e.g. NVIDIA, some drivers require invariant
+// must match between vertex and fragment shader, e.g. AMD. The behavior on AMD is obviously wrong.
+// Remove invariant for input in fragment shader to workaround the restriction on Intel Mesa.
+// But don't remove on AMD Linux to avoid triggering the bug on AMD.
+const ShCompileOptions SH_DONT_REMOVE_INVARIANT_FOR_FRAGMENT_INPUT = UINT64_C(1) << 29;
+
+// Due to spec difference between GLSL 4.1 or lower and ESSL3, some platforms (for example, Mac OSX
+// core profile) require a variable's "invariant"/"centroid" qualifiers to match between vertex and
+// fragment shader. A simple solution to allow such shaders to link is to omit the two qualifiers.
+// Note that the two flags only take effect on ESSL3 input shaders translated to GLSL 4.1 or lower.
+// TODO(zmo): This is not a good long-term solution. Simply dropping these qualifiers may break some
+// developers' content. A more complex workaround of dynamically generating, compiling, and
+// re-linking shaders that use these qualifiers should be implemented.
+const ShCompileOptions SH_REMOVE_INVARIANT_AND_CENTROID_FOR_ESSL3 = UINT64_C(1) << 30;
+
+// Defines alternate strategies for implementing array index clamping.
+enum ShArrayIndexClampingStrategy
+{
+    // Use the clamp intrinsic for array index clamping.
+    SH_CLAMP_WITH_CLAMP_INTRINSIC = 1,
+
+    // Use a user-defined function for array index clamping.
+    SH_CLAMP_WITH_USER_DEFINED_INT_CLAMP_FUNCTION
+};
 
 // The 64 bits hash function. The first parameter is the input string; the
 // second parameter is the string length.
-typedef khronos_uint64_t (*ShHashFunction64)(const char*, size_t);
+using ShHashFunction64 = khronos_uint64_t (*)(const char *, size_t);
 
 //
 // Implementation dependent built-in resources (constants and extensions).
 // The names for these resources has been obtained by stripping gl_/GL_.
 //
-typedef struct
+struct ShBuiltInResources
 {
     // Constants.
     int MaxVertexAttribs;
     int MaxVertexUniformVectors;
     int MaxVaryingVectors;
     int MaxVertexTextureImageUnits;
     int MaxCombinedTextureImageUnits;
     int MaxTextureImageUnits;
@@ -355,62 +356,72 @@ typedef struct
     // maximum number of atomic counter buffers in a fragment shader
     int MaxFragmentAtomicCounterBuffers;
 
     // maximum number of atomic counter buffers in a program
     int MaxCombinedAtomicCounterBuffers;
 
     // maximum number of buffer object storage in machine units
     int MaxAtomicCounterBufferSize;
-
-} ShBuiltInResources;
-
-//
-// Initialize built-in resources with minimum expected values.
-// Parameters:
-// resources: The object to initialize. Will be comparable with memcmp.
-//
-COMPILER_EXPORT void ShInitBuiltInResources(ShBuiltInResources *resources);
+};
 
 //
 // ShHandle held by but opaque to the driver.  It is allocated,
 // managed, and de-allocated by the compiler. Its contents
 // are defined by and used by the compiler.
 //
 // If handle creation fails, 0 will be returned.
 //
-typedef void *ShHandle;
+using ShHandle = void *;
+
+//
+// Driver must call this first, once, before doing any other
+// compiler operations.
+// If the function succeeds, the return value is true, else false.
+//
+bool ShInitialize();
+//
+// Driver should call this at shutdown.
+// If the function succeeds, the return value is true, else false.
+//
+bool ShFinalize();
+
+//
+// Initialize built-in resources with minimum expected values.
+// Parameters:
+// resources: The object to initialize. Will be comparable with memcmp.
+//
+void ShInitBuiltInResources(ShBuiltInResources *resources);
 
 //
 // Returns the a concatenated list of the items in ShBuiltInResources as a
 // null-terminated string.
 // This function must be updated whenever ShBuiltInResources is changed.
 // Parameters:
 // handle: Specifies the handle of the compiler to be used.
-COMPILER_EXPORT const std::string &ShGetBuiltInResourcesString(const ShHandle handle);
+const std::string &ShGetBuiltInResourcesString(const ShHandle handle);
 
 //
 // Driver calls these to create and destroy compiler objects.
 //
 // Returns the handle of constructed compiler, null if the requested compiler is
 // not supported.
 // Parameters:
 // type: Specifies the type of shader - GL_FRAGMENT_SHADER or GL_VERTEX_SHADER.
 // spec: Specifies the language spec the compiler must conform to -
 //       SH_GLES2_SPEC or SH_WEBGL_SPEC.
 // output: Specifies the output code type - for example SH_ESSL_OUTPUT, SH_GLSL_OUTPUT,
 //         SH_HLSL_3_0_OUTPUT or SH_HLSL_4_1_OUTPUT. Note: Each output type may only
 //         be supported in some configurations.
 // resources: Specifies the built-in resources.
-COMPILER_EXPORT ShHandle ShConstructCompiler(
-    sh::GLenum type,
-    ShShaderSpec spec,
-    ShShaderOutput output,
-    const ShBuiltInResources *resources);
-COMPILER_EXPORT void ShDestruct(ShHandle handle);
+ShHandle ShConstructCompiler(sh::GLenum type,
+                             ShShaderSpec spec,
+                             ShShaderOutput output,
+                             const ShBuiltInResources *resources);
+void ShDestruct(ShHandle handle);
 
 //
 // Compiles the given shader source.
 // If the function succeeds, the return value is true, else false.
 // Parameters:
 // handle: Specifies the handle of compiler to be used.
 // shaderStrings: Specifies an array of pointers to null-terminated strings
 //                containing the shader source code.
@@ -420,95 +431,227 @@ COMPILER_EXPORT void ShDestruct(ShHandle
 //              specified during compiler construction.
 // SH_VALIDATE_LOOP_INDEXING: Validates loop and indexing in the shader to
 //                            ensure that they do not exceed the minimum
 //                            functionality mandated in GLSL 1.0 spec,
 //                            Appendix A, Section 4 and 5.
 //                            There is no need to specify this parameter when
 //                            compiling for WebGL - it is implied.
 // SH_INTERMEDIATE_TREE: Writes intermediate tree to info log.
-//                       Can be queried by calling ShGetInfoLog().
+//                       Can be queried by calling sh::GetInfoLog().
 // SH_OBJECT_CODE: Translates intermediate tree to glsl or hlsl shader.
-//                 Can be queried by calling ShGetObjectCode().
+//                 Can be queried by calling sh::GetObjectCode().
 // SH_VARIABLES: Extracts attributes, uniforms, and varyings.
 //               Can be queried by calling ShGetVariableInfo().
 //
-COMPILER_EXPORT bool ShCompile(const ShHandle handle,
-                               const char *const shaderStrings[],
-                               size_t numStrings,
-                               ShCompileOptions compileOptions);
+bool ShCompile(const ShHandle handle,
+               const char *const shaderStrings[],
+               size_t numStrings,
+               ShCompileOptions compileOptions);
 
 // Clears the results from the previous compilation.
-COMPILER_EXPORT void ShClearResults(const ShHandle handle);
+void ShClearResults(const ShHandle handle);
 
 // Return the version of the shader language.
-COMPILER_EXPORT int ShGetShaderVersion(const ShHandle handle);
+int ShGetShaderVersion(const ShHandle handle);
 
 // Return the currently set language output type.
-COMPILER_EXPORT ShShaderOutput ShGetShaderOutputType(
-    const ShHandle handle);
+ShShaderOutput ShGetShaderOutputType(const ShHandle handle);
 
 // Returns null-terminated information log for a compiled shader.
 // Parameters:
 // handle: Specifies the compiler
-COMPILER_EXPORT const std::string &ShGetInfoLog(const ShHandle handle);
+const std::string &ShGetInfoLog(const ShHandle handle);
 
 // Returns null-terminated object code for a compiled shader.
 // Parameters:
 // handle: Specifies the compiler
-COMPILER_EXPORT const std::string &ShGetObjectCode(const ShHandle handle);
+const std::string &ShGetObjectCode(const ShHandle handle);
 
 // Returns a (original_name, hash) map containing all the user defined
 // names in the shader, including variable names, function names, struct
 // names, and struct field names.
 // Parameters:
 // handle: Specifies the compiler
-COMPILER_EXPORT const std::map<std::string, std::string> *ShGetNameHashingMap(
-    const ShHandle handle);
+const std::map<std::string, std::string> *ShGetNameHashingMap(const ShHandle handle);
 
 // Shader variable inspection.
 // Returns a pointer to a list of variables of the designated type.
 // (See ShaderVars.h for type definitions, included above)
 // Returns NULL on failure.
 // Parameters:
 // handle: Specifies the compiler
-COMPILER_EXPORT const std::vector<sh::Uniform> *ShGetUniforms(const ShHandle handle);
-COMPILER_EXPORT const std::vector<sh::Varying> *ShGetVaryings(const ShHandle handle);
-COMPILER_EXPORT const std::vector<sh::Attribute> *ShGetAttributes(const ShHandle handle);
-COMPILER_EXPORT const std::vector<sh::OutputVariable> *ShGetOutputVariables(const ShHandle handle);
-COMPILER_EXPORT const std::vector<sh::InterfaceBlock> *ShGetInterfaceBlocks(const ShHandle handle);
-COMPILER_EXPORT sh::WorkGroupSize ShGetComputeShaderLocalGroupSize(const ShHandle handle);
-
-typedef struct
-{
-    sh::GLenum type;
-    int size;
-} ShVariableInfo;
+const std::vector<sh::Uniform> *ShGetUniforms(const ShHandle handle);
+const std::vector<sh::Varying> *ShGetVaryings(const ShHandle handle);
+const std::vector<sh::Attribute> *ShGetAttributes(const ShHandle handle);
+const std::vector<sh::OutputVariable> *ShGetOutputVariables(const ShHandle handle);
+const std::vector<sh::InterfaceBlock> *ShGetInterfaceBlocks(const ShHandle handle);
+sh::WorkGroupSize ShGetComputeShaderLocalGroupSize(const ShHandle handle);
 
 // Returns true if the passed in variables pack in maxVectors following
 // the packing rules from the GLSL 1.017 spec, Appendix A, section 7.
 // Returns false otherwise. Also look at the SH_ENFORCE_PACKING_RESTRICTIONS
 // flag above.
 // Parameters:
 // maxVectors: the available rows of registers.
 // variables: an array of variables.
-COMPILER_EXPORT bool ShCheckVariablesWithinPackingLimits(
-    int maxVectors,
-    const std::vector<sh::ShaderVariable> &variables);
+bool ShCheckVariablesWithinPackingLimits(int maxVectors,
+                                         const std::vector<sh::ShaderVariable> &variables);
 
 // Gives the compiler-assigned register for an interface block.
 // The method writes the value to the output variable "indexOut".
 // Returns true if it found a valid interface block, false otherwise.
 // Parameters:
 // handle: Specifies the compiler
 // interfaceBlockName: Specifies the interface block
 // indexOut: output variable that stores the assigned register
-COMPILER_EXPORT bool ShGetInterfaceBlockRegister(const ShHandle handle,
-                                                 const std::string &interfaceBlockName,
-                                                 unsigned int *indexOut);
+bool ShGetInterfaceBlockRegister(const ShHandle handle,
+                                 const std::string &interfaceBlockName,
+                                 unsigned int *indexOut);
 
 // Gives a map from uniform names to compiler-assigned registers in the default
 // interface block. Note that the map contains also registers of samplers that
 // have been extracted from structs.
-COMPILER_EXPORT const std::map<std::string, unsigned int> *ShGetUniformRegisterMap(
-    const ShHandle handle);
+const std::map<std::string, unsigned int> *ShGetUniformRegisterMap(const ShHandle handle);
+
+// Temporary duplicate of the scoped APIs, to be removed when we roll ANGLE and fix Chromium.
+// TODO(jmadill): Consolidate with these APIs once we roll ANGLE.
+
+namespace sh
+{
+
+//
+// Driver must call this first, once, before doing any other compiler operations.
+// If the function succeeds, the return value is true, else false.
+//
+bool Initialize();
+//
+// Driver should call this at shutdown.
+// If the function succeeds, the return value is true, else false.
+//
+bool Finalize();
+
+//
+// Initialize built-in resources with minimum expected values.
+// Parameters:
+// resources: The object to initialize. Will be comparable with memcmp.
+//
+void InitBuiltInResources(ShBuiltInResources *resources);
+
+//
+// Returns the a concatenated list of the items in ShBuiltInResources as a null-terminated string.
+// This function must be updated whenever ShBuiltInResources is changed.
+// Parameters:
+// handle: Specifies the handle of the compiler to be used.
+const std::string &GetBuiltInResourcesString(const ShHandle handle);
+
+//
+// Driver calls these to create and destroy compiler objects.
+//
+// Returns the handle of constructed compiler, null if the requested compiler is not supported.
+// Parameters:
+// type: Specifies the type of shader - GL_FRAGMENT_SHADER or GL_VERTEX_SHADER.
+// spec: Specifies the language spec the compiler must conform to - SH_GLES2_SPEC or SH_WEBGL_SPEC.
+// output: Specifies the output code type - for example SH_ESSL_OUTPUT, SH_GLSL_OUTPUT,
+//         SH_HLSL_3_0_OUTPUT or SH_HLSL_4_1_OUTPUT. Note: Each output type may only
+//         be supported in some configurations.
+// resources: Specifies the built-in resources.
+ShHandle ConstructCompiler(sh::GLenum type,
+                           ShShaderSpec spec,
+                           ShShaderOutput output,
+                           const ShBuiltInResources *resources);
+void Destruct(ShHandle handle);
+
+//
+// Compiles the given shader source.
+// If the function succeeds, the return value is true, else false.
+// Parameters:
+// handle: Specifies the handle of compiler to be used.
+// shaderStrings: Specifies an array of pointers to null-terminated strings containing the shader
+// source code.
+// numStrings: Specifies the number of elements in shaderStrings array.
+// compileOptions: A mask containing the following parameters:
+// SH_VALIDATE: Validates shader to ensure that it conforms to the spec
+//              specified during compiler construction.
+// SH_VALIDATE_LOOP_INDEXING: Validates loop and indexing in the shader to
+//                            ensure that they do not exceed the minimum
+//                            functionality mandated in GLSL 1.0 spec,
+//                            Appendix A, Section 4 and 5.
+//                            There is no need to specify this parameter when
+//                            compiling for WebGL - it is implied.
+// SH_INTERMEDIATE_TREE: Writes intermediate tree to info log.
+//                       Can be queried by calling sh::GetInfoLog().
+// SH_OBJECT_CODE: Translates intermediate tree to glsl or hlsl shader.
+//                 Can be queried by calling sh::GetObjectCode().
+// SH_VARIABLES: Extracts attributes, uniforms, and varyings.
+//               Can be queried by calling ShGetVariableInfo().
+//
+bool Compile(const ShHandle handle,
+             const char *const shaderStrings[],
+             size_t numStrings,
+             ShCompileOptions compileOptions);
+
+// Clears the results from the previous compilation.
+void ClearResults(const ShHandle handle);
+
+// Return the version of the shader language.
+int GetShaderVersion(const ShHandle handle);
+
+// Return the currently set language output type.
+ShShaderOutput GetShaderOutputType(const ShHandle handle);
+
+// Returns null-terminated information log for a compiled shader.
+// Parameters:
+// handle: Specifies the compiler
+const std::string &GetInfoLog(const ShHandle handle);
+
+// Returns null-terminated object code for a compiled shader.
+// Parameters:
+// handle: Specifies the compiler
+const std::string &GetObjectCode(const ShHandle handle);
+
+// Returns a (original_name, hash) map containing all the user defined names in the shader,
+// including variable names, function names, struct names, and struct field names.
+// Parameters:
+// handle: Specifies the compiler
+const std::map<std::string, std::string> *GetNameHashingMap(const ShHandle handle);
+
+// Shader variable inspection.
+// Returns a pointer to a list of variables of the designated type.
+// (See ShaderVars.h for type definitions, included above)
+// Returns NULL on failure.
+// Parameters:
+// handle: Specifies the compiler
+const std::vector<sh::Uniform> *GetUniforms(const ShHandle handle);
+const std::vector<sh::Varying> *GetVaryings(const ShHandle handle);
+const std::vector<sh::Attribute> *GetAttributes(const ShHandle handle);
+const std::vector<sh::OutputVariable> *GetOutputVariables(const ShHandle handle);
+const std::vector<sh::InterfaceBlock> *GetInterfaceBlocks(const ShHandle handle);
+sh::WorkGroupSize GetComputeShaderLocalGroupSize(const ShHandle handle);
+
+// Returns true if the passed in variables pack in maxVectors followingthe packing rules from the
+// GLSL 1.017 spec, Appendix A, section 7.
+// Returns false otherwise. Also look at the SH_ENFORCE_PACKING_RESTRICTIONS
+// flag above.
+// Parameters:
+// maxVectors: the available rows of registers.
+// variables: an array of variables.
+bool CheckVariablesWithinPackingLimits(int maxVectors,
+                                       const std::vector<sh::ShaderVariable> &variables);
+
+// Gives the compiler-assigned register for an interface block.
+// The method writes the value to the output variable "indexOut".
+// Returns true if it found a valid interface block, false otherwise.
+// Parameters:
+// handle: Specifies the compiler
+// interfaceBlockName: Specifies the interface block
+// indexOut: output variable that stores the assigned register
+bool GetInterfaceBlockRegister(const ShHandle handle,
+                               const std::string &interfaceBlockName,
+                               unsigned int *indexOut);
+
+// Gives a map from uniform names to compiler-assigned registers in the default interface block.
+// Note that the map contains also registers of samplers that have been extracted from structs.
+const std::map<std::string, unsigned int> *GetUniformRegisterMap(const ShHandle handle);
+
+}  // namespace sh
 
 #endif // GLSLANG_SHADERLANG_H_
--- a/gfx/angle/include/GLSLANG/ShaderVars.h
+++ b/gfx/angle/include/GLSLANG/ShaderVars.h
@@ -24,31 +24,31 @@ namespace sh
 enum InterpolationType
 {
     INTERPOLATION_SMOOTH,
     INTERPOLATION_CENTROID,
     INTERPOLATION_FLAT
 };
 
 // Validate link & SSO consistency of interpolation qualifiers
-COMPILER_EXPORT bool InterpolationTypesMatch(InterpolationType a, InterpolationType b);
+bool InterpolationTypesMatch(InterpolationType a, InterpolationType b);
 
 // Uniform block layout qualifier, see section 4.3.8.3 of the ESSL 3.00.4 spec
 enum BlockLayoutType
 {
     BLOCKLAYOUT_STANDARD,
     BLOCKLAYOUT_PACKED,
     BLOCKLAYOUT_SHARED
 };
 
 // Base class for all variables defined in shaders, including Varyings, Uniforms, etc
 // Note: we must override the copy constructor and assignment operator so we can
 // work around excessive GCC binary bloating:
 // See https://code.google.com/p/angleproject/issues/detail?id=697
-struct COMPILER_EXPORT ShaderVariable
+struct ShaderVariable
 {
     ShaderVariable();
     ShaderVariable(GLenum typeIn, unsigned int arraySizeIn);
     ~ShaderVariable();
     ShaderVariable(const ShaderVariable &other);
     ShaderVariable &operator=(const ShaderVariable &other);
 
     bool isArray() const { return arraySize > 0; }
@@ -87,17 +87,17 @@ struct COMPILER_EXPORT ShaderVariable
 
     bool operator==(const ShaderVariable &other) const;
     bool operator!=(const ShaderVariable &other) const
     {
         return !operator==(other);
     }
 };
 
-struct COMPILER_EXPORT Uniform : public ShaderVariable
+struct Uniform : public ShaderVariable
 {
     Uniform();
     ~Uniform();
     Uniform(const Uniform &other);
     Uniform &operator=(const Uniform &other);
     bool operator==(const Uniform &other) const;
     bool operator!=(const Uniform &other) const
     {
@@ -108,49 +108,49 @@ struct COMPILER_EXPORT Uniform : public 
     // assuming one from vertex shader and the other from fragment shader.
     // See GLSL ES Spec 3.00.3, sec 4.3.5.
     bool isSameUniformAtLinkTime(const Uniform &other) const;
 };
 
 // An interface variable is a variable which passes data between the GL data structures and the
 // shader execution: either vertex shader inputs or fragment shader outputs. These variables can
 // have integer locations to pass back to the GL API.
-struct COMPILER_EXPORT InterfaceVariable : public ShaderVariable
+struct InterfaceVariable : public ShaderVariable
 {
     InterfaceVariable();
     ~InterfaceVariable();
     InterfaceVariable(const InterfaceVariable &other);
     InterfaceVariable &operator=(const InterfaceVariable &other);
     bool operator==(const InterfaceVariable &other) const;
     bool operator!=(const InterfaceVariable &other) const { return !operator==(other); }
 
     int location;
 };
 
-struct COMPILER_EXPORT Attribute : public InterfaceVariable
+struct Attribute : public InterfaceVariable
 {
     Attribute();
     ~Attribute();
     Attribute(const Attribute &other);
     Attribute &operator=(const Attribute &other);
     bool operator==(const Attribute &other) const;
     bool operator!=(const Attribute &other) const { return !operator==(other); }
 };
 
-struct COMPILER_EXPORT OutputVariable : public InterfaceVariable
+struct OutputVariable : public InterfaceVariable
 {
     OutputVariable();
     ~OutputVariable();
     OutputVariable(const OutputVariable &other);
     OutputVariable &operator=(const OutputVariable &other);
     bool operator==(const OutputVariable &other) const;
     bool operator!=(const OutputVariable &other) const { return !operator==(other); }
 };
 
-struct COMPILER_EXPORT InterfaceBlockField : public ShaderVariable
+struct InterfaceBlockField : public ShaderVariable
 {
     InterfaceBlockField();
     ~InterfaceBlockField();
     InterfaceBlockField(const InterfaceBlockField &other);
     InterfaceBlockField &operator=(const InterfaceBlockField &other);
     bool operator==(const InterfaceBlockField &other) const;
     bool operator!=(const InterfaceBlockField &other) const
     {
@@ -162,17 +162,17 @@ struct COMPILER_EXPORT InterfaceBlockFie
     // fragment shader.
     // See GLSL ES Spec 3.00.3, sec 4.3.7.
     bool isSameInterfaceBlockFieldAtLinkTime(
         const InterfaceBlockField &other) const;
 
     bool isRowMajorLayout;
 };
 
-struct COMPILER_EXPORT Varying : public ShaderVariable
+struct Varying : public ShaderVariable
 {
     Varying();
     ~Varying();
     Varying(const Varying &otherg);
     Varying &operator=(const Varying &other);
     bool operator==(const Varying &other) const;
     bool operator!=(const Varying &other) const
     {
@@ -188,17 +188,17 @@ struct COMPILER_EXPORT Varying : public 
 
     // Deprecated version of isSameVaryingAtLinkTime, which assumes ESSL1.
     bool isSameVaryingAtLinkTime(const Varying &other) const;
 
     InterpolationType interpolation;
     bool isInvariant;
 };
 
-struct COMPILER_EXPORT InterfaceBlock
+struct InterfaceBlock
 {
     InterfaceBlock();
     ~InterfaceBlock();
     InterfaceBlock(const InterfaceBlock &other);
     InterfaceBlock &operator=(const InterfaceBlock &other);
 
     // Fields from blocks with non-empty instance names are prefixed with the block name.
     std::string fieldPrefix() const;
@@ -211,17 +211,17 @@ struct COMPILER_EXPORT InterfaceBlock
     std::string instanceName;
     unsigned int arraySize;
     BlockLayoutType layout;
     bool isRowMajorLayout;
     bool staticUse;
     std::vector<InterfaceBlockField> fields;
 };
 
-struct COMPILER_EXPORT WorkGroupSize
+struct WorkGroupSize
 {
     void fill(int fillValue);
     void setLocalSize(int localSizeX, int localSizeY, int localSizeZ);
 
     int &operator[](size_t index);
     int operator[](size_t index) const;
     size_t size() const;
 
--- a/gfx/angle/moz.build
+++ b/gfx/angle/moz.build
@@ -69,56 +69,59 @@ UNIFIED_SOURCES += [
     'src/compiler/translator/OutputHLSL.cpp',
     'src/compiler/translator/ParseContext.cpp',
     'src/compiler/translator/PoolAlloc.cpp',
     'src/compiler/translator/PruneEmptyDeclarations.cpp',
     'src/compiler/translator/QualifierTypes.cpp',
     'src/compiler/translator/RecordConstantPrecision.cpp',
     'src/compiler/translator/RegenerateStructNames.cpp',
     'src/compiler/translator/RemoveDynamicIndexing.cpp',
+    'src/compiler/translator/RemoveInvariantDeclaration.cpp',
     'src/compiler/translator/RemovePow.cpp',
     'src/compiler/translator/RemoveSwitchFallThrough.cpp',
     'src/compiler/translator/RewriteDoWhile.cpp',
     'src/compiler/translator/RewriteElseBlocks.cpp',
-    'src/compiler/translator/RewriteTexelFetchOffset.cpp',
+    'src/compiler/translator/RewriteUnaryMinusOperatorInt.cpp',
     'src/compiler/translator/ScalarizeVecAndMatConstructorArgs.cpp',
     'src/compiler/translator/SearchSymbol.cpp',
     'src/compiler/translator/SeparateArrayInitialization.cpp',
     'src/compiler/translator/SeparateDeclarations.cpp',
     'src/compiler/translator/SeparateExpressionsReturningArrays.cpp',
-    'src/compiler/translator/ShaderLang.cpp',
     'src/compiler/translator/ShaderVars.cpp',
     'src/compiler/translator/SimplifyLoopConditions.cpp',
     'src/compiler/translator/SplitSequenceOperator.cpp',
     'src/compiler/translator/StructureHLSL.cpp',
     'src/compiler/translator/SymbolTable.cpp',
     'src/compiler/translator/TextureFunctionHLSL.cpp',
     'src/compiler/translator/TranslatorESSL.cpp',
     'src/compiler/translator/TranslatorGLSL.cpp',
     'src/compiler/translator/TranslatorHLSL.cpp',
     'src/compiler/translator/Types.cpp',
     'src/compiler/translator/UnfoldShortCircuitAST.cpp',
     'src/compiler/translator/UnfoldShortCircuitToIf.cpp',
     'src/compiler/translator/UniformHLSL.cpp',
+    'src/compiler/translator/UseInterfaceBlockFields.cpp',
     'src/compiler/translator/util.cpp',
     'src/compiler/translator/UtilsHLSL.cpp',
     'src/compiler/translator/ValidateGlobalInitializer.cpp',
     'src/compiler/translator/ValidateLimitations.cpp',
     'src/compiler/translator/ValidateMaxParameters.cpp',
     'src/compiler/translator/ValidateOutputs.cpp',
     'src/compiler/translator/ValidateSwitch.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/EmulateGLFragColorBroadcast.cpp',
     'src/compiler/translator/glslang_lex.cpp',
     'src/compiler/translator/glslang_tab.cpp',
+    'src/compiler/translator/RewriteTexelFetchOffset.cpp',
+    'src/compiler/translator/ShaderLang.cpp',
 ]
 
 
 if CONFIG['GNU_CXX']:
     CXXFLAGS += [
         '-Wno-attributes',
         '-Wno-shadow',
         '-Wno-sign-compare',
--- a/gfx/angle/src/angle.gyp
+++ b/gfx/angle/src/angle.gyp
@@ -40,30 +40,31 @@
             {
                 'angle_enable_gl%': 1,
             }],
             ['use_ozone==1',
             {
                 'angle_enable_gl%': 1,
             }],
         ],
+        'angle_enable_null%': 1, # Available on all platforms
     },
     'includes':
     [
         'compiler.gypi',
         'libGLESv2.gypi',
         'libEGL.gypi'
     ],
 
     'targets':
     [
         {
             'target_name': 'angle_common',
             'type': 'static_library',
-            'includes': [ '../build/common_defines.gypi', ],
+            'includes': [ '../gyp/common_defines.gypi', ],
             'sources':
             [
                 '<@(libangle_common_sources)',
             ],
             'include_dirs':
             [
                 '.',
                 '../include',
@@ -140,17 +141,17 @@
                     },
                 }],
             ],
         },
 
         {
             'target_name': 'angle_image_util',
             'type': 'static_library',
-            'includes': [ '../build/common_defines.gypi', ],
+            'includes': [ '../gyp/common_defines.gypi', ],
             'sources':
             [
                 '<@(libangle_image_util_sources)',
             ],
             'include_dirs':
             [
                 '.',
                 '../include',
@@ -167,17 +168,17 @@
                     '<(angle_path)/src',
                 ],
             },
         },
 
         {
             'target_name': 'copy_scripts',
             'type': 'none',
-            'includes': [ '../build/common_defines.gypi', ],
+            'includes': [ '../gyp/common_defines.gypi', ],
             'hard_dependency': 1,
             'copies':
             [
                 {
                     'destination': '<(angle_gen_path)',
                     'files': [ 'copy_compiler_dll.bat', '<(angle_id_script_base)' ],
                 },
             ],
@@ -194,17 +195,17 @@
     [
         ['angle_use_commit_id!=0',
         {
             'targets':
             [
                 {
                     'target_name': 'commit_id',
                     'type': 'none',
-                    'includes': [ '../build/common_defines.gypi', ],
+                    'includes': [ '../gyp/common_defines.gypi', ],
                     'dependencies': [ 'copy_scripts', ],
                     'hard_dependency': 1,
                     '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
@@ -236,17 +237,17 @@
         },
         { # angle_use_commit_id==0
             'targets':
             [
                 {
                     'target_name': 'commit_id',
                     'type': 'none',
                     'hard_dependency': 1,
-                    'includes': [ '../build/common_defines.gypi', ],
+                    'includes': [ '../gyp/common_defines.gypi', ],
                     'copies':
                     [
                         {
                             'destination': '<(angle_gen_path)/id',
                             'files': [ '<(angle_id_header_base)' ]
                         }
                     ],
                     'all_dependent_settings':
@@ -269,17 +270,17 @@
         ['OS=="win"',
         {
             'targets':
             [
                 {
                     'target_name': 'copy_compiler_dll',
                     'type': 'none',
                     'dependencies': [ 'copy_scripts', ],
-                    'includes': [ '../build/common_defines.gypi', ],
+                    'includes': [ '../gyp/common_defines.gypi', ],
                     'conditions':
                     [
                         ['angle_build_winrt==0',
                         {
                             'actions':
                             [
                                 {
                                     'action_name': 'copy_dll',
--- a/gfx/angle/src/commit.h
+++ b/gfx/angle/src/commit.h
@@ -1,3 +1,3 @@
-#define ANGLE_COMMIT_HASH "8b3e8b4d1b09"
+#define ANGLE_COMMIT_HASH "2a250c8a0e15"
 #define ANGLE_COMMIT_HASH_SIZE 12
-#define ANGLE_COMMIT_DATE "2016-10-24 15:38:47 +0800"
+#define ANGLE_COMMIT_DATE "2016-11-23 17:58:16 +0800"
--- a/gfx/angle/src/common/BitSetIterator.h
+++ b/gfx/angle/src/common/BitSetIterator.h
@@ -99,17 +99,16 @@ typename BitSetIterator<N>::Iterator &Bi
 
 inline unsigned long ScanForward(unsigned long bits)
 {
     ASSERT(bits != 0);
 #if defined(ANGLE_PLATFORM_WINDOWS)
     unsigned long firstBitIndex = 0ul;
     unsigned char ret = _BitScanForward(&firstBitIndex, bits);
     ASSERT(ret != 0);
-    UNUSED_ASSERTION_VARIABLE(ret);
     return firstBitIndex;
 #elif defined(ANGLE_PLATFORM_POSIX)
     return static_cast<unsigned long>(__builtin_ctzl(bits));
 #else
 #error Please implement bit-scan-forward for your platform!
 #endif
 }
 
--- a/gfx/angle/src/common/angleutils.h
+++ b/gfx/angle/src/common/angleutils.h
@@ -151,16 +151,24 @@ inline std::string Str(int i)
     return strstr.str();
 }
 
 size_t FormatStringIntoVector(const char *fmt, va_list vararg, std::vector<char>& buffer);
 
 std::string FormatString(const char *fmt, va_list vararg);
 std::string FormatString(const char *fmt, ...);
 
+template <typename T>
+std::string ToString(const T &value)
+{
+    std::ostringstream o;
+    o << value;
+    return o.str();
+}
+
 // snprintf is not defined with MSVC prior to to msvc14
 #if defined(_MSC_VER) && _MSC_VER < 1900
 #define snprintf _snprintf
 #endif
 
 #define GL_BGR565_ANGLEX 0x6ABB
 #define GL_BGRA4_ANGLEX 0x6ABC
 #define GL_BGR5_A1_ANGLEX 0x6ABD
--- a/gfx/angle/src/common/debug.cpp
+++ b/gfx/angle/src/common/debug.cpp
@@ -166,9 +166,14 @@ ScopedPerfEventHelper::ScopedPerfEventHe
 ScopedPerfEventHelper::~ScopedPerfEventHelper()
 {
     if (DebugAnnotationsActive())
     {
         g_debugAnnotator->endEvent();
     }
 }
 
+std::ostream &DummyStream()
+{
+    return std::cout;
 }
+
+}  // namespace gl
--- a/gfx/angle/src/common/debug.h
+++ b/gfx/angle/src/common/debug.h
@@ -52,17 +52,30 @@ class DebugAnnotator : angle::NonCopyabl
     virtual void setMarker(const wchar_t *markerName) = 0;
     virtual bool getStatus() = 0;
 };
 
 void InitializeDebugAnnotations(DebugAnnotator *debugAnnotator);
 void UninitializeDebugAnnotations();
 bool DebugAnnotationsActive();
 
-}
+// This class is used to explicitly ignore values in the conditional logging macros. This avoids
+// compiler warnings like "value computed is not used" and "statement has no effect".
+class LogMessageVoidify
+{
+  public:
+    LogMessageVoidify() {}
+    // This has to be an operator with a precedence lower than << but higher than ?:
+    void operator&(std::ostream &) {}
+};
+
+// This can be any ostream, it is unused, but needs to be a valid reference.
+std::ostream &DummyStream();
+
+}  // namespace gl
 
 #if defined(ANGLE_ENABLE_DEBUG_TRACE) || defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
 #define ANGLE_TRACE_ENABLED
 #endif
 
 #define ANGLE_EMPTY_STATEMENT for (;;) break
 #if !defined(NDEBUG) || defined(ANGLE_ENABLE_RELEASE_ASSERTS)
 #define ANGLE_ENABLE_ASSERTS
@@ -99,66 +112,63 @@ bool DebugAnnotationsActive();
 #else
 #define EVENT(message, ...) (void(0))
 #endif
 
 #if defined(ANGLE_TRACE_ENABLED)
 #undef ANGLE_TRACE_ENABLED
 #endif
 
+#if defined(COMPILER_GCC) || defined(__clang__)
+#define ANGLE_CRASH() __builtin_trap()
+#else
+#define ANGLE_CRASH() ((void)(*(volatile char *)0 = 0))
+#endif
+
 #if !defined(NDEBUG)
 #define ANGLE_ASSERT_IMPL(expression) assert(expression)
 #else
 // TODO(jmadill): Detect if debugger is attached and break.
-#define ANGLE_ASSERT_IMPL(expression) abort()
+#define ANGLE_ASSERT_IMPL(expression) ANGLE_CRASH()
 #endif  // !defined(NDEBUG)
 
+// Helper macro which avoids evaluating the arguments to a stream if the condition doesn't hold.
+// Condition is evaluated once and only once.
+#define ANGLE_LAZY_STREAM(stream, condition) \
+    !(condition) ? static_cast<void>(0) : ::gl::LogMessageVoidify() & (stream)
+
+#if defined(NDEBUG) && !defined(ANGLE_ENABLE_ASSERTS)
+#define ANGLE_ASSERTS_ON 0
+#else
+#define ANGLE_ASSERTS_ON 1
+#endif
+
 // A macro asserting a condition and outputting failures to the debug log
-#if defined(ANGLE_ENABLE_ASSERTS)
-#define ASSERT(expression)                                                                 \
-    {                                                                                      \
-        if (!(expression))                                                                 \
-        {                                                                                  \
-            ERR("\t! Assert failed in %s(%d): %s\n", __FUNCTION__, __LINE__, #expression); \
-            ANGLE_ASSERT_IMPL(expression);                                                 \
-        }                                                                                  \
-    }                                                                                      \
-    ANGLE_EMPTY_STATEMENT
-#define UNUSED_ASSERTION_VARIABLE(variable)
+#if ANGLE_ASSERTS_ON
+#define ASSERT(expression)                                                                        \
+    (expression ? static_cast<void>(0)                                                            \
+                : (ERR("\t! Assert failed in %s(%d): %s\n", __FUNCTION__, __LINE__, #expression), \
+                   ANGLE_ASSERT_IMPL(expression)))
 #else
-#define ASSERT(expression) (void(0))
-#define UNUSED_ASSERTION_VARIABLE(variable) ((void)variable)
-#endif
+#define ASSERT(condition)                                                           \
+    ANGLE_LAZY_STREAM(::gl::DummyStream(), ANGLE_ASSERTS_ON ? !(condition) : false) \
+        << "Check failed: " #condition ". "
+#endif  // ANGLE_ASSERTS_ON
 
 #define UNUSED_VARIABLE(variable) ((void)variable)
 
 // A macro to indicate unimplemented functionality
-
-#if defined (ANGLE_TEST_CONFIG)
+#ifndef NOASSERT_UNIMPLEMENTED
 #define NOASSERT_UNIMPLEMENTED 1
 #endif
 
-// 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
-
-#if !defined(NDEBUG)
-#define UNIMPLEMENTED() { \
-    FIXME("\t! Unimplemented: %s(%d)\n", __FUNCTION__, __LINE__); \
-    assert(NOASSERT_UNIMPLEMENTED); \
-    } ANGLE_EMPTY_STATEMENT
-#else
-    #define UNIMPLEMENTED() FIXME("\t! Unimplemented: %s(%d)\n", __FUNCTION__, __LINE__)
-#endif
+#define UNIMPLEMENTED()                                             \
+    {                                                               \
+        ERR("\t! Unimplemented: %s(%d)\n", __FUNCTION__, __LINE__); \
+        ASSERT(NOASSERT_UNIMPLEMENTED);                             \
+    }                                                               \
+    ANGLE_EMPTY_STATEMENT
 
 // A macro for code which is not expected to be reached under valid assumptions
-#if !defined(NDEBUG)
-#define UNREACHABLE() { \
-    ERR("\t! Unreachable reached: %s(%d)\n", __FUNCTION__, __LINE__); \
-    assert(false); \
-    } ANGLE_EMPTY_STATEMENT
-#else
-    #define UNREACHABLE() ERR("\t! Unreachable reached: %s(%d)\n", __FUNCTION__, __LINE__)
-#endif
+#define UNREACHABLE() \
+    (ERR("\t! Unreachable reached: %s(%d)\n", __FUNCTION__, __LINE__), ASSERT(false))
 
 #endif   // COMMON_DEBUG_H_
--- a/gfx/angle/src/common/mathutil.cpp
+++ b/gfx/angle/src/common/mathutil.cpp
@@ -9,36 +9,42 @@
 #include "common/mathutil.h"
 
 #include <algorithm>
 #include <math.h>
 
 namespace gl
 {
 
+namespace
+{
+
 struct RGB9E5Data
 {
     unsigned int R : 9;
     unsigned int G : 9;
     unsigned int B : 9;
     unsigned int E : 5;
 };
 
 // B is the exponent bias (15)
-static const int g_sharedexp_bias = 15;
+constexpr int g_sharedexp_bias = 15;
 
 // N is the number of mantissa bits per component (9)
-static const int g_sharedexp_mantissabits = 9;
+constexpr int g_sharedexp_mantissabits = 9;
 
 // Emax is the maximum allowed biased exponent value (31)
-static const int g_sharedexp_maxexponent = 31;
+constexpr int g_sharedexp_maxexponent = 31;
 
-static const float g_sharedexp_max = ((pow(2.0f, g_sharedexp_mantissabits) - 1) /
-                                       pow(2.0f, g_sharedexp_mantissabits)) *
-                                     pow(2.0f, g_sharedexp_maxexponent - g_sharedexp_bias);
+constexpr float g_sharedexp_max =
+    ((static_cast<float>(1 << g_sharedexp_mantissabits) - 1) /
+     static_cast<float>(1 << g_sharedexp_mantissabits)) *
+    static_cast<float>(1 << (g_sharedexp_maxexponent - g_sharedexp_bias));
+
+}  // anonymous namespace
 
 unsigned int convertRGBFloatsTo999E5(float red, float green, float blue)
 {
     const float red_c = std::max<float>(0, std::min(g_sharedexp_max, red));
     const float green_c = std::max<float>(0, std::min(g_sharedexp_max, green));
     const float blue_c = std::max<float>(0, std::min(g_sharedexp_max, blue));
 
     const float max_c = std::max<float>(std::max<float>(red_c, green_c), blue_c);
--- a/gfx/angle/src/common/mathutil.h
+++ b/gfx/angle/src/common/mathutil.h
@@ -39,16 +39,25 @@ struct Vector4
     Vector4(float x, float y, float z, float w) : x(x), y(y), z(z), w(w) {}
 
     float x;
     float y;
     float z;
     float w;
 };
 
+struct Vector2
+{
+    Vector2() {}
+    Vector2(float x, float y) : x(x), y(y) {}
+
+    float x;
+    float y;
+};
+
 inline bool isPow2(int x)
 {
     return (x & (x - 1)) == 0 && (x != 0);
 }
 
 inline int log2(int x)
 {
     int r = 0;
@@ -751,16 +760,50 @@ struct iSquareRoot<N, N>
 }  // namespace priv
 
 template <unsigned int N>
 constexpr unsigned int iSquareRoot()
 {
     return priv::iSquareRoot<N, 1>::value;
 }
 
+// Sum, difference and multiplication operations for signed ints that wrap on 32-bit overflow.
+//
+// Unsigned types are defined to do arithmetic modulo 2^n in C++. For signed types, overflow
+// behavior is undefined.
+
+template <typename T>
+inline T WrappingSum(T lhs, T rhs)
+{
+    uint32_t lhsUnsigned = static_cast<uint32_t>(lhs);
+    uint32_t rhsUnsigned = static_cast<uint32_t>(rhs);
+    return static_cast<T>(lhsUnsigned + rhsUnsigned);
+}
+
+template <typename T>
+inline T WrappingDiff(T lhs, T rhs)
+{
+    uint32_t lhsUnsigned = static_cast<uint32_t>(lhs);
+    uint32_t rhsUnsigned = static_cast<uint32_t>(rhs);
+    return static_cast<T>(lhsUnsigned - rhsUnsigned);
+}
+
+inline int32_t WrappingMul(int32_t lhs, int32_t rhs)
+{
+    int64_t lhsWide = static_cast<int64_t>(lhs);
+    int64_t rhsWide = static_cast<int64_t>(rhs);
+    // The multiplication is guaranteed not to overflow.
+    int64_t resultWide = lhsWide * rhsWide;
+    // Implement the desired wrapping behavior by masking out the high-order 32 bits.
+    resultWide = resultWide & 0xffffffffll;
+    // Casting to a narrower signed type is fine since the casted value is representable in the
+    // narrower type.
+    return static_cast<int32_t>(resultWide);
+}
+
 }  // namespace gl
 
 namespace rx
 {
 
 template <typename T>
 T roundUp(const T value, const T alignment)
 {
--- a/gfx/angle/src/common/third_party/numerics/base/logging.h
+++ b/gfx/angle/src/common/third_party/numerics/base/logging.h
@@ -11,12 +11,12 @@
 #include "common/debug.h"
 
 #ifndef CHECK
 #define CHECK(X) ASSERT(X)
 #endif
 
 // Unfortunately ANGLE relies on ASSERT being an empty statement, which these libs don't respect.
 #ifndef NOTREACHED
-#define NOTREACHED() 0
+#define NOTREACHED() UNREACHABLE()
 #endif
 
-#endif  // BASE_LOGGING_H_
\ No newline at end of file
+#endif  // BASE_LOGGING_H_
--- a/gfx/angle/src/common/third_party/numerics/base/numerics/safe_conversions_impl.h
+++ b/gfx/angle/src/common/third_party/numerics/base/numerics/safe_conversions_impl.h
@@ -87,17 +87,17 @@ template <typename Dst, typename Src>
 struct StaticDstRangeRelationToSrcRange<Dst,
                                         Src,
                                         INTEGER_REPRESENTATION_UNSIGNED,
                                         INTEGER_REPRESENTATION_SIGNED>
 {
     static const NumericRangeRepresentation value = NUMERIC_RANGE_NOT_CONTAINED;
 };
 
-enum RangeConstraint
+enum RangeConstraint : unsigned char
 {
     RANGE_VALID     = 0x0,  // Value can be represented by the destination type.
     RANGE_UNDERFLOW = 0x1,  // Value would overflow.
     RANGE_OVERFLOW  = 0x2,  // Value would underflow.
     RANGE_INVALID   = RANGE_UNDERFLOW | RANGE_OVERFLOW  // Invalid (i.e. NaN).
 };
 
 // Helper function for coercing an int back to a RangeContraint.
--- a/gfx/angle/src/common/utilities.cpp
+++ b/gfx/angle/src/common/utilities.cpp
@@ -242,17 +242,29 @@ int VariableRowCount(GLenum type)
       case GL_INT_SAMPLER_2D_ARRAY:
       case GL_UNSIGNED_INT_SAMPLER_2D:
       case GL_UNSIGNED_INT_SAMPLER_3D:
       case GL_UNSIGNED_INT_SAMPLER_CUBE:
       case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
       case GL_SAMPLER_2D_SHADOW:
       case GL_SAMPLER_CUBE_SHADOW:
       case GL_SAMPLER_2D_ARRAY_SHADOW:
-        return 1;
+      case GL_IMAGE_2D:
+      case GL_INT_IMAGE_2D:
+      case GL_UNSIGNED_INT_IMAGE_2D:
+      case GL_IMAGE_2D_ARRAY:
+      case GL_INT_IMAGE_2D_ARRAY:
+      case GL_UNSIGNED_INT_IMAGE_2D_ARRAY:
+      case GL_IMAGE_3D:
+      case GL_INT_IMAGE_3D:
+      case GL_UNSIGNED_INT_IMAGE_3D:
+      case GL_IMAGE_CUBE:
+      case GL_INT_IMAGE_CUBE:
+      case GL_UNSIGNED_INT_IMAGE_CUBE:
+          return 1;
       case GL_FLOAT_MAT2:
       case GL_FLOAT_MAT3x2:
       case GL_FLOAT_MAT4x2:
         return 2;
       case GL_FLOAT_MAT3:
       case GL_FLOAT_MAT2x3:
       case GL_FLOAT_MAT4x3:
         return 3;
@@ -639,16 +651,39 @@ std::string ParseUniformName(const std::
         {
             *outSubscript = GL_INVALID_INDEX;
         }
     }
 
     return name.substr(0, open);
 }
 
+template <>
+GLuint ConvertToGLuint(GLfloat param)
+{
+    return uiround<GLuint>(param);
+}
+
+template <>
+GLint ConvertToGLint(GLfloat param)
+{
+    return iround<GLint>(param);
+}
+
+template <>
+GLint ConvertFromGLfloat(GLfloat param)
+{
+    return iround<GLint>(param);
+}
+template <>
+GLuint ConvertFromGLfloat(GLfloat param)
+{
+    return uiround<GLuint>(param);
+}
+
 unsigned int ParseAndStripArrayIndex(std::string *name)
 {
     unsigned int subscript = GL_INVALID_INDEX;
 
     // Strip any trailing array operator and retrieve the subscript
     size_t open  = name->find_last_of('[');
     size_t close = name->find_last_of(']');
     if (open != std::string::npos && close == name->length() - 1)
--- a/gfx/angle/src/common/utilities.h
+++ b/gfx/angle/src/common/utilities.h
@@ -63,16 +63,86 @@ GLuint GetPrimitiveRestartIndex(GLenum i
 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); }
 
+// Helper for converting arbitrary GL types to other GL types used in queries and state setting
+template <typename ParamType>
+GLuint ConvertToGLuint(ParamType param)
+{
+    return static_cast<GLuint>(param);
+}
+template <>
+GLuint ConvertToGLuint(GLfloat param);
+
+template <typename ParamType>
+GLint ConvertToGLint(ParamType param)
+{
+    return static_cast<GLint>(param);
+}
+template <>
+GLint ConvertToGLint(GLfloat param);
+
+// Same conversion as uint
+template <typename ParamType>
+GLenum ConvertToGLenum(ParamType param)
+{
+    return static_cast<GLenum>(ConvertToGLuint(param));
+}
+
+template <typename ParamType>
+GLfloat ConvertToGLfloat(ParamType param)
+{
+    return static_cast<GLfloat>(param);
+}
+
+template <typename ParamType>
+ParamType ConvertFromGLfloat(GLfloat param)
+{
+    return static_cast<ParamType>(param);
+}
+template <>
+GLint ConvertFromGLfloat(GLfloat param);
+template <>
+GLuint ConvertFromGLfloat(GLfloat param);
+
+template <typename ParamType>
+ParamType ConvertFromGLenum(GLenum param)
+{
+    return static_cast<ParamType>(param);
+}
+
+template <typename ParamType>
+ParamType ConvertFromGLuint(GLuint param)
+{
+    return static_cast<ParamType>(param);
+}
+
+template <typename ParamType>
+ParamType ConvertFromGLint(GLint param)
+{
+    return static_cast<ParamType>(param);
+}
+
+template <typename ParamType>
+ParamType ConvertFromGLboolean(GLboolean param)
+{
+    return static_cast<ParamType>(param ? GL_TRUE : GL_FALSE);
+}
+
+template <typename ParamType>
+ParamType ConvertFromGLint64(GLint64 param)
+{
+    return clampCast<ParamType>(param);
+}
+
 unsigned int ParseAndStripArrayIndex(std::string *name);
 
 }  // namespace gl
 
 namespace egl
 {
 static const EGLenum FirstCubeMapTextureTarget = EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR;
 static const EGLenum LastCubeMapTextureTarget = EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR;
--- a/gfx/angle/src/compiler.gypi
+++ b/gfx/angle/src/compiler.gypi
@@ -1,17 +1,17 @@
 # Copyright (c) 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.
 
 {
     'variables':
     {
         # These file lists are shared with the GN build.
-        'angle_translator_lib_sources':
+        'angle_translator_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',
@@ -87,32 +87,40 @@
             'compiler/translator/PruneEmptyDeclarations.cpp',
             'compiler/translator/PruneEmptyDeclarations.h',
             'compiler/translator/QualifierTypes.h',
             'compiler/translator/QualifierTypes.cpp',
             'compiler/translator/RecordConstantPrecision.cpp',
             'compiler/translator/RecordConstantPrecision.h',
             'compiler/translator/RegenerateStructNames.cpp',
             'compiler/translator/RegenerateStructNames.h',
+            'compiler/translator/RemoveInvariantDeclaration.cpp',
+            'compiler/translator/RemoveInvariantDeclaration.h',
             'compiler/translator/RemovePow.cpp',
             'compiler/translator/RemovePow.h',
             'compiler/translator/RewriteDoWhile.cpp',
             'compiler/translator/RewriteDoWhile.h',
             'compiler/translator/RewriteTexelFetchOffset.cpp',
             'compiler/translator/RewriteTexelFetchOffset.h',
+            'compiler/translator/RewriteUnaryMinusOperatorInt.cpp',
+            'compiler/translator/RewriteUnaryMinusOperatorInt.h',
             'compiler/translator/ScalarizeVecAndMatConstructorArgs.cpp',
             'compiler/translator/ScalarizeVecAndMatConstructorArgs.h',
             'compiler/translator/SearchSymbol.cpp',
             'compiler/translator/SearchSymbol.h',
+            'compiler/translator/ShaderLang.cpp',
+            'compiler/translator/ShaderVars.cpp',
             'compiler/translator/SymbolTable.cpp',
             'compiler/translator/SymbolTable.h',
             'compiler/translator/Types.cpp',
             'compiler/translator/Types.h',
             'compiler/translator/UnfoldShortCircuitAST.cpp',
             'compiler/translator/UnfoldShortCircuitAST.h',
+            'compiler/translator/UseInterfaceBlockFields.cpp',
+            'compiler/translator/UseInterfaceBlockFields.h',
             'compiler/translator/ValidateGlobalInitializer.cpp',
             'compiler/translator/ValidateGlobalInitializer.h',
             'compiler/translator/ValidateLimitations.cpp',
             'compiler/translator/ValidateLimitations.h',
             'compiler/translator/ValidateMaxParameters.h',
             'compiler/translator/ValidateMaxParameters.cpp',
             'compiler/translator/ValidateOutputs.cpp',
             'compiler/translator/ValidateOutputs.h',
@@ -132,39 +140,39 @@
             'compiler/translator/glslang_tab.h',
             'compiler/translator/intermOut.cpp',
             'compiler/translator/length_limits.h',
             'compiler/translator/util.cpp',
             'compiler/translator/util.h',
             'third_party/compiler/ArrayBoundsClamper.cpp',
             'third_party/compiler/ArrayBoundsClamper.h',
         ],
-        'angle_translator_lib_essl_sources':
+        'angle_translator_essl_sources':
         [
             'compiler/translator/OutputESSL.cpp',
             'compiler/translator/OutputESSL.h',
             'compiler/translator/TranslatorESSL.cpp',
             'compiler/translator/TranslatorESSL.h',
         ],
-        'angle_translator_lib_glsl_sources':
+        'angle_translator_glsl_sources':
         [
             'compiler/translator/BuiltInFunctionEmulatorGLSL.cpp',
             'compiler/translator/BuiltInFunctionEmulatorGLSL.h',
             'compiler/translator/ExtensionGLSL.cpp',
             'compiler/translator/ExtensionGLSL.h',
             'compiler/translator/OutputGLSL.cpp',
             'compiler/translator/OutputGLSL.h',
             'compiler/translator/OutputGLSLBase.cpp',
             'compiler/translator/OutputGLSLBase.h',
             'compiler/translator/TranslatorGLSL.cpp',
             'compiler/translator/TranslatorGLSL.h',
             'compiler/translator/VersionGLSL.cpp',
             'compiler/translator/VersionGLSL.h',
         ],
-        'angle_translator_lib_hlsl_sources':
+        'angle_translator_hlsl_sources':
         [
             'compiler/translator/AddDefaultReturnStatements.cpp',
             'compiler/translator/AddDefaultReturnStatements.h',
             'compiler/translator/ArrayReturnValueToOutParameter.cpp',
             'compiler/translator/ArrayReturnValueToOutParameter.h',
             'compiler/translator/ASTMetadataHLSL.cpp',
             'compiler/translator/ASTMetadataHLSL.h',
             'compiler/translator/blocklayoutHLSL.cpp',
@@ -227,48 +235,42 @@
             'compiler/preprocessor/Preprocessor.h',
             'compiler/preprocessor/SourceLocation.h',
             'compiler/preprocessor/Token.cpp',
             'compiler/preprocessor/Token.h',
             'compiler/preprocessor/Tokenizer.cpp',
             'compiler/preprocessor/Tokenizer.h',
             'compiler/preprocessor/Tokenizer.l',
             'compiler/preprocessor/numeric_lex.h',
-            'compiler/preprocessor/pp_utils.h',
         ],
     },
     # Everything below this is duplicated in the GN build. If you change
     # anything also change angle/BUILD.gn
     'targets':
     [
         {
             'target_name': 'preprocessor',
             'type': 'static_library',
-            'includes': [ '../build/common_defines.gypi', ],
+            'dependencies': [ 'angle_common' ],
+            'includes': [ '../gyp/common_defines.gypi', ],
             'sources': [ '<@(angle_preprocessor_sources)', ],
         },
         {
-            'target_name': 'translator_lib',
+            'target_name': 'translator',
             'type': 'static_library',
             'dependencies': [ 'preprocessor', 'angle_common' ],
-            'includes': [ '../build/common_defines.gypi', ],
+            'includes': [ '../gyp/common_defines.gypi', ],
             'include_dirs':
             [
                 '.',
                 '../include',
             ],
-            'defines':
-            [
-                # define the static translator to indicate exported
-                # classes are (in fact) locally defined
-                'ANGLE_TRANSLATOR_STATIC',
-            ],
             'sources':
             [
-                '<@(angle_translator_lib_sources)',
+                '<@(angle_translator_sources)',
             ],
             'msvs_settings':
             {
               'VCLibrarianTool':
               {
                 'AdditionalOptions': ['/ignore:4221']
               },
             },
@@ -284,17 +286,17 @@
                     {
                         'defines':
                         [
                             'ANGLE_ENABLE_ESSL',
                         ],
                     },
                     'sources':
                     [
-                        '<@(angle_translator_lib_essl_sources)',
+                        '<@(angle_translator_essl_sources)',
                     ],
                 }],
                 ['angle_enable_glsl==1',
                 {
                     'defines':
                     [
                         'ANGLE_ENABLE_GLSL',
                     ],
@@ -302,17 +304,17 @@
                     {
                         'defines':
                         [
                             'ANGLE_ENABLE_GLSL',
                         ],
                     },
                     'sources':
                     [
-                        '<@(angle_translator_lib_glsl_sources)',
+                        '<@(angle_translator_glsl_sources)',
                     ],
                 }],
                 ['angle_enable_hlsl==1',
                 {
                     'defines':
                     [
                         'ANGLE_ENABLE_HLSL',
                     ],
@@ -320,64 +322,15 @@
                     {
                         'defines':
                         [
                             'ANGLE_ENABLE_HLSL',
                         ],
                     },
                     'sources':
                     [
-                        '<@(angle_translator_lib_hlsl_sources)',
+                        '<@(angle_translator_hlsl_sources)',
                     ],
                 }],
             ],
         },
-
-        {
-            'target_name': 'translator',
-            'type': '<(component)',
-            'dependencies': [ 'translator_lib', 'angle_common' ],
-            'includes': [ '../build/common_defines.gypi', ],
-            'include_dirs':
-            [
-                '.',
-                '../include',
-            ],
-            'defines':
-            [
-                'ANGLE_TRANSLATOR_IMPLEMENTATION',
-            ],
-            'sources':
-            [
-                'compiler/translator/ShaderLang.cpp',
-                'compiler/translator/ShaderVars.cpp'
-            ],
-        },
-
-        {
-            'target_name': 'translator_static',
-            'type': 'static_library',
-            'dependencies': [ 'translator_lib' ],
-            'includes': [ '../build/common_defines.gypi', ],
-            'include_dirs':
-            [
-                '.',
-                '../include',
-            ],
-            'defines':
-            [
-                'ANGLE_TRANSLATOR_STATIC',
-            ],
-            'direct_dependent_settings':
-            {
-                'defines':
-                [
-                    'ANGLE_TRANSLATOR_STATIC',
-                ],
-            },
-            'sources':
-            [
-                'compiler/translator/ShaderLang.cpp',
-                'compiler/translator/ShaderVars.cpp'
-            ],
-        },
     ],
 }
new file mode 100644
--- /dev/null
+++ b/gfx/angle/src/compiler/fuzz/translator_fuzzer.cpp
@@ -0,0 +1,161 @@
+//
+// Copyright (c) 2016 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.
+//
+
+// translator_fuzzer.cpp: A libfuzzer fuzzer for the shader translator.
+
+#include <stddef.h>
+#include <stdint.h>
+#include <unordered_map>
+#include <iostream>
+
+#include "compiler/translator/Compiler.h"
+#include "angle_gl.h"
+
+using namespace sh;
+
+struct TranslatorCacheKey
+{
+    bool operator==(const TranslatorCacheKey &other) const
+    {
+        return type == other.type && spec == other.spec && output == other.output;
+    }
+
+    uint32_t type   = 0;
+    uint32_t spec   = 0;
+    uint32_t output = 0;
+};
+
+namespace std
+{
+
+template <>
+struct hash<TranslatorCacheKey>
+{
+    std::size_t operator()(const TranslatorCacheKey &k) const
+    {
+        return (hash<uint32_t>()(k.type) << 1) ^ (hash<uint32_t>()(k.spec) >> 1) ^
+               hash<uint32_t>()(k.output);
+    }
+};
+}  // namespace std
+
+static std::unordered_map<TranslatorCacheKey, TCompiler *> translators;
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
+{
+    // Reserve some size for future compile options
+    const size_t kHeaderSize = 128;
+
+    if (size <= kHeaderSize)
+    {
+        return 0;
+    }
+
+    // Make sure the rest of data will be a valid C string so that we don't have to copy it.
+    if (data[size - 1] != 0)
+    {
+        return 0;
+    }
+
+    uint32_t type    = *reinterpret_cast<const uint32_t *>(data);
+    uint32_t spec    = *reinterpret_cast<const uint32_t *>(data + 4);
+    uint32_t output  = *reinterpret_cast<const uint32_t *>(data + 8);
+    uint64_t options = *reinterpret_cast<const uint64_t *>(data + 12);
+
+    if (type != GL_FRAGMENT_SHADER && type != GL_VERTEX_SHADER)
+    {
+        return 0;
+    }
+
+    if (spec != SH_GLES2_SPEC && type != SH_WEBGL_SPEC && spec != SH_GLES3_SPEC &&
+        spec != SH_WEBGL2_SPEC)
+    {
+        return 0;
+    }
+
+    std::vector<uint32_t> validOutputs;
+    validOutputs.push_back(SH_ESSL_OUTPUT);
+    validOutputs.push_back(SH_GLSL_COMPATIBILITY_OUTPUT);
+    validOutputs.push_back(SH_GLSL_130_OUTPUT);
+    validOutputs.push_back(SH_GLSL_140_OUTPUT);
+    validOutputs.push_back(SH_GLSL_150_CORE_OUTPUT);
+    validOutputs.push_back(SH_GLSL_330_CORE_OUTPUT);
+    validOutputs.push_back(SH_GLSL_400_CORE_OUTPUT);
+    validOutputs.push_back(SH_GLSL_410_CORE_OUTPUT);
+    validOutputs.push_back(SH_GLSL_420_CORE_OUTPUT);
+    validOutputs.push_back(SH_GLSL_430_CORE_OUTPUT);
+    validOutputs.push_back(SH_GLSL_440_CORE_OUTPUT);
+    validOutputs.push_back(SH_GLSL_450_CORE_OUTPUT);
+    validOutputs.push_back(SH_HLSL_3_0_OUTPUT);
+    validOutputs.push_back(SH_HLSL_4_1_OUTPUT);
+    validOutputs.push_back(SH_HLSL_4_0_FL9_3_OUTPUT);
+    bool found = false;
+    for (auto valid : validOutputs)
+    {
+        found = found || (valid == output);
+    }
+    if (!found)
+    {
+        return 0;
+    }
+
+    size -= kHeaderSize;
+    data += kHeaderSize;
+
+    if (!ShInitialize())
+    {
+        return 0;
+    }
+
+    TranslatorCacheKey key;
+    key.type   = type;
+    key.spec   = spec;
+    key.output = output;
+
+    if (translators.find(key) == translators.end())
+    {
+        TCompiler *translator = ConstructCompiler(type, static_cast<ShShaderSpec>(spec),
+                                                  static_cast<ShShaderOutput>(output));
+
+        if (!translator)
+        {
+            return 0;
+        }
+
+        ShBuiltInResources resources;
+        ShInitBuiltInResources(&resources);
+
+        // Enable all the extensions to have more coverage
+        resources.OES_standard_derivatives        = 1;
+        resources.OES_EGL_image_external          = 1;
+        resources.OES_EGL_image_external_essl3    = 1;
+        resources.NV_EGL_stream_consumer_external = 1;
+        resources.ARB_texture_rectangle           = 1;
+        resources.EXT_blend_func_extended         = 1;
+        resources.EXT_draw_buffers                = 1;
+        resources.EXT_frag_depth                  = 1;
+        resources.EXT_shader_texture_lod          = 1;
+        resources.WEBGL_debug_shader_precision    = 1;
+        resources.EXT_shader_framebuffer_fetch    = 1;
+        resources.NV_shader_framebuffer_fetch     = 1;
+        resources.ARM_shader_framebuffer_fetch    = 1;
+
+        if (!translator->Init(resources))
+        {
+            DeleteCompiler(translator);
+            return 0;
+        }
+
+        translators[key] = translator;
+    }
+
+    TCompiler *translator = translators[key];
+
+    const char *shaderStrings[] = {reinterpret_cast<const char *>(data)};
+    translator->compile(shaderStrings, 1, options);
+
+    return 0;
+}
--- a/gfx/angle/src/compiler/preprocessor/64bit-tokenizer-safety.patch
+++ b/gfx/angle/src/compiler/preprocessor/64bit-tokenizer-safety.patch
@@ -1,31 +1,79 @@
+diff --git a/src/compiler/preprocessor/Tokenizer.cpp b/src/compiler/preprocessor/Tokenizer.cpp
+index 0d7ad58..5ef0e5e 100644
 --- a/src/compiler/preprocessor/Tokenizer.cpp
 +++ b/src/compiler/preprocessor/Tokenizer.cpp
-@@ -56,6 +56,7 @@ typedef int16_t flex_int16_t;
- typedef uint16_t flex_uint16_t;
- typedef int32_t flex_int32_t;
- typedef uint32_t flex_uint32_t;
-+typedef uint64_t flex_uint64_t;
- #else
- typedef signed char flex_int8_t;
- typedef short int flex_int16_t;
-@@ -179,6 +180,11 @@ typedef void* yyscan_t;
- typedef struct yy_buffer_state *YY_BUFFER_STATE;
- #endif
-
-+#ifndef YY_TYPEDEF_YY_SIZE_T
-+#define YY_TYPEDEF_YY_SIZE_T
-+typedef size_t yy_size_t;
-+#endif
-+
- #define EOB_ACT_CONTINUE_SCAN 0
- #define EOB_ACT_END_OF_FILE 1
- #define EOB_ACT_LAST_MATCH 2
-@@ -353,7 +354,7 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
+@@ -1703,7 +1703,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
+ 	else
+ 		{
+ 			int num_to_read =
+-			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
++			static_cast<int>(YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1);
+ 
+ 		while ( num_to_read <= 0 )
+ 			{ /* Not enough room in the buffer - grow it. */
+@@ -1737,8 +1737,8 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
+ 
+ 			yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+ 
+-			num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+-						number_to_move - 1;
++			num_to_read = static_cast<int>(YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
++						number_to_move - 1);
+ 
+ 			}
+ 
+@@ -1746,8 +1746,10 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
+ 			num_to_read = YY_READ_BUF_SIZE;
+ 
+ 		/* Read in more data. */
++		yy_size_t ret = 0;
+ 		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+-			yyg->yy_n_chars, num_to_read );
++			ret, num_to_read );
++		yyg->yy_n_chars = static_cast<int>(ret);
+ 
+ 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
+ 		}
+@@ -1773,13 +1775,13 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
+ 
+ 	if ((int) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+ 		/* Extend the array by 50%, plus the number we really need. */
+-		int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
++		yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
+ 		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) pprealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
+ 		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+ 			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+ 	}
+ 
+-	yyg->yy_n_chars += number_to_move;
++	yyg->yy_n_chars += static_cast<int>(number_to_move);
+ 	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
+ 	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+ 
+@@ -2171,7 +2173,7 @@ void pppop_buffer_state (yyscan_t yyscanner)
   */
- #define YY_DO_BEFORE_ACTION \
- 	yyg->yytext_ptr = yy_bp; \
--	yyleng = (size_t) (yy_cp - yy_bp); \
-+	yyleng = (yy_size_t) (yy_cp - yy_bp); \
- 	yyg->yy_hold_char = *yy_cp; \
- 	*yy_cp = '\0'; \
- 	yyg->yy_c_buf_p = yy_cp;
+ static void ppensure_buffer_stack (yyscan_t yyscanner)
+ {
+-	int num_to_alloc;
++	yy_size_t num_to_alloc;
+     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ 
+ 	if (!yyg->yy_buffer_stack) {
+@@ -2238,7 +2240,7 @@ YY_BUFFER_STATE pp_scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscann
+ 	if ( ! b )
+ 		YY_FATAL_ERROR( "out of dynamic memory in pp_scan_buffer()" );
+ 
+-	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
++	b->yy_buf_size = static_cast<int>(size - 2);	/* "- 2" to take care of EOB's */
+ 	b->yy_buf_pos = b->yy_ch_buf = base;
+ 	b->yy_is_our_buffer = 0;
+ 	b->yy_input_file = NULL;
+@@ -2293,7 +2295,7 @@ YY_BUFFER_STATE pp_scan_bytes  (yyconst char * yybytes, int  _yybytes_len , yysc
+ 	if ( ! buf )
+ 		YY_FATAL_ERROR( "out of dynamic memory in pp_scan_bytes()" );
+ 
+-	for ( i = 0; i < _yybytes_len; ++i )
++	for ( i = 0; i < static_cast<yy_size_t>(_yybytes_len); ++i )
+ 		buf[i] = yybytes[i];
+ 
+ 	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
--- a/gfx/angle/src/compiler/preprocessor/DiagnosticsBase.cpp
+++ b/gfx/angle/src/compiler/preprocessor/DiagnosticsBase.cpp
@@ -1,17 +1,17 @@
 //
 // 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 "DiagnosticsBase.h"
+#include "compiler/preprocessor/DiagnosticsBase.h"
 
-#include <cassert>
+#include "common/debug.h"
 
 namespace pp
 {
 
 Diagnostics::~Diagnostics()
 {
 }
 
@@ -26,17 +26,17 @@ void Diagnostics::report(ID id,
 Diagnostics::Severity Diagnostics::severity(ID id)
 {
     if ((id > PP_ERROR_BEGIN) && (id < PP_ERROR_END))
         return PP_ERROR;
 
     if ((id > PP_WARNING_BEGIN) && (id < PP_WARNING_END))
         return PP_WARNING;
 
-    assert(false);
+    UNREACHABLE();
     return PP_ERROR;
 }
 
 std::string Diagnostics::message(ID id)
 {
     switch (id)
     {
       // Errors begin.
@@ -69,16 +69,18 @@ std::string Diagnostics::message(ID id)
       case PP_MACRO_REDEFINED:
         return "macro redefined";
       case PP_MACRO_PREDEFINED_REDEFINED:
         return "predefined macro redefined";
       case PP_MACRO_PREDEFINED_UNDEFINED:
         return "predefined macro undefined";
       case PP_MACRO_UNTERMINATED_INVOCATION:
         return "unterminated macro invocation";
+      case PP_MACRO_UNDEFINED_WHILE_INVOKED:
+          return "macro undefined while being invoked";
       case PP_MACRO_TOO_FEW_ARGS:
         return "Not enough arguments for macro";
       case PP_MACRO_TOO_MANY_ARGS:
         return "Too many arguments for macro";
       case PP_MACRO_DUPLICATE_PARAMETER_NAMES:
         return "duplicate macro parameter name";
       case PP_CONDITIONAL_ENDIF_WITHOUT_IF:
         return "unexpected #endif found without a matching #if";
@@ -126,14 +128,14 @@ std::string Diagnostics::message(ID id)
       case PP_UNRECOGNIZED_PRAGMA:
         return "unrecognized pragma";
       case PP_NON_PP_TOKEN_BEFORE_EXTENSION_ESSL1:
         return "extension directive should occur before any non-preprocessor tokens";
       case PP_WARNING_MACRO_NAME_RESERVED:
         return "macro name with a double underscore is reserved - unintented behavior is possible";
       // Warnings end.
       default:
-        assert(false);
-        return "";
+          UNREACHABLE();
+          return "";
     }
 }
 
 }  // namespace pp
--- a/gfx/angle/src/compiler/preprocessor/DiagnosticsBase.h
+++ b/gfx/angle/src/compiler/preprocessor/DiagnosticsBase.h
@@ -39,16 +39,17 @@ class Diagnostics
         PP_EOF_IN_COMMENT,
         PP_UNEXPECTED_TOKEN,
         PP_DIRECTIVE_INVALID_NAME,
         PP_MACRO_NAME_RESERVED,
         PP_MACRO_REDEFINED,
         PP_MACRO_PREDEFINED_REDEFINED,
         PP_MACRO_PREDEFINED_UNDEFINED,
         PP_MACRO_UNTERMINATED_INVOCATION,
+        PP_MACRO_UNDEFINED_WHILE_INVOKED,
         PP_MACRO_TOO_FEW_ARGS,
         PP_MACRO_TOO_MANY_ARGS,
         PP_MACRO_DUPLICATE_PARAMETER_NAMES,
         PP_CONDITIONAL_ENDIF_WITHOUT_IF,
         PP_CONDITIONAL_ELSE_WITHOUT_IF,
         PP_CONDITIONAL_ELSE_AFTER_ELSE,
         PP_CONDITIONAL_ELIF_WITHOUT_IF,
         PP_CONDITIONAL_ELIF_AFTER_ELSE,
--- a/gfx/angle/src/compiler/preprocessor/DirectiveHandlerBase.cpp
+++ b/gfx/angle/src/compiler/preprocessor/DirectiveHandlerBase.cpp
@@ -1,15 +1,15 @@
 //
 // 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 "DirectiveHandlerBase.h"
+#include "compiler/preprocessor/DirectiveHandlerBase.h"
 
 namespace pp
 {
 
 DirectiveHandler::~DirectiveHandler()
 {
 }
 
--- a/gfx/angle/src/compiler/preprocessor/DirectiveParser.cpp
+++ b/gfx/angle/src/compiler/preprocessor/DirectiveParser.cpp
@@ -1,27 +1,27 @@
 //
 // Copyright (c) 2011-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 "DirectiveParser.h"
+#include "compiler/preprocessor/DirectiveParser.h"
 
 #include <algorithm>
-#include <cassert>
 #include <cstdlib>
 #include <sstream>
 
-#include "DiagnosticsBase.h"
-#include "DirectiveHandlerBase.h"
-#include "ExpressionParser.h"
-#include "MacroExpander.h"
-#include "Token.h"
-#include "Tokenizer.h"
+#include "common/debug.h"
+#include "compiler/preprocessor/DiagnosticsBase.h"
+#include "compiler/preprocessor/DirectiveHandlerBase.h"
+#include "compiler/preprocessor/ExpressionParser.h"
+#include "compiler/preprocessor/MacroExpander.h"
+#include "compiler/preprocessor/Token.h"
+#include "compiler/preprocessor/Tokenizer.h"
 
 namespace {
 enum DirectiveType
 {
     DIRECTIVE_NONE,
     DIRECTIVE_DEFINE,
     DIRECTIVE_UNDEF,
     DIRECTIVE_IF,
@@ -243,17 +243,17 @@ void DirectiveParser::lex(Token *token)
     }
     while (skipping() || (token->type == '\n'));
 
     mPastFirstStatement = true;
 }
 
 void DirectiveParser::parseDirective(Token *token)
 {
-    assert(token->type == Token::PP_HASH);
+    ASSERT(token->type == Token::PP_HASH);
 
     mTokenizer->lex(token);
     if (isEOD(token))
     {
         // Empty Directive.
         return;
     }
 
@@ -309,31 +309,31 @@ void DirectiveParser::parseDirective(Tok
         break;
       case DIRECTIVE_VERSION:
         parseVersion(token);
         break;
       case DIRECTIVE_LINE:
         parseLine(token);
         break;
       default:
-        assert(false);
-        break;
+          UNREACHABLE();
+          break;
     }
 
     skipUntilEOD(mTokenizer, token);
     if (token->type == Token::LAST)
     {
         mDiagnostics->report(Diagnostics::PP_EOF_IN_DIRECTIVE,
                              token->location, token->text);
     }
 }
 
 void DirectiveParser::parseDefine(Token *token)
 {
-    assert(getDirective(token) == DIRECTIVE_DEFINE);
+    ASSERT(getDirective(token) == DIRECTIVE_DEFINE);
 
     mTokenizer->lex(token);
     if (token->type != Token::IDENTIFIER)
     {
         mDiagnostics->report(Diagnostics::PP_UNEXPECTED_TOKEN,
                              token->location, token->text);
         return;
     }
@@ -423,33 +423,40 @@ void DirectiveParser::parseDefine(Token 
                              macro.name);
         return;
     }
     mMacroSet->insert(std::make_pair(macro.name, macro));
 }
 
 void DirectiveParser::parseUndef(Token *token)
 {
-    assert(getDirective(token) == DIRECTIVE_UNDEF);
+    ASSERT(getDirective(token) == DIRECTIVE_UNDEF);
 
     mTokenizer->lex(token);
     if (token->type != Token::IDENTIFIER)
     {
         mDiagnostics->report(Diagnostics::PP_UNEXPECTED_TOKEN,
                              token->location, token->text);
         return;
     }
 
     MacroSet::iterator iter = mMacroSet->find(token->text);
     if (iter != mMacroSet->end())
     {
         if (iter->second.predefined)
         {
             mDiagnostics->report(Diagnostics::PP_MACRO_PREDEFINED_UNDEFINED,
                                  token->location, token->text);
+            return;
+        }
+        else if (iter->second.expansionCount > 0)
+        {
+            mDiagnostics->report(Diagnostics::PP_MACRO_UNDEFINED_WHILE_INVOKED, token->location,
+                                 token->text);
+            return;
         }
         else
         {
             mMacroSet->erase(iter);
         }
     }
 
     mTokenizer->lex(token);
@@ -458,35 +465,35 @@ void DirectiveParser::parseUndef(Token *
         mDiagnostics->report(Diagnostics::PP_UNEXPECTED_TOKEN,
                              token->location, token->text);
         skipUntilEOD(mTokenizer, token);
     }
 }
 
 void DirectiveParser::parseIf(Token *token)
 {
-    assert(getDirective(token) == DIRECTIVE_IF);
+    ASSERT(getDirective(token) == DIRECTIVE_IF);
     parseConditionalIf(token);
 }
 
 void DirectiveParser::parseIfdef(Token *token)
 {
-    assert(getDirective(token) == DIRECTIVE_IFDEF);
+    ASSERT(getDirective(token) == DIRECTIVE_IFDEF);
     parseConditionalIf(token);
 }
 
 void DirectiveParser::parseIfndef(Token *token)
 {
-    assert(getDirective(token) == DIRECTIVE_IFNDEF);
+    ASSERT(getDirective(token) == DIRECTIVE_IFNDEF);
     parseConditionalIf(token);
 }
 
 void DirectiveParser::parseElse(Token *token)
 {
-    assert(getDirective(token) == DIRECTIVE_ELSE);
+    ASSERT(getDirective(token) == DIRECTIVE_ELSE);
 
     if (mConditionalStack.empty())
     {
         mDiagnostics->report(Diagnostics::PP_CONDITIONAL_ELSE_WITHOUT_IF,
                              token->location, token->text);
         skipUntilEOD(mTokenizer, token);
         return;
     }
@@ -517,17 +524,17 @@ void DirectiveParser::parseElse(Token *t
         mDiagnostics->report(Diagnostics::PP_CONDITIONAL_UNEXPECTED_TOKEN,
                              token->location, token->text);
         skipUntilEOD(mTokenizer, token);
     }
 }
 
 void DirectiveParser::parseElif(Token *token)
 {
-    assert(getDirective(token) == DIRECTIVE_ELIF);
+    ASSERT(getDirective(token) == DIRECTIVE_ELIF);
 
     if (mConditionalStack.empty())
     {
         mDiagnostics->report(Diagnostics::PP_CONDITIONAL_ELIF_WITHOUT_IF,
                              token->location, token->text);
         skipUntilEOD(mTokenizer, token);
         return;
     }
@@ -557,17 +564,17 @@ void DirectiveParser::parseElif(Token *t
 
     int expression = parseExpressionIf(token);
     block.skipGroup = expression == 0;
     block.foundValidGroup = expression != 0;
 }
 
 void DirectiveParser::parseEndif(Token *token)
 {
-    assert(getDirective(token) == DIRECTIVE_ENDIF);
+    ASSERT(getDirective(token) == DIRECTIVE_ENDIF);
 
     if (mConditionalStack.empty())
     {
         mDiagnostics->report(Diagnostics::PP_CONDITIONAL_ENDIF_WITHOUT_IF,
                              token->location, token->text);
         skipUntilEOD(mTokenizer, token);
         return;
     }
@@ -581,32 +588,32 @@ void DirectiveParser::parseEndif(Token *
         mDiagnostics->report(Diagnostics::PP_CONDITIONAL_UNEXPECTED_TOKEN,
                              token->location, token->text);
         skipUntilEOD(mTokenizer, token);
     }
 }
 
 void DirectiveParser::parseError(Token *token)
 {
-    assert(getDirective(token) == DIRECTIVE_ERROR);
+    ASSERT(getDirective(token) == DIRECTIVE_ERROR);
 
     std::ostringstream stream;
     mTokenizer->lex(token);
     while ((token->type != '\n') && (token->type != Token::LAST))
     {
         stream << *token;
         mTokenizer->lex(token);
     }
     mDirectiveHandler->handleError(token->location, stream.str());
 }
 
 // Parses pragma of form: #pragma name[(value)].
 void DirectiveParser::parsePragma(Token *token)
 {
-    assert(getDirective(token) == DIRECTIVE_PRAGMA);
+    ASSERT(getDirective(token) == DIRECTIVE_PRAGMA);
 
     enum State
     {
         PRAGMA_NAME,
         LEFT_PAREN,
         PRAGMA_VALUE,
         RIGHT_PAREN
     };
@@ -657,17 +664,17 @@ void DirectiveParser::parsePragma(Token 
     else if (state > PRAGMA_NAME)  // Do not notify for empty pragma.
     {
         mDirectiveHandler->handlePragma(token->location, name, value, stdgl);
     }
 }
 
 void DirectiveParser::parseExtension(Token *token)
 {
-    assert(getDirective(token) == DIRECTIVE_EXTENSION);
+    ASSERT(getDirective(token) == DIRECTIVE_EXTENSION);
 
     enum State
     {
         EXT_NAME,
         COLON,
         EXT_BEHAVIOR
     };
 
@@ -738,17 +745,17 @@ void DirectiveParser::parseExtension(Tok
         }
     }
     if (valid)
         mDirectiveHandler->handleExtension(token->location, name, behavior);
 }
 
 void DirectiveParser::parseVersion(Token *token)
 {
-    assert(getDirective(token) == DIRECTIVE_VERSION);
+    ASSERT(getDirective(token) == DIRECTIVE_VERSION);
 
     if (mPastFirstStatement)
     {
         mDiagnostics->report(Diagnostics::PP_VERSION_NOT_FIRST_STATEMENT,
                              token->location, token->text);
         skipUntilEOD(mTokenizer, token);
         return;
     }
@@ -825,17 +832,17 @@ void DirectiveParser::parseVersion(Token
         mDirectiveHandler->handleVersion(token->location, version);
         mShaderVersion = version;
         PredefineMacro(mMacroSet, "__VERSION__", version);
     }
 }
 
 void DirectiveParser::parseLine(Token *token)
 {
-    assert(getDirective(token) == DIRECTIVE_LINE);
+    ASSERT(getDirective(token) == DIRECTIVE_LINE);
 
     bool valid = true;
     bool parsedFileNumber = false;
     int line = 0, file = 0;
 
     MacroExpander macroExpander(mTokenizer, mMacroSet, mDiagnostics);
 
     // Lex the first token after "#line" so we can check it for EOD.
@@ -926,29 +933,28 @@ void DirectiveParser::parseConditionalIf
             break;
           case DIRECTIVE_IFDEF:
             expression = parseExpressionIfdef(token);
             break;
           case DIRECTIVE_IFNDEF:
             expression = parseExpressionIfdef(token) == 0 ? 1 : 0;
             break;
           default:
-            assert(false);
-            break;
+              UNREACHABLE();
+              break;
         }
         block.skipGroup = expression == 0;
         block.foundValidGroup = expression != 0;
     }
     mConditionalStack.push_back(block);
 }
 
 int DirectiveParser::parseExpressionIf(Token *token)
 {
-    assert((getDirective(token) == DIRECTIVE_IF) ||
-           (getDirective(token) == DIRECTIVE_ELIF));
+    ASSERT((getDirective(token) == DIRECTIVE_IF) || (getDirective(token) == DIRECTIVE_ELIF));
 
     DefinedParser definedParser(mTokenizer, mMacroSet, mDiagnostics);
     MacroExpander macroExpander(&definedParser, mMacroSet, mDiagnostics);
     ExpressionParser expressionParser(&macroExpander, mDiagnostics);
 
     int expression = 0;
     ExpressionParser::ErrorSettings errorSettings;
     errorSettings.integerLiteralsMustFit32BitSignedRange = false;
@@ -965,18 +971,17 @@ int DirectiveParser::parseExpressionIf(T
         skipUntilEOD(mTokenizer, token);
     }
 
     return expression;
 }
 
 int DirectiveParser::parseExpressionIfdef(Token *token)
 {
-    assert((getDirective(token) == DIRECTIVE_IFDEF) ||
-           (getDirective(token) == DIRECTIVE_IFNDEF));
+    ASSERT((getDirective(token) == DIRECTIVE_IFDEF) || (getDirective(token) == DIRECTIVE_IFNDEF));
 
     mTokenizer->lex(token);
     if (token->type != Token::IDENTIFIER)
     {
         mDiagnostics->report(Diagnostics::PP_UNEXPECTED_TOKEN,
                              token->location, token->text);
         skipUntilEOD(mTokenizer, token);
         return 0;
--- a/gfx/angle/src/compiler/preprocessor/DirectiveParser.h
+++ b/gfx/angle/src/compiler/preprocessor/DirectiveParser.h
@@ -2,20 +2,19 @@
 // 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 COMPILER_PREPROCESSOR_DIRECTIVEPARSER_H_
 #define COMPILER_PREPROCESSOR_DIRECTIVEPARSER_H_
 
-#include "Lexer.h"
-#include "Macro.h"
-#include "pp_utils.h"
-#include "SourceLocation.h"
+#include "compiler/preprocessor/Lexer.h"
+#include "compiler/preprocessor/Macro.h"
+#include "compiler/preprocessor/SourceLocation.h"
 
 namespace pp
 {
 
 class Diagnostics;
 class DirectiveHandler;
 class Tokenizer;
 
@@ -25,17 +24,16 @@ class DirectiveParser : public Lexer
     DirectiveParser(Tokenizer *tokenizer,
                     MacroSet *macroSet,
                     Diagnostics *diagnostics,
                     DirectiveHandler *directiveHandler);
 
     void lex(Token *token) override;
 
   private:
-    PP_DISALLOW_COPY_AND_ASSIGN(DirectiveParser);
 
     void parseDirective(Token *token);
     void parseDefine(Token *token);
     void parseUndef(Token *token);
     void parseIf(Token *token);
     void parseIfdef(Token *token);
     void parseIfndef(Token *token);
     void parseElse(Token *token);
--- a/gfx/angle/src/compiler/preprocessor/ExpressionParser.cpp
+++ b/gfx/angle/src/compiler/preprocessor/ExpressionParser.cpp
@@ -94,27 +94,25 @@
 #if defined(_MSC_VER)
 #include <malloc.h>
 #else
 #include <stdlib.h>
 #endif
 
 #include <cassert>
 #include <sstream>
+#include <stdint.h>
 
 #include "DiagnosticsBase.h"
 #include "Lexer.h"
 #include "Token.h"
+#include "common/mathutil.h"
 
-#if defined(_MSC_VER)
-typedef __int64 YYSTYPE;
-#else
-#include <stdint.h>
-typedef intmax_t YYSTYPE;
-#endif  // _MSC_VER
+typedef int32_t YYSTYPE;
+typedef uint32_t UNSIGNED_TYPE;
 
 #define YYENABLE_NLS 0
 #define YYLTYPE_IS_TRIVIAL 1
 #define YYSTYPE_IS_TRIVIAL 1
 #define YYSTYPE_IS_DECLARED 1
 
 namespace {
 struct Context
@@ -493,19 +491,22 @@ static const yytype_uint8 yytranslate[] 
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
        5,     6,    10,    11,    14,    15,    16,    17,    23
 };
 
 #if YYDEBUG
   /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
-static const yytype_uint16 yyrline[] = {0,   110, 110, 117, 118, 129, 129, 150, 150, 171,
-                                        174, 177, 180, 183, 186, 189, 192, 195, 198, 218,
-                                        238, 241, 244, 264, 284, 287, 290, 293, 296, 299};
+static const yytype_uint16 yyrline[] =
+{
+       0,   108,   108,   115,   116,   127,   127,   148,   148,   169,
+     172,   175,   178,   181,   184,   187,   190,   193,   196,   221,
+     246,   249,   252,   278,   305,   308,   311,   314,   326,   329
+};
 #endif
 
 #if YYDEBUG || YYERROR_VERBOSE || 0
 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
 static const char *const yytname[] =
 {
   "$end", "error", "$undefined", "TOK_CONST_INT", "TOK_IDENTIFIER",
@@ -1487,73 +1488,85 @@ yyreduce:
         (yyval) = (yyvsp[-2]) < (yyvsp[0]);
     }
 
     break;
 
   case 18:
 
     {
-        if ((yyvsp[0]) < 0)
+        if ((yyvsp[0]) < 0 || (yyvsp[0]) > 31)
         {
             if (!context->isIgnoringErrors())
             {
                 std::ostringstream stream;
                 stream << (yyvsp[-2]) << " >> " << (yyvsp[0]);
                 std::string text = stream.str();
                 context->diagnostics->report(pp::Diagnostics::PP_UNDEFINED_SHIFT,
-                                             context->token->location, text.c_str());
+                                             context->token->location,
+                                             text.c_str());
                 *(context->valid) = false;
             }
             (yyval) = static_cast<YYSTYPE>(0);
         }
+        else if ((yyvsp[-2]) < 0)
+        {
+            // Logical shift right.
+            (yyval) = static_cast<YYSTYPE>(static_cast<UNSIGNED_TYPE>((yyvsp[-2])) >> (yyvsp[0]));
+        }
         else
         {
             (yyval) = (yyvsp[-2]) >> (yyvsp[0]);
         }
     }
 
     break;
 
   case 19:
 
     {
-        if ((yyvsp[0]) < 0)
+        if ((yyvsp[0]) < 0 || (yyvsp[0]) > 31)
         {
             if (!context->isIgnoringErrors())
             {
                 std::ostringstream stream;
                 stream << (yyvsp[-2]) << " << " << (yyvsp[0]);
                 std::string text = stream.str();
                 context->diagnostics->report(pp::Diagnostics::PP_UNDEFINED_SHIFT,
-                                             context->token->location, text.c_str());
+                                             context->token->location,
+                                             text.c_str());
                 *(context->valid) = false;
             }
             (yyval) = static_cast<YYSTYPE>(0);
         }
+        else if ((yyvsp[-2]) < 0)
+        {
+            // Logical shift left.
+            (yyval) = static_cast<YYSTYPE>(static_cast<UNSIGNED_TYPE>((yyvsp[-2])) << (yyvsp[0]));
+        }
         else
         {
             (yyval) = (yyvsp[-2]) << (yyvsp[0]);
         }
     }
 
     break;
 
   case 20:
 
     {
-        (yyval) = (yyvsp[-2]) - (yyvsp[0]);
+        (yyval) = gl::WrappingDiff<YYSTYPE>((yyvsp[-2]), (yyvsp[0]));
     }
 
     break;
 
   case 21:
 
     {
-        (yyval) = (yyvsp[-2]) + (yyvsp[0]);
+        (yyval) = gl::WrappingSum<YYSTYPE>((yyvsp[-2]), (yyvsp[0]));
     }
 
     break;
 
   case 22:
 
     {
         if ((yyvsp[0]) == 0)
@@ -1565,16 +1578,22 @@ yyreduce:
                 std::string text = stream.str();
                 context->diagnostics->report(pp::Diagnostics::PP_DIVISION_BY_ZERO,
                                              context->token->location,
                                              text.c_str());
                 *(context->valid) = false;
             }
             (yyval) = static_cast<YYSTYPE>(0);
         }
+        else if (((yyvsp[-2]) == std::numeric_limits<YYSTYPE>::min()) && ((yyvsp[0]) == -1))
+        {
+            // Check for the special case where the minimum representable number is
+            // divided by -1. If left alone this has undefined results.
+            (yyval) = 0;
+        }
         else
         {
             (yyval) = (yyvsp[-2]) % (yyvsp[0]);
         }
     }
 
     break;
 
@@ -1590,28 +1609,35 @@ yyreduce:
                 std::string text = stream.str();
                 context->diagnostics->report(pp::Diagnostics::PP_DIVISION_BY_ZERO,
                                             context->token->location,
                                             text.c_str());
                 *(context->valid) = false;
             }
             (yyval) = static_cast<YYSTYPE>(0);
         }
+        else if (((yyvsp[-2]) == std::numeric_limits<YYSTYPE>::min()) && ((yyvsp[0]) == -1))
+        {
+            // Check for the special case where the minimum representable number is
+            // divided by -1. If left alone this leads to integer overflow in C++, which
+            // has undefined results.
+            (yyval) = std::numeric_limits<YYSTYPE>::max();
+        }
         else
         {
             (yyval) = (yyvsp[-2]) / (yyvsp[0]);
         }
     }
 
     break;
 
   case 24:
 
     {
-        (yyval) = (yyvsp[-2]) * (yyvsp[0]);
+        (yyval) = gl::WrappingMul((yyvsp[-2]), (yyvsp[0]));
     }
 
     break;
 
   case 25:
 
     {
         (yyval) = ! (yyvsp[0]);
@@ -1625,17 +1651,26 @@ yyreduce:
         (yyval) = ~ (yyvsp[0]);
     }
 
     break;
 
   case 27:
 
     {
-        (yyval) = - (yyvsp[0]);
+        // Check for negation of minimum representable integer to prevent undefined signed int
+        // overflow.
+        if ((yyvsp[0]) == std::numeric_limits<YYSTYPE>::min())
+        {
+            (yyval) = std::numeric_limits<YYSTYPE>::min();
+        }
+        else
+        {
+            (yyval) = -(yyvsp[0]);
+        }
     }
 
     break;
 
   case 28:
 
     {
         (yyval) = + (yyvsp[0]);
--- a/gfx/angle/src/compiler/preprocessor/ExpressionParser.h
+++ b/gfx/angle/src/compiler/preprocessor/ExpressionParser.h
@@ -2,26 +2,26 @@
 // 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 COMPILER_PREPROCESSOR_EXPRESSIONPARSER_H_
 #define COMPILER_PREPROCESSOR_EXPRESSIONPARSER_H_
 
-#include "DiagnosticsBase.h"
-#include "pp_utils.h"
+#include "common/angleutils.h"
+#include "compiler/preprocessor/DiagnosticsBase.h"
 
 namespace pp
 {
 
 class Lexer;
 struct Token;
 
-class ExpressionParser
+class ExpressionParser : angle::NonCopyable
 {
   public:
     struct ErrorSettings
     {
         Diagnostics::ID unexpectedIdentifier;
         bool integerLiteralsMustFit32BitSignedRange;
     };
 
@@ -29,17 +29,15 @@ class ExpressionParser
 
     bool parse(Token *token,
                int *result,
                bool parsePresetToken,
                const ErrorSettings &errorSettings,
                bool *valid);
 
   private:
-    PP_DISALLOW_COPY_AND_ASSIGN(ExpressionParser);
-
     Lexer *mLexer;
     Diagnostics *mDiagnostics;
 };
 
 }  // namespace pp
 
 #endif  // COMPILER_PREPROCESSOR_EXPRESSIONPARSER_H_
--- a/gfx/angle/src/compiler/preprocessor/ExpressionParser.y
+++ b/gfx/angle/src/compiler/preprocessor/ExpressionParser.y
@@ -36,27 +36,25 @@ WHICH GENERATES THE GLSL ES preprocessor
 #if defined(_MSC_VER)
 #include <malloc.h>
 #else
 #include <stdlib.h>
 #endif
 
 #include <cassert>
 #include <sstream>
+#include <stdint.h>
 
 #include "DiagnosticsBase.h"
 #include "Lexer.h"
 #include "Token.h"
+#include "common/mathutil.h"
 
-#if defined(_MSC_VER)
-typedef __int64 YYSTYPE;
-#else
-#include <stdint.h>
-typedef intmax_t YYSTYPE;
-#endif  // _MSC_VER
+typedef int32_t YYSTYPE;
+typedef uint32_t UNSIGNED_TYPE;
 
 #define YYENABLE_NLS 0
 #define YYLTYPE_IS_TRIVIAL 1
 #define YYSTYPE_IS_TRIVIAL 1
 #define YYSTYPE_IS_DECLARED 1
 
 namespace {
 struct Context
@@ -191,76 +189,92 @@ expression
     }
     | expression '>' expression {
         $$ = $1 > $3;
     }
     | expression '<' expression {
         $$ = $1 < $3;
     }
     | expression TOK_OP_RIGHT expression {
-        if ($3 < 0)
+        if ($3 < 0 || $3 > 31)
         {
             if (!context->isIgnoringErrors())
             {
                 std::ostringstream stream;
                 stream << $1 << " >> " << $3;
                 std::string text = stream.str();
                 context->diagnostics->report(pp::Diagnostics::PP_UNDEFINED_SHIFT,
                                              context->token->location,
                                              text.c_str());
                 *(context->valid) = false;
             }
             $$ = static_cast<YYSTYPE>(0);
         }
+        else if ($1 < 0)
+        {
+            // Logical shift right.
+            $$ = static_cast<YYSTYPE>(static_cast<UNSIGNED_TYPE>($1) >> $3);
+        }
         else
         {
             $$ = $1 >> $3;
         }
     }
     | expression TOK_OP_LEFT expression {
-        if ($3 < 0)
+        if ($3 < 0 || $3 > 31)
         {
             if (!context->isIgnoringErrors())
             {
                 std::ostringstream stream;
                 stream << $1 << " << " << $3;
                 std::string text = stream.str();
                 context->diagnostics->report(pp::Diagnostics::PP_UNDEFINED_SHIFT,
                                              context->token->location,
                                              text.c_str());
                 *(context->valid) = false;
             }
             $$ = static_cast<YYSTYPE>(0);
         }
+        else if ($1 < 0)
+        {
+            // Logical shift left.
+            $$ = static_cast<YYSTYPE>(static_cast<UNSIGNED_TYPE>($1) << $3);
+        }
         else
         {
             $$ = $1 << $3;
         }
     }
     | expression '-' expression {
-        $$ = $1 - $3;
+        $$ = gl::WrappingDiff<YYSTYPE>($1, $3);
     }
     | expression '+' expression {
-        $$ = $1 + $3;
+        $$ = gl::WrappingSum<YYSTYPE>($1, $3);
     }
     | expression '%' expression {
         if ($3 == 0)
         {
             if (!context->isIgnoringErrors())
             {
                 std::ostringstream stream;
                 stream << $1 << " % " << $3;
                 std::string text = stream.str();
                 context->diagnostics->report(pp::Diagnostics::PP_DIVISION_BY_ZERO,
                                              context->token->location,
                                              text.c_str());
                 *(context->valid) = false;
             }
             $$ = static_cast<YYSTYPE>(0);
         }
+        else if (($1 == std::numeric_limits<YYSTYPE>::min()) && ($3 == -1))
+        {
+            // Check for the special case where the minimum representable number is
+            // divided by -1. If left alone this has undefined results.
+            $$ = 0;
+        }
         else
         {
             $$ = $1 % $3;
         }
     }
     | expression '/' expression {
         if ($3 == 0)
         {
@@ -271,32 +285,48 @@ expression
                 std::string text = stream.str();
                 context->diagnostics->report(pp::Diagnostics::PP_DIVISION_BY_ZERO,
                                             context->token->location,
                                             text.c_str());
                 *(context->valid) = false;
             }
             $$ = static_cast<YYSTYPE>(0);
         }
+        else if (($1 == std::numeric_limits<YYSTYPE>::min()) && ($3 == -1))
+        {
+            // Check for the special case where the minimum representable number is
+            // divided by -1. If left alone this leads to integer overflow in C++, which
+            // has undefined results.
+            $$ = std::numeric_limits<YYSTYPE>::max();
+        }
         else
         {
             $$ = $1 / $3;
         }
     }
     | expression '*' expression {
-        $$ = $1 * $3;
+        $$ = gl::WrappingMul($1, $3);
     }
     | '!' expression %prec TOK_UNARY {
         $$ = ! $2;
     }
     | '~' expression %prec TOK_UNARY {
         $$ = ~ $2;
     }
     | '-' expression %prec TOK_UNARY {
-        $$ = - $2;
+        // Check for negation of minimum representable integer to prevent undefined signed int
+        // overflow.
+        if ($2 == std::numeric_limits<YYSTYPE>::min())
+        {
+            $$ = std::numeric_limits<YYSTYPE>::min();
+        }
+        else
+        {
+            $$ = -$2;
+        }
     }
     | '+' expression %prec TOK_UNARY {
         $$ = + $2;
     }
     | '(' expression ')' {
         $$ = $2;
     }
 ;
--- a/gfx/angle/src/compiler/preprocessor/Input.cpp
+++ b/gfx/angle/src/compiler/preprocessor/Input.cpp
@@ -1,20 +1,21 @@
 //
 // Copyright (c) 2011 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 "Input.h"
+#include "compiler/preprocessor/Input.h"
 
 #include <algorithm>
-#include <cassert>
 #include <cstring>
 
+#include "common/debug.h"
+
 namespace pp
 {
 
 Input::Input() : mCount(0), mString(0)
 {
 }
 
 Input::Input(size_t count, const char *const string[], const int length[]) :
@@ -27,17 +28,17 @@ Input::Input(size_t count, const char *c
         int len = length ? length[i] : -1;
         mLength.push_back(len < 0 ? std::strlen(mString[i]) : len);
     }
 }
 
 const char *Input::skipChar()
 {
     // This function should only be called when there is a character to skip.
-    assert(mReadLoc.cIndex < mLength[mReadLoc.sIndex]);
+    ASSERT(mReadLoc.cIndex < mLength[mReadLoc.sIndex]);
     ++mReadLoc.cIndex;
     if (mReadLoc.cIndex == mLength[mReadLoc.sIndex])
     {
         ++mReadLoc.sIndex;
         mReadLoc.cIndex = 0;
     }
     if (mReadLoc.sIndex >= mCount)
     {
--- a/gfx/angle/src/compiler/preprocessor/Input.h
+++ b/gfx/angle/src/compiler/preprocessor/Input.h
@@ -2,17 +2,17 @@
 // Copyright (c) 2011 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 COMPILER_PREPROCESSOR_INPUT_H_
 #define COMPILER_PREPROCESSOR_INPUT_H_
 
-#include <stddef.h>
+#include <cstddef>
 #include <vector>
 
 namespace pp
 {
 
 // Holds and reads input for Lexer.
 class Input
 {
--- a/gfx/angle/src/compiler/preprocessor/Lexer.cpp
+++ b/gfx/angle/src/compiler/preprocessor/Lexer.cpp
@@ -1,15 +1,15 @@
 //
 // 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 "Lexer.h"
+#include "compiler/preprocessor/Lexer.h"
 
 namespace pp
 {
 
 Lexer::~Lexer()
 {
 }
 
--- a/gfx/angle/src/compiler/preprocessor/Lexer.h
+++ b/gfx/angle/src/compiler/preprocessor/Lexer.h
@@ -2,22 +2,24 @@
 // 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 COMPILER_PREPROCESSOR_LEXER_H_
 #define COMPILER_PREPROCESSOR_LEXER_H_
 
+#include "common/angleutils.h"
+
 namespace pp
 {
 
 struct Token;
 
-class Lexer
+class Lexer : angle::NonCopyable
 {
   public:
     virtual ~Lexer();
 
     virtual void lex(Token *token) = 0;
 };
 
 }  // namespace pp
--- a/gfx/angle/src/compiler/preprocessor/Macro.cpp
+++ b/gfx/angle/src/compiler/preprocessor/Macro.cpp
@@ -1,39 +1,35 @@
 //
 // Copyright (c) 2011 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 "Macro.h"
+#include "compiler/preprocessor/Macro.h"
 
-#include <sstream>
-
-#include "Token.h"
+#include "common/angleutils.h"
+#include "compiler/preprocessor/Token.h"
 
 namespace pp
 {
 
 bool Macro::equals(const Macro &other) const
 {
     return (type == other.type) &&
            (name == other.name) &&
            (parameters == other.parameters) &&
            (replacements == other.replacements);
 }
 
 void PredefineMacro(MacroSet *macroSet, const char *name, int value)
 {
-    std::ostringstream stream;
-    stream << value;
-
     Token token;
     token.type = Token::CONST_INT;
-    token.text = stream.str();
+    token.text = ToString(value);
 
     Macro macro;
     macro.predefined = true;
     macro.type       = Macro::kTypeObj;
     macro.name = name;
     macro.replacements.push_back(token);
 
     (*macroSet)[name] = macro;
--- a/gfx/angle/src/compiler/preprocessor/Macro.h
+++ b/gfx/angle/src/compiler/preprocessor/Macro.h
@@ -21,26 +21,22 @@ struct Macro
     enum Type
     {
         kTypeObj,
         kTypeFunc
     };
     typedef std::vector<std::string> Parameters;
     typedef std::vector<Token> Replacements;
 
-    Macro()
-        : predefined(false),
-          disabled(false),
-          type(kTypeObj)
-    {
-    }
+    Macro() : predefined(false), disabled(false), expansionCount(0), type(kTypeObj) {}
     bool equals(const Macro &other) const;
 
     bool predefined;
     mutable bool disabled;
+    mutable int expansionCount;
 
     Type type;
     std::string name;
     Parameters parameters;
     Replacements replacements;
 };
 
 typedef std::map<std::string, Macro> MacroSet;
--- a/gfx/angle/src/compiler/preprocessor/MacroExpander.cpp
+++ b/gfx/angle/src/compiler/preprocessor/MacroExpander.cpp
@@ -1,25 +1,30 @@
 //
 // Copyright (c) 2011 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 "MacroExpander.h"
+#include "compiler/preprocessor/MacroExpander.h"
 
 #include <algorithm>
-#include <sstream>
 
-#include "DiagnosticsBase.h"
-#include "Token.h"
+#include "common/debug.h"
+#include "compiler/preprocessor/DiagnosticsBase.h"
+#include "compiler/preprocessor/Token.h"
 
 namespace pp
 {
 
+namespace
+{
+
+const size_t kMaxContextTokens = 10000;
+
 class TokenLexer : public Lexer
 {
  public:
     typedef std::vector<Token> TokenVector;
 
     TokenLexer(TokenVector *tokens)
     {
         tokens->swap(mTokens);
@@ -35,32 +40,32 @@ class TokenLexer : public Lexer
         }
         else
         {
             *token = *mIter++;
         }
     }
 
  private:
-    PP_DISALLOW_COPY_AND_ASSIGN(TokenLexer);
-
     TokenVector mTokens;
     TokenVector::const_iterator mIter;
 };
 
+}  // anonymous namespace
+
 MacroExpander::MacroExpander(Lexer *lexer, MacroSet *macroSet, Diagnostics *diagnostics)
-    : mLexer(lexer), mMacroSet(macroSet), mDiagnostics(diagnostics)
+    : mLexer(lexer), mMacroSet(macroSet), mDiagnostics(diagnostics), mTotalTokensInContexts(0)
 {
 }
 
 MacroExpander::~MacroExpander()
 {
-    for (std::size_t i = 0; i < mContextStack.size(); ++i)
+    for (MacroContext *context : mContextStack)
     {
-        delete mContextStack[i];
+        delete context;
     }
 }
 
 void MacroExpander::lex(Token *token)
 {
     while (true)
     {
         getToken(token);
@@ -77,20 +82,25 @@ void MacroExpander::lex(Token *token)
 
         const Macro& macro = iter->second;
         if (macro.disabled)
         {
             // If a particular token is not expanded, it is never expanded.
             token->setExpansionDisabled(true);
             break;
         }
+
+        // Bump the expansion count before peeking if the next token is a '('
+        // otherwise there could be a #undef of the macro before the next token.
+        macro.expansionCount++;
         if ((macro.type == Macro::kTypeFunc) && !isNextTokenLeftParen())
         {
             // If the token immediately after the macro name is not a '(',
             // this macro should not be expanded.
+            macro.expansionCount--;
             break;
         }
 
         pushMacro(macro, *token);
     }
 }
 
 void MacroExpander::getToken(Token *token)
@@ -109,31 +119,32 @@ void MacroExpander::getToken(Token *toke
     }
 
     if (!mContextStack.empty())
     {
         *token = mContextStack.back()->get();
     }
     else
     {
+        ASSERT(mTotalTokensInContexts == 0);
         mLexer->lex(token);
     }
 }
 
 void MacroExpander::ungetToken(const Token &token)
 {
     if (!mContextStack.empty())
     {
         MacroContext *context = mContextStack.back();
         context->unget();
-        assert(context->replacements[context->index] == token);
+        ASSERT(context->replacements[context->index] == token);
     }
     else
     {
-        assert(!mReserveToken.get());
+        ASSERT(!mReserveToken.get());
         mReserveToken.reset(new Token(token));
     }
 }
 
 bool MacroExpander::isNextTokenLeftParen()
 {
     Token token;
     getToken(&token);
@@ -141,45 +152,49 @@ bool MacroExpander::isNextTokenLeftParen
     bool lparen = token.type == '(';
     ungetToken(token);
 
     return lparen;
 }
 
 bool MacroExpander::pushMacro(const Macro &macro, const Token &identifier)
 {
-    assert(!macro.disabled);
-    assert(!identifier.expansionDisabled());
-    assert(identifier.type == Token::IDENTIFIER);
-    assert(identifier.text == macro.name);
+    ASSERT(!macro.disabled);
+    ASSERT(!identifier.expansionDisabled());
+    ASSERT(identifier.type == Token::IDENTIFIER);
+    ASSERT(identifier.text == macro.name);
 
     std::vector<Token> replacements;
     if (!expandMacro(macro, identifier, &replacements))
         return false;
 
     // Macro is disabled for expansion until it is popped off the stack.
     macro.disabled = true;
 
     MacroContext *context = new MacroContext;
     context->macro = &macro;
     context->replacements.swap(replacements);
     mContextStack.push_back(context);
+    mTotalTokensInContexts += context->replacements.size();
     return true;
 }
 
 void MacroExpander::popMacro()
 {
-    assert(!mContextStack.empty());
+    ASSERT(!mContextStack.empty());
 
     MacroContext *context = mContextStack.back();
     mContextStack.pop_back();
 
-    assert(context->empty());
-    assert(context->macro->disabled);
+    ASSERT(context->empty());
+    ASSERT(context->macro->disabled);
+    ASSERT(context->macro->expansionCount > 0);
     context->macro->disabled = false;
+    context->macro->expansionCount--;
+    mTotalTokensInContexts -= context->replacements.size();
     delete context;
 }
 
 bool MacroExpander::expandMacro(const Macro &macro,
                                 const Token &identifier,
                                 std::vector<Token> *replacements)
 {
     replacements->clear();
@@ -194,35 +209,31 @@ bool MacroExpander::expandMacro(const Ma
         replacements->assign(macro.replacements.begin(),
                              macro.replacements.end());
 
         if (macro.predefined)
         {
             const char kLine[] = "__LINE__";
             const char kFile[] = "__FILE__";
 
-            assert(replacements->size() == 1);
+            ASSERT(replacements->size() == 1);
             Token& repl = replacements->front();
             if (macro.name == kLine)
             {
-                std::ostringstream stream;
-                stream << identifier.location.line;
-                repl.text = stream.str();
+                repl.text = ToString(identifier.location.line);
             }
             else if (macro.name == kFile)
             {
-                std::ostringstream stream;
-                stream << identifier.location.file;
-                repl.text = stream.str();
+                repl.text = ToString(identifier.location.file);
             }
         }
     }
     else
     {
-        assert(macro.type == Macro::kTypeFunc);
+        ASSERT(macro.type == Macro::kTypeFunc);
         std::vector<MacroArg> args;
         args.reserve(macro.parameters.size());
         if (!collectMacroArgs(macro, identifier, &args, &replacementLocation))
             return false;
 
         replaceMacroParams(macro, args, replacements);
     }
 
@@ -243,20 +254,22 @@ bool MacroExpander::expandMacro(const Ma
 
 bool MacroExpander::collectMacroArgs(const Macro &macro,
                                      const Token &identifier,
                                      std::vector<MacroArg> *args,
                                      SourceLocation *closingParenthesisLocation)
 {
     Token token;
     getToken(&token);
-    assert(token.type == '(');
+    ASSERT(token.type == '(');
 
     args->push_back(MacroArg());
-    for (int openParens = 1; openParens != 0; )
+
+    int openParens = 1;
+    while (openParens != 0)
     {
         getToken(&token);
 
         if (token.type == Token::LAST)
         {
             mDiagnostics->report(Diagnostics::PP_MACRO_UNTERMINATED_INVOCATION,
                                  identifier.location, identifier.text);
             // Do not lose EOF token.
@@ -312,39 +325,53 @@ bool MacroExpander::collectMacroArgs(con
             Diagnostics::PP_MACRO_TOO_MANY_ARGS;
         mDiagnostics->report(id, identifier.location, identifier.text);
         return false;
     }
 
     // Pre-expand each argument before substitution.
     // This step expands each argument individually before they are
     // inserted into the macro body.
-    for (std::size_t i = 0; i < args->size(); ++i)
+    size_t numTokens = 0;
+    for (auto &arg : *args)
     {
-        MacroArg &arg = args->at(i);
         TokenLexer lexer(&arg);
         MacroExpander expander(&lexer, mMacroSet, mDiagnostics);
 
         arg.clear();
         expander.lex(&token);
         while (token.type != Token::LAST)
         {
             arg.push_back(token);
             expander.lex(&token);
+            numTokens++;
+            if (numTokens + mTotalTokensInContexts > kMaxContextTokens)
+            {
+                mDiagnostics->report(Diagnostics::PP_OUT_OF_MEMORY, token.location, token.text);
+                return false;
+            }
         }
     }
     return true;
 }
 
 void MacroExpander::replaceMacroParams(const Macro &macro,
                                        const std::vector<MacroArg> &args,
                                        std::vector<Token> *replacements)
 {
     for (std::size_t i = 0; i < macro.replacements.size(); ++i)
     {
+        if (!replacements->empty() &&
+            replacements->size() + mTotalTokensInContexts > kMaxContextTokens)
+        {
+            const Token &token = replacements->back();
+            mDiagnostics->report(Diagnostics::PP_OUT_OF_MEMORY, token.location, token.text);
+            return;
+        }
+
         const Token &repl = macro.replacements[i];
         if (repl.type != Token::IDENTIFIER)
         {
             replacements->push_back(repl);
             continue;
         }
 
         // TODO(alokp): Optimize this.
@@ -367,10 +394,30 @@ void MacroExpander::replaceMacroParams(c
         std::size_t iRepl = replacements->size();
         replacements->insert(replacements->end(), arg.begin(), arg.end());
         // The replacement token inherits padding properties from
         // macro replacement token.
         replacements->at(iRepl).setHasLeadingSpace(repl.hasLeadingSpace());
     }
 }
 
+MacroExpander::MacroContext::MacroContext() : macro(0), index(0)
+{
+}
+
+bool MacroExpander::MacroContext::empty() const
+{
+    return index == replacements.size();
+}
+
+const Token &MacroExpander::MacroContext::get()
+{
+    return replacements[index++];
+}
+
+void MacroExpander::MacroContext::unget()
+{
+    ASSERT(index > 0);
+    --index;
+}
+
 }  // namespace pp
 
--- a/gfx/angle/src/compiler/preprocessor/MacroExpander.h
+++ b/gfx/angle/src/compiler/preprocessor/MacroExpander.h
@@ -2,41 +2,37 @@
 // 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 COMPILER_PREPROCESSOR_MACROEXPANDER_H_
 #define COMPILER_PREPROCESSOR_MACROEXPANDER_H_
 
-#include <cassert>
 #include <memory>
 #include <vector>
 
-#include "Lexer.h"
-#include "Macro.h"
-#include "pp_utils.h"
+#include "compiler/preprocessor/Lexer.h"
+#include "compiler/preprocessor/Macro.h"
 
 namespace pp
 {
 
 class Diagnostics;
 struct SourceLocation;
 
 class MacroExpander : public Lexer
 {
   public:
     MacroExpander(Lexer *lexer, MacroSet *macroSet, Diagnostics *diagnostics);
     ~MacroExpander() override;
 
     void lex(Token *token) override;
 
   private:
-    PP_DISALLOW_COPY_AND_ASSIGN(MacroExpander);
-
     void getToken(Token *token);
     void ungetToken(const Token &token);
     bool isNextTokenLeftParen();
 
     bool pushMacro(const Macro &macro, const Token &identifier);
     void popMacro();
 
     bool expandMacro(const Macro &macro,
@@ -49,43 +45,30 @@ class MacroExpander : public Lexer
                           std::vector<MacroArg> *args,
                           SourceLocation *closingParenthesisLocation);
     void replaceMacroParams(const Macro &macro,
                             const std::vector<MacroArg> &args,
                             std::vector<Token> *replacements);
 
     struct MacroContext
     {
+        MacroContext();
+        bool empty() const;
+        const Token &get();
+        void unget();
+
         const Macro *macro;
         std::size_t index;
         std::vector<Token> replacements;
-
-        MacroContext()
-            : macro(0),
-              index(0)
-        {
-        }
-        bool empty() const
-        {
-            return index == replacements.size();
-        }
-        const Token &get()
-        {
-            return replacements[index++];
-        }
-        void unget()
-        {
-            assert(index > 0);
-            --index;
-        }
     };
 
     Lexer *mLexer;
     MacroSet *mMacroSet;
     Diagnostics *mDiagnostics;
 
     std::unique_ptr<Token> mReserveToken;
     std::vector<MacroContext *> mContextStack;
+    size_t mTotalTokensInContexts;
 };
 
 }  // namespace pp
 
 #endif  // COMPILER_PREPROCESSOR_MACROEXPANDER_H_
--- a/gfx/angle/src/compiler/preprocessor/Preprocessor.cpp
+++ b/gfx/angle/src/compiler/preprocessor/Preprocessor.cpp
@@ -1,24 +1,23 @@
 //
 // Copyright (c) 2011 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 "Preprocessor.h"
-
-#include <cassert>
+#include "compiler/preprocessor/Preprocessor.h"
 
-#include "DiagnosticsBase.h"
-#include "DirectiveParser.h"
-#include "Macro.h"
-#include "MacroExpander.h"
-#include "Token.h"
-#include "Tokenizer.h"
+#include "common/debug.h"
+#include "compiler/preprocessor/DiagnosticsBase.h"
+#include "compiler/preprocessor/DirectiveParser.h"
+#include "compiler/preprocessor/Macro.h"
+#include "compiler/preprocessor/MacroExpander.h"
+#include "compiler/preprocessor/Token.h"
+#include "compiler/preprocessor/Tokenizer.h"
 
 namespace pp
 {
 
 struct PreprocessorImpl
 {
     Diagnostics *diagnostics;
     MacroSet macroSet;
@@ -73,18 +72,18 @@ void Preprocessor::lex(Token *token)
     {
         mImpl->macroExpander.lex(token);
         switch (token->type)
         {
           // We should not be returning internal preprocessing tokens.
           // Convert preprocessing tokens to compiler tokens or report
           // diagnostics.
           case Token::PP_HASH:
-            assert(false);
-            break;
+              UNREACHABLE();
+              break;
           case Token::PP_NUMBER:
             mImpl->diagnostics->report(Diagnostics::PP_INVALID_NUMBER,
                                        token->location, token->text);
             break;
           case Token::PP_OTHER:
             mImpl->diagnostics->report(Diagnostics::PP_INVALID_CHARACTER,
                                        token->location, token->text);
             break;
--- a/gfx/angle/src/compiler/preprocessor/Preprocessor.h
+++ b/gfx/angle/src/compiler/preprocessor/Preprocessor.h
@@ -2,29 +2,29 @@
 // Copyright (c) 2011 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 COMPILER_PREPROCESSOR_PREPROCESSOR_H_
 #define COMPILER_PREPROCESSOR_PREPROCESSOR_H_
 
-#include <stddef.h>
+#include <cstddef>
 
-#include "pp_utils.h"
+#include "common/angleutils.h"
 
 namespace pp
 {
 
 class Diagnostics;
 class DirectiveHandler;
 struct PreprocessorImpl;
 struct Token;
 
-class Preprocessor
+class Preprocessor : angle::NonCopyable
 {
   public:
     Preprocessor(Diagnostics *diagnostics, DirectiveHandler *directiveHandler);
     ~Preprocessor();
 
     // count: specifies the number of elements in the string and length arrays.
     // string: specifies an array of pointers to strings.
     // length: specifies an array of string lengths.
@@ -39,16 +39,14 @@ class Preprocessor
     void predefineMacro(const char *name, int value);
 
     void lex(Token *token);
 
     // Set maximum preprocessor token size
     void setMaxTokenSize(size_t maxTokenSize);
 
   private:
-    PP_DISALLOW_COPY_AND_ASSIGN(Preprocessor);
-
     PreprocessorImpl *mImpl;
 };
 
 }  // namespace pp
 
 #endif  // COMPILER_PREPROCESSOR_PREPROCESSOR_H_
--- a/gfx/angle/src/compiler/preprocessor/Token.cpp
+++ b/gfx/angle/src/compiler/preprocessor/Token.cpp
@@ -1,19 +1,18 @@
 //
 // Copyright (c) 2011 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 "Token.h"
+#include "compiler/preprocessor/Token.h"
 
-#include <cassert>
-
-#include "numeric_lex.h"
+#include "common/debug.h"
+#include "compiler/preprocessor/numeric_lex.h"
 
 namespace pp
 {
 
 void Token::reset()
 {
     type = 0;
     flags = 0;
@@ -50,29 +49,29 @@ void Token::setExpansionDisabled(bool di
     if (disable)
         flags |= EXPANSION_DISABLED;
     else
         flags &= ~EXPANSION_DISABLED;
 }
 
 bool Token::iValue(int *value) const
 {
-    assert(type == CONST_INT);
+    ASSERT(type == CONST_INT);
     return numeric_lex_int(text, value);
 }
 
 bool Token::uValue(unsigned int *value) const
 {
-    assert(type == CONST_INT);
+    ASSERT(type == CONST_INT);
     return numeric_lex_int(text, value);
 }
 
 bool Token::fValue(float *value) const
 {
-    assert(type == CONST_FLOAT);
+    ASSERT(type == CONST_FLOAT);
     return numeric_lex_float(text, value);
 }
 
 std::ostream &operator<<(std::ostream &out, const Token &token)
 {
     if (token.hasLeadingSpace())
         out << " ";
 
--- a/gfx/angle/src/compiler/preprocessor/Token.h
+++ b/gfx/angle/src/compiler/preprocessor/Token.h
@@ -5,17 +5,17 @@
 //
 
 #ifndef COMPILER_PREPROCESSOR_TOKEN_H_
 #define COMPILER_PREPROCESSOR_TOKEN_H_
 
 #include <ostream>
 #include <string>
 
-#include "SourceLocation.h"
+#include "compiler/preprocessor/SourceLocation.h"
 
 namespace pp
 {
 
 struct Token
 {
     enum Type
     {
@@ -108,13 +108,13 @@ inline bool operator==(const Token &lhs,
     return lhs.equals(rhs);
 }
 
 inline bool operator!=(const Token &lhs, const Token &rhs)
 {
     return !lhs.equals(rhs);
 }
 
-extern std::ostream &operator<<(std::ostream &out, const Token &token);
+std::ostream &operator<<(std::ostream &out, const Token &token);
 
 }  // namepsace pp
 
 #endif  // COMPILER_PREPROCESSOR_TOKEN_H_
--- a/gfx/angle/src/compiler/preprocessor/Tokenizer.cpp
+++ b/gfx/angle/src/compiler/preprocessor/Tokenizer.cpp
@@ -4,30 +4,106 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 
 // This file is auto-generated by generate_parser.sh. DO NOT EDIT!
 
 
 
-#line 13 "./Tokenizer.cpp"
-
 #define  YY_INT_ALIGNED short int
 
 /* A lexical scanner generated by flex */
 
+
+
+
+
+
+
+
+
+
+
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 39
+#define YY_FLEX_MINOR_VERSION 6
+#define YY_FLEX_SUBMINOR_VERSION 1
 #if YY_FLEX_SUBMINOR_VERSION > 0
 #define FLEX_BETA
 #endif
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+        
+        
+    
+    
+
+
+    
+    
+
+
+
+    
+    
+
+
+
+    
+    
+    
+
+
+
+
+
+
 /* First, we deal with  platform-specific or compiler-specific issues. */
 
 /* begin standard C headers. */
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
 #include <stdlib.h>
 
@@ -51,17 +127,16 @@
 
 #include <inttypes.h>
 typedef int8_t flex_int8_t;
 typedef uint8_t flex_uint8_t;
 typedef int16_t flex_int16_t;
 typedef uint16_t flex_uint16_t;
 typedef int32_t flex_int32_t;
 typedef uint32_t flex_uint32_t;
-typedef uint64_t flex_uint64_t;
 #else
 typedef signed char flex_int8_t;
 typedef short int flex_int16_t;
 typedef int flex_int32_t;
 typedef unsigned char flex_uint8_t; 
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
 
@@ -93,150 +168,213 @@ typedef unsigned int flex_uint32_t;
 #ifndef UINT32_MAX
 #define UINT32_MAX             (4294967295U)
 #endif
 
 #endif /* ! C99 */
 
 #endif /* ! FLEXINT_H */
 
-#ifdef __cplusplus
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else	/* ! __cplusplus */
-
-/* C99 requires __STDC__ to be defined as 1. */
-#if defined (__STDC__)
-
-#define YY_USE_CONST
-
-#endif	/* defined (__STDC__) */
-#endif	/* ! __cplusplus */
-
-#ifdef YY_USE_CONST
+
+
+/* TODO: this is always defined, so inline it */
 #define yyconst const
+
+#if defined(__GNUC__) && __GNUC__ >= 3
+#define yynoreturn __attribute__((__noreturn__))
 #else
-#define yyconst
+#define yynoreturn
 #endif
 
+
+    
+
+
+
 /* Returned upon end-of-file. */
 #define YY_NULL 0
 
+
+
 /* Promotes a possibly negative, possibly signed char to an unsigned
  * integer for use as an array index.  If the signed char is negative,
  * we want to instead treat it as an 8-bit unsigned char, hence the
  * double cast.
  */
 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
 
+
+
+
+
 /* An opaque pointer. */
 #ifndef YY_TYPEDEF_YY_SCANNER_T
 #define YY_TYPEDEF_YY_SCANNER_T
 typedef void* yyscan_t;
 #endif
 
+
+
+
+
+
+
+
+
+    
+    
+
+
+
+
+
+
+
+
 /* For convenience, these vars (plus the bison vars far below)
    are macros in the reentrant scanner. */
 #define yyin yyg->yyin_r
 #define yyout yyg->yyout_r
 #define yyextra yyg->yyextra_r
 #define yyleng yyg->yyleng_r
 #define yytext yyg->yytext_r
 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
 #define yy_flex_debug yyg->yy_flex_debug_r
 
+
+
+
+
+
+
+
+
+    
+    
+    
+    
+
+
+
 /* Enter a start condition.  This macro really ought to take a parameter,
  * but we do it the disgusting crufty way forced on us by the ()-less
  * definition of BEGIN.
  */
 #define BEGIN yyg->yy_start = 1 + 2 *
 
+
+
 /* Translate the current start state into a value that can be later handed
  * to BEGIN to return to the state.  The YYSTATE alias is for lex
  * compatibility.
  */
 #define YY_START ((yyg->yy_start - 1) / 2)
 #define YYSTATE YY_START
 
+
+
 /* Action number for EOF rule of a given start state. */
 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
 
+
+
 /* Special action meaning "start processing a new file". */
 #define YY_NEW_FILE pprestart(yyin ,yyscanner )
 
+
+
 #define YY_END_OF_BUFFER_CHAR 0
 
+
 /* Size of default input buffer. */
 #ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
 #define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
 #endif
 
+
 /* The state buf must be large enough to hold one state per character in the main buffer.
  */
 #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
 
+
+
 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
 #define YY_TYPEDEF_YY_BUFFER_STATE
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
 #endif
 
 #ifndef YY_TYPEDEF_YY_SIZE_T
 #define YY_TYPEDEF_YY_SIZE_T
 typedef size_t yy_size_t;
 #endif
 
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
+
+
 
 #define EOB_ACT_CONTINUE_SCAN 0
 #define EOB_ACT_END_OF_FILE 1
 #define EOB_ACT_LAST_MATCH 2
 
+