Bug 801158 - Update ANGLE to r1561 - r=bjacob
authorJeff Gilbert <jgilbert@mozilla.com>
Thu, 24 Jan 2013 06:21:01 -0800
changeset 119752 a941576624be57425157655d9367ff473e87c1c6
parent 119736 c71ba28efaa06baefcc7362f7501afeacd706fd2
child 119753 f25cde34bb5620c867db82b6a749687126d658d2
push id24224
push userryanvm@gmail.com
push dateFri, 25 Jan 2013 01:59:34 +0000
treeherdermozilla-central@82f3c39bc8fc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbjacob
bugs801158
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 801158 - Update ANGLE to r1561 - r=bjacob
gfx/angle/.gitignore
gfx/angle/AUTHORS
gfx/angle/CONTRIBUTORS
gfx/angle/LICENSE.preprocessor
gfx/angle/Makefile.in
gfx/angle/README.mozilla
gfx/angle/angle-1317.patch
gfx/angle/angle-abort-on-oom-in-preprocessor.patch
gfx/angle/angle-build-dedupe-debug-cpp-h.patch
gfx/angle/angle-build-dedupe-preproc-files.patch
gfx/angle/angle-build-stdcall-alias.patch
gfx/angle/angle-enforce-readpixels-spec.patch
gfx/angle/angle-impl-read-bgra.patch
gfx/angle/angle-long-ident-spooky-hash.patch
gfx/angle/angle-long-identifier-hash-spooky.patch
gfx/angle/angle-renaming-debug.patch
gfx/angle/angle-renaming-preprocessor-diagonostics.patch
gfx/angle/angle-renaming-preprocessor-directivehandler.patch
gfx/angle/angle-stdcall-alias.patch
gfx/angle/extensions/ANGLE_multiple_render_targets.txt
gfx/angle/include/GLSLANG/ShaderLang.h
gfx/angle/samples/build_samples.gyp
gfx/angle/samples/gles2_book/Common/Win32/esUtil_TGA.c
gfx/angle/samples/gles2_book/Common/Win32/esUtil_win32.c
gfx/angle/samples/gles2_book/Common/esShader.c
gfx/angle/samples/gles2_book/Common/esShapes.c
gfx/angle/samples/gles2_book/Common/esTransform.c
gfx/angle/samples/gles2_book/Common/esUtil.c
gfx/angle/samples/gles2_book/Common/esUtil.h
gfx/angle/samples/gles2_book/Common/esUtil.vcproj
gfx/angle/samples/gles2_book/Common/esUtil_win.h
gfx/angle/samples/gles2_book/Hello_Triangle/Hello_Triangle.c
gfx/angle/samples/gles2_book/Hello_Triangle/Hello_Triangle.vcproj
gfx/angle/samples/gles2_book/MipMap2D/MipMap2D.c
gfx/angle/samples/gles2_book/MipMap2D/MipMap2D.vcproj
gfx/angle/samples/gles2_book/MultiTexture/MultiTexture.c
gfx/angle/samples/gles2_book/MultiTexture/MultiTexture.vcproj
gfx/angle/samples/gles2_book/MultiTexture/basemap.tga
gfx/angle/samples/gles2_book/MultiTexture/lightmap.tga
gfx/angle/samples/gles2_book/ParticleSystem/ParticleSystem.c
gfx/angle/samples/gles2_book/ParticleSystem/ParticleSystem.vcproj
gfx/angle/samples/gles2_book/ParticleSystem/smoke.tga
gfx/angle/samples/gles2_book/PostSubBuffer/PostSubBuffer.c
gfx/angle/samples/gles2_book/PostSubBuffer/PostSubBuffer.vcproj
gfx/angle/samples/gles2_book/Simple_Texture2D/Simple_Texture2D.c
gfx/angle/samples/gles2_book/Simple_Texture2D/Simple_Texture2D.vcproj
gfx/angle/samples/gles2_book/Simple_TextureCubemap/Simple_TextureCubemap.c
gfx/angle/samples/gles2_book/Simple_TextureCubemap/Simple_TextureCubemap.vcproj
gfx/angle/samples/gles2_book/Simple_VertexShader/Simple_VertexShader.c
gfx/angle/samples/gles2_book/Simple_VertexShader/Simple_VertexShader.vcproj
gfx/angle/samples/gles2_book/Stencil_Test/Stencil_Test.c
gfx/angle/samples/gles2_book/Stencil_Test/Stencil_Test.vcproj
gfx/angle/samples/gles2_book/TextureWrap/TextureWrap.c
gfx/angle/samples/gles2_book/TextureWrap/TextureWrap.vcproj
gfx/angle/samples/samples.sln
gfx/angle/samples/translator/essl_to_glsl.vcproj
gfx/angle/samples/translator/essl_to_hlsl.vcproj
gfx/angle/samples/translator/translator.cpp
gfx/angle/src/ANGLE.sln
gfx/angle/src/build_angle.gyp
gfx/angle/src/build_angle.gypi
gfx/angle/src/common/debug.cpp
gfx/angle/src/common/version.h
gfx/angle/src/compiler/Compiler.cpp
gfx/angle/src/compiler/Diagnostics.cpp
gfx/angle/src/compiler/Diagnostics.h
gfx/angle/src/compiler/DirectiveHandler.cpp
gfx/angle/src/compiler/DirectiveHandler.h
gfx/angle/src/compiler/HashNames.h
gfx/angle/src/compiler/Intermediate.cpp
gfx/angle/src/compiler/OutputESSL.cpp
gfx/angle/src/compiler/OutputESSL.h
gfx/angle/src/compiler/OutputGLSL.cpp
gfx/angle/src/compiler/OutputGLSL.h
gfx/angle/src/compiler/OutputGLSLBase.cpp
gfx/angle/src/compiler/OutputGLSLBase.h
gfx/angle/src/compiler/OutputHLSL.cpp
gfx/angle/src/compiler/ParseHelper.cpp
gfx/angle/src/compiler/ParseHelper.h
gfx/angle/src/compiler/ShHandle.h
gfx/angle/src/compiler/ShaderLang.cpp
gfx/angle/src/compiler/SymbolTable.cpp
gfx/angle/src/compiler/TranslatorESSL.cpp
gfx/angle/src/compiler/TranslatorGLSL.cpp
gfx/angle/src/compiler/Types.h
gfx/angle/src/compiler/UnfoldShortCircuit.cpp
gfx/angle/src/compiler/VariableInfo.cpp
gfx/angle/src/compiler/VariableInfo.h
gfx/angle/src/compiler/VersionGLSL.cpp
gfx/angle/src/compiler/VersionGLSL.h
gfx/angle/src/compiler/compiler_debug.cpp
gfx/angle/src/compiler/compiler_debug.h
gfx/angle/src/compiler/compilerdebug.cpp
gfx/angle/src/compiler/compilerdebug.h
gfx/angle/src/compiler/glslang.l
gfx/angle/src/compiler/glslang.y
gfx/angle/src/compiler/glslang_lex.cpp
gfx/angle/src/compiler/glslang_tab.cpp
gfx/angle/src/compiler/intermediate.h
gfx/angle/src/compiler/osinclude.h
gfx/angle/src/compiler/ossource_nspr.cpp
gfx/angle/src/compiler/preprocessor/Diagnostics.h
gfx/angle/src/compiler/preprocessor/DirectiveHandler.h
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/PreprocessorDiagnostics.cpp
gfx/angle/src/compiler/preprocessor/PreprocessorDirectiveHandler.cpp
gfx/angle/src/compiler/preprocessor/SourceLocation.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/atom.c
gfx/angle/src/compiler/preprocessor/atom.h
gfx/angle/src/compiler/preprocessor/compile.h
gfx/angle/src/compiler/preprocessor/cpp.c
gfx/angle/src/compiler/preprocessor/cpp.h
gfx/angle/src/compiler/preprocessor/cppstruct.c
gfx/angle/src/compiler/preprocessor/generate_parser.sh
gfx/angle/src/compiler/preprocessor/memory.c
gfx/angle/src/compiler/preprocessor/memory.h
gfx/angle/src/compiler/preprocessor/new/Diagnostics.h
gfx/angle/src/compiler/preprocessor/new/DirectiveHandler.h
gfx/angle/src/compiler/preprocessor/new/DirectiveParser.cpp
gfx/angle/src/compiler/preprocessor/new/DirectiveParser.h
gfx/angle/src/compiler/preprocessor/new/ExpressionParser.cpp
gfx/angle/src/compiler/preprocessor/new/ExpressionParser.h
gfx/angle/src/compiler/preprocessor/new/ExpressionParser.y
gfx/angle/src/compiler/preprocessor/new/Input.cpp
gfx/angle/src/compiler/preprocessor/new/Input.h
gfx/angle/src/compiler/preprocessor/new/Lexer.cpp
gfx/angle/src/compiler/preprocessor/new/Lexer.h
gfx/angle/src/compiler/preprocessor/new/Macro.cpp
gfx/angle/src/compiler/preprocessor/new/Macro.h
gfx/angle/src/compiler/preprocessor/new/MacroExpander.cpp
gfx/angle/src/compiler/preprocessor/new/MacroExpander.h
gfx/angle/src/compiler/preprocessor/new/Preprocessor.cpp
gfx/angle/src/compiler/preprocessor/new/Preprocessor.h
gfx/angle/src/compiler/preprocessor/new/PreprocessorDiagnostics.cpp
gfx/angle/src/compiler/preprocessor/new/PreprocessorDirectiveHandler.cpp
gfx/angle/src/compiler/preprocessor/new/SourceLocation.h
gfx/angle/src/compiler/preprocessor/new/Token.cpp
gfx/angle/src/compiler/preprocessor/new/Token.h
gfx/angle/src/compiler/preprocessor/new/Tokenizer.cpp
gfx/angle/src/compiler/preprocessor/new/Tokenizer.h
gfx/angle/src/compiler/preprocessor/new/Tokenizer.l
gfx/angle/src/compiler/preprocessor/new/generate_parser.sh
gfx/angle/src/compiler/preprocessor/new/numeric_lex.h
gfx/angle/src/compiler/preprocessor/new/pp_utils.h
gfx/angle/src/compiler/preprocessor/new/preprocessor.vcproj
gfx/angle/src/compiler/preprocessor/numeric_lex.h
gfx/angle/src/compiler/preprocessor/parser.h
gfx/angle/src/compiler/preprocessor/pp_utils.h
gfx/angle/src/compiler/preprocessor/preprocess.h
gfx/angle/src/compiler/preprocessor/preprocessor.vcxproj
gfx/angle/src/compiler/preprocessor/preprocessor.vcxproj.filters
gfx/angle/src/compiler/preprocessor/scanner.c
gfx/angle/src/compiler/preprocessor/scanner.h
gfx/angle/src/compiler/preprocessor/slglobals.h
gfx/angle/src/compiler/preprocessor/symbols.c
gfx/angle/src/compiler/preprocessor/symbols.h
gfx/angle/src/compiler/preprocessor/tokens.c
gfx/angle/src/compiler/preprocessor/tokens.h
gfx/angle/src/compiler/translator_common.vcproj
gfx/angle/src/compiler/translator_common.vcxproj
gfx/angle/src/compiler/translator_common.vcxproj.filters
gfx/angle/src/compiler/translator_hlsl.vcproj
gfx/angle/src/compiler/translator_hlsl.vcxproj
gfx/angle/src/compiler/translator_hlsl.vcxproj.filters
gfx/angle/src/libEGL/Display.cpp
gfx/angle/src/libEGL/Display.h
gfx/angle/src/libEGL/Makefile.in
gfx/angle/src/libEGL/Surface.cpp
gfx/angle/src/libEGL/libEGL.vcproj
gfx/angle/src/libEGL/libEGL.vcxproj
gfx/angle/src/libEGL/libEGL.vcxproj.filters
gfx/angle/src/libEGL/main.cpp
gfx/angle/src/libGLESv2/BinaryStream.h
gfx/angle/src/libGLESv2/Blit.cpp
gfx/angle/src/libGLESv2/Context.cpp
gfx/angle/src/libGLESv2/Context.h
gfx/angle/src/libGLESv2/D3DConstantTable.cpp
gfx/angle/src/libGLESv2/D3DConstantTable.h
gfx/angle/src/libGLESv2/Float16ToFloat32.cpp
gfx/angle/src/libGLESv2/Float16ToFloat32.py
gfx/angle/src/libGLESv2/Framebuffer.cpp
gfx/angle/src/libGLESv2/Makefile.in
gfx/angle/src/libGLESv2/Program.h
gfx/angle/src/libGLESv2/ProgramBinary.cpp
gfx/angle/src/libGLESv2/ProgramBinary.h
gfx/angle/src/libGLESv2/Shader.cpp
gfx/angle/src/libGLESv2/Shader.h
gfx/angle/src/libGLESv2/Texture.cpp
gfx/angle/src/libGLESv2/Texture.h
gfx/angle/src/libGLESv2/libGLESv2.cpp
gfx/angle/src/libGLESv2/libGLESv2.def
gfx/angle/src/libGLESv2/libGLESv2.vcproj
gfx/angle/src/libGLESv2/libGLESv2.vcxproj
gfx/angle/src/libGLESv2/libGLESv2.vcxproj.filters
gfx/angle/src/libGLESv2/main.cpp
gfx/angle/src/libGLESv2/mathutil.h
gfx/angle/src/libGLESv2/utilities.cpp
gfx/angle/src/libGLESv2/utilities.h
gfx/angle/tests/build_tests.gyp
gfx/angle/tests/compiler_tests/VariablePacker_test.cpp
gfx/angle/tests/preprocessor_tests/MockDiagnostics.h
gfx/angle/tests/preprocessor_tests/MockDirectiveHandler.h
gfx/angle/tests/preprocessor_tests/PreprocessorTest.cpp
gfx/angle/tests/preprocessor_tests/PreprocessorTest.h
gfx/angle/tests/preprocessor_tests/char_test.cpp
gfx/angle/tests/preprocessor_tests/comment_test.cpp
gfx/angle/tests/preprocessor_tests/define_test.cpp
gfx/angle/tests/preprocessor_tests/error_test.cpp
gfx/angle/tests/preprocessor_tests/extension_test.cpp
gfx/angle/tests/preprocessor_tests/identifier_test.cpp
gfx/angle/tests/preprocessor_tests/if_test.cpp
gfx/angle/tests/preprocessor_tests/input_test.cpp
gfx/angle/tests/preprocessor_tests/location_test.cpp
gfx/angle/tests/preprocessor_tests/number_test.cpp
gfx/angle/tests/preprocessor_tests/operator_test.cpp
gfx/angle/tests/preprocessor_tests/pragma_test.cpp
gfx/angle/tests/preprocessor_tests/space_test.cpp
gfx/angle/tests/preprocessor_tests/token_test.cpp
gfx/angle/tests/preprocessor_tests/version_test.cpp
new file mode 100644
--- /dev/null
+++ b/gfx/angle/.gitignore
@@ -0,0 +1,9 @@
+Debug
+Release
+*.sdf
+*.ncb
+*.suo
+*.vcproj.*
+*.vcxproj.user
+patches-*
+*.target.mk
--- a/gfx/angle/AUTHORS
+++ b/gfx/angle/AUTHORS
@@ -1,18 +1,32 @@
 # This is the official list of The ANGLE Project Authors
 # for copyright purposes.
 # This file is distinct from the CONTRIBUTORS files.
 # See the latter for an explanation.
 
 # Names should be added to this file as
-#	Name or Organization <email address>
-# The email address is not required for organizations.
-
-TransGaming Inc.
+#	Name or Organization
+# Email addresses for individuals are tracked elsewhere to avoid spam.
 
 Google Inc.
-
+TransGaming Inc.
 3DLabs Inc. Ltd.
 
+Adobe Systems Inc.
+Autodesk, Inc.
 Cloud Party, Inc.
+Intel Corporation
+Mozilla Corporation
+Turbulenz
+Klarälvdalens Datakonsult AB
 
-Jacek Caban <cjacek at gmail.com>
+Jacek Caban
+Mark Callow
+Ginn Chen
+James Hauxwell
+Sam Hocevar
+Pierre Leveille
+Jonathan Liu
+Boying Lu
+Aitor Moreno
+Yuri O'Donnell
+Josh Soref
--- a/gfx/angle/CONTRIBUTORS
+++ b/gfx/angle/CONTRIBUTORS
@@ -12,49 +12,62 @@ TransGaming Inc.
  Andrew Lewycky
  Gavriel State
  Shannon Woods
 
 Google Inc.
  Brent Austin
  Michael Bai
  John Bauman
+ Peter Beverloo
  Steve Block
+ Rachel Blum
+ Eric Boren
  Henry Bridge
  Nat Duca
+ Peter Kasting
  Vangelis Kokkevis
  Zhenyao Mo
  Daniel Nicoara
  Alastair Patrick
  Alok Priyadarshi
  Kenneth Russell
  Brian Salomon
+ Gregg Tavares
+ Jeff Timanus
  Ben Vanik
  Adrienne Walker
+ thestig@chromium.org
+
+Adobe Systems Inc.
+ Alexandru Chiculita
+ Steve Minns
+ Max Vujovic
+
+Autodesk, Inc.
+ Ranger Harke
+
+Cloud Party, Inc.
+ Conor Dickinson
+
+Intel Corporation
+ Jin Yang
+ Andy Chen
+ Josh Triplett
+
+Klarälvdalens Datakonsult AB
+ Milian Wolff
 
 Mozilla Corp.
  Ehsan Akhgari
+ Jeff Gilbert
  Mike Hommey
  Benoit Jacob
  Makoto Kato
  Vladimir Vukicevic
 
-Apple Inc.
- David Kilzer
-
-Adobe Systems Inc.
- Alexandru Chiculita
- Max Vujovic
-
-Cloud Party, Inc.
- Conor Dickinson
+Turbulenz
+ Michael Braithwaite
 
-Aitor Moreno <aitormoreno at gmail.com>
-Jim Hauxwell <james at dattrax.co.uk>
-ddefrostt
-timeless
-Yore Apex
-Mark Callow
-Yuriy O'Donnell
-Sam Hocevar
-Pierre Leveille
-Jin Yang
+Ulrik Persson (ddefrostt)
+Mark Banner (standard8mbp)
+David Kilzer
 
deleted file mode 100644
--- a/gfx/angle/LICENSE.preprocessor
+++ /dev/null
@@ -1,45 +0,0 @@
-Files in src/compiler/preprocessor are provided under the following license:
-
-****************************************************************************
-Copyright (c) 2002, NVIDIA Corporation.
-
-NVIDIA Corporation("NVIDIA") supplies this software to you in
-consideration of your agreement to the following terms, and your use,
-installation, modification or redistribution of this NVIDIA software
-constitutes acceptance of these terms.  If you do not agree with these
-terms, please do not use, install, modify or redistribute this NVIDIA
-software.
-
-In consideration of your agreement to abide by the following terms, and
-subject to these terms, NVIDIA grants you a personal, non-exclusive
-license, under NVIDIA's copyrights in this original NVIDIA software (the
-"NVIDIA Software"), to use, reproduce, modify and redistribute the
-NVIDIA Software, with or without modifications, in source and/or binary
-forms; provided that if you redistribute the NVIDIA Software, you must
-retain the copyright notice of NVIDIA, this notice and the following
-text and disclaimers in all such redistributions of the NVIDIA Software.
-Neither the name, trademarks, service marks nor logos of NVIDIA
-Corporation may be used to endorse or promote products derived from the
-NVIDIA Software without specific prior written permission from NVIDIA.
-Except as expressly stated in this notice, no other rights or licenses
-express or implied, are granted by NVIDIA herein, including but not
-limited to any patent rights that may be infringed by your derivative
-works or by other works in which the NVIDIA Software may be
-incorporated. No hardware is licensed hereunder. 
-
-THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED,
-INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE,
-NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
-ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER
-PRODUCTS.
-
-IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT,
-INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY
-OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE
-NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT,
-TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
-NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-****************************************************************************
--- a/gfx/angle/Makefile.in
+++ b/gfx/angle/Makefile.in
@@ -1,128 +1,136 @@
-# 
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-DEPTH		= @DEPTH@
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
+DEPTH     = @DEPTH@
+topsrcdir = @top_srcdir@
+srcdir    = @srcdir@
+VPATH     = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-MODULE		= angle
-LIBRARY_NAME	= angle
-LIBXUL_LIBRARY  = 1
+MODULE         = angle
+LIBRARY_NAME   = angle
+LIBXUL_LIBRARY = 1
 ifeq (WINNT,$(OS_TARGET))
 VISIBILITY_FLAGS =
 endif
 
 EXPORTS_NAMESPACES = angle
 
 EXPORTS_angle = \
-	include/GLSLANG/ShaderLang.h \
-	$(NULL)
+  include/GLSLANG/ShaderLang.h \
+  include/KHR/khrplatform.h \
+  $(NULL)
 
-LOCAL_INCLUDES += -I$(srcdir)/include -I$(srcdir)/src
+# The below is a rough translation of build_angle.gypi:
+DEFINES += -DANGLE_DISABLE_TRACE
+DEFINES += -DANGLE_COMPILE_OPTIMIZATION_LEVEL=D3DCOMPILE_OPTIMIZATION_LEVEL0
 
-VPATH += $(srcdir)/src
-VPATH += $(srcdir)/src/compiler
+# Target: 'preprocessor'
+# src/compiler/preprocessor:
 VPATH += $(srcdir)/src/compiler/preprocessor
-VPATH += $(srcdir)/src/compiler/preprocessor/new
-VPATH += $(srcdir)/src/compiler/timing
-VPATH += $(srcdir)/src/compiler/depgraph
+CPPSRCS += \
+  PreprocessorDiagnostics.cpp \
+  PreprocessorDirectiveHandler.cpp \
+  DirectiveParser.cpp \
+  ExpressionParser.cpp \
+  Input.cpp \
+  Lexer.cpp \
+  Macro.cpp \
+  MacroExpander.cpp \
+  Preprocessor.cpp \
+  Token.cpp \
+  Tokenizer.cpp \
+  $(NULL)
+
+# Target: 'translator_common'
+#   Requires: 'preprocessor'
+LOCAL_INCLUDES += \
+  -I$(srcdir)/include \
+  -I$(srcdir)/include/KHR \
+  -I$(srcdir)/src
+
+DEFINES += -DCOMPILER_IMPLEMENTATION
 
-CPPSRCS = \
-        Diagnostics.cpp \
-        PreprocessorDiagnostics.cpp \
-        DirectiveHandler.cpp \
-        PreprocessorDirectiveHandler.cpp \
-        DirectiveParser.cpp \
-        ExpressionParser.cpp \
-        Macro.cpp \
-        MacroExpander.cpp \
-        Tokenizer.cpp \
-        InitializeParseContext.cpp \
-        DependencyGraph.cpp \
-        DependencyGraphBuilder.cpp \
-        DependencyGraphOutput.cpp \
-        DependencyGraphTraverse.cpp \
-        RestrictFragmentShaderTiming.cpp \
-        RestrictVertexShaderTiming.cpp \
-        Compiler.cpp \
-        DetectRecursion.cpp \
-        InfoSink.cpp \
-        Initialize.cpp \
-        InitializeDll.cpp \
-        Intermediate.cpp \
-        intermOut.cpp \
-        IntermTraverse.cpp \
-        parseConst.cpp \
-        ParseHelper.cpp \
-        PoolAlloc.cpp \
-        QualifierAlive.cpp \
-        RemoveTree.cpp \
-        ShaderLang.cpp \
-        SymbolTable.cpp \
-        VariableInfo.cpp \
-        compilerdebug.cpp \
-        util.cpp \
-        ValidateLimitations.cpp \
-        ForLoopUnroll.cpp \
-        MapLongVariableNames.cpp \
-        spooky.cpp \
-        BuiltInFunctionEmulator.cpp \
-        Input.cpp \
-        Lexer.cpp \
-        Preprocessor.cpp \
-        Token.cpp \
-        VariablePacker.cpp \
-        $(NULL)
+VPATH += $(srcdir)/src/compiler
+# src/compiler:
+CPPSRCS += \
+  BuiltInFunctionEmulator.cpp \
+  Compiler.cpp \
+  compiler_debug.cpp \
+  DetectRecursion.cpp \
+  Diagnostics.cpp \
+  DirectiveHandler.cpp \
+  ForLoopUnroll.cpp \
+  glslang_lex.cpp \
+  glslang_tab.cpp \
+  InfoSink.cpp \
+  Initialize.cpp \
+  InitializeDll.cpp \
+  InitializeParseContext.cpp \
+  Intermediate.cpp \
+  intermOut.cpp \
+  IntermTraverse.cpp \
+  MapLongVariableNames.cpp \
+  parseConst.cpp \
+  ParseHelper.cpp \
+  PoolAlloc.cpp \
+  QualifierAlive.cpp \
+  RemoveTree.cpp \
+  spooky.cpp \
+  SymbolTable.cpp \
+  util.cpp \
+  ValidateLimitations.cpp \
+  VariableInfo.cpp \
+  VariablePacker.cpp \
+  $(NULL)
 
-# flex/yacc generated files
-CPPSRCS += \
-        glslang_lex.cpp \
-        glslang_tab.cpp \
-        $(NULL)
-
-# GLSL translator backend
+VPATH += $(srcdir)/src/compiler/depgraph
+# src/compiler/depgraph:
 CPPSRCS += \
-        CodeGenGLSL.cpp \
-        OutputGLSL.cpp \
-        TranslatorGLSL.cpp \
-        VersionGLSL.cpp \
-        OutputESSL.cpp \
-        OutputGLSLBase.cpp \
-        TranslatorESSL.cpp \
-        $(NULL)
+  DependencyGraph.cpp \
+  DependencyGraphBuilder.cpp \
+  DependencyGraphOutput.cpp \
+  DependencyGraphTraverse.cpp \
+  $(NULL)
+
+VPATH += $(srcdir)/src/compiler/timing
+# src/compiler/timing:
+CPPSRCS += \
+  RestrictFragmentShaderTiming.cpp \
+  RestrictVertexShaderTiming.cpp \
+  $(NULL)
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
-CPPSRCS += ossource_win.cpp $(NULL)
+CPPSRCS += ossource_win.cpp
 else
-CPPSRCS += ossource_posix.cpp $(NULL)
+CPPSRCS += ossource_posix.cpp
 endif
 
-CSRCS   = \
-        atom.c \
-        cpp.c \
-        cppstruct.c \
-        memory.c \
-        scanner.c \
-        symbols.c \
-        tokens.c \
-        $(NULL)
 
-DEFINES += -DANGLE_BUILD -DCOMPILER_IMPLEMENTATION
+# Target: 'translator_glsl'
+#   Requires: 'translator_common'
+# src/compiler:
+CPPSRCS += \
+  CodeGenGLSL.cpp \
+  OutputESSL.cpp \
+  OutputGLSLBase.cpp \
+  OutputGLSL.cpp \
+  ShaderLang.cpp \
+  TranslatorESSL.cpp \
+  TranslatorGLSL.cpp \
+  VersionGLSL.cpp \
+  $(NULL)
 
-#these defines are from ANGLE's build_angle.gyp
-DEFINES += -DANGLE_DISABLE_TRACE
-DEFINES += -DANGLE_COMPILE_OPTIMIZATION_LEVEL=D3DCOMPILE_OPTIMIZATION_LEVEL0
-DEFINES += -DANGLE_USE_NEW_PREPROCESSOR=1
+  
+# End gpy translation. Remainder of targets are in src/libEGL/Makefile.in and
+# src/libGLESv2/Makefile.in
 
 ifdef MOZ_ANGLE_RENDERER
 
 # libEGL depends on (links against!) libGLESv2!
 DIRS = src/libGLESv2 src/libEGL
 
 libs::
 ifdef MOZ_D3DX9_CAB
@@ -131,8 +139,13 @@ endif
 ifdef MOZ_D3DCOMPILER_CAB
 	expand "$(MOZ_D3DCOMPILER_CAB)" -F:$(MOZ_D3DCOMPILER_DLL) "$(DIST)/bin"
 endif
 
 endif
 
 include $(topsrcdir)/config/rules.mk
 
+# We have to filter out -pedantic, because of
+# comma-at-end-of-enumerator list failures.  We can try to get this fixed
+# upstream at some point.
+CXXFLAGS := $(filter-out -pedantic,$(CXXFLAGS))
+CFLAGS   := $(filter-out -pedantic,$(CFLAGS))
--- a/gfx/angle/README.mozilla
+++ b/gfx/angle/README.mozilla
@@ -1,50 +1,86 @@
 This is the ANGLE project, from http://code.google.com/p/angleproject/
 
-Current revision: r1267
+Current revision: r1561
+
 
 == Applied local patches ==
-
 In this order:
-
-  angle-renaming-debug.patch
-    rename debug.h to compilerdebug.h to avoid conflict in our makefiles
-
-  angle-renaming-preprocessor-diagonostics.patch
-    rename one of the two Diagnostics.cpp to avoid conflict in our makefiles
-
-  angle-renaming-preprocessor-directivehandler.patch
-    rename one of the two DirectiveHandler.cpp to avoid conflict in our makefiles
-
-  angle-enforce-readpixels-spec.patch
-    see bug 724476
-
-  angle-impl-read-bgra.patch
-    see bug 724476
-
-  gfx/angle/angle-long-identifier-hash-spooky.patch
-    see bug 676071
-
-  angle-abort-on-oom-in-preprocessor.patch
-    see bug 680840. Probably not useful anymore now that we're on the new
-    preprocessor, but it doesn't hurt to keep it around a bit longer.
-
-  angle-faceforward-emu.patch
-    See bug 771406. Adds emulation for faceforward(float,float,float),
-    which is needed to prevent crashing on Mac+Intel.
-
-  angle-r1278.patch
-    Imports ANGLE r1278, which fixes ANGLE bug 350, a crasher.
+  angle-build-stdcall-alias.patch:
+    Fix an issue GCC has with linking to undecorated stdcalls.
+    
+  angle-build-dedupe-debug-cpp-h.patch:
+    Rename: "src/compiler/debug.{cpp,h}"
+    To:     "src/compiler/compiler_debug.{cpp,h}"
+    Repair includes accordingly.
+    
+  angle-build-dedupe-preproc-files.patch:
+    Rename: "src/compiler/preprocessor/Diagnostics.cpp"
+    To:     "src/compiler/preprocessor/PreprocessorDiagnostics.cpp"
+    Rename: "src/compiler/preprocessor/DirectiveHandler.cpp"
+    To:     "src/compiler/preprocessor/PreprocessorDirectiveHandler.cpp"
+  
+  angle-long-ident-spooky-hash.patch:
+    Use Spooky Hash for long identifier hashing. See bug 676071.
+  
+  angle-faceforward-emu.patch:
+    Adds emulation for faceforward(float,float,float), which is needed to
+    prevent crashing on Mac+Intel. See bug 771406.
 
 In addition to these patches, the Makefile.in files are ours, they're not present in
 upsteam ANGLE. Therefore, changes made to the Makefile.in files should not be stored
 in the local .patch files.
 
-== How to update this ANGLE copy ==
+
+== How to do a clean-slate upgrade ==
+1.  Backup our moz-specific files:
+      README.mozilla
+      Makefile.in
+      *.patch
+      src/libEGL/Makefile.in
+      src/libGLESv2/Makefile.in
+
+2.  $ rm -rf gfx/angle
+
+3.  Copy the folder containing the angle rev you want onto gfx/angle.
+    $ svn export -r <rev> <src> <moz-central>/gfx/angle 
+
+4.  Fold our moz-specific files into this new angle folder. (Makefiles, README)
+4a. Remove the unused directories. (test/, samples/, etc)
+
+5.  Clear out the "Applied Local Patches" section above, since we're going to
+    repopulate it.
+
+6.  Re-apply the angle-build-*.patch files and record them above.
+
+7.  Update the Makefile.in files with the current deps from the .gyp(i) files.
+
+8.  Build. Fix things until it builds.
+
+9.  Reapply the rest of the .patch files and record them above.
+
+10. Try runs and reviews!
+
+
+== Applying Diffs ==
+In general:
+$ patch -p1 -R < gfx/angle/angle-some-bug-fix.patch
+
+SVN diffs however can be iffy. They don't seem to be completely compatible
+with `patch`. Be aware that you'll likely get rejects whenever a file is
+removed.
+
+
+
+== How to do an incremental update ==
+Same general idea here, but instead of nuking the ANGLE dir, we're going to
+have to get a diff between revs from SVN, and deal with applying that. We
+also naturally have to peel off our local patches before we can apply a diff
+from upstream.
 
 1. Unapply patches
 
 Unapply them in reverse order, so iterate over the above list of applied patch
 starting from the bottom. You most likely want to record these patch-unapply
 operations as individual patches themselves, in order to re-apply patches later.
 
 $ cd /path/to/mozilla-central
@@ -125,15 +161,15 @@ Try options. You may want reftest as wel
 8. Get reviews.
 
 Typically, you would get review on your Makefiles patch, and any
 new patches that you need to add to get this update to work.
 
 You do not need a review for the ANGLE diff itself and for trivial updates of
 existing patches.
 
+
 == Visual Studio Solution Files ==
-
 Ignore these. We don't use them anymore. We use custom Makefiles.
 
+
 == Generated parser code==
-
 Don't bother about that anymore. The parser is now generated and included in the ANGLE svn repo.
deleted file mode 100644
--- a/gfx/angle/angle-1317.patch
+++ /dev/null
@@ -1,732 +0,0 @@
-# HG changeset patch
-# Parent ef5d80327785b28df0bd778acc86f4987ba5a678
-
-diff --git a/gfx/angle/Makefile.in b/gfx/angle/Makefile.in
---- a/gfx/angle/Makefile.in
-+++ b/gfx/angle/Makefile.in
-@@ -71,16 +71,17 @@ CPPSRCS = \
-         ForLoopUnroll.cpp \
-         MapLongVariableNames.cpp \
-         spooky.cpp \
-         BuiltInFunctionEmulator.cpp \
-         Input.cpp \
-         Lexer.cpp \
-         Preprocessor.cpp \
-         Token.cpp \
-+        VariablePacker.cpp \
-         $(NULL)
- 
- # flex/yacc generated files
- CPPSRCS += \
-         glslang_lex.cpp \
-         glslang_tab.cpp \
-         $(NULL)
- 
-diff --git a/gfx/angle/include/GLSLANG/ShaderLang.h b/gfx/angle/include/GLSLANG/ShaderLang.h
---- a/gfx/angle/include/GLSLANG/ShaderLang.h
-+++ b/gfx/angle/include/GLSLANG/ShaderLang.h
-@@ -137,17 +137,20 @@ typedef enum {
-   SH_TIMING_RESTRICTIONS = 0x0200,
-     
-   // This flag prints the dependency graph that is used to enforce timing
-   // restrictions on fragment shaders.
-   // This flag only has an effect if all of the following are true:
-   // - The shader spec is SH_WEBGL_SPEC.
-   // - The compile options contain the SH_TIMING_RESTRICTIONS flag.
-   // - The shader type is SH_FRAGMENT_SHADER.
--  SH_DEPENDENCY_GRAPH = 0x0400
-+  SH_DEPENDENCY_GRAPH = 0x0400,
-+
-+  // Enforce the GLSL 1.017 Appendix A section 7 packing restrictions.
-+  SH_ENFORCE_PACKING_RESTRICTIONS = 0x0800,
- } ShCompileOptions;
- 
- //
- // Driver must call this first, once, before doing any other
- // compiler operations.
- // If the function succeeds, the return value is nonzero, else zero.
- //
- COMPILER_EXPORT int ShInitialize();
-diff --git a/gfx/angle/src/compiler/Compiler.cpp b/gfx/angle/src/compiler/Compiler.cpp
---- a/gfx/angle/src/compiler/Compiler.cpp
-+++ b/gfx/angle/src/compiler/Compiler.cpp
-@@ -9,16 +9,17 @@
- #include "compiler/ForLoopUnroll.h"
- #include "compiler/Initialize.h"
- #include "compiler/InitializeParseContext.h"
- #include "compiler/MapLongVariableNames.h"
- #include "compiler/ParseHelper.h"
- #include "compiler/RenameFunction.h"
- #include "compiler/ShHandle.h"
- #include "compiler/ValidateLimitations.h"
-+#include "compiler/VariablePacker.h"
- #include "compiler/depgraph/DependencyGraph.h"
- #include "compiler/depgraph/DependencyGraphOutput.h"
- #include "compiler/timing/RestrictFragmentShaderTiming.h"
- #include "compiler/timing/RestrictVertexShaderTiming.h"
- 
- bool isWebGLBasedSpec(ShShaderSpec spec)
- {
-      return spec == SH_WEBGL_SPEC || spec == SH_CSS_SHADERS_SPEC;
-@@ -108,16 +109,19 @@ TCompiler::TCompiler(ShShaderType type, 
- TCompiler::~TCompiler()
- {
-     ASSERT(longNameMap);
-     longNameMap->Release();
- }
- 
- bool TCompiler::Init(const ShBuiltInResources& resources)
- {
-+    maxUniformVectors = (shaderType == SH_VERTEX_SHADER) ?
-+        resources.MaxVertexUniformVectors :
-+        resources.MaxFragmentUniformVectors;
-     TScopedPoolAllocator scopedAlloc(&allocator, false);
- 
-     // Generate built-in symbol table.
-     if (!InitBuiltInSymbolTable(resources))
-         return false;
-     InitExtensionBehavior(resources, extensionBehavior);
- 
-     return true;
-@@ -187,18 +191,25 @@ bool TCompiler::compile(const char* cons
-             builtInFunctionEmulator.MarkBuiltInFunctionsForEmulation(root);
- 
-         // Call mapLongVariableNames() before collectAttribsUniforms() so in
-         // collectAttribsUniforms() we already have the mapped symbol names and
-         // we could composite mapped and original variable names.
-         if (success && (compileOptions & SH_MAP_LONG_VARIABLE_NAMES))
-             mapLongVariableNames(root);
- 
--        if (success && (compileOptions & SH_ATTRIBUTES_UNIFORMS))
-+        if (success && (compileOptions & SH_ATTRIBUTES_UNIFORMS)) {
-             collectAttribsUniforms(root);
-+            if (compileOptions & SH_ENFORCE_PACKING_RESTRICTIONS) {
-+                success = enforcePackingRestrictions();
-+                if (!success) {
-+                    infoSink.info.message(EPrefixError, "too many uniforms");
-+                }
-+            }
-+        }
- 
-         if (success && (compileOptions & SH_INTERMEDIATE_TREE))
-             intermediate.outputTree(root);
- 
-         if (success && (compileOptions & SH_OBJECT_CODE))
-             translate(root);
-     }
- 
-@@ -305,16 +316,22 @@ bool TCompiler::enforceVertexShaderTimin
- }
- 
- void TCompiler::collectAttribsUniforms(TIntermNode* root)
- {
-     CollectAttribsUniforms collect(attribs, uniforms);
-     root->traverse(&collect);
- }
- 
-+bool TCompiler::enforcePackingRestrictions()
-+{
-+    VariablePacker packer;
-+    return packer.CheckVariablesWithinPackingLimits(maxUniformVectors, uniforms);
-+}
-+
- void TCompiler::mapLongVariableNames(TIntermNode* root)
- {
-     ASSERT(longNameMap);
-     MapLongVariableNames map(longNameMap);
-     root->traverse(&map);
- }
- 
- int TCompiler::getMappedNameMaxLength() const
-diff --git a/gfx/angle/src/compiler/ShHandle.h b/gfx/angle/src/compiler/ShHandle.h
---- a/gfx/angle/src/compiler/ShHandle.h
-+++ b/gfx/angle/src/compiler/ShHandle.h
-@@ -83,32 +83,37 @@ protected:
-     // functionality mandated in GLSL 1.0 spec Appendix A.
-     bool validateLimitations(TIntermNode* root);
-     // Collect info for all attribs and uniforms.
-     void collectAttribsUniforms(TIntermNode* root);
-     // Map long variable names into shorter ones.
-     void mapLongVariableNames(TIntermNode* root);
-     // Translate to object code.
-     virtual void translate(TIntermNode* root) = 0;
-+    // Returns true if, after applying the packing rules in the GLSL 1.017 spec
-+    // Appendix A, section 7, the shader does not use too many uniforms.
-+    bool enforcePackingRestrictions();
-     // Returns true if the shader passes the restrictions that aim to prevent timing attacks.
-     bool enforceTimingRestrictions(TIntermNode* root, bool outputGraph);
-     // Returns true if the shader does not use samplers.
-     bool enforceVertexShaderTimingRestrictions(TIntermNode* root);
-     // Returns true if the shader does not use sampler dependent values to affect control 
-     // flow or in operations whose time can depend on the input values.
-     bool enforceFragmentShaderTimingRestrictions(const TDependencyGraph& graph);
-     // Get built-in extensions with default behavior.
-     const TExtensionBehavior& getExtensionBehavior() const;
- 
-     const BuiltInFunctionEmulator& getBuiltInFunctionEmulator() const;
- 
- private:
-     ShShaderType shaderType;
-     ShShaderSpec shaderSpec;
- 
-+    int maxUniformVectors;
-+
-     // Built-in symbol table for the given language, spec, and resources.
-     // It is preserved from compile-to-compile.
-     TSymbolTable symbolTable;
-     // Built-in extensions with default behavior.
-     TExtensionBehavior extensionBehavior;
- 
-     BuiltInFunctionEmulator builtInFunctionEmulator;
- 
-diff --git a/gfx/angle/src/compiler/VariableInfo.cpp b/gfx/angle/src/compiler/VariableInfo.cpp
---- a/gfx/angle/src/compiler/VariableInfo.cpp
-+++ b/gfx/angle/src/compiler/VariableInfo.cpp
-@@ -133,16 +133,26 @@ void getUserDefinedVariableInfo(const TT
-         const TType* fieldType = (*structure)[i].type;
-         getVariableInfo(*fieldType,
-                         name + "." + fieldType->getFieldName(),
-                         mappedName + "." + fieldType->getFieldName(),
-                         infoList);
-     }
- }
- 
-+TVariableInfo::TVariableInfo()
-+{
-+}
-+
-+TVariableInfo::TVariableInfo(ShDataType type, int size)
-+    : type(type),
-+      size(size)
-+{
-+}
-+
- CollectAttribsUniforms::CollectAttribsUniforms(TVariableInfoList& attribs,
-                                                TVariableInfoList& uniforms)
-     : mAttribs(attribs),
-       mUniforms(uniforms)
- {
- }
- 
- // We are only interested in attribute and uniform variable declaration.
-diff --git a/gfx/angle/src/compiler/VariableInfo.h b/gfx/angle/src/compiler/VariableInfo.h
---- a/gfx/angle/src/compiler/VariableInfo.h
-+++ b/gfx/angle/src/compiler/VariableInfo.h
-@@ -8,16 +8,19 @@
- #define COMPILER_VARIABLE_INFO_H_
- 
- #include "GLSLANG/ShaderLang.h"
- #include "compiler/intermediate.h"
- 
- // Provides information about a variable.
- // It is currently being used to store info about active attribs and uniforms.
- struct TVariableInfo {
-+    TVariableInfo(ShDataType type, int size);
-+    TVariableInfo();
-+
-     TPersistString name;
-     TPersistString mappedName;
-     ShDataType type;
-     int size;
- };
- typedef std::vector<TVariableInfo> TVariableInfoList;
- 
- // Traverses intermediate tree to collect all attributes and uniforms.
-diff --git a/gfx/angle/src/compiler/VariablePacker.cpp b/gfx/angle/src/compiler/VariablePacker.cpp
-new file mode 100644
---- /dev/null
-+++ b/gfx/angle/src/compiler/VariablePacker.cpp
-@@ -0,0 +1,297 @@
-+//
-+// Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+//
-+#include "compiler/VariablePacker.h"
-+
-+#include <algorithm>
-+#include "compiler/ShHandle.h"
-+
-+namespace {
-+int GetSortOrder(ShDataType type)
-+{
-+    switch (type) {
-+        case SH_FLOAT_MAT4:
-+            return 0;
-+        case SH_FLOAT_MAT2:
-+            return 1;
-+        case SH_FLOAT_VEC4:
-+        case SH_INT_VEC4:
-+        case SH_BOOL_VEC4:
-+            return 2;
-+        case SH_FLOAT_MAT3:
-+            return 3;
-+        case SH_FLOAT_VEC3:
-+        case SH_INT_VEC3:
-+        case SH_BOOL_VEC3:
-+            return 4;
-+        case SH_FLOAT_VEC2:
-+        case SH_INT_VEC2:
-+        case SH_BOOL_VEC2:
-+            return 5;
-+        case SH_FLOAT:
-+        case SH_INT:
-+        case SH_BOOL:
-+        case SH_SAMPLER_2D:
-+        case SH_SAMPLER_CUBE:
-+        case SH_SAMPLER_EXTERNAL_OES:
-+        case SH_SAMPLER_2D_RECT_ARB:
-+            return 6;
-+        default:
-+            ASSERT(false);
-+            return 7;
-+    }
-+}
-+}    // namespace
-+
-+int VariablePacker::GetNumComponentsPerRow(ShDataType type)
-+{
-+    switch (type) {
-+        case SH_FLOAT_MAT4:
-+        case SH_FLOAT_MAT2:
-+        case SH_FLOAT_VEC4:
-+        case SH_INT_VEC4:
-+        case SH_BOOL_VEC4:
-+            return 4;
-+        case SH_FLOAT_MAT3:
-+        case SH_FLOAT_VEC3:
-+        case SH_INT_VEC3:
-+        case SH_BOOL_VEC3:
-+            return 3;
-+        case SH_FLOAT_VEC2:
-+        case SH_INT_VEC2:
-+        case SH_BOOL_VEC2:
-+            return 2;
-+        case SH_FLOAT:
-+        case SH_INT:
-+        case SH_BOOL:
-+        case SH_SAMPLER_2D:
-+        case SH_SAMPLER_CUBE:
-+        case SH_SAMPLER_EXTERNAL_OES:
-+        case SH_SAMPLER_2D_RECT_ARB:
-+            return 1;
-+        default:
-+            ASSERT(false);
-+            return 5;
-+    }
-+}
-+
-+int VariablePacker::GetNumRows(ShDataType type)
-+{
-+    switch (type) {
-+        case SH_FLOAT_MAT4:
-+            return 4;
-+        case SH_FLOAT_MAT3:
-+            return 3;
-+        case SH_FLOAT_MAT2:
-+            return 1;
-+        case SH_FLOAT_VEC4:
-+        case SH_INT_VEC4:
-+        case SH_BOOL_VEC4:
-+        case SH_FLOAT_VEC3:
-+        case SH_INT_VEC3:
-+        case SH_BOOL_VEC3:
-+        case SH_FLOAT_VEC2:
-+        case SH_INT_VEC2:
-+        case SH_BOOL_VEC2:
-+        case SH_FLOAT:
-+        case SH_INT:
-+        case SH_BOOL:
-+        case SH_SAMPLER_2D:
-+        case SH_SAMPLER_CUBE:
-+        case SH_SAMPLER_EXTERNAL_OES:
-+        case SH_SAMPLER_2D_RECT_ARB:
-+            return 1;
-+        default:
-+            ASSERT(false);
-+            return 100000;
-+    }
-+}
-+
-+struct TVariableInfoComparer {
-+    bool operator()(const TVariableInfo& lhs, const TVariableInfo& rhs) const
-+    {
-+        int lhsSortOrder = GetSortOrder(lhs.type);
-+        int rhsSortOrder = GetSortOrder(rhs.type);
-+        if (lhsSortOrder != rhsSortOrder) {
-+            return lhsSortOrder < rhsSortOrder;
-+        }
-+        // Sort by largest first.
-+        return lhs.size > rhs.size;
-+    }
-+};
-+
-+unsigned VariablePacker::makeColumnFlags(int column, int numComponentsPerRow)
-+{
-+    return ((kColumnMask << (kNumColumns - numComponentsPerRow)) &
-+                    kColumnMask) >> column;
-+}
-+
-+void VariablePacker::fillColumns(int topRow, int numRows, int column, int numComponentsPerRow)
-+{
-+    unsigned columnFlags = makeColumnFlags(column, numComponentsPerRow);
-+    for (int r = 0; r < numRows; ++r) {
-+        int row = topRow + r;
-+        ASSERT((rows_[row] & columnFlags) == 0);
-+        rows_[row] |= columnFlags;
-+    }
-+}
-+
-+bool VariablePacker::searchColumn(int column, int numRows, int* destRow, int* destSize)
-+{
-+    ASSERT(destRow);
-+
-+    for (; topNonFullRow_ < maxRows_ && rows_[topNonFullRow_] == kColumnMask;
-+         ++topNonFullRow_) {
-+    }
-+
-+    for (; bottomNonFullRow_ >= 0 && rows_[bottomNonFullRow_] == kColumnMask;
-+         --bottomNonFullRow_) {
-+    }
-+
-+    if (bottomNonFullRow_ - topNonFullRow_ + 1 < numRows) {
-+        return false;
-+    }
-+
-+    unsigned columnFlags = makeColumnFlags(column, 1);
-+    int topGoodRow = 0;
-+    int smallestGoodTop = -1;
-+    int smallestGoodSize = maxRows_ + 1;
-+    int bottomRow = bottomNonFullRow_ + 1;
-+    bool found = false;
-+    for (int row = topNonFullRow_; row <= bottomRow; ++row) {
-+        bool rowEmpty = row < bottomRow ? ((rows_[row] & columnFlags) == 0) : false;
-+        if (rowEmpty) {
-+            if (!found) {
-+                topGoodRow = row;
-+                found = true;
-+            }
-+        } else {
-+            if (found) {
-+                int size = row - topGoodRow;
-+                if (size >= numRows && size < smallestGoodSize) {
-+                    smallestGoodSize = size;
-+                    smallestGoodTop = topGoodRow;
-+                }
-+            }
-+            found = false;
-+        }
-+    }
-+    if (smallestGoodTop < 0) {
-+        return false;
-+    }
-+
-+    *destRow = smallestGoodTop;
-+    if (destSize) {
-+        *destSize = smallestGoodSize;
-+    }
-+    return true;
-+}
-+
-+bool VariablePacker::CheckVariablesWithinPackingLimits(int maxVectors, const TVariableInfoList& in_variables)
-+{
-+    ASSERT(maxVectors > 0);
-+    maxRows_ = maxVectors;
-+    topNonFullRow_ = 0;
-+    bottomNonFullRow_ = maxRows_ - 1;
-+    TVariableInfoList variables(in_variables);
-+
-+    // As per GLSL 1.017 Appendix A, Section 7 variables are packed in specific
-+    // order by type, then by size of array, largest first.
-+    std::sort(variables.begin(), variables.end(), TVariableInfoComparer());
-+    rows_.clear();
-+    rows_.resize(maxVectors, 0);
-+
-+    // Packs the 4 column variables.
-+    size_t ii = 0;
-+    for (; ii < variables.size(); ++ii) {
-+        const TVariableInfo& variable = variables[ii];
-+        if (GetNumComponentsPerRow(variable.type) != 4) {
-+            break;
-+        }
-+        topNonFullRow_ += GetNumRows(variable.type) * variable.size;
-+    }
-+
-+    if (topNonFullRow_ > maxRows_) {
-+        return false;
-+    }
-+
-+    // Packs the 3 column variables.
-+    int num3ColumnRows = 0;
-+    for (; ii < variables.size(); ++ii) {
-+        const TVariableInfo& variable = variables[ii];
-+        if (GetNumComponentsPerRow(variable.type) != 3) {
-+            break;
-+        }
-+        num3ColumnRows += GetNumRows(variable.type) * variable.size;
-+    }
-+
-+    if (topNonFullRow_ + num3ColumnRows > maxRows_) {
-+        return false;
-+    }
-+
-+    fillColumns(topNonFullRow_, num3ColumnRows, 0, 3);
-+
-+    // Packs the 2 column variables.
-+    int top2ColumnRow = topNonFullRow_ + num3ColumnRows;
-+    int twoColumnRowsAvailable = maxRows_ - top2ColumnRow;
-+    int rowsAvailableInColumns01 = twoColumnRowsAvailable;
-+    int rowsAvailableInColumns23 = twoColumnRowsAvailable;
-+    for (; ii < variables.size(); ++ii) {
-+        const TVariableInfo& variable = variables[ii];
-+        if (GetNumComponentsPerRow(variable.type) != 2) {
-+            break;
-+        }
-+        int numRows = GetNumRows(variable.type) * variable.size;
-+        if (numRows <= rowsAvailableInColumns01) {
-+            rowsAvailableInColumns01 -= numRows;
-+        } else if (numRows <= rowsAvailableInColumns23) {
-+            rowsAvailableInColumns23 -= numRows;
-+        } else {
-+            return false;
-+        }
-+    }
-+
-+    int numRowsUsedInColumns01 =
-+        twoColumnRowsAvailable - rowsAvailableInColumns01;
-+    int numRowsUsedInColumns23 =
-+        twoColumnRowsAvailable - rowsAvailableInColumns23;
-+    fillColumns(top2ColumnRow, numRowsUsedInColumns01, 0, 2);
-+    fillColumns(maxRows_ - numRowsUsedInColumns23, numRowsUsedInColumns23,
-+                2, 2);
-+
-+    // Packs the 1 column variables.
-+    for (; ii < variables.size(); ++ii) {
-+        const TVariableInfo& variable = variables[ii];
-+        ASSERT(1 == GetNumComponentsPerRow(variable.type));
-+        int numRows = GetNumRows(variable.type) * variable.size;
-+        int smallestColumn = -1;
-+        int smallestSize = maxRows_ + 1;
-+        int topRow = -1;
-+        for (int column = 0; column < kNumColumns; ++column) {
-+            int row = 0;
-+            int size = 0;
-+            if (searchColumn(column, numRows, &row, &size)) {
-+                if (size < smallestSize) {
-+                    smallestSize = size;
-+                    smallestColumn = column;
-+                    topRow = row;
-+                }
-+            }
-+        }
-+
-+        if (smallestColumn < 0) {
-+            return false;
-+        }
-+
-+        fillColumns(topRow, numRows, smallestColumn, 1);
-+    }
-+
-+    ASSERT(variables.size() == ii);
-+
-+    return true;
-+}
-+
-+
-+
-diff --git a/gfx/angle/src/compiler/VariablePacker.h b/gfx/angle/src/compiler/VariablePacker.h
-new file mode 100644
---- /dev/null
-+++ b/gfx/angle/src/compiler/VariablePacker.h
-@@ -0,0 +1,41 @@
-+//
-+// Copyright (c) 2002-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 _VARIABLEPACKER_INCLUDED_
-+#define _VARIABLEPACKER_INCLUDED_
-+
-+#include <vector>
-+#include "compiler/ShHandle.h"
-+
-+class VariablePacker {
-+ public:
-+    // Returns true if the passed in variables pack in maxVectors following
-+    // the packing rules from the GLSL 1.017 spec, Appendix A, section 7.
-+    bool CheckVariablesWithinPackingLimits(
-+        int maxVectors,
-+        const TVariableInfoList& in_variables);
-+
-+    // Gets how many components in a row a data type takes.
-+    static int GetNumComponentsPerRow(ShDataType type);
-+
-+    // Gets how many rows a data type takes.
-+    static int GetNumRows(ShDataType type);
-+
-+ private:
-+    static const int kNumColumns = 4;
-+    static const unsigned kColumnMask = (1 << kNumColumns) - 1;
-+
-+    unsigned makeColumnFlags(int column, int numComponentsPerRow);
-+    void fillColumns(int topRow, int numRows, int column, int numComponentsPerRow);
-+    bool searchColumn(int column, int numRows, int* destRow, int* destSize);
-+
-+    int topNonFullRow_;
-+    int bottomNonFullRow_;
-+    int maxRows_;
-+    std::vector<unsigned> rows_;
-+};
-+
-+#endif // _VARIABLEPACKER_INCLUDED_
-diff --git a/gfx/angle/src/libGLESv2/Makefile.in b/gfx/angle/src/libGLESv2/Makefile.in
---- a/gfx/angle/src/libGLESv2/Makefile.in
-+++ b/gfx/angle/src/libGLESv2/Makefile.in
-@@ -84,16 +84,17 @@ CPPSRCS = \
-         ForLoopUnroll.cpp \
-         MapLongVariableNames.cpp \
-         spooky.cpp \
-         BuiltInFunctionEmulator.cpp \
-         Input.cpp \
-         Lexer.cpp \
-         Preprocessor.cpp \
-         Token.cpp \
-+        VariablePacker.cpp \
-         $(NULL)
- 
- # flex/yacc generated files
- CPPSRCS += \
-         glslang_lex.cpp \
-         glslang_tab.cpp \
-         $(NULL)
- 
-diff --git a/gfx/angle/tests/build_tests.gyp b/gfx/angle/tests/build_tests.gyp
---- a/gfx/angle/tests/build_tests.gyp
-+++ b/gfx/angle/tests/build_tests.gyp
-@@ -58,16 +58,35 @@
-         'preprocessor_tests/pragma_test.cpp',
-         'preprocessor_tests/PreprocessorTest.cpp',
-         'preprocessor_tests/PreprocessorTest.h',
-         'preprocessor_tests/space_test.cpp',
-         'preprocessor_tests/token_test.cpp',
-         'preprocessor_tests/version_test.cpp',
-       ],
-     },
-+    {
-+      'target_name': 'compiler_tests',
-+      'type': 'executable',
-+      'dependencies': [
-+        '../src/build_angle.gyp:translator_common',
-+        'gtest',
-+        'gmock',
-+      ],
-+      'include_dirs': [
-+        '../include',
-+        '../src',
-+        '../third_party/googletest/include',
-+        '../third_party/googlemock/include',
-+      ],
-+      'sources': [
-+        '../third_party/googlemock/src/gmock_main.cc',
-+        'compiler_tests/VariablePacker_test.cpp',
-+      ],
-+    },
-   ],
- }
- 
- # Local Variables:
- # tab-width:2
- # indent-tabs-mode:nil
- # End:
- # vim: set expandtab tabstop=2 shiftwidth=2:
-diff --git a/gfx/angle/tests/compiler_tests/VariablePacker_test.cpp b/gfx/angle/tests/compiler_tests/VariablePacker_test.cpp
-new file mode 100644
---- /dev/null
-+++ b/gfx/angle/tests/compiler_tests/VariablePacker_test.cpp
-@@ -0,0 +1,85 @@
-+//
-+// Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+//
-+#include "compiler/VariablePacker.h"
-+#include "gtest/gtest.h"
-+
-+TEST(VariablePacking, Pack) {
-+  VariablePacker packer;
-+  TVariableInfoList vars;
-+  const int kMaxRows = 16;
-+  // test no vars.
-+  EXPECT_TRUE(packer.CheckVariablesWithinPackingLimits(kMaxRows, vars));
-+
-+  ShDataType types[] = {
-+    SH_FLOAT_MAT4,            // 0
-+    SH_FLOAT_MAT2,            // 1
-+    SH_FLOAT_VEC4,            // 2
-+    SH_INT_VEC4,              // 3
-+    SH_BOOL_VEC4,             // 4
-+    SH_FLOAT_MAT3,            // 5
-+    SH_FLOAT_VEC3,            // 6
-+    SH_INT_VEC3,              // 7
-+    SH_BOOL_VEC3,             // 8
-+    SH_FLOAT_VEC2,            // 9
-+    SH_INT_VEC2,              // 10
-+    SH_BOOL_VEC2,             // 11
-+    SH_FLOAT,                 // 12
-+    SH_INT,                   // 13
-+    SH_BOOL,                  // 14
-+    SH_SAMPLER_2D,            // 15
-+    SH_SAMPLER_CUBE,          // 16
-+    SH_SAMPLER_EXTERNAL_OES,  // 17
-+    SH_SAMPLER_2D_RECT_ARB,   // 18
-+  };
-+
-+  for (size_t tt = 0; tt < sizeof(types) / sizeof(types[0]); ++tt) {
-+    ShDataType type = types[tt];
-+    int num_rows = VariablePacker::GetNumRows(type);
-+    int num_components_per_row = VariablePacker::GetNumComponentsPerRow(type);
-+    // Check 1 of the type.
-+    vars.clear();
-+    vars.push_back(TVariableInfo(type, 1));
-+    EXPECT_TRUE(packer.CheckVariablesWithinPackingLimits(kMaxRows, vars));
-+
-+    // Check exactly the right amount of 1 type as an array.
-+    int num_vars = kMaxRows / num_rows;
-+    vars.clear();
-+    vars.push_back(TVariableInfo(type, num_vars));
-+    EXPECT_TRUE(packer.CheckVariablesWithinPackingLimits(kMaxRows, vars));
-+
-+    // test too many
-+    vars.clear();
-+    vars.push_back(TVariableInfo(type, num_vars + 1));
-+    EXPECT_FALSE(packer.CheckVariablesWithinPackingLimits(kMaxRows, vars));
-+
-+    // Check exactly the right amount of 1 type as individual vars.
-+    num_vars = kMaxRows / num_rows *
-+        ((num_components_per_row > 2) ? 1 : (4 / num_components_per_row));
-+    vars.clear();
-+    for (int ii = 0; ii < num_vars; ++ii) {
-+      vars.push_back(TVariableInfo(type, 1));
-+    }
-+    EXPECT_TRUE(packer.CheckVariablesWithinPackingLimits(kMaxRows, vars));
-+
-+    // Check 1 too many.
-+    vars.push_back(TVariableInfo( type, 1));
-+    EXPECT_FALSE(packer.CheckVariablesWithinPackingLimits(kMaxRows, vars));
-+  }
-+
-+  // Test example from GLSL ES 3.0 spec chapter 11.
-+  vars.clear();
-+  vars.push_back(TVariableInfo(SH_FLOAT_VEC4, 1));
-+  vars.push_back(TVariableInfo(SH_FLOAT_MAT3, 1));
-+  vars.push_back(TVariableInfo(SH_FLOAT_MAT3, 1));
-+  vars.push_back(TVariableInfo(SH_FLOAT_VEC2, 6));
-+  vars.push_back(TVariableInfo(SH_FLOAT_VEC2, 4));
-+  vars.push_back(TVariableInfo(SH_FLOAT_VEC2, 1));
-+  vars.push_back(TVariableInfo(SH_FLOAT, 3));
-+  vars.push_back(TVariableInfo(SH_FLOAT, 2));
-+  vars.push_back(TVariableInfo(SH_FLOAT, 1));
-+  EXPECT_TRUE(packer.CheckVariablesWithinPackingLimits(kMaxRows, vars));
-+}
-+
deleted file mode 100644
--- a/gfx/angle/angle-abort-on-oom-in-preprocessor.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-# HG changeset patch
-# Parent 11023ab3d23865b71678e9a4b22a45646ec0c0f0
-diff --git a/gfx/angle/src/compiler/preprocessor/atom.c b/gfx/angle/src/compiler/preprocessor/atom.c
---- a/gfx/angle/src/compiler/preprocessor/atom.c
-+++ b/gfx/angle/src/compiler/preprocessor/atom.c
-@@ -327,22 +327,17 @@ static int GrowAtomTable(AtomTable *atab
-             newmap = realloc(atable->amap, sizeof(int)*size);
-             newrev = realloc(atable->arev, sizeof(int)*size);
-         } else {
-             newmap = malloc(sizeof(int)*size);
-             newrev = malloc(sizeof(int)*size);
-             atable->size = 0;
-         }
-         if (!newmap || !newrev) {
--            /* failed to grow -- error */
--            if (newmap)
--                atable->amap = newmap;
--            if (newrev)
--                atable->arev = newrev;
--            return -1;
-+            abort();
-         }
-         memset(&newmap[atable->size], 0, (size - atable->size) * sizeof(int));
-         memset(&newrev[atable->size], 0, (size - atable->size) * sizeof(int));
-         atable->amap = newmap;
-         atable->arev = newrev;
-         atable->size = size;
-     }
-     return 0;
new file mode 100644
--- /dev/null
+++ b/gfx/angle/angle-build-dedupe-debug-cpp-h.patch
@@ -0,0 +1,180 @@
+From: Jeff Gilbert <jgilbert@mozilla.com>
+
+diff --git a/gfx/angle/src/compiler/Diagnostics.cpp b/gfx/angle/src/compiler/Diagnostics.cpp
+--- a/gfx/angle/src/compiler/Diagnostics.cpp
++++ b/gfx/angle/src/compiler/Diagnostics.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 "compiler/Diagnostics.h"
+ 
+-#include "compiler/debug.h"
++#include "compiler/compiler_debug.h"
+ #include "compiler/InfoSink.h"
+ #include "compiler/preprocessor/SourceLocation.h"
+ 
+ TDiagnostics::TDiagnostics(TInfoSink& infoSink) :
+     mInfoSink(infoSink),
+     mNumErrors(0),
+     mNumWarnings(0)
+ {
+diff --git a/gfx/angle/src/compiler/DirectiveHandler.cpp b/gfx/angle/src/compiler/DirectiveHandler.cpp
+--- a/gfx/angle/src/compiler/DirectiveHandler.cpp
++++ b/gfx/angle/src/compiler/DirectiveHandler.cpp
+@@ -3,17 +3,17 @@
+ // Use of this source code is governed by a BSD-style license that can be
+ // found in the LICENSE file.
+ //
+ 
+ #include "compiler/DirectiveHandler.h"
+ 
+ #include <sstream>
+ 
+-#include "compiler/debug.h"
++#include "compiler/compiler_debug.h"
+ #include "compiler/Diagnostics.h"
+ 
+ static TBehavior getBehavior(const std::string& str)
+ {
+     static const std::string kRequire("require");
+     static const std::string kEnable("enable");
+     static const std::string kDisable("disable");
+     static const std::string kWarn("warn");
+diff --git a/gfx/angle/src/compiler/OutputGLSLBase.cpp b/gfx/angle/src/compiler/OutputGLSLBase.cpp
+--- a/gfx/angle/src/compiler/OutputGLSLBase.cpp
++++ b/gfx/angle/src/compiler/OutputGLSLBase.cpp
+@@ -1,16 +1,16 @@
+ //
+ // Copyright (c) 2002-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 "compiler/OutputGLSLBase.h"
+-#include "compiler/debug.h"
++#include "compiler/compiler_debug.h"
+ 
+ namespace
+ {
+ TString arrayBrackets(const TType& type)
+ {
+     ASSERT(type.isArray());
+     TInfoSinkBase out;
+     out << "[" << type.getArraySize() << "]";
+diff --git a/gfx/angle/src/compiler/OutputHLSL.cpp b/gfx/angle/src/compiler/OutputHLSL.cpp
+--- a/gfx/angle/src/compiler/OutputHLSL.cpp
++++ b/gfx/angle/src/compiler/OutputHLSL.cpp
+@@ -2,17 +2,17 @@
+ // Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved.
+ // Use of this source code is governed by a BSD-style license that can be
+ // found in the LICENSE file.
+ //
+ 
+ #include "compiler/OutputHLSL.h"
+ 
+ #include "common/angleutils.h"
+-#include "compiler/debug.h"
++#include "compiler/compiler_debug.h"
+ #include "compiler/InfoSink.h"
+ #include "compiler/UnfoldShortCircuit.h"
+ #include "compiler/SearchSymbol.h"
+ #include "compiler/DetectDiscontinuity.h"
+ 
+ #include <stdio.h>
+ #include <algorithm>
+ 
+diff --git a/gfx/angle/src/compiler/Types.h b/gfx/angle/src/compiler/Types.h
+--- a/gfx/angle/src/compiler/Types.h
++++ b/gfx/angle/src/compiler/Types.h
+@@ -4,17 +4,17 @@
+ // found in the LICENSE file.
+ //
+ 
+ #ifndef _TYPES_INCLUDED
+ #define _TYPES_INCLUDED
+ 
+ #include "compiler/BaseTypes.h"
+ #include "compiler/Common.h"
+-#include "compiler/debug.h"
++#include "compiler/compiler_debug.h"
+ 
+ class TType;
+ struct TPublicType;
+ 
+ //
+ // Need to have association of line numbers to types in a list for building structs.
+ //
+ struct TTypeLine {
+diff --git a/gfx/angle/src/compiler/debug.cpp b/gfx/angle/src/compiler/compiler_debug.cpp
+rename from gfx/angle/src/compiler/debug.cpp
+rename to gfx/angle/src/compiler/compiler_debug.cpp
+--- a/gfx/angle/src/compiler/debug.cpp
++++ b/gfx/angle/src/compiler/compiler_debug.cpp
+@@ -1,17 +1,17 @@
+ //
+ // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
+ // Use of this source code is governed by a BSD-style license that can be
+ // found in the LICENSE file.
+ //
+ 
+-// debug.cpp: Debugging utilities.
++// compiler_debug.cpp: Debugging utilities.
+ 
+-#include "compiler/debug.h"
++#include "compiler/compiler_debug.h"
+ 
+ #include <stdarg.h>
+ #include <stdio.h>
+ 
+ #include "compiler/InitializeParseContext.h"
+ #include "compiler/ParseHelper.h"
+ 
+ static const int kTraceBufferLen = 1024;
+diff --git a/gfx/angle/src/compiler/debug.h b/gfx/angle/src/compiler/compiler_debug.h
+rename from gfx/angle/src/compiler/debug.h
+rename to gfx/angle/src/compiler/compiler_debug.h
+--- a/gfx/angle/src/compiler/debug.h
++++ b/gfx/angle/src/compiler/compiler_debug.h
+@@ -1,15 +1,15 @@
+ //
+ // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
+ // Use of this source code is governed by a BSD-style license that can be
+ // found in the LICENSE file.
+ //
+ 
+-// debug.h: Debugging utilities.
++// compiler_debug.h: Debugging utilities.
+ 
+ #ifndef COMPILER_DEBUG_H_
+ #define COMPILER_DEBUG_H_
+ 
+ #include <assert.h>
+ 
+ #ifdef _DEBUG
+ #define TRACE_ENABLED  // define to enable debug message tracing
+diff --git a/gfx/angle/src/compiler/osinclude.h b/gfx/angle/src/compiler/osinclude.h
+--- a/gfx/angle/src/compiler/osinclude.h
++++ b/gfx/angle/src/compiler/osinclude.h
+@@ -30,17 +30,17 @@
+ #include <windows.h>
+ #elif defined(ANGLE_OS_POSIX)
+ #include <pthread.h>
+ #include <semaphore.h>
+ #include <errno.h>
+ #endif  // ANGLE_OS_WIN
+ 
+ 
+-#include "compiler/debug.h"
++#include "compiler/compiler_debug.h"
+ 
+ //
+ // Thread Local Storage Operations
+ //
+ #if defined(ANGLE_OS_WIN)
+ typedef DWORD OS_TLSIndex;
+ #define OS_INVALID_TLS_INDEX (TLS_OUT_OF_INDEXES)
+ #elif defined(ANGLE_OS_POSIX)
new file mode 100644
--- /dev/null
+++ b/gfx/angle/angle-build-dedupe-preproc-files.patch
@@ -0,0 +1,8 @@
+From: Jeff Gilbert <jgilbert@mozilla.com>
+
+diff --git a/gfx/angle/src/compiler/preprocessor/Diagnostics.cpp b/gfx/angle/src/compiler/preprocessor/PreprocessorDiagnostics.cpp
+rename from gfx/angle/src/compiler/preprocessor/Diagnostics.cpp
+rename to gfx/angle/src/compiler/preprocessor/PreprocessorDiagnostics.cpp
+diff --git a/gfx/angle/src/compiler/preprocessor/DirectiveHandler.cpp b/gfx/angle/src/compiler/preprocessor/PreprocessorDirectiveHandler.cpp
+rename from gfx/angle/src/compiler/preprocessor/DirectiveHandler.cpp
+rename to gfx/angle/src/compiler/preprocessor/PreprocessorDirectiveHandler.cpp
new file mode 100644
--- /dev/null
+++ b/gfx/angle/angle-build-stdcall-alias.patch
@@ -0,0 +1,19 @@
+From: Jeff Gilbert <jgilbert@mozilla.com>
+
+diff --git a/gfx/angle/src/libGLESv2/libGLESv2.def b/gfx/angle/src/libGLESv2/libGLESv2.def
+--- a/gfx/angle/src/libGLESv2/libGLESv2.def
++++ b/gfx/angle/src/libGLESv2/libGLESv2.def
+@@ -175,8 +175,13 @@ EXPORTS
+ 
+     ; EGL dependencies
+     glCreateContext                 @144 NONAME
+     glDestroyContext                @145 NONAME
+     glMakeCurrent                   @146 NONAME
+     glGetCurrentContext             @147 NONAME
+     glGetProcAddress                @148 NONAME
+     glBindTexImage                  @158 NONAME
++
++    ; GCC has problems with linking to undecorated stdcall functions,
++    ; so we explicitly add aliases for APIs used by EGL.
++    glGetProcAddress@4=glGetProcAddress
++    glBindTexImage@4=glBindTexImage
deleted file mode 100644
--- a/gfx/angle/angle-enforce-readpixels-spec.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-# HG changeset patch
-# Parent a1fed68f51737972901e0d6fc829d3e044a453bd
-diff --git a/gfx/angle/src/libGLESv2/libGLESv2.cpp b/gfx/angle/src/libGLESv2/libGLESv2.cpp
---- a/gfx/angle/src/libGLESv2/libGLESv2.cpp
-+++ b/gfx/angle/src/libGLESv2/libGLESv2.cpp
-@@ -231,27 +231,16 @@ bool validReadFormatType(GLenum format, 
-         switch (type)
-         {
-           case GL_UNSIGNED_BYTE:
-             break;
-           default:
-             return false;
-         }
-         break;
--      case GL_BGRA_EXT:
--        switch (type)
--        {
--          case GL_UNSIGNED_BYTE:
--          case GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT:
--          case GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT:
--            break;
--          default:
--            return false;
--        }
--        break;
-       case gl::IMPLEMENTATION_COLOR_READ_FORMAT:
-         switch (type)
-         {
-           case gl::IMPLEMENTATION_COLOR_READ_TYPE:
-             break;
-           default:
-             return false;
-         }
deleted file mode 100644
--- a/gfx/angle/angle-impl-read-bgra.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-# HG changeset patch
-# Parent 97ded57f965865c06306a8ef82d082064542caff
-diff --git a/gfx/angle/src/libGLESv2/Context.cpp b/gfx/angle/src/libGLESv2/Context.cpp
---- a/gfx/angle/src/libGLESv2/Context.cpp
-+++ b/gfx/angle/src/libGLESv2/Context.cpp
-@@ -2585,16 +2585,17 @@ void Context::readPixels(GLint x, GLint 
-     {
-         if (desc.Format == D3DFMT_A8R8G8B8 &&
-             format == GL_BGRA_EXT &&
-             type == GL_UNSIGNED_BYTE)
-         {
-             // Fast path for EXT_read_format_bgra, given
-             // an RGBA source buffer.  Note that buffers with no
-             // alpha go through the slow path below.
-+            // Note that this is also the combo exposed by IMPLEMENTATION_COLOR_READ_TYPE/FORMAT
-             memcpy(dest + j * outputPitch,
-                    source + j * inputPitch,
-                    (rect.right - rect.left) * 4);
-             continue;
-         }
- 
-         for (int i = 0; i < rect.right - rect.left; i++)
-         {
-@@ -2732,20 +2733,20 @@ void Context::readPixels(GLint x, GLint 
-                         ((unsigned short)(     a + 0.5f) << 15) |
-                         ((unsigned short)(31 * r + 0.5f) << 10) |
-                         ((unsigned short)(31 * g + 0.5f) << 5) |
-                         ((unsigned short)(31 * b + 0.5f) << 0);
-                     break;
-                   default: UNREACHABLE();
-                 }
-                 break;
--              case GL_RGB:   // IMPLEMENTATION_COLOR_READ_FORMAT
-+              case GL_RGB:
-                 switch (type)
-                 {
--                  case GL_UNSIGNED_SHORT_5_6_5:   // IMPLEMENTATION_COLOR_READ_TYPE
-+                  case GL_UNSIGNED_SHORT_5_6_5:
-                     dest16[i + j * outputPitch / sizeof(unsigned short)] = 
-                         ((unsigned short)(31 * b + 0.5f) << 0) |
-                         ((unsigned short)(63 * g + 0.5f) << 5) |
-                         ((unsigned short)(31 * r + 0.5f) << 11);
-                     break;
-                   default: UNREACHABLE();
-                 }
-                 break;
-diff --git a/gfx/angle/src/libGLESv2/Context.h b/gfx/angle/src/libGLESv2/Context.h
---- a/gfx/angle/src/libGLESv2/Context.h
-+++ b/gfx/angle/src/libGLESv2/Context.h
-@@ -69,18 +69,18 @@ enum
-     MAX_VARYING_VECTORS_SM3 = 10,
-     MAX_TEXTURE_IMAGE_UNITS = 16,
-     MAX_VERTEX_TEXTURE_IMAGE_UNITS_VTF = 4,   // For devices supporting vertex texture fetch
-     MAX_COMBINED_TEXTURE_IMAGE_UNITS_VTF = MAX_TEXTURE_IMAGE_UNITS + MAX_VERTEX_TEXTURE_IMAGE_UNITS_VTF,    
-     MAX_FRAGMENT_UNIFORM_VECTORS_SM2 = 32 - 3,    // Reserve space for dx_Coord, dx_Depth, and dx_DepthRange. dx_PointOrLines and dx_FrontCCW use separate bool registers.
-     MAX_FRAGMENT_UNIFORM_VECTORS_SM3 = 224 - 3,
-     MAX_DRAW_BUFFERS = 1,
- 
--    IMPLEMENTATION_COLOR_READ_FORMAT = GL_RGB,
--    IMPLEMENTATION_COLOR_READ_TYPE = GL_UNSIGNED_SHORT_5_6_5
-+    IMPLEMENTATION_COLOR_READ_FORMAT = GL_BGRA_EXT,
-+    IMPLEMENTATION_COLOR_READ_TYPE = GL_UNSIGNED_BYTE
- };
- 
- enum QueryType
- {
-     QUERY_ANY_SAMPLES_PASSED,
-     QUERY_ANY_SAMPLES_PASSED_CONSERVATIVE,
- 
-     QUERY_TYPE_COUNT
new file mode 100644
--- /dev/null
+++ b/gfx/angle/angle-long-ident-spooky-hash.patch
@@ -0,0 +1,743 @@
+# HG changeset patch
+# Parent 6a165b9e45205190517515abec94429715303081
+
+diff --git a/gfx/angle/Makefile.in b/gfx/angle/Makefile.in
+--- a/gfx/angle/Makefile.in
++++ b/gfx/angle/Makefile.in
+@@ -73,16 +73,17 @@ CPPSRCS += \
+   intermOut.cpp \
+   IntermTraverse.cpp \
+   MapLongVariableNames.cpp \
+   parseConst.cpp \
+   ParseHelper.cpp \
+   PoolAlloc.cpp \
+   QualifierAlive.cpp \
+   RemoveTree.cpp \
++  spooky.cpp \
+   SymbolTable.cpp \
+   util.cpp \
+   ValidateLimitations.cpp \
+   VariableInfo.cpp \
+   VariablePacker.cpp \
+   $(NULL)
+ 
+ VPATH += $(srcdir)/src/compiler/depgraph
+diff --git a/gfx/angle/src/compiler/MapLongVariableNames.cpp b/gfx/angle/src/compiler/MapLongVariableNames.cpp
+--- a/gfx/angle/src/compiler/MapLongVariableNames.cpp
++++ b/gfx/angle/src/compiler/MapLongVariableNames.cpp
+@@ -1,29 +1,36 @@
+ //
+ // Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved.
+ // Use of this source code is governed by a BSD-style license that can be
+ // found in the LICENSE file.
+ //
+ 
+ #include "compiler/MapLongVariableNames.h"
++#include "spooky.h"
+ 
+ namespace {
+ 
+ TString mapLongName(int id, const TString& name, bool isGlobal)
+ {
+     ASSERT(name.size() > MAX_SHORTENED_IDENTIFIER_SIZE);
+     TStringStream stream;
+-    stream << "webgl_";
+-    if (isGlobal)
+-        stream << "g";
+-    stream << id;
+-    if (name[0] != '_')
+-        stream << "_";
+-    stream << name.substr(0, MAX_SHORTENED_IDENTIFIER_SIZE - stream.str().size());
++    uint64 hash = SpookyHash::Hash64(name.data(), name.length(), 0);
++
++    // We want to avoid producing a string with a double underscore,
++    // which would be an illegal GLSL identifier. We can assume that the
++    // original identifier doesn't have a double underscore, otherwise
++    // it's illegal anyway.
++    stream << (name[0] == '_' ? "webgl" : "webgl_")
++           << name.substr(0, 9)
++           << (name[8] == '_' ? "" : "_")
++           << std::hex
++           << hash;
++    ASSERT(stream.str().length() <= MAX_SHORTENED_IDENTIFIER_SIZE);
++    ASSERT(stream.str().length() >= MAX_SHORTENED_IDENTIFIER_SIZE - 2);
+     return stream.str();
+ }
+ 
+ LongNameMap* gLongNameMapInstance = NULL;
+ 
+ }  // anonymous namespace
+ 
+ LongNameMap::LongNameMap()
+diff --git a/gfx/angle/src/compiler/spooky.cpp b/gfx/angle/src/compiler/spooky.cpp
+new file mode 100644
+--- /dev/null
++++ b/gfx/angle/src/compiler/spooky.cpp
+@@ -0,0 +1,348 @@
++// Spooky Hash
++// A 128-bit noncryptographic hash, for checksums and table lookup
++// By Bob Jenkins.  Public domain.
++//   Oct 31 2010: published framework, disclaimer ShortHash isn't right
++//   Nov 7 2010: disabled ShortHash
++//   Oct 31 2011: replace End, ShortMix, ShortEnd, enable ShortHash again
++
++#include <memory.h>
++#include <string.h>
++#include "spooky.h"
++
++#define ALLOW_UNALIGNED_READS 1
++
++//
++// short hash ... it could be used on any message, 
++// but it's used by Spooky just for short messages.
++//
++void SpookyHash::Short(
++    const void *message,
++    size_t length,
++    uint64 *hash1,
++    uint64 *hash2)
++{
++    uint64 buf[sc_numVars];
++    union 
++    { 
++        const uint8 *p8; 
++        uint32 *p32;
++        uint64 *p64; 
++        size_t i; 
++    } u;
++
++    u.p8 = (const uint8 *)message;
++    
++    if (!ALLOW_UNALIGNED_READS && (u.i & 0x7))
++    {
++        memcpy(buf, message, length);
++        u.p64 = buf;
++    }
++
++    size_t remainder = length%32;
++    uint64 a=*hash1;
++    uint64 b=*hash2;
++    uint64 c=sc_const;
++    uint64 d=sc_const;
++
++    if (length > 15)
++    {
++        const uint64 *end = u.p64 + (length/32)*4;
++        
++        // handle all complete sets of 32 bytes
++        for (; u.p64 < end; u.p64 += 4)
++        {
++            c += u.p64[0];
++            d += u.p64[1];
++            ShortMix(a,b,c,d);
++            a += u.p64[2];
++            b += u.p64[3];
++        }
++        
++        //Handle the case of 16+ remaining bytes.
++        if (remainder >= 16)
++        {
++            c += u.p64[0];
++            d += u.p64[1];
++            ShortMix(a,b,c,d);
++            u.p64 += 2;
++            remainder -= 16;
++        }
++    }
++    
++    // Handle the last 0..15 bytes, and its length
++    d = ((uint64)length) << 56;
++    switch (remainder)
++    {
++    case 15:
++    d += ((uint64)u.p8[14]) << 48;
++    case 14:
++        d += ((uint64)u.p8[13]) << 40;
++    case 13:
++        d += ((uint64)u.p8[12]) << 32;
++    case 12:
++        d += u.p32[2];
++        c += u.p64[0];
++        break;
++    case 11:
++        d += ((uint64)u.p8[10]) << 16;
++    case 10:
++        d += ((uint64)u.p8[9]) << 8;
++    case 9:
++        d += (uint64)u.p8[8];
++    case 8:
++        c += u.p64[0];
++        break;
++    case 7:
++        c += ((uint64)u.p8[6]) << 48;
++    case 6:
++        c += ((uint64)u.p8[5]) << 40;
++    case 5:
++        c += ((uint64)u.p8[4]) << 32;
++    case 4:
++        c += u.p32[0];
++        break;
++    case 3:
++        c += ((uint64)u.p8[2]) << 16;
++    case 2:
++        c += ((uint64)u.p8[1]) << 8;
++    case 1:
++        c += (uint64)u.p8[0];
++        break;
++    case 0:
++        c += sc_const;
++        d += sc_const;
++    }
++    ShortEnd(a,b,c,d);
++    *hash1 = a;
++    *hash2 = b;
++}
++
++
++
++
++// do the whole hash in one call
++void SpookyHash::Hash128(
++    const void *message, 
++    size_t length, 
++    uint64 *hash1, 
++    uint64 *hash2)
++{
++    if (length < sc_bufSize)
++    {
++        Short(message, length, hash1, hash2);
++        return;
++    }
++
++    uint64 h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11;
++    uint64 buf[sc_numVars];
++    uint64 *end;
++    union 
++    { 
++        const uint8 *p8; 
++        uint64 *p64; 
++        size_t i; 
++    } u;
++    size_t remainder;
++    
++    h0=h3=h6=h9  = *hash1;
++    h1=h4=h7=h10 = *hash2;
++    h2=h5=h8=h11 = sc_const;
++    
++    u.p8 = (const uint8 *)message;
++    end = u.p64 + (length/sc_blockSize)*sc_numVars;
++
++    // handle all whole sc_blockSize blocks of bytes
++    if (ALLOW_UNALIGNED_READS || ((u.i & 0x7) == 0))
++    {
++        while (u.p64 < end)
++        { 
++            Mix(u.p64, h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
++	    u.p64 += sc_numVars;
++        }
++    }
++    else
++    {
++        while (u.p64 < end)
++        {
++            memcpy(buf, u.p64, sc_blockSize);
++            Mix(buf, h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
++	    u.p64 += sc_numVars;
++        }
++    }
++
++    // handle the last partial block of sc_blockSize bytes
++    remainder = (length - ((const uint8 *)end-(const uint8 *)message));
++    memcpy(buf, end, remainder);
++    memset(((uint8 *)buf)+remainder, 0, sc_blockSize-remainder);
++    ((uint8 *)buf)[sc_blockSize-1] = remainder;
++    Mix(buf, h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
++    
++    // do some final mixing 
++    End(h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
++    *hash1 = h0;
++    *hash2 = h1;
++}
++
++
++
++// init spooky state
++void SpookyHash::Init(uint64 seed1, uint64 seed2)
++{
++    m_length = 0;
++    m_remainder = 0;
++    m_state[0] = seed1;
++    m_state[1] = seed2;
++}
++
++
++// add a message fragment to the state
++void SpookyHash::Update(const void *message, size_t length)
++{
++    uint64 h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11;
++    size_t newLength = length + m_remainder;
++    uint8  remainder;
++    union 
++    { 
++        const uint8 *p8; 
++        uint64 *p64; 
++        size_t i; 
++    } u;
++    const uint64 *end;
++    
++    // Is this message fragment too short?  If it is, stuff it away.
++    if (newLength < sc_bufSize)
++    {
++        memcpy(&((uint8 *)m_data)[m_remainder], message, length);
++        m_length = length + m_length;
++        m_remainder = (uint8)newLength;
++        return;
++    }
++    
++    // init the variables
++    if (m_length < sc_bufSize)
++    {
++        h0=h3=h6=h9  = m_state[0];
++        h1=h4=h7=h10 = m_state[1];
++        h2=h5=h8=h11 = sc_const;
++    }
++    else
++    {
++        h0 = m_state[0];
++        h1 = m_state[1];
++        h2 = m_state[2];
++        h3 = m_state[3];
++        h4 = m_state[4];
++        h5 = m_state[5];
++        h6 = m_state[6];
++        h7 = m_state[7];
++        h8 = m_state[8];
++        h9 = m_state[9];
++        h10 = m_state[10];
++        h11 = m_state[11];
++    }
++    m_length = length + m_length;
++    
++    // if we've got anything stuffed away, use it now
++    if (m_remainder)
++    {
++        uint8 prefix = sc_bufSize-m_remainder;
++        memcpy(&(((uint8 *)m_data)[m_remainder]), message, prefix);
++        u.p64 = m_data;
++        Mix(u.p64, h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
++        Mix(&u.p64[sc_numVars], h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
++        u.p8 = ((const uint8 *)message) + prefix;
++        length -= prefix;
++    }
++    else
++    {
++        u.p8 = (const uint8 *)message;
++    }
++    
++    // handle all whole blocks of sc_blockSize bytes
++    end = u.p64 + (length/sc_blockSize)*sc_numVars;
++    remainder = (uint8)(length-((const uint8 *)end-u.p8));
++    if (ALLOW_UNALIGNED_READS || (u.i & 0x7) == 0)
++    {
++        while (u.p64 < end)
++        { 
++            Mix(u.p64, h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
++	    u.p64 += sc_numVars;
++        }
++    }
++    else
++    {
++        while (u.p64 < end)
++        { 
++            memcpy(m_data, u.p8, sc_blockSize);
++            Mix(m_data, h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
++	    u.p64 += sc_numVars;
++        }
++    }
++
++    // stuff away the last few bytes
++    m_remainder = remainder;
++    memcpy(m_data, end, remainder);
++    
++    // stuff away the variables
++    m_state[0] = h0;
++    m_state[1] = h1;
++    m_state[2] = h2;
++    m_state[3] = h3;
++    m_state[4] = h4;
++    m_state[5] = h5;
++    m_state[6] = h6;
++    m_state[7] = h7;
++    m_state[8] = h8;
++    m_state[9] = h9;
++    m_state[10] = h10;
++    m_state[11] = h11;
++}
++
++
++// report the hash for the concatenation of all message fragments so far
++void SpookyHash::Final(uint64 *hash1, uint64 *hash2)
++{
++    // init the variables
++    if (m_length < sc_bufSize)
++    {
++        Short( m_data, m_length, hash1, hash2);
++        return;
++    }
++    
++    const uint64 *data = (const uint64 *)m_data;
++    uint8 remainder = m_remainder;
++    
++    uint64 h0 = m_state[0];
++    uint64 h1 = m_state[1];
++    uint64 h2 = m_state[2];
++    uint64 h3 = m_state[3];
++    uint64 h4 = m_state[4];
++    uint64 h5 = m_state[5];
++    uint64 h6 = m_state[6];
++    uint64 h7 = m_state[7];
++    uint64 h8 = m_state[8];
++    uint64 h9 = m_state[9];
++    uint64 h10 = m_state[10];
++    uint64 h11 = m_state[11];
++
++    if (remainder >= sc_blockSize)
++    {
++        // m_data can contain two blocks; handle any whole first block
++        Mix(data, h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
++	data += sc_numVars;
++	remainder -= sc_blockSize;
++    }
++
++    // mix in the last partial block, and the length mod sc_blockSize
++    memset(&((uint8 *)data)[remainder], 0, (sc_blockSize-remainder));
++
++    ((uint8 *)data)[sc_blockSize-1] = remainder;
++    Mix(data, h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
++    
++    // do some final mixing
++    End(h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
++
++    *hash1 = h0;
++    *hash2 = h1;
++}
++
+diff --git a/gfx/angle/src/compiler/spooky.h b/gfx/angle/src/compiler/spooky.h
+new file mode 100644
+--- /dev/null
++++ b/gfx/angle/src/compiler/spooky.h
+@@ -0,0 +1,293 @@
++//
++// SpookyHash: a 128-bit noncryptographic hash function
++// By Bob Jenkins, public domain
++//   Oct 31 2010: alpha, framework + SpookyHash::Mix appears right
++//   Oct 31 2011: alpha again, Mix only good to 2^^69 but rest appears right
++//   Dec 31 2011: beta, improved Mix, tested it for 2-bit deltas
++//   Feb  2 2012: production, same bits as beta
++//   Feb  5 2012: adjusted definitions of uint* to be more portable
++// 
++// Up to 4 bytes/cycle for long messages.  Reasonably fast for short messages.
++// All 1 or 2 bit deltas achieve avalanche within 1% bias per output bit.
++//
++// This was developed for and tested on 64-bit x86-compatible processors.
++// It assumes the processor is little-endian.  There is a macro
++// controlling whether unaligned reads are allowed (by default they are).
++// This should be an equally good hash on big-endian machines, but it will
++// compute different results on them than on little-endian machines.
++//
++// Google's CityHash has similar specs to SpookyHash, and CityHash is faster
++// on some platforms.  MD4 and MD5 also have similar specs, but they are orders
++// of magnitude slower.  CRCs are two or more times slower, but unlike 
++// SpookyHash, they have nice math for combining the CRCs of pieces to form 
++// the CRCs of wholes.  There are also cryptographic hashes, but those are even 
++// slower than MD5.
++//
++
++#include <stddef.h>
++
++#ifdef _MSC_VER
++# define INLINE __forceinline
++  typedef  unsigned __int64 uint64;
++  typedef  unsigned __int32 uint32;
++  typedef  unsigned __int16 uint16;
++  typedef  unsigned __int8  uint8;
++#else
++# include <stdint.h>
++# define INLINE inline
++  typedef  uint64_t  uint64;
++  typedef  uint32_t  uint32;
++  typedef  uint16_t  uint16;
++  typedef  uint8_t   uint8;
++#endif
++
++
++class SpookyHash
++{
++public:
++    //
++    // SpookyHash: hash a single message in one call, produce 128-bit output
++    //
++    static void Hash128(
++        const void *message,  // message to hash
++        size_t length,        // length of message in bytes
++        uint64 *hash1,        // in/out: in seed 1, out hash value 1
++        uint64 *hash2);       // in/out: in seed 2, out hash value 2
++
++    //
++    // Hash64: hash a single message in one call, return 64-bit output
++    //
++    static uint64 Hash64(
++        const void *message,  // message to hash
++        size_t length,        // length of message in bytes
++        uint64 seed)          // seed
++    {
++        uint64 hash1 = seed;
++        Hash128(message, length, &hash1, &seed);
++        return hash1;
++    }
++
++    //
++    // Hash32: hash a single message in one call, produce 32-bit output
++    //
++    static uint32 Hash32(
++        const void *message,  // message to hash
++        size_t length,        // length of message in bytes
++        uint32 seed)          // seed
++    {
++        uint64 hash1 = seed, hash2 = seed;
++        Hash128(message, length, &hash1, &hash2);
++        return (uint32)hash1;
++    }
++
++    //
++    // Init: initialize the context of a SpookyHash
++    //
++    void Init(
++        uint64 seed1,       // any 64-bit value will do, including 0
++        uint64 seed2);      // different seeds produce independent hashes
++    
++    //
++    // Update: add a piece of a message to a SpookyHash state
++    //
++    void Update(
++        const void *message,  // message fragment
++        size_t length);       // length of message fragment in bytes
++
++
++    //
++    // Final: compute the hash for the current SpookyHash state
++    //
++    // This does not modify the state; you can keep updating it afterward
++    //
++    // The result is the same as if SpookyHash() had been called with
++    // all the pieces concatenated into one message.
++    //
++    void Final(
++        uint64 *hash1,    // out only: first 64 bits of hash value.
++        uint64 *hash2);   // out only: second 64 bits of hash value.
++
++    //
++    // left rotate a 64-bit value by k bytes
++    //
++    static INLINE uint64 Rot64(uint64 x, int k)
++    {
++        return (x << k) | (x >> (64 - k));
++    }
++
++    //
++    // This is used if the input is 96 bytes long or longer.
++    //
++    // The internal state is fully overwritten every 96 bytes.
++    // Every input bit appears to cause at least 128 bits of entropy
++    // before 96 other bytes are combined, when run forward or backward
++    //   For every input bit,
++    //   Two inputs differing in just that input bit
++    //   Where "differ" means xor or subtraction
++    //   And the base value is random
++    //   When run forward or backwards one Mix
++    // I tried 3 pairs of each; they all differed by at least 212 bits.
++    //
++    static INLINE void Mix(
++        const uint64 *data, 
++        uint64 &s0, uint64 &s1, uint64 &s2, uint64 &s3,
++        uint64 &s4, uint64 &s5, uint64 &s6, uint64 &s7,
++        uint64 &s8, uint64 &s9, uint64 &s10,uint64 &s11)
++    {
++      s0 += data[0];    s2 ^= s10;    s11 ^= s0;    s0 = Rot64(s0,11);    s11 += s1;
++      s1 += data[1];    s3 ^= s11;    s0 ^= s1;    s1 = Rot64(s1,32);    s0 += s2;
++      s2 += data[2];    s4 ^= s0;    s1 ^= s2;    s2 = Rot64(s2,43);    s1 += s3;
++      s3 += data[3];    s5 ^= s1;    s2 ^= s3;    s3 = Rot64(s3,31);    s2 += s4;
++      s4 += data[4];    s6 ^= s2;    s3 ^= s4;    s4 = Rot64(s4,17);    s3 += s5;
++      s5 += data[5];    s7 ^= s3;    s4 ^= s5;    s5 = Rot64(s5,28);    s4 += s6;
++      s6 += data[6];    s8 ^= s4;    s5 ^= s6;    s6 = Rot64(s6,39);    s5 += s7;
++      s7 += data[7];    s9 ^= s5;    s6 ^= s7;    s7 = Rot64(s7,57);    s6 += s8;
++      s8 += data[8];    s10 ^= s6;    s7 ^= s8;    s8 = Rot64(s8,55);    s7 += s9;
++      s9 += data[9];    s11 ^= s7;    s8 ^= s9;    s9 = Rot64(s9,54);    s8 += s10;
++      s10 += data[10];    s0 ^= s8;    s9 ^= s10;    s10 = Rot64(s10,22);    s9 += s11;
++      s11 += data[11];    s1 ^= s9;    s10 ^= s11;    s11 = Rot64(s11,46);    s10 += s0;
++    }
++
++    //
++    // Mix all 12 inputs together so that h0, h1 are a hash of them all.
++    //
++    // For two inputs differing in just the input bits
++    // Where "differ" means xor or subtraction
++    // And the base value is random, or a counting value starting at that bit
++    // The final result will have each bit of h0, h1 flip
++    // For every input bit,
++    // with probability 50 +- .3%
++    // For every pair of input bits,
++    // with probability 50 +- 3%
++    //
++    // This does not rely on the last Mix() call having already mixed some.
++    // Two iterations was almost good enough for a 64-bit result, but a
++    // 128-bit result is reported, so End() does three iterations.
++    //
++    static INLINE void EndPartial(
++        uint64 &h0, uint64 &h1, uint64 &h2, uint64 &h3,
++        uint64 &h4, uint64 &h5, uint64 &h6, uint64 &h7, 
++        uint64 &h8, uint64 &h9, uint64 &h10,uint64 &h11)
++    {
++        h11+= h1;    h2 ^= h11;   h1 = Rot64(h1,44);
++	h0 += h2;    h3 ^= h0;    h2 = Rot64(h2,15);
++	h1 += h3;    h4 ^= h1;    h3 = Rot64(h3,34);
++	h2 += h4;    h5 ^= h2;    h4 = Rot64(h4,21);
++	h3 += h5;    h6 ^= h3;    h5 = Rot64(h5,38);
++	h4 += h6;    h7 ^= h4;    h6 = Rot64(h6,33);
++	h5 += h7;    h8 ^= h5;    h7 = Rot64(h7,10);
++	h6 += h8;    h9 ^= h6;    h8 = Rot64(h8,13);
++	h7 += h9;    h10^= h7;    h9 = Rot64(h9,38);
++	h8 += h10;   h11^= h8;    h10= Rot64(h10,53);
++	h9 += h11;   h0 ^= h9;    h11= Rot64(h11,42);
++	h10+= h0;    h1 ^= h10;   h0 = Rot64(h0,54);
++    }
++
++    static INLINE void End(
++        uint64 &h0, uint64 &h1, uint64 &h2, uint64 &h3,
++        uint64 &h4, uint64 &h5, uint64 &h6, uint64 &h7, 
++        uint64 &h8, uint64 &h9, uint64 &h10,uint64 &h11)
++    {
++        EndPartial(h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
++        EndPartial(h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
++        EndPartial(h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
++    }
++
++    //
++    // The goal is for each bit of the input to expand into 128 bits of 
++    //   apparent entropy before it is fully overwritten.
++    // n trials both set and cleared at least m bits of h0 h1 h2 h3
++    //   n: 2   m: 29
++    //   n: 3   m: 46
++    //   n: 4   m: 57
++    //   n: 5   m: 107
++    //   n: 6   m: 146
++    //   n: 7   m: 152
++    // when run forwards or backwards
++    // for all 1-bit and 2-bit diffs
++    // with diffs defined by either xor or subtraction
++    // with a base of all zeros plus a counter, or plus another bit, or random
++    //
++    static INLINE void ShortMix(uint64 &h0, uint64 &h1, uint64 &h2, uint64 &h3)
++    {
++        h2 = Rot64(h2,50);  h2 += h3;  h0 ^= h2;
++        h3 = Rot64(h3,52);  h3 += h0;  h1 ^= h3;
++        h0 = Rot64(h0,30);  h0 += h1;  h2 ^= h0;
++        h1 = Rot64(h1,41);  h1 += h2;  h3 ^= h1;
++        h2 = Rot64(h2,54);  h2 += h3;  h0 ^= h2;
++        h3 = Rot64(h3,48);  h3 += h0;  h1 ^= h3;
++        h0 = Rot64(h0,38);  h0 += h1;  h2 ^= h0;
++        h1 = Rot64(h1,37);  h1 += h2;  h3 ^= h1;
++        h2 = Rot64(h2,62);  h2 += h3;  h0 ^= h2;
++        h3 = Rot64(h3,34);  h3 += h0;  h1 ^= h3;
++        h0 = Rot64(h0,5);   h0 += h1;  h2 ^= h0;
++        h1 = Rot64(h1,36);  h1 += h2;  h3 ^= h1;
++    }
++
++    //
++    // Mix all 4 inputs together so that h0, h1 are a hash of them all.
++    //
++    // For two inputs differing in just the input bits
++    // Where "differ" means xor or subtraction
++    // And the base value is random, or a counting value starting at that bit
++    // The final result will have each bit of h0, h1 flip
++    // For every input bit,
++    // with probability 50 +- .3% (it is probably better than that)
++    // For every pair of input bits,
++    // with probability 50 +- .75% (the worst case is approximately that)
++    //
++    static INLINE void ShortEnd(uint64 &h0, uint64 &h1, uint64 &h2, uint64 &h3)
++    {
++        h3 ^= h2;  h2 = Rot64(h2,15);  h3 += h2;
++        h0 ^= h3;  h3 = Rot64(h3,52);  h0 += h3;
++        h1 ^= h0;  h0 = Rot64(h0,26);  h1 += h0;
++        h2 ^= h1;  h1 = Rot64(h1,51);  h2 += h1;
++        h3 ^= h2;  h2 = Rot64(h2,28);  h3 += h2;
++        h0 ^= h3;  h3 = Rot64(h3,9);   h0 += h3;
++        h1 ^= h0;  h0 = Rot64(h0,47);  h1 += h0;
++        h2 ^= h1;  h1 = Rot64(h1,54);  h2 += h1;
++        h3 ^= h2;  h2 = Rot64(h2,32);  h3 += h2;
++        h0 ^= h3;  h3 = Rot64(h3,25);  h0 += h3;
++        h1 ^= h0;  h0 = Rot64(h0,63);  h1 += h0;
++    }
++    
++private:
++
++    //
++    // Short is used for messages under 192 bytes in length
++    // Short has a low startup cost, the normal mode is good for long
++    // keys, the cost crossover is at about 192 bytes.  The two modes were
++    // held to the same quality bar.
++    // 
++    static void Short(
++        const void *message,
++        size_t length,
++        uint64 *hash1,
++        uint64 *hash2);
++
++    // number of uint64's in internal state
++    static const size_t sc_numVars = 12;
++
++    // size of the internal state
++    static const size_t sc_blockSize = sc_numVars*8;
++
++    // size of buffer of unhashed data, in bytes
++    static const size_t sc_bufSize = 2*sc_blockSize;
++
++    //
++    // sc_const: a constant which:
++    //  * is not zero
++    //  * is odd
++    //  * is a not-very-regular mix of 1's and 0's
++    //  * does not need any other special mathematical properties
++    //
++    static const uint64 sc_const = 0xdeadbeefdeadbeefLL;
++
++    uint64 m_data[2*sc_numVars];   // unhashed data, for partial messages
++    uint64 m_state[sc_numVars];  // internal state of the hash
++    size_t m_length;             // total length of the input so far
++    uint8  m_remainder;          // length of unhashed data stashed in m_data
++};
++
++
++
+diff --git a/gfx/angle/src/libGLESv2/Makefile.in b/gfx/angle/src/libGLESv2/Makefile.in
+--- a/gfx/angle/src/libGLESv2/Makefile.in
++++ b/gfx/angle/src/libGLESv2/Makefile.in
+@@ -86,16 +86,17 @@ CPPSRCS += \
+   intermOut.cpp \
+   IntermTraverse.cpp \
+   MapLongVariableNames.cpp \
+   parseConst.cpp \
+   ParseHelper.cpp \
+   PoolAlloc.cpp \
+   QualifierAlive.cpp \
+   RemoveTree.cpp \
++  spooky.cpp \
+   SymbolTable.cpp \
+   util.cpp \
+   ValidateLimitations.cpp \
+   VariableInfo.cpp \
+   VariablePacker.cpp \
+   $(NULL)
+ 
+ VPATH += $(srcdir)/../compiler/depgraph
deleted file mode 100644
--- a/gfx/angle/angle-long-identifier-hash-spooky.patch
+++ /dev/null
@@ -1,701 +0,0 @@
-# HG changeset patch
-# Parent c5e7517cbb1c38ce9821ba3deca88768b4dff066
-
-diff --git a/gfx/angle/src/compiler/MapLongVariableNames.cpp b/gfx/angle/src/compiler/MapLongVariableNames.cpp
---- a/gfx/angle/src/compiler/MapLongVariableNames.cpp
-+++ b/gfx/angle/src/compiler/MapLongVariableNames.cpp
-@@ -1,29 +1,36 @@
- //
- // Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved.
- // Use of this source code is governed by a BSD-style license that can be
- // found in the LICENSE file.
- //
- 
- #include "compiler/MapLongVariableNames.h"
-+#include "spooky.h"
- 
- namespace {
- 
- TString mapLongName(int id, const TString& name, bool isGlobal)
- {
-     ASSERT(name.size() > MAX_SHORTENED_IDENTIFIER_SIZE);
-     TStringStream stream;
--    stream << "webgl_";
--    if (isGlobal)
--        stream << "g";
--    stream << id;
--    if (name[0] != '_')
--        stream << "_";
--    stream << name.substr(0, MAX_SHORTENED_IDENTIFIER_SIZE - stream.str().size());
-+    uint64 hash = SpookyHash::Hash64(name.data(), name.length(), 0);
-+
-+    // We want to avoid producing a string with a double underscore,
-+    // which would be an illegal GLSL identifier. We can assume that the
-+    // original identifier doesn't have a double underscore, otherwise
-+    // it's illegal anyway.
-+    stream << (name[0] == '_' ? "webgl" : "webgl_")
-+           << name.substr(0, 9)
-+           << (name[8] == '_' ? "" : "_")
-+           << std::hex
-+           << hash;
-+    ASSERT(stream.str().length() <= MAX_SHORTENED_IDENTIFIER_SIZE);
-+    ASSERT(stream.str().length() >= MAX_SHORTENED_IDENTIFIER_SIZE - 2);
-     return stream.str();
- }
- 
- LongNameMap* gLongNameMapInstance = NULL;
- 
- }  // anonymous namespace
- 
- LongNameMap::LongNameMap()
-diff --git a/gfx/angle/src/compiler/spooky.cpp b/gfx/angle/src/compiler/spooky.cpp
-new file mode 100644
---- /dev/null
-+++ b/gfx/angle/src/compiler/spooky.cpp
-@@ -0,0 +1,348 @@
-+// Spooky Hash
-+// A 128-bit noncryptographic hash, for checksums and table lookup
-+// By Bob Jenkins.  Public domain.
-+//   Oct 31 2010: published framework, disclaimer ShortHash isn't right
-+//   Nov 7 2010: disabled ShortHash
-+//   Oct 31 2011: replace End, ShortMix, ShortEnd, enable ShortHash again
-+
-+#include <memory.h>
-+#include <string.h>
-+#include "spooky.h"
-+
-+#define ALLOW_UNALIGNED_READS 1
-+
-+//
-+// short hash ... it could be used on any message, 
-+// but it's used by Spooky just for short messages.
-+//
-+void SpookyHash::Short(
-+    const void *message,
-+    size_t length,
-+    uint64 *hash1,
-+    uint64 *hash2)
-+{
-+    uint64 buf[sc_numVars];
-+    union 
-+    { 
-+        const uint8 *p8; 
-+        uint32 *p32;
-+        uint64 *p64; 
-+        size_t i; 
-+    } u;
-+
-+    u.p8 = (const uint8 *)message;
-+    
-+    if (!ALLOW_UNALIGNED_READS && (u.i & 0x7))
-+    {
-+        memcpy(buf, message, length);
-+        u.p64 = buf;
-+    }
-+
-+    size_t remainder = length%32;
-+    uint64 a=*hash1;
-+    uint64 b=*hash2;
-+    uint64 c=sc_const;
-+    uint64 d=sc_const;
-+
-+    if (length > 15)
-+    {
-+        const uint64 *end = u.p64 + (length/32)*4;
-+        
-+        // handle all complete sets of 32 bytes
-+        for (; u.p64 < end; u.p64 += 4)
-+        {
-+            c += u.p64[0];
-+            d += u.p64[1];
-+            ShortMix(a,b,c,d);
-+            a += u.p64[2];
-+            b += u.p64[3];
-+        }
-+        
-+        //Handle the case of 16+ remaining bytes.
-+        if (remainder >= 16)
-+        {
-+            c += u.p64[0];
-+            d += u.p64[1];
-+            ShortMix(a,b,c,d);
-+            u.p64 += 2;
-+            remainder -= 16;
-+        }
-+    }
-+    
-+    // Handle the last 0..15 bytes, and its length
-+    d = ((uint64)length) << 56;
-+    switch (remainder)
-+    {
-+    case 15:
-+    d += ((uint64)u.p8[14]) << 48;
-+    case 14:
-+        d += ((uint64)u.p8[13]) << 40;
-+    case 13:
-+        d += ((uint64)u.p8[12]) << 32;
-+    case 12:
-+        d += u.p32[2];
-+        c += u.p64[0];
-+        break;
-+    case 11:
-+        d += ((uint64)u.p8[10]) << 16;
-+    case 10:
-+        d += ((uint64)u.p8[9]) << 8;
-+    case 9:
-+        d += (uint64)u.p8[8];
-+    case 8:
-+        c += u.p64[0];
-+        break;
-+    case 7:
-+        c += ((uint64)u.p8[6]) << 48;
-+    case 6:
-+        c += ((uint64)u.p8[5]) << 40;
-+    case 5:
-+        c += ((uint64)u.p8[4]) << 32;
-+    case 4:
-+        c += u.p32[0];
-+        break;
-+    case 3:
-+        c += ((uint64)u.p8[2]) << 16;
-+    case 2:
-+        c += ((uint64)u.p8[1]) << 8;
-+    case 1:
-+        c += (uint64)u.p8[0];
-+        break;
-+    case 0:
-+        c += sc_const;
-+        d += sc_const;
-+    }
-+    ShortEnd(a,b,c,d);
-+    *hash1 = a;
-+    *hash2 = b;
-+}
-+
-+
-+
-+
-+// do the whole hash in one call
-+void SpookyHash::Hash128(
-+    const void *message, 
-+    size_t length, 
-+    uint64 *hash1, 
-+    uint64 *hash2)
-+{
-+    if (length < sc_bufSize)
-+    {
-+        Short(message, length, hash1, hash2);
-+        return;
-+    }
-+
-+    uint64 h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11;
-+    uint64 buf[sc_numVars];
-+    uint64 *end;
-+    union 
-+    { 
-+        const uint8 *p8; 
-+        uint64 *p64; 
-+        size_t i; 
-+    } u;
-+    size_t remainder;
-+    
-+    h0=h3=h6=h9  = *hash1;
-+    h1=h4=h7=h10 = *hash2;
-+    h2=h5=h8=h11 = sc_const;
-+    
-+    u.p8 = (const uint8 *)message;
-+    end = u.p64 + (length/sc_blockSize)*sc_numVars;
-+
-+    // handle all whole sc_blockSize blocks of bytes
-+    if (ALLOW_UNALIGNED_READS || ((u.i & 0x7) == 0))
-+    {
-+        while (u.p64 < end)
-+        { 
-+            Mix(u.p64, h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
-+	    u.p64 += sc_numVars;
-+        }
-+    }
-+    else
-+    {
-+        while (u.p64 < end)
-+        {
-+            memcpy(buf, u.p64, sc_blockSize);
-+            Mix(buf, h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
-+	    u.p64 += sc_numVars;
-+        }
-+    }
-+
-+    // handle the last partial block of sc_blockSize bytes
-+    remainder = (length - ((const uint8 *)end-(const uint8 *)message));
-+    memcpy(buf, end, remainder);
-+    memset(((uint8 *)buf)+remainder, 0, sc_blockSize-remainder);
-+    ((uint8 *)buf)[sc_blockSize-1] = remainder;
-+    Mix(buf, h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
-+    
-+    // do some final mixing 
-+    End(h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
-+    *hash1 = h0;
-+    *hash2 = h1;
-+}
-+
-+
-+
-+// init spooky state
-+void SpookyHash::Init(uint64 seed1, uint64 seed2)
-+{
-+    m_length = 0;
-+    m_remainder = 0;
-+    m_state[0] = seed1;
-+    m_state[1] = seed2;
-+}
-+
-+
-+// add a message fragment to the state
-+void SpookyHash::Update(const void *message, size_t length)
-+{
-+    uint64 h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11;
-+    size_t newLength = length + m_remainder;
-+    uint8  remainder;
-+    union 
-+    { 
-+        const uint8 *p8; 
-+        uint64 *p64; 
-+        size_t i; 
-+    } u;
-+    const uint64 *end;
-+    
-+    // Is this message fragment too short?  If it is, stuff it away.
-+    if (newLength < sc_bufSize)
-+    {
-+        memcpy(&((uint8 *)m_data)[m_remainder], message, length);
-+        m_length = length + m_length;
-+        m_remainder = (uint8)newLength;
-+        return;
-+    }
-+    
-+    // init the variables
-+    if (m_length < sc_bufSize)
-+    {
-+        h0=h3=h6=h9  = m_state[0];
-+        h1=h4=h7=h10 = m_state[1];
-+        h2=h5=h8=h11 = sc_const;
-+    }
-+    else
-+    {
-+        h0 = m_state[0];
-+        h1 = m_state[1];
-+        h2 = m_state[2];
-+        h3 = m_state[3];
-+        h4 = m_state[4];
-+        h5 = m_state[5];
-+        h6 = m_state[6];
-+        h7 = m_state[7];
-+        h8 = m_state[8];
-+        h9 = m_state[9];
-+        h10 = m_state[10];
-+        h11 = m_state[11];
-+    }
-+    m_length = length + m_length;
-+    
-+    // if we've got anything stuffed away, use it now
-+    if (m_remainder)
-+    {
-+        uint8 prefix = sc_bufSize-m_remainder;
-+        memcpy(&(((uint8 *)m_data)[m_remainder]), message, prefix);
-+        u.p64 = m_data;
-+        Mix(u.p64, h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
-+        Mix(&u.p64[sc_numVars], h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
-+        u.p8 = ((const uint8 *)message) + prefix;
-+        length -= prefix;
-+    }
-+    else
-+    {
-+        u.p8 = (const uint8 *)message;
-+    }
-+    
-+    // handle all whole blocks of sc_blockSize bytes
-+    end = u.p64 + (length/sc_blockSize)*sc_numVars;
-+    remainder = (uint8)(length-((const uint8 *)end-u.p8));
-+    if (ALLOW_UNALIGNED_READS || (u.i & 0x7) == 0)
-+    {
-+        while (u.p64 < end)
-+        { 
-+            Mix(u.p64, h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
-+	    u.p64 += sc_numVars;
-+        }
-+    }
-+    else
-+    {
-+        while (u.p64 < end)
-+        { 
-+            memcpy(m_data, u.p8, sc_blockSize);
-+            Mix(m_data, h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
-+	    u.p64 += sc_numVars;
-+        }
-+    }
-+
-+    // stuff away the last few bytes
-+    m_remainder = remainder;
-+    memcpy(m_data, end, remainder);
-+    
-+    // stuff away the variables
-+    m_state[0] = h0;
-+    m_state[1] = h1;
-+    m_state[2] = h2;
-+    m_state[3] = h3;
-+    m_state[4] = h4;
-+    m_state[5] = h5;
-+    m_state[6] = h6;
-+    m_state[7] = h7;
-+    m_state[8] = h8;
-+    m_state[9] = h9;
-+    m_state[10] = h10;
-+    m_state[11] = h11;
-+}
-+
-+
-+// report the hash for the concatenation of all message fragments so far
-+void SpookyHash::Final(uint64 *hash1, uint64 *hash2)
-+{
-+    // init the variables
-+    if (m_length < sc_bufSize)
-+    {
-+        Short( m_data, m_length, hash1, hash2);
-+        return;
-+    }
-+    
-+    const uint64 *data = (const uint64 *)m_data;
-+    uint8 remainder = m_remainder;
-+    
-+    uint64 h0 = m_state[0];
-+    uint64 h1 = m_state[1];
-+    uint64 h2 = m_state[2];
-+    uint64 h3 = m_state[3];
-+    uint64 h4 = m_state[4];
-+    uint64 h5 = m_state[5];
-+    uint64 h6 = m_state[6];
-+    uint64 h7 = m_state[7];
-+    uint64 h8 = m_state[8];
-+    uint64 h9 = m_state[9];
-+    uint64 h10 = m_state[10];
-+    uint64 h11 = m_state[11];
-+
-+    if (remainder >= sc_blockSize)
-+    {
-+        // m_data can contain two blocks; handle any whole first block
-+        Mix(data, h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
-+	data += sc_numVars;
-+	remainder -= sc_blockSize;
-+    }
-+
-+    // mix in the last partial block, and the length mod sc_blockSize
-+    memset(&((uint8 *)data)[remainder], 0, (sc_blockSize-remainder));
-+
-+    ((uint8 *)data)[sc_blockSize-1] = remainder;
-+    Mix(data, h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
-+    
-+    // do some final mixing
-+    End(h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
-+
-+    *hash1 = h0;
-+    *hash2 = h1;
-+}
-+
-diff --git a/gfx/angle/src/compiler/spooky.h b/gfx/angle/src/compiler/spooky.h
-new file mode 100644
---- /dev/null
-+++ b/gfx/angle/src/compiler/spooky.h
-@@ -0,0 +1,293 @@
-+//
-+// SpookyHash: a 128-bit noncryptographic hash function
-+// By Bob Jenkins, public domain
-+//   Oct 31 2010: alpha, framework + SpookyHash::Mix appears right
-+//   Oct 31 2011: alpha again, Mix only good to 2^^69 but rest appears right
-+//   Dec 31 2011: beta, improved Mix, tested it for 2-bit deltas
-+//   Feb  2 2012: production, same bits as beta
-+//   Feb  5 2012: adjusted definitions of uint* to be more portable
-+// 
-+// Up to 4 bytes/cycle for long messages.  Reasonably fast for short messages.
-+// All 1 or 2 bit deltas achieve avalanche within 1% bias per output bit.
-+//
-+// This was developed for and tested on 64-bit x86-compatible processors.
-+// It assumes the processor is little-endian.  There is a macro
-+// controlling whether unaligned reads are allowed (by default they are).
-+// This should be an equally good hash on big-endian machines, but it will
-+// compute different results on them than on little-endian machines.
-+//
-+// Google's CityHash has similar specs to SpookyHash, and CityHash is faster
-+// on some platforms.  MD4 and MD5 also have similar specs, but they are orders
-+// of magnitude slower.  CRCs are two or more times slower, but unlike 
-+// SpookyHash, they have nice math for combining the CRCs of pieces to form 
-+// the CRCs of wholes.  There are also cryptographic hashes, but those are even 
-+// slower than MD5.
-+//
-+
-+#include <stddef.h>
-+
-+#ifdef _MSC_VER
-+# define INLINE __forceinline
-+  typedef  unsigned __int64 uint64;
-+  typedef  unsigned __int32 uint32;
-+  typedef  unsigned __int16 uint16;
-+  typedef  unsigned __int8  uint8;
-+#else
-+# include <stdint.h>
-+# define INLINE inline
-+  typedef  uint64_t  uint64;
-+  typedef  uint32_t  uint32;
-+  typedef  uint16_t  uint16;
-+  typedef  uint8_t   uint8;
-+#endif
-+
-+
-+class SpookyHash
-+{
-+public:
-+    //
-+    // SpookyHash: hash a single message in one call, produce 128-bit output
-+    //
-+    static void Hash128(
-+        const void *message,  // message to hash
-+        size_t length,        // length of message in bytes
-+        uint64 *hash1,        // in/out: in seed 1, out hash value 1
-+        uint64 *hash2);       // in/out: in seed 2, out hash value 2
-+
-+    //
-+    // Hash64: hash a single message in one call, return 64-bit output
-+    //
-+    static uint64 Hash64(
-+        const void *message,  // message to hash
-+        size_t length,        // length of message in bytes
-+        uint64 seed)          // seed
-+    {
-+        uint64 hash1 = seed;
-+        Hash128(message, length, &hash1, &seed);
-+        return hash1;
-+    }
-+
-+    //
-+    // Hash32: hash a single message in one call, produce 32-bit output
-+    //
-+    static uint32 Hash32(
-+        const void *message,  // message to hash
-+        size_t length,        // length of message in bytes
-+        uint32 seed)          // seed
-+    {
-+        uint64 hash1 = seed, hash2 = seed;
-+        Hash128(message, length, &hash1, &hash2);
-+        return (uint32)hash1;
-+    }
-+
-+    //
-+    // Init: initialize the context of a SpookyHash
-+    //
-+    void Init(
-+        uint64 seed1,       // any 64-bit value will do, including 0
-+        uint64 seed2);      // different seeds produce independent hashes
-+    
-+    //
-+    // Update: add a piece of a message to a SpookyHash state
-+    //
-+    void Update(
-+        const void *message,  // message fragment
-+        size_t length);       // length of message fragment in bytes
-+
-+
-+    //
-+    // Final: compute the hash for the current SpookyHash state
-+    //
-+    // This does not modify the state; you can keep updating it afterward
-+    //
-+    // The result is the same as if SpookyHash() had been called with
-+    // all the pieces concatenated into one message.
-+    //
-+    void Final(
-+        uint64 *hash1,    // out only: first 64 bits of hash value.
-+        uint64 *hash2);   // out only: second 64 bits of hash value.
-+
-+    //
-+    // left rotate a 64-bit value by k bytes
-+    //
-+    static INLINE uint64 Rot64(uint64 x, int k)
-+    {
-+        return (x << k) | (x >> (64 - k));
-+    }
-+
-+    //
-+    // This is used if the input is 96 bytes long or longer.
-+    //
-+    // The internal state is fully overwritten every 96 bytes.
-+    // Every input bit appears to cause at least 128 bits of entropy
-+    // before 96 other bytes are combined, when run forward or backward
-+    //   For every input bit,
-+    //   Two inputs differing in just that input bit
-+    //   Where "differ" means xor or subtraction
-+    //   And the base value is random
-+    //   When run forward or backwards one Mix
-+    // I tried 3 pairs of each; they all differed by at least 212 bits.
-+    //
-+    static INLINE void Mix(
-+        const uint64 *data, 
-+        uint64 &s0, uint64 &s1, uint64 &s2, uint64 &s3,
-+        uint64 &s4, uint64 &s5, uint64 &s6, uint64 &s7,
-+        uint64 &s8, uint64 &s9, uint64 &s10,uint64 &s11)
-+    {
-+      s0 += data[0];    s2 ^= s10;    s11 ^= s0;    s0 = Rot64(s0,11);    s11 += s1;
-+      s1 += data[1];    s3 ^= s11;    s0 ^= s1;    s1 = Rot64(s1,32);    s0 += s2;
-+      s2 += data[2];    s4 ^= s0;    s1 ^= s2;    s2 = Rot64(s2,43);    s1 += s3;
-+      s3 += data[3];    s5 ^= s1;    s2 ^= s3;    s3 = Rot64(s3,31);    s2 += s4;
-+      s4 += data[4];    s6 ^= s2;    s3 ^= s4;    s4 = Rot64(s4,17);    s3 += s5;
-+      s5 += data[5];    s7 ^= s3;    s4 ^= s5;    s5 = Rot64(s5,28);    s4 += s6;
-+      s6 += data[6];    s8 ^= s4;    s5 ^= s6;    s6 = Rot64(s6,39);    s5 += s7;
-+      s7 += data[7];    s9 ^= s5;    s6 ^= s7;    s7 = Rot64(s7,57);    s6 += s8;
-+      s8 += data[8];    s10 ^= s6;    s7 ^= s8;    s8 = Rot64(s8,55);    s7 += s9;
-+      s9 += data[9];    s11 ^= s7;    s8 ^= s9;    s9 = Rot64(s9,54);    s8 += s10;
-+      s10 += data[10];    s0 ^= s8;    s9 ^= s10;    s10 = Rot64(s10,22);    s9 += s11;
-+      s11 += data[11];    s1 ^= s9;    s10 ^= s11;    s11 = Rot64(s11,46);    s10 += s0;
-+    }
-+
-+    //
-+    // Mix all 12 inputs together so that h0, h1 are a hash of them all.
-+    //
-+    // For two inputs differing in just the input bits
-+    // Where "differ" means xor or subtraction
-+    // And the base value is random, or a counting value starting at that bit
-+    // The final result will have each bit of h0, h1 flip
-+    // For every input bit,
-+    // with probability 50 +- .3%
-+    // For every pair of input bits,
-+    // with probability 50 +- 3%
-+    //
-+    // This does not rely on the last Mix() call having already mixed some.
-+    // Two iterations was almost good enough for a 64-bit result, but a
-+    // 128-bit result is reported, so End() does three iterations.
-+    //
-+    static INLINE void EndPartial(
-+        uint64 &h0, uint64 &h1, uint64 &h2, uint64 &h3,
-+        uint64 &h4, uint64 &h5, uint64 &h6, uint64 &h7, 
-+        uint64 &h8, uint64 &h9, uint64 &h10,uint64 &h11)
-+    {
-+        h11+= h1;    h2 ^= h11;   h1 = Rot64(h1,44);
-+	h0 += h2;    h3 ^= h0;    h2 = Rot64(h2,15);
-+	h1 += h3;    h4 ^= h1;    h3 = Rot64(h3,34);
-+	h2 += h4;    h5 ^= h2;    h4 = Rot64(h4,21);
-+	h3 += h5;    h6 ^= h3;    h5 = Rot64(h5,38);
-+	h4 += h6;    h7 ^= h4;    h6 = Rot64(h6,33);
-+	h5 += h7;    h8 ^= h5;    h7 = Rot64(h7,10);
-+	h6 += h8;    h9 ^= h6;    h8 = Rot64(h8,13);
-+	h7 += h9;    h10^= h7;    h9 = Rot64(h9,38);
-+	h8 += h10;   h11^= h8;    h10= Rot64(h10,53);
-+	h9 += h11;   h0 ^= h9;    h11= Rot64(h11,42);
-+	h10+= h0;    h1 ^= h10;   h0 = Rot64(h0,54);
-+    }
-+
-+    static INLINE void End(
-+        uint64 &h0, uint64 &h1, uint64 &h2, uint64 &h3,
-+        uint64 &h4, uint64 &h5, uint64 &h6, uint64 &h7, 
-+        uint64 &h8, uint64 &h9, uint64 &h10,uint64 &h11)
-+    {
-+        EndPartial(h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
-+        EndPartial(h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
-+        EndPartial(h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
-+    }
-+
-+    //
-+    // The goal is for each bit of the input to expand into 128 bits of 
-+    //   apparent entropy before it is fully overwritten.
-+    // n trials both set and cleared at least m bits of h0 h1 h2 h3
-+    //   n: 2   m: 29
-+    //   n: 3   m: 46
-+    //   n: 4   m: 57
-+    //   n: 5   m: 107
-+    //   n: 6   m: 146
-+    //   n: 7   m: 152
-+    // when run forwards or backwards
-+    // for all 1-bit and 2-bit diffs
-+    // with diffs defined by either xor or subtraction
-+    // with a base of all zeros plus a counter, or plus another bit, or random
-+    //
-+    static INLINE void ShortMix(uint64 &h0, uint64 &h1, uint64 &h2, uint64 &h3)
-+    {
-+        h2 = Rot64(h2,50);  h2 += h3;  h0 ^= h2;
-+        h3 = Rot64(h3,52);  h3 += h0;  h1 ^= h3;
-+        h0 = Rot64(h0,30);  h0 += h1;  h2 ^= h0;
-+        h1 = Rot64(h1,41);  h1 += h2;  h3 ^= h1;
-+        h2 = Rot64(h2,54);  h2 += h3;  h0 ^= h2;
-+        h3 = Rot64(h3,48);  h3 += h0;  h1 ^= h3;
-+        h0 = Rot64(h0,38);  h0 += h1;  h2 ^= h0;
-+        h1 = Rot64(h1,37);  h1 += h2;  h3 ^= h1;
-+        h2 = Rot64(h2,62);  h2 += h3;  h0 ^= h2;
-+        h3 = Rot64(h3,34);  h3 += h0;  h1 ^= h3;
-+        h0 = Rot64(h0,5);   h0 += h1;  h2 ^= h0;
-+        h1 = Rot64(h1,36);  h1 += h2;  h3 ^= h1;
-+    }
-+
-+    //
-+    // Mix all 4 inputs together so that h0, h1 are a hash of them all.
-+    //
-+    // For two inputs differing in just the input bits
-+    // Where "differ" means xor or subtraction
-+    // And the base value is random, or a counting value starting at that bit
-+    // The final result will have each bit of h0, h1 flip
-+    // For every input bit,
-+    // with probability 50 +- .3% (it is probably better than that)
-+    // For every pair of input bits,
-+    // with probability 50 +- .75% (the worst case is approximately that)
-+    //
-+    static INLINE void ShortEnd(uint64 &h0, uint64 &h1, uint64 &h2, uint64 &h3)
-+    {
-+        h3 ^= h2;  h2 = Rot64(h2,15);  h3 += h2;
-+        h0 ^= h3;  h3 = Rot64(h3,52);  h0 += h3;
-+        h1 ^= h0;  h0 = Rot64(h0,26);  h1 += h0;
-+        h2 ^= h1;  h1 = Rot64(h1,51);  h2 += h1;
-+        h3 ^= h2;  h2 = Rot64(h2,28);  h3 += h2;
-+        h0 ^= h3;  h3 = Rot64(h3,9);   h0 += h3;
-+        h1 ^= h0;  h0 = Rot64(h0,47);  h1 += h0;
-+        h2 ^= h1;  h1 = Rot64(h1,54);  h2 += h1;
-+        h3 ^= h2;  h2 = Rot64(h2,32);  h3 += h2;
-+        h0 ^= h3;  h3 = Rot64(h3,25);  h0 += h3;
-+        h1 ^= h0;  h0 = Rot64(h0,63);  h1 += h0;
-+    }
-+    
-+private:
-+
-+    //
-+    // Short is used for messages under 192 bytes in length
-+    // Short has a low startup cost, the normal mode is good for long
-+    // keys, the cost crossover is at about 192 bytes.  The two modes were
-+    // held to the same quality bar.
-+    // 
-+    static void Short(
-+        const void *message,
-+        size_t length,
-+        uint64 *hash1,
-+        uint64 *hash2);
-+
-+    // number of uint64's in internal state
-+    static const size_t sc_numVars = 12;
-+
-+    // size of the internal state
-+    static const size_t sc_blockSize = sc_numVars*8;
-+
-+    // size of buffer of unhashed data, in bytes
-+    static const size_t sc_bufSize = 2*sc_blockSize;
-+
-+    //
-+    // sc_const: a constant which:
-+    //  * is not zero
-+    //  * is odd
-+    //  * is a not-very-regular mix of 1's and 0's
-+    //  * does not need any other special mathematical properties
-+    //
-+    static const uint64 sc_const = 0xdeadbeefdeadbeefLL;
-+
-+    uint64 m_data[2*sc_numVars];   // unhashed data, for partial messages
-+    uint64 m_state[sc_numVars];  // internal state of the hash
-+    size_t m_length;             // total length of the input so far
-+    uint8  m_remainder;          // length of unhashed data stashed in m_data
-+};
-+
-+
-+
deleted file mode 100644
--- a/gfx/angle/angle-renaming-debug.patch
+++ /dev/null
@@ -1,246 +0,0 @@
-# HG changeset patch
-# Parent 8e2ee5b1a34208fd10f501fdee330878e20df599
-
-diff --git a/gfx/angle/src/compiler/Diagnostics.cpp b/gfx/angle/src/compiler/Diagnostics.cpp
---- a/gfx/angle/src/compiler/Diagnostics.cpp
-+++ b/gfx/angle/src/compiler/Diagnostics.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 "compiler/Diagnostics.h"
- 
--#include "compiler/debug.h"
-+#include "compiler/compilerdebug.h"
- #include "compiler/InfoSink.h"
- #include "compiler/preprocessor/new/SourceLocation.h"
- 
- TDiagnostics::TDiagnostics(TInfoSink& infoSink) :
-     mInfoSink(infoSink),
-     mNumErrors(0),
-     mNumWarnings(0)
- {
-diff --git a/gfx/angle/src/compiler/DirectiveHandler.cpp b/gfx/angle/src/compiler/DirectiveHandler.cpp
---- a/gfx/angle/src/compiler/DirectiveHandler.cpp
-+++ b/gfx/angle/src/compiler/DirectiveHandler.cpp
-@@ -3,17 +3,17 @@
- // Use of this source code is governed by a BSD-style license that can be
- // found in the LICENSE file.
- //
- 
- #include "compiler/DirectiveHandler.h"
- 
- #include <sstream>
- 
--#include "compiler/debug.h"
-+#include "compiler/compilerdebug.h"
- #include "compiler/Diagnostics.h"
- 
- static TBehavior getBehavior(const std::string& str)
- {
-     static const std::string kRequire("require");
-     static const std::string kEnable("enable");
-     static const std::string kDisable("disable");
-     static const std::string kWarn("warn");
-diff --git a/gfx/angle/src/compiler/OutputGLSLBase.cpp b/gfx/angle/src/compiler/OutputGLSLBase.cpp
---- a/gfx/angle/src/compiler/OutputGLSLBase.cpp
-+++ b/gfx/angle/src/compiler/OutputGLSLBase.cpp
-@@ -1,16 +1,16 @@
- //
- // Copyright (c) 2002-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 "compiler/OutputGLSLBase.h"
--#include "compiler/debug.h"
-+#include "compiler/compilerdebug.h"
- 
- namespace
- {
- TString getTypeName(const TType& type)
- {
-     TInfoSinkBase out;
-     if (type.isMatrix())
-     {
-diff --git a/gfx/angle/src/compiler/OutputHLSL.cpp b/gfx/angle/src/compiler/OutputHLSL.cpp
---- a/gfx/angle/src/compiler/OutputHLSL.cpp
-+++ b/gfx/angle/src/compiler/OutputHLSL.cpp
-@@ -2,17 +2,17 @@
- // Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved.
- // Use of this source code is governed by a BSD-style license that can be
- // found in the LICENSE file.
- //
- 
- #include "compiler/OutputHLSL.h"
- 
- #include "common/angleutils.h"
--#include "compiler/debug.h"
-+#include "compiler/compilerdebug.h"
- #include "compiler/InfoSink.h"
- #include "compiler/UnfoldShortCircuit.h"
- #include "compiler/SearchSymbol.h"
- #include "compiler/DetectDiscontinuity.h"
- 
- #include <stdio.h>
- #include <algorithm>
- 
-diff --git a/gfx/angle/src/compiler/Types.h b/gfx/angle/src/compiler/Types.h
---- a/gfx/angle/src/compiler/Types.h
-+++ b/gfx/angle/src/compiler/Types.h
-@@ -4,17 +4,17 @@
- // found in the LICENSE file.
- //
- 
- #ifndef _TYPES_INCLUDED
- #define _TYPES_INCLUDED
- 
- #include "compiler/BaseTypes.h"
- #include "compiler/Common.h"
--#include "compiler/debug.h"
-+#include "compiler/compilerdebug.h"
- 
- //
- // Need to have association of line numbers to types in a list for building structs.
- //
- class TType;
- struct TTypeLine {
-     TType* type;
-     int line;
-diff --git a/gfx/angle/src/compiler/debug.cpp b/gfx/angle/src/compiler/compilerdebug.cpp
-rename from gfx/angle/src/compiler/debug.cpp
-rename to gfx/angle/src/compiler/compilerdebug.cpp
---- a/gfx/angle/src/compiler/debug.cpp
-+++ b/gfx/angle/src/compiler/compilerdebug.cpp
-@@ -1,17 +1,17 @@
- //
- // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
- // Use of this source code is governed by a BSD-style license that can be
- // found in the LICENSE file.
- //
- 
- // debug.cpp: Debugging utilities.
- 
--#include "compiler/debug.h"
-+#include "compiler/compilerdebug.h"
- 
- #include <stdarg.h>
- #include <stdio.h>
- 
- #include "compiler/InitializeParseContext.h"
- #include "compiler/ParseHelper.h"
- 
- static const int kTraceBufferLen = 1024;
-diff --git a/gfx/angle/src/compiler/debug.h b/gfx/angle/src/compiler/compilerdebug.h
-rename from gfx/angle/src/compiler/debug.h
-rename to gfx/angle/src/compiler/compilerdebug.h
---- a/gfx/angle/src/compiler/debug.h
-+++ b/gfx/angle/src/compiler/compilerdebug.h
-@@ -1,15 +1,15 @@
- //
- // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
- // Use of this source code is governed by a BSD-style license that can be
- // found in the LICENSE file.
- //
- 
--// debug.h: Debugging utilities.
-+// compilerdebug.h: Debugging utilities.
- 
- #ifndef COMPILER_DEBUG_H_
- #define COMPILER_DEBUG_H_
- 
- #include <assert.h>
- 
- #ifdef _DEBUG
- #define TRACE_ENABLED  // define to enable debug message tracing
-diff --git a/gfx/angle/src/compiler/osinclude.h b/gfx/angle/src/compiler/osinclude.h
---- a/gfx/angle/src/compiler/osinclude.h
-+++ b/gfx/angle/src/compiler/osinclude.h
-@@ -32,17 +32,17 @@
- #include <windows.h>
- #elif defined(ANGLE_OS_POSIX)
- #include <pthread.h>
- #include <semaphore.h>
- #include <errno.h>
- #endif  // ANGLE_USE_NSPR
- 
- 
--#include "compiler/debug.h"
-+#include "compiler/compilerdebug.h"
- 
- //
- // Thread Local Storage Operations
- //
- #if defined(ANGLE_USE_NSPR)
- typedef PRUintn OS_TLSIndex;
- #define OS_INVALID_TLS_INDEX 0xFFFFFFFF
- #elif defined(ANGLE_OS_WIN)
-diff --git a/gfx/angle/src/compiler/preprocessor/atom.c b/gfx/angle/src/compiler/preprocessor/atom.c
---- a/gfx/angle/src/compiler/preprocessor/atom.c
-+++ b/gfx/angle/src/compiler/preprocessor/atom.c
-@@ -46,17 +46,17 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILI
- // atom.c
- //
- 
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
- 
- #include "common/angleutils.h"
--#include "compiler/debug.h"
-+#include "compiler/compilerdebug.h"
- #include "compiler/preprocessor/slglobals.h"
- 
- #undef malloc
- #undef realloc
- #undef free
- 
- ///////////////////////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////// String table: //////////////////////////////////////
-diff --git a/gfx/angle/src/compiler/preprocessor/tokens.c b/gfx/angle/src/compiler/preprocessor/tokens.c
---- a/gfx/angle/src/compiler/preprocessor/tokens.c
-+++ b/gfx/angle/src/compiler/preprocessor/tokens.c
-@@ -46,17 +46,17 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILI
- //
- 
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
- #include <ctype.h>
- 
- #include "common/angleutils.h"
--#include "compiler/debug.h"
-+#include "compiler/compilerdebug.h"
- #include "compiler/preprocessor/slglobals.h"
- #include "compiler/util.h"
- 
- #if defined(_MSC_VER)
- #pragma warning(disable: 4054)
- #pragma warning(disable: 4152)
- #endif
- 
-diff --git a/gfx/angle/src/compiler/translator_common.vcproj b/gfx/angle/src/compiler/translator_common.vcproj
---- a/gfx/angle/src/compiler/translator_common.vcproj
-+++ b/gfx/angle/src/compiler/translator_common.vcproj
-@@ -580,17 +580,17 @@
- 				RelativePath=".\Common.h"
- 				>
- 			</File>
- 			<File
- 				RelativePath=".\ConstantUnion.h"
- 				>
- 			</File>
- 			<File
--				RelativePath=".\debug.h"
-+				RelativePath=".\compilerdebug.h"
- 				>
- 			</File>
- 			<File
- 				RelativePath=".\DetectRecursion.h"
- 				>
- 			</File>
- 			<File
- 				RelativePath=".\Diagnostics.h"
deleted file mode 100644
--- a/gfx/angle/angle-renaming-preprocessor-diagonostics.patch
+++ /dev/null
@@ -1,6 +0,0 @@
-# HG changeset patch
-# Parent 2cd2556d673d90f79dc29a78a927d2a38b92e14b
-
-diff --git a/gfx/angle/src/compiler/preprocessor/new/Diagnostics.cpp b/gfx/angle/src/compiler/preprocessor/new/PreprocessorDiagnostics.cpp
-rename from gfx/angle/src/compiler/preprocessor/new/Diagnostics.cpp
-rename to gfx/angle/src/compiler/preprocessor/new/PreprocessorDiagnostics.cpp
deleted file mode 100644
--- a/gfx/angle/angle-renaming-preprocessor-directivehandler.patch
+++ /dev/null
@@ -1,6 +0,0 @@
-# HG changeset patch
-# Parent a98ccd93f2ab811670cb50edca50f6381274a345
-
-diff --git a/gfx/angle/src/compiler/preprocessor/new/DirectiveHandler.cpp b/gfx/angle/src/compiler/preprocessor/new/PreprocessorDirectiveHandler.cpp
-rename from gfx/angle/src/compiler/preprocessor/new/DirectiveHandler.cpp
-rename to gfx/angle/src/compiler/preprocessor/new/PreprocessorDirectiveHandler.cpp
deleted file mode 100644
--- a/gfx/angle/angle-stdcall-alias.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/gfx/angle/src/libGLESv2/libGLESv2.def b/gfx/angle/src/libGLESv2/libGLESv2.def
-index 5f935c3..2324dcb 100644
---- a/gfx/angle/src/libGLESv2/libGLESv2.def
-+++ b/gfx/angle/src/libGLESv2/libGLESv2.def
-@@ -180,3 +180,8 @@ EXPORTS
-     glGetCurrentContext             @147 NONAME
-     glGetProcAddress                @148 NONAME
-     glBindTexImage                  @158 NONAME
-+
-+    ; GCC has problems with linking to undecored stdcall functions,
-+    ; so we explicitly add aliases for APIs used by EGL
-+    glGetProcAddress@4=glGetProcAddress
-+    glBindTexImage@4=glBindTexImage
new file mode 100644
--- /dev/null
+++ b/gfx/angle/extensions/ANGLE_multiple_render_targets.txt
@@ -0,0 +1,383 @@
+Name
+
+    ANGLE_multiple_render_targets
+
+Name Strings
+
+    GL_ANGLE_multiple_render_targets
+
+Contributors
+
+    Contributors to GL_NV_draw_buffers
+    Contributors to GL_NV_fbo_color_attachments
+    Contributors to the OpenGL ES 2.0 specification
+    Contributors to the OpenGLSL ES 1.0.17 specification
+    Contributors to the OpenGL ES 3.0 specification
+    Nicolas Capens, TransGaming Inc.
+    Daniel Koch, TransGaming Inc.
+    Alastair Patrick, Google Inc.
+    Members of the WebGL working group
+
+Contact
+
+    Daniel Koch <daniel> <at> <transgaming> <dot> <com>
+
+Status
+
+    Incomplete -- do not implement!
+
+Version
+
+    Last Modified Data: November 13, 2012
+    Revision: #5
+
+Number
+
+    TBD
+
+Dependencies
+
+    OpenGL ES 2.0 is required.
+
+    The extension is written against the OpenGL ES 2.0 specification.
+
+    ANGLE_framebuffer_blit affects the definition of this extension.
+    APPLE_framebuffer_multisample affects the definitin of this extension.
+
+Overview
+
+    This extension increases the number of available framebuffer object
+    color attachment points, extends OpenGL ES 2.0 to allow multiple output
+    colors, and provides a mechanism for directing those outputs to
+    multiple color buffers.
+
+    This extension is similar to the combination of the GL_NV_draw_buffers
+    and GL_NV_fbo_color_attachments extensions, but imposes certain
+    restrictions informed by the OpenGL ES 3.0 API.
+
+New Procedures and Functions
+
+      void DrawBuffersANGLE(sizei n, const enum *bufs);
+
+New Tokens
+
+    Accepted by the <pname> parameter of GetIntegerv:
+
+        MAX_COLOR_ATTACHMENTS_ANGLE                  0x8CDF
+
+    Accepted by the <pname> parameters of GetIntegerv and GetFloatv:
+
+        MAX_DRAW_BUFFERS_ANGLE                  0x8824
+        DRAW_BUFFER0_ANGLE                      0x8825
+        DRAW_BUFFER1_ANGLE                      0x8826
+        DRAW_BUFFER2_ANGLE                      0x8827
+        DRAW_BUFFER3_ANGLE                      0x8828
+        DRAW_BUFFER4_ANGLE                      0x8829
+        DRAW_BUFFER5_ANGLE                      0x882A
+        DRAW_BUFFER6_ANGLE                      0x882B
+        DRAW_BUFFER7_ANGLE                      0x882C
+        DRAW_BUFFER8_ANGLE                      0x882D
+        DRAW_BUFFER9_ANGLE                      0x882E
+        DRAW_BUFFER10_ANGLE                     0x882F
+        DRAW_BUFFER11_ANGLE                     0x8830
+        DRAW_BUFFER12_ANGLE                     0x8831
+        DRAW_BUFFER13_ANGLE                     0x8832
+        DRAW_BUFFER14_ANGLE                     0x8833
+        DRAW_BUFFER15_ANGLE                     0x8834
+
+    Accepted by the <attachment> parameter of FramebufferRenderbuffer,
+    FramebufferTexture2D and GetFramebufferAttachmentParameteriv, and by
+    the <bufs> parameter of DrawBuffersANGLE:
+
+        COLOR_ATTACHMENT0_ANGLE                      0x8CE0
+        COLOR_ATTACHMENT1_ANGLE                      0x8CE1
+        COLOR_ATTACHMENT2_ANGLE                      0x8CE2
+        COLOR_ATTACHMENT3_ANGLE                      0x8CE3
+        COLOR_ATTACHMENT4_ANGLE                      0x8CE4
+        COLOR_ATTACHMENT5_ANGLE                      0x8CE5
+        COLOR_ATTACHMENT6_ANGLE                      0x8CE6
+        COLOR_ATTACHMENT7_ANGLE                      0x8CE7
+        COLOR_ATTACHMENT8_ANGLE                      0x8CE8
+        COLOR_ATTACHMENT9_ANGLE                      0x8CE9
+        COLOR_ATTACHMENT10_ANGLE                     0x8CEA
+        COLOR_ATTACHMENT11_ANGLE                     0x8CEB
+        COLOR_ATTACHMENT12_ANGLE                     0x8CEC
+        COLOR_ATTACHMENT13_ANGLE                     0x8CED
+        COLOR_ATTACHMENT14_ANGLE                     0x8CEE
+        COLOR_ATTACHMENT15_ANGLE                     0x8CEF
+
+    The COLOR_ATTACHMENT0_ANGLE constant is equal to the
+    COLOR_ATTACHMENT0 constant.
+
+    Each COLOR_ATTACHMENT<i>_ANGLE adheres to COLOR_ATTACHMENT<i>_ANGLE
+    = COLOR_ATTACHMENT0_ANGLE + <i>.
+
+Changes to Chapter 3 of the OpenGL ES 2.0 Specification (Rasterization)
+
+    Section 3.2, (Multisampling). Replace the second paragraph:
+
+    An additional buffer, called the multisample buffer, is added to the
+    window system-provided framebuffer. Pixel sample values, including
+    color, depth, and stencil values, are stored in this buffer. Samples
+    contain separate color values for each fragment color. When the
+    window system-provided framebuffer includes a multisample buffer, it
+    does not include depth or stencil buffers, even if the multisample
+    buffer does not store depth or stencil values. Color buffers do
+    coexist with the multisample buffer, however.
+
+    Section 3.8.2, (Shader Execution) Replace subsection "Shader
+    Outputs":
+
+    The OpenGL ES Shading Language specification describes the values
+    that may be output by a fragment shader. These are gl_FragColor and
+    gl_FragData[n].  The final fragment color values or the final
+    fragment data values written by a fragment shader are clamped to the
+    range [0, 1] and then converted to fixed-point as described in
+    section 2.1.2 for framebuffer color components.
+
+    Writing to gl_FragColor specifies the fragment color (color number
+    zero) that will be used by subsequent stages of the pipeline.
+    Writing to gl_FragData[n] specifies the value of fragment color
+    number n. Any colors, or color components, associated with a
+    fragment that are not written by the fragment shader are undefined.
+    A fragment shader may not statically assign values to both
+    gl_FragColor and gl_FragData. In this case, a compile or link error
+    will result. A shader statically assigns a value to a variable if,
+    after preprocessing, it contains a statement that would write to the
+    variable, whether or not run-time flow of control will cause that
+    statement to be executed.
+
+Changes to Chapter 4 of the OpenGL ES 2.0 Specification (Per-Fragment
+Operations and the Frame Buffer)
+
+    Insert Table 4.3 (and renumber subsequent tables): Arguments to
+    DrawBuffersANGLE when the context is bound to a framebuffer
+    object, and the buffers they indicate. <i> in
+    COLOR_ATTACHMENT<i>_ANGLE may range from zero to the value of
+    MAX_COLOR_ATTACHMENTS_ANGLE minus one.
+
+    Symbolic Constant                         Meaning
+    -----------------                         ---------------------
+    NONE                                      No buffer
+
+    COLOR_ATTACHMENT<i>_ANGLE (see caption)   Output fragment color to image 
+                                              attached at color attachment
+                                              point i
+
+
+    Replace Section 4.2.1, "Selecting a Buffer for Writing" with the following:
+
+    "By default, color values are written into the front buffer for
+    single buffered surfaces or into the back buffer for back buffered
+    surfaces as determined when making the context current. To control
+    the color buffer into which each of the fragment color values is
+    written, DrawBuffersANGLE is used.
+
+    The command
+
+      void DrawBuffersANGLE(sizei n, const enum *bufs);
+
+    defines the draw buffers to which all fragment colors are written.
+    <n> specifies the number of buffers in <bufs>. <bufs> is a pointer
+    to an array of symbolic constants specifying the buffer to which
+    each fragment color is written.
+
+    Each buffer listed in <bufs> must be BACK, NONE, or one of the
+    values from table 4.3. Further, acceptable values for the constants
+    in <bufs> depend on whether the GL is using the default framebuffer
+    (i.e., DRAW_FRAMEBUFFER_BINDING is zero), or a framebuffer object
+    (i.e., DRAW_FRAMEBUFFER_BINDING is non-zero). For more information
+    about framebuffer objects, see section 4.4.
+
+    If the GL is bound to the default framebuffer, then <n> must be 1
+    and the constant must be BACK or NONE. When draw buffer zero is
+    BACK, color values are written into the sole buffer for single-
+    buffered contexts, or into the back buffer for double-buffered
+    contexts. If DrawBuffersANGLE is supplied with a constant other than
+    BACK and NONE, the error INVALID_OPERATION is generated.
+
+    If the GL is bound to a draw framebuffer object, then each of the
+    constants must be one of the values listed in table 4.3.
+
+    In both cases, the draw buffers being defined correspond in order to
+    the respective fragment colors. The draw buffer for fragment
+    colors beyond <n> is set to NONE.
+
+    The maximum number of draw buffers is implementation-dependent. The
+    number of draw buffers supported can be queried by calling
+    GetIntegerv with the symbolic constant MAX_DRAW_BUFFERS_ANGLE. An
+    INVALID_VALUE error is generated if <n> is greater than
+    MAX_DRAW_BUFFERS_ANGLE.
+
+    If the GL is bound to a draw framebuffer object, the <i>th buffer listed
+    in <bufs> must be COLOR_ATTACHMENT<i>_ANGLE or NONE. Specifying a
+    buffer out of order, BACK, or COLOR_ATTACHMENT<m>_ANGLE where <m> is
+    greater than or equal to the value of MAX_COLOR_ATTACHMENTS_ANGLE,
+    will generate the error INVALID_OPERATION.
+
+    If a fragment shader writes to "gl_FragColor", DrawBuffersANGLE 
+    specifies a set of draw buffers into which the color written to
+    "gl_FragColor" is written. If a fragment shader writes to
+    "gl_FragData", DrawBuffersANGLE specifies a set of draw buffers
+    into which each of the multiple output colors defined by these
+    variables are separately written. If a fragment shader writes to
+    neither "gl_FragColor" nor "gl_FragData" the values of the
+    fragment colors following shader execution are undefined, and may
+    differ for each fragment color.
+
+    Indicating a buffer or buffers using DrawBuffersANGLE causes
+    subsequent pixel color value writes to affect the indicated
+    buffers. If the GL is bound to a draw framebuffer object and a draw
+    buffer selects an attachment that has no image attached, then that
+    fragment color is not written.
+
+    Specifying NONE as the draw buffer for a fragment color will inhibit
+    that fragment color from being written.
+
+    The state required to handle color buffer selection for each
+    framebuffer is an integer for each supported fragment color. For the
+    default framebuffer, in the initial state the draw buffer for
+    fragment color zero is BACK if there is a default framebuffer
+    associated with the context, otherwise NONE. For framebuffer
+    objects, in the initial state the draw buffer for fragment color
+    zero is COLOR_ATTACHMENT0_ANGLE.
+
+    For both the default framebuffer and framebuffer objects, the
+    initial state of draw buffers for fragment colors other than zero is
+    NONE.
+
+    The value of the draw buffer selected for fragment color <i> can be
+    queried by calling GetIntegerv with the symbolic constant
+    DRAW_BUFFER<i>_ANGLE."
+
+    Replace the second paragraph of Section 4.4.1 (Binding and Managing
+    Framebuffer Objects) with the following:
+
+    "The namespace for framebuffer objects is the unsigned integers, with
+    zero reserved by OpenGL ES to refer to the default framebuffer. A
+    framebuffer object is created by binding an unused name to the
+    target FRAMEBUFFER, DRAW_FRAMEBUFFER, or READ_FRAMEBUFFER. The binding
+    is effected by calling
+
+        void BindFramebuffer(enum target, uint framebuffer);
+
+    with <target> set the desired framebuffer target and <framebuffer> set 
+    to the unused name. The resulting framebuffer object is a new state 
+    vector. There is a number of color attachment points, plus one each
+    for the depth and stencil attachment points. The number of color attachment
+    points is equal to the value of MAX_COLOR_ATTACHMENTS_ANGLE."
+
+Changes to Chapter 3 of the OpenGL ES Shading Language 1.0.17 Specification (Basics)
+
+    Add a new section:
+
+    3.4.1 GL_ANGLE_multiple_render_targets Extension
+
+    To use the GL_ANGLE_multiple_render_targets extension in a shader it
+    must be enabled using the #extension directive.
+
+    The shading language preprocessor #define
+    GL_ANGLE_multiple_render_targets will be defined to 1, if the
+    GL_ANGLE_multiple_render_targets extension is supported.
+
+Dependencies on ANGLE_framebuffer_blit and APPLE_framebuffer_multisample:
+
+    If neither ANGLE_framebuffer_blit nor APPLE_framebuffer_multisample are
+    supported, then all references to "draw framebuffers" should be replaced
+    with references to "framebuffers". References to DRAW_FRAMEBUFFER_BINDING
+    should be replaced with references to FRAMEBUFFER_BINDING. References to
+    DRAW_FRAMEBUFFER and READ_FRAMEBUFFER should be removed.
+
+    If ANGLE_framebuffer_blit is supported, DRAW_FRAMEBUFFER_BINDING, DRAW_FRAMEBUFFER
+    and READ_FRAMEBUFFER all refer to corresponding _ANGLE suffixed names
+    (they have the same token values).
+
+    If APPLE_framebuffer_multisample is supported, DRAW_FRAMEBUFFER_BINDING,
+    DRAW_FRAMEBUFFER and READ_FRAMEBUFFER all refer to the corresponding _APPLE
+    suffixed names (they have the same token values).
+
+Errors
+
+    <TBD>
+
+New State
+
+    Add Table 6.X Framebuffer (State per framebuffer object):
+
+    State                 Type Get Command  Initial Value Description 
+    ---------------       ---- ------------ ------------- -----------
+    DRAW_BUFFER<i>_ANGLE  Z10* GetIntegerv  see 4.2.1     Draw buffer selected 
+							  for fragment color i
+
+    Add to Table 6.18 (Implementation Dependent Values)
+
+    Get value                    Type Get Cmnd    Minimum Value Description             Sec.
+    ------------------------     ---- ----------- ------------- -----------             -----
+    MAX_DRAW_BUFFERS_ANGLE       Z+   GetIntegerv 1             Maximum number of       4.2.1
+                                                                active draw buffers
+    MAX_COLOR_ATTACHMENTS_ANGLE  Z+   GetIntegerv 1             Number of framebuffer   4.4.1
+                                                                color attachment points
+Issues
+
+    See ARB_draw_buffers for relevant issues.
+
+  1) Differences from NV_draw_buffers + NV_fbo_color_attachments?
+
+   - interactions with blit_framebuffer
+   - MAX limits are global instead of per-fbo (TBD - Issue 2)
+   - no broadcast from gl_FragColor (TBD - Issue 3)
+   - can be used to with default framebuffer to set NONE/BACK (TBD - Issue 4)
+
+   2) Should the MAX_DRAW_BUFFERS_ANGLE and MAX_COLOR_ATTACHMENTS_ANGLE limits
+    be per-framebuffer values or implementation dependent constants?
+
+    DISCUSSION: In ARB_draw_buffers this was per-context (see Issue 2).
+    EXT_framebuffer_object (and subsequently ARB_framebuffer_object, and GL 3.0
+    through GL 4.2) made these queries framebuffer-dependent. 
+    However GL in 4.3 and GLES 3.0, these limits were moved from 
+    framebuffer-dependent state to implementation-dependent state after
+    much discussion (Bug 7990).
+
+    NV_draw_buffers has MAX_DRAW_BUFFERS listed as per-framebuffer state,
+    but NV_fbo_color_attachments has MAX_COLOR_ATTACHMENTS as an 
+    implementation-dependent constant.
+
+    This is relevant because some implementations are not able to support 
+    multisampling in conjuction with multiple color attachments.  If the
+    query is per-framebuffer, they can report a maximum of one attachment
+    when there are multisampled attachments, but a higher limit when only
+    single-sampled attachments are present.
+
+   3) Should we support broadcast from gl_FragColor to all gl_FragData[x]
+    or should it be synonymous with gl_FragData[0]?
+
+    DISCUSSION: With NV_draw_buffers, writing to gl_FragColor writes to all
+    the enabled draw buffers (ie broadcast). In OpenGL ES 3.0 when using 
+    ESSL 1.0, gl_FragColor is equivalent to writing a single output to 
+    gl_FragData[0] and multiple outputs are not possible. When using ESSL 3.0,
+    only user-defined out variables may be used.
+
+    If broadcast is supported, some implementations may have to replace
+    writes to gl_FragColor with replicated writes to all possible gl_FragData
+    locations when this extension is enabled.
+
+   4) Should we allow DrawBuffersANGLE to be called when the default FBO is bound?
+
+    DISCUSSION: NV_draw_buffers specifies that DrawBuffersNV errors with 
+    INVALID_OPERATION when the default FBO is bound. OpenGL ES 3.0 allows
+    DrawBuffers to toggle between BACK and NONE on the default FBO.
+
+    An implementation that does not natively support disabling the drawbuffer
+    on the default FBO could emulate this by disabling color writes.
+
+
+Revision History
+
+    11/13/2012  dgkoch  add revision history
+                        add text from updated ES 3.0 spec
+                        add issues for discussion
+    10/16/2012  kbr     update name string
+    10/16/2012  kbr     remove restrition requiring draw buffer 0 to be non-NULL
+    10/12/2012  kbr     remove references to GetDoublev and ReadBuffer
+    10/11/2012  kbr     initial draft extension
+
--- a/gfx/angle/include/GLSLANG/ShaderLang.h
+++ b/gfx/angle/include/GLSLANG/ShaderLang.h
@@ -18,16 +18,18 @@
 #else  // defined(WIN32)
 #define COMPILER_EXPORT __attribute__((visibility("default")))
 #endif
 
 #else  // defined(COMPONENT_BUILD)
 #define COMPILER_EXPORT
 #endif
 
+#include "khrplatform.h"
+
 //
 // This is the platform independent interface between an OGL driver
 // and the shading language compiler.
 //
 
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -105,17 +107,20 @@ typedef enum {
 
 typedef enum {
   SH_INFO_LOG_LENGTH             =  0x8B84,
   SH_OBJECT_CODE_LENGTH          =  0x8B88,  // GL_SHADER_SOURCE_LENGTH
   SH_ACTIVE_UNIFORMS             =  0x8B86,
   SH_ACTIVE_UNIFORM_MAX_LENGTH   =  0x8B87,
   SH_ACTIVE_ATTRIBUTES           =  0x8B89,
   SH_ACTIVE_ATTRIBUTE_MAX_LENGTH =  0x8B8A,
-  SH_MAPPED_NAME_MAX_LENGTH      =  0x8B8B
+  SH_MAPPED_NAME_MAX_LENGTH      =  0x6000,
+  SH_NAME_MAX_LENGTH             =  0x6001,
+  SH_HASHED_NAME_MAX_LENGTH      =  0x6002,
+  SH_HASHED_NAMES_COUNT          =  0x6003
 } ShShaderInfo;
 
 // Compile options.
 typedef enum {
   SH_VALIDATE                = 0,
   SH_VALIDATE_LOOP_INDEXING  = 0x0001,
   SH_INTERMEDIATE_TREE       = 0x0002,
   SH_OBJECT_CODE             = 0x0004,
@@ -140,31 +145,35 @@ typedef enum {
   // restrictions on fragment shaders.
   // This flag only has an effect if all of the following are true:
   // - The shader spec is SH_WEBGL_SPEC.
   // - The compile options contain the SH_TIMING_RESTRICTIONS flag.
   // - The shader type is SH_FRAGMENT_SHADER.
   SH_DEPENDENCY_GRAPH = 0x0400,
 
   // Enforce the GLSL 1.017 Appendix A section 7 packing restrictions.
-  SH_ENFORCE_PACKING_RESTRICTIONS = 0x0800,
+  SH_ENFORCE_PACKING_RESTRICTIONS = 0x0800
 } ShCompileOptions;
 
 //
 // Driver must call this first, once, before doing any other
 // compiler operations.
 // If the function succeeds, the return value is nonzero, else zero.
 //
 COMPILER_EXPORT int ShInitialize();
 //
 // Driver should call this at shutdown.
 // If the function succeeds, the return value is nonzero, else zero.
 //
 COMPILER_EXPORT int ShFinalize();
 
+// 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*, unsigned int);
+
 //
 // Implementation dependent built-in resources (constants and extensions).
 // The names for these resources has been obtained by stripping gl_/GL_.
 //
 typedef struct
 {
     // Constants.
     int MaxVertexAttribs;
@@ -176,16 +185,21 @@ typedef struct
     int MaxFragmentUniformVectors;
     int MaxDrawBuffers;
 
     // Extensions.
     // Set to 1 to enable the extension, else 0.
     int OES_standard_derivatives;
     int OES_EGL_image_external;
     int ARB_texture_rectangle;
+
+    // Name Hashing.
+    // Set a 64 bit hash function to enable user-defined name hashing.
+    // Default is NULL.
+    ShHashFunction64 HashFunction;
 } ShBuiltInResources;
 
 //
 // Initialize built-in resources with minimum expected values.
 //
 COMPILER_EXPORT void ShInitBuiltInResources(ShBuiltInResources* resources);
 
 //
@@ -262,16 +276,21 @@ COMPILER_EXPORT int ShCompile(
 //                                 variable name including the null
 //                                 termination character.
 // SH_ACTIVE_UNIFORMS: the number of active uniform variables.
 // SH_ACTIVE_UNIFORM_MAX_LENGTH: the length of the longest active uniform
 //                               variable name including the null
 //                               termination character.
 // SH_MAPPED_NAME_MAX_LENGTH: the length of the mapped variable name including
 //                            the null termination character.
+// SH_NAME_MAX_LENGTH: the max length of a user-defined name including the
+//                     null termination character.
+// SH_HASHED_NAME_MAX_LENGTH: the max length of a hashed name including the
+//                            null termination character.
+// SH_HASHED_NAMES_COUNT: the number of hashed names from the latest compile.
 // 
 // params: Requested parameter
 COMPILER_EXPORT void ShGetInfo(const ShHandle handle,
                                ShShaderInfo pname,
                                int* params);
 
 // Returns nul-terminated information log for a compiled shader.
 // Parameters:
@@ -342,13 +361,31 @@ COMPILER_EXPORT void ShGetActiveAttrib(c
 COMPILER_EXPORT void ShGetActiveUniform(const ShHandle handle,
                                         int index,
                                         int* length,
                                         int* size,
                                         ShDataType* type,
                                         char* name,
                                         char* mappedName);
 
+// Returns information about a name hashing entry from the latest compile.
+// Parameters:
+// handle: Specifies the compiler
+// index: Specifies the index of the name hashing entry to be queried.
+// name: Returns a null terminated string containing the user defined name.
+//       It is assumed that name has enough memory to accomodate the name.
+//       The size of the buffer required to store the user defined name can
+//       be obtained by calling ShGetInfo with SH_NAME_MAX_LENGTH.
+// hashedName: Returns a null terminated string containing the hashed name of
+//             the uniform variable, It is assumed that hashedName has enough
+//             memory to accomodate the name. The size of the buffer required
+//             to store the name can be obtained by calling ShGetInfo with
+//             SH_HASHED_NAME_MAX_LENGTH.
+COMPILER_EXPORT void ShGetNameHashingEntry(const ShHandle handle,
+                                           int index,
+                                           char* name,
+                                           char* hashedName);
+
 #ifdef __cplusplus
 }
 #endif
 
 #endif // _COMPILER_INTERFACE_INCLUDED_
deleted file mode 100644
--- a/gfx/angle/samples/build_samples.gyp
+++ /dev/null
@@ -1,179 +0,0 @@
-# Copyright (c) 2010 The ANGLE Project Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
-  'targets': [
-    {
-      'target_name': 'essl_to_glsl',
-      'type': 'executable',
-      'dependencies': [
-        '../src/build_angle.gyp:translator_glsl',
-      ],
-      'include_dirs': [
-        '../include',
-      ],
-      'sources': [
-        'translator/translator.cpp',
-      ],
-    },
-  ],
-  'conditions': [
-    ['OS=="win"', {
-      'targets': [
-        {
-          'target_name': 'essl_to_hlsl',
-          'type': 'executable',
-          'dependencies': [
-            '../src/build_angle.gyp:translator_hlsl',
-          ],
-          'include_dirs': [
-            '../include',
-            '../src',
-          ],
-          'sources': [
-            'translator/translator.cpp',
-            '../src/common/debug.cpp',
-          ],
-          'msvs_settings': {
-            'VCLinkerTool': {
-              'AdditionalLibraryDirectories': ['$(DXSDK_DIR)/lib/x86'],
-              'AdditionalDependencies': ['d3d9.lib'],
-            }
-          }
-        },
-        {
-          'target_name': 'es_util',
-          'type': 'static_library',
-          'dependencies': [
-            '../src/build_angle.gyp:libEGL',
-            '../src/build_angle.gyp:libGLESv2',
-          ],
-          'include_dirs': [
-            'gles2_book/Common',
-            '../include',
-          ],
-          'sources': [
-            'gles2_book/Common/esShader.c',
-            'gles2_book/Common/esShapes.c',
-            'gles2_book/Common/esTransform.c',
-            'gles2_book/Common/esUtil.c',
-            'gles2_book/Common/esUtil.h',
-            'gles2_book/Common/esUtil_win.h',
-            'gles2_book/Common/Win32/esUtil_TGA.c',
-            'gles2_book/Common/Win32/esUtil_win32.c',
-          ],
-          'direct_dependent_settings': {
-            'include_dirs': [
-              'gles2_book/Common',
-              '../include',
-            ],
-          },
-        },
-        {
-          'target_name': 'hello_triangle',
-          'type': 'executable',
-          'dependencies': ['es_util'],
-          'sources': [
-            'gles2_book/Hello_Triangle/Hello_Triangle.c',
-          ],
-        },
-        {
-          'target_name': 'mip_map_2d',
-          'type': 'executable',
-          'dependencies': ['es_util'],
-          'sources': [
-            'gles2_book/MipMap2D/MipMap2D.c',
-          ],
-        },
-        {
-          'target_name': 'multi_texture',
-          'type': 'executable',
-          'dependencies': ['es_util'],
-          'sources': [
-            'gles2_book/MultiTexture/MultiTexture.c',
-          ],
-          'copies': [
-            {
-              'destination': '<(PRODUCT_DIR)',
-              'files': [
-                'gles2_book/MultiTexture/basemap.tga',
-                'gles2_book/MultiTexture/lightmap.tga',
-              ],
-            },
-          ],
-        },
-        {
-          'target_name': 'particle_system',
-          'type': 'executable',
-          'dependencies': ['es_util'],
-          'sources': [
-            'gles2_book/ParticleSystem/ParticleSystem.c',
-          ],
-          'copies': [
-            {
-              'destination': '<(PRODUCT_DIR)',
-              'files': [
-                'gles2_book/ParticleSystem/smoke.tga',
-              ],
-            },
-          ],
-        },
-        {
-          'target_name': 'simple_texture_2d',
-          'type': 'executable',
-          'dependencies': ['es_util'],
-          'sources': [
-            'gles2_book/Simple_Texture2D/Simple_Texture2D.c',
-          ],
-        },
-        {
-          'target_name': 'simple_texture_cubemap',
-          'type': 'executable',
-          'dependencies': ['es_util'],
-          'sources': [
-            'gles2_book/Simple_TextureCubemap/Simple_TextureCubemap.c',
-          ],
-        },
-        {
-          'target_name': 'simple_vertex_shader',
-          'type': 'executable',
-          'dependencies': ['es_util'],
-          'sources': [
-            'gles2_book/Simple_VertexShader/Simple_VertexShader.c',
-          ],
-        },
-        {
-          'target_name': 'stencil_test',
-          'type': 'executable',
-          'dependencies': ['es_util'],
-          'sources': [
-            'gles2_book/Stencil_Test/Stencil_Test.c',
-          ],
-        },
-        {
-          'target_name': 'texture_wrap',
-          'type': 'executable',
-          'dependencies': ['es_util'],
-          'sources': [
-            'gles2_book/TextureWrap/TextureWrap.c',
-          ],
-        },
-        {
-          'target_name': 'post_sub_buffer',
-          'type': 'executable',
-          'dependencies': ['es_util'],
-          'sources': [
-            'gles2_book/PostSubBuffer/PostSubBuffer.c',
-          ],
-        },
-      ],
-    }],
-  ],
-}
-
-# Local Variables:
-# tab-width:2
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=2 shiftwidth=2:
deleted file mode 100644
--- a/gfx/angle/samples/gles2_book/Common/Win32/esUtil_TGA.c
+++ /dev/null
@@ -1,122 +0,0 @@
-//
-// Book:      OpenGL(R) ES 2.0 Programming Guide
-// Authors:   Aaftab Munshi, Dan Ginsburg, Dave Shreiner
-// ISBN-10:   0321502795
-// ISBN-13:   9780321502797
-// Publisher: Addison-Wesley Professional
-// URLs:      http://safari.informit.com/9780321563835
-//            http://www.opengles-book.com
-//
-
-// esUtil_TGA.c
-//
-//    This file contains the Win32 implementation of a TGA image loader
-
-#include <windows.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-///
-//  Macros
-//
-#define INVERTED_BIT            (1 << 5)
-
-///
-//  Types
-//
-#pragma pack(push,x1)                            // Byte alignment (8-bit)
-#pragma pack(1)
-
-typedef struct
-{
-   unsigned char  IdSize,
-                  MapType,
-                  ImageType;
-   unsigned short PaletteStart,
-                  PaletteSize;
-   unsigned char  PaletteEntryDepth;
-   unsigned short X,
-                  Y,
-                  Width,
-                  Height;
-   unsigned char  ColorDepth,
-                  Descriptor;
-         
-} TGA_HEADER;
-
-#pragma pack(pop,x1)
-
-////////////////////////////////////////////////////////////////////////////////////
-//
-//  Private Functions
-//
-
-////////////////////////////////////////////////////////////////////////////////////
-//
-//  Public Functions
-//
-//
-
-
-///
-//  WinTGALoad()
-//
-int WinTGALoad( const char *fileName, char **buffer, int *width, int *height )
-{
-   FILE        *fp;
-   TGA_HEADER   Header;
-
-   if ( fopen_s ( &fp, fileName, "rb" ) != 0 )
-   {
-      return FALSE;
-   }
-
-   if ( fp == NULL )
-   {
-      return FALSE;
-   }
-
-   fread ( &Header, sizeof(TGA_HEADER), 1, fp );
-
-   *width = Header.Width;
-   *height = Header.Height;
-   
-   if ( Header.ColorDepth == 24 )
-   {
-      RGBTRIPLE *Buffer24;
-
-      Buffer24= (RGBTRIPLE*)malloc(sizeof(RGBTRIPLE) * (*width) * (*height));
-
-      if(Buffer24)
-      {
-         int i=0;
-         int x,
-             y;
-
-         fread(Buffer24, sizeof(RGBTRIPLE), (*width) * (*height), fp);
-
-         *buffer= (LPSTR) malloc(3 * (*width) * (*height));
-
-         for ( y = 0; y < *height; y++ )
-            for( x = 0; x < *width; x++ )
-            {
-               int Index= y * (*width) + x;
-
-               if(!(Header.Descriptor & INVERTED_BIT))
-                  Index= ((*height) - 1 - y) * (*width) + x;
-
-               (*buffer)[(i * 3)]=      Buffer24[Index].rgbtRed;
-               (*buffer)[(i * 3) + 1]=  Buffer24[Index].rgbtGreen;
-               (*buffer)[(i * 3) + 2]=  Buffer24[Index].rgbtBlue;
-        
-               i++;
-            }
-         
-         fclose(fp);
-         free(Buffer24);
-         return(TRUE);
-      }		
-   }
-
-   return(FALSE);
-}
deleted file mode 100644
--- a/gfx/angle/samples/gles2_book/Common/Win32/esUtil_win32.c
+++ /dev/null
@@ -1,190 +0,0 @@
-//
-// Book:      OpenGL(R) ES 2.0 Programming Guide
-// Authors:   Aaftab Munshi, Dan Ginsburg, Dave Shreiner
-// ISBN-10:   0321502795
-// ISBN-13:   9780321502797
-// Publisher: Addison-Wesley Professional
-// URLs:      http://safari.informit.com/9780321563835
-//            http://www.opengles-book.com
-//
-
-// esUtil_win32.c
-//
-//    This file contains the Win32 implementation of the windowing functions. 
-
-
-///
-// Includes
-//
-
-#include <windows.h>
-#include "esUtil.h"
-
-//////////////////////////////////////////////////////////////////
-//
-//  Private Functions
-//
-//
-
-///
-//  ESWindowProc()
-//
-//      Main window procedure
-//
-LRESULT WINAPI ESWindowProc ( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) 
-{
-   LRESULT  lRet = 1; 
-
-   switch (uMsg) 
-   { 
-      case WM_CREATE:
-         break;
-
-      case WM_SIZE:
-         {
-            ESContext *esContext = (ESContext*)(LONG_PTR) GetWindowLongPtr ( hWnd, GWL_USERDATA );
-            if ( esContext ) {
-               esContext->width = LOWORD( lParam );
-               esContext->height = HIWORD( lParam );
-               InvalidateRect( esContext->hWnd, NULL, FALSE );
-            }
-         }
-
-      case WM_PAINT:
-         {
-            ESContext *esContext = (ESContext*)(LONG_PTR) GetWindowLongPtr ( hWnd, GWL_USERDATA );
-            
-            if ( esContext && esContext->drawFunc )
-               esContext->drawFunc ( esContext );
-            
-            if ( esContext )
-              ValidateRect( esContext->hWnd, NULL );
-         }
-         break;
-
-      case WM_DESTROY:
-         PostQuitMessage(0);             
-         break; 
-      
-      case WM_CHAR:
-         {
-            POINT      point;
-            ESContext *esContext = (ESContext*)(LONG_PTR) GetWindowLongPtr ( hWnd, GWL_USERDATA );
-            
-            GetCursorPos( &point );
-
-            if ( esContext && esContext->keyFunc )
-	            esContext->keyFunc ( esContext, (unsigned char) wParam, 
-		                             (int) point.x, (int) point.y );
-}
-         break;
-         
-      default: 
-         lRet = DefWindowProc (hWnd, uMsg, wParam, lParam); 
-         break; 
-   } 
-
-   return lRet; 
-}
-
-//////////////////////////////////////////////////////////////////
-//
-//  Public Functions
-//
-//
-
-///
-//  WinCreate()
-//
-//      Create Win32 instance and window
-//
-GLboolean WinCreate ( ESContext *esContext, LPCTSTR title )
-{
-   WNDCLASS wndclass = {0}; 
-   DWORD    wStyle   = 0;
-   RECT     windowRect;
-   HINSTANCE hInstance = GetModuleHandle(NULL);
-   
-   wndclass.style         = CS_OWNDC;
-   wndclass.lpfnWndProc   = (WNDPROC)ESWindowProc; 
-   wndclass.hInstance     = hInstance; 
-   wndclass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); 
-   wndclass.lpszClassName = TEXT("opengles2.0");
-
-   if (!RegisterClass (&wndclass) ) 
-      return FALSE; 
-
-   wStyle = WS_VISIBLE | WS_POPUP | WS_BORDER | WS_SYSMENU | WS_CAPTION | WS_SIZEBOX;
-   
-   // Adjust the window rectangle so that the client area has
-   // the correct number of pixels
-   windowRect.left = 0;
-   windowRect.top = 0;
-   windowRect.right = esContext->width;
-   windowRect.bottom = esContext->height;
-
-   AdjustWindowRect ( &windowRect, wStyle, FALSE );
-
-   esContext->hWnd = CreateWindow(
-                         TEXT("opengles2.0"),
-                         title,
-                         wStyle,
-                         0,
-                         0,
-                         windowRect.right - windowRect.left,
-                         windowRect.bottom - windowRect.top,
-                         NULL,
-                         NULL,
-                         hInstance,
-                         NULL);
-
-   // Set the ESContext* to the GWL_USERDATA so that it is available to the 
-   // ESWindowProc
-   SetWindowLongPtr (  esContext->hWnd, GWL_USERDATA, (LONG) (LONG_PTR) esContext );
-
-   if ( esContext->hWnd == NULL )
-      return GL_FALSE;
-
-   ShowWindow ( esContext->hWnd, TRUE );
-
-   return GL_TRUE;
-}
-
-///
-//  winLoop()
-//
-//      Start main windows loop
-//
-void WinLoop ( ESContext *esContext )
-{
-   MSG msg = { 0 };
-   int done = 0;
-   DWORD lastTime = GetTickCount();
-   
-   while (!done)
-   {
-      int gotMsg = (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) != 0);
-      DWORD curTime = GetTickCount();
-      float deltaTime = (float)( curTime - lastTime ) / 1000.0f;
-      lastTime = curTime;
-
-      if ( gotMsg )
-      {
-         if (msg.message==WM_QUIT)
-         {
-             done=1; 
-         }
-         else
-         {
-             TranslateMessage(&msg); 
-             DispatchMessage(&msg); 
-         }
-      }
-      else
-         SendMessage( esContext->hWnd, WM_PAINT, 0, 0 );
-
-      // Call update function if registered
-      if ( esContext->updateFunc != NULL )
-         esContext->updateFunc ( esContext, deltaTime );
-   }
-}
deleted file mode 100644
--- a/gfx/angle/samples/gles2_book/Common/esShader.c
+++ /dev/null
@@ -1,155 +0,0 @@
-//
-// Book:      OpenGL(R) ES 2.0 Programming Guide
-// Authors:   Aaftab Munshi, Dan Ginsburg, Dave Shreiner
-// ISBN-10:   0321502795
-// ISBN-13:   9780321502797
-// Publisher: Addison-Wesley Professional
-// URLs:      http://safari.informit.com/9780321563835
-//            http://www.opengles-book.com
-//
-
-// ESShader.c
-//
-//    Utility functions for loading shaders and creating program objects.
-//
-
-///
-//  Includes
-//
-#include "esUtil.h"
-#include <stdlib.h>
-
-//////////////////////////////////////////////////////////////////
-//
-//  Private Functions
-//
-//
-
-
-
-//////////////////////////////////////////////////////////////////
-//
-//  Public Functions
-//
-//
-
-//
-///
-/// \brief Load a shader, check for compile errors, print error messages to output log
-/// \param type Type of shader (GL_VERTEX_SHADER or GL_FRAGMENT_SHADER)
-/// \param shaderSrc Shader source string
-/// \return A new shader object on success, 0 on failure
-//
-GLuint ESUTIL_API esLoadShader ( GLenum type, const char *shaderSrc )
-{
-   GLuint shader;
-   GLint compiled;
-   
-   // Create the shader object
-   shader = glCreateShader ( type );
-
-   if ( shader == 0 )
-   	return 0;
-
-   // Load the shader source
-   glShaderSource ( shader, 1, &shaderSrc, NULL );
-   
-   // Compile the shader
-   glCompileShader ( shader );
-
-   // Check the compile status
-   glGetShaderiv ( shader, GL_COMPILE_STATUS, &compiled );
-
-   if ( !compiled ) 
-   {
-      GLint infoLen = 0;
-
-      glGetShaderiv ( shader, GL_INFO_LOG_LENGTH, &infoLen );
-      
-      if ( infoLen > 1 )
-      {
-         char* infoLog = malloc (sizeof(char) * infoLen );
-
-         glGetShaderInfoLog ( shader, infoLen, NULL, infoLog );
-         esLogMessage ( "Error compiling shader:\n%s\n", infoLog );            
-         
-         free ( infoLog );
-      }
-
-      glDeleteShader ( shader );
-      return 0;
-   }
-
-   return shader;
-
-}
-
-
-//
-///
-/// \brief Load a vertex and fragment shader, create a program object, link program.
-//         Errors output to log.
-/// \param vertShaderSrc Vertex shader source code
-/// \param fragShaderSrc Fragment shader source code
-/// \return A new program object linked with the vertex/fragment shader pair, 0 on failure
-//
-GLuint ESUTIL_API esLoadProgram ( const char *vertShaderSrc, const char *fragShaderSrc )
-{
-   GLuint vertexShader;
-   GLuint fragmentShader;
-   GLuint programObject;
-   GLint linked;
-
-   // Load the vertex/fragment shaders
-   vertexShader = esLoadShader ( GL_VERTEX_SHADER, vertShaderSrc );
-   if ( vertexShader == 0 )
-      return 0;
-
-   fragmentShader = esLoadShader ( GL_FRAGMENT_SHADER, fragShaderSrc );
-   if ( fragmentShader == 0 )
-   {
-      glDeleteShader( vertexShader );
-      return 0;
-   }
-
-   // Create the program object
-   programObject = glCreateProgram ( );
-   
-   if ( programObject == 0 )
-      return 0;
-
-   glAttachShader ( programObject, vertexShader );
-   glAttachShader ( programObject, fragmentShader );
-
-   // Link the program
-   glLinkProgram ( programObject );
-
-   // Check the link status
-   glGetProgramiv ( programObject, GL_LINK_STATUS, &linked );
-
-   if ( !linked ) 
-   {
-      GLint infoLen = 0;
-
-      glGetProgramiv ( programObject, GL_INFO_LOG_LENGTH, &infoLen );
-      
-      if ( infoLen > 1 )
-      {
-         char* infoLog = malloc (sizeof(char) * infoLen );
-
-         glGetProgramInfoLog ( programObject, infoLen, NULL, infoLog );
-         esLogMessage ( "Error linking program:\n%s\n", infoLog );            
-         
-         free ( infoLog );
-      }
-
-      glDeleteProgram ( programObject );
-      return 0;
-   }
-
-   // Free up no longer needed shader resources
-   glDeleteShader ( vertexShader );
-   glDeleteShader ( fragmentShader );
-
-   return programObject;
-}
deleted file mode 100644
--- a/gfx/angle/samples/gles2_book/Common/esShapes.c
+++ /dev/null
@@ -1,279 +0,0 @@
-//
-// Book:      OpenGL(R) ES 2.0 Programming Guide
-// Authors:   Aaftab Munshi, Dan Ginsburg, Dave Shreiner
-// ISBN-10:   0321502795
-// ISBN-13:   9780321502797
-// Publisher: Addison-Wesley Professional
-// URLs:      http://safari.informit.com/9780321563835
-//            http://www.opengles-book.com
-//
-
-// ESShapes.c
-//
-//    Utility functions for generating shapes
-//
-
-///
-//  Includes
-//
-#include "esUtil.h"
-#include <stdlib.h>
-#include <math.h>
-
-///
-// Defines
-//
-#define ES_PI  (3.14159265f)
-
-//////////////////////////////////////////////////////////////////
-//
-//  Private Functions
-//
-//
-
-
-
-//////////////////////////////////////////////////////////////////
-//
-//  Public Functions
-//
-//
-
-//
-/// \brief Generates geometry for a sphere.  Allocates memory for the vertex data and stores 
-///        the results in the arrays.  Generate index list for a TRIANGLE_STRIP
-/// \param numSlices The number of slices in the sphere
-/// \param vertices If not NULL, will contain array of float3 positions
-/// \param normals If not NULL, will contain array of float3 normals
-/// \param texCoords If not NULL, will contain array of float2 texCoords
-/// \param indices If not NULL, will contain the array of indices for the triangle strip
-/// \return The number of indices required for rendering the buffers (the number of indices stored in the indices array
-///         if it is not NULL ) as a GL_TRIANGLE_STRIP
-//
-int ESUTIL_API esGenSphere ( int numSlices, float radius, GLfloat **vertices, GLfloat **normals, 
-                             GLfloat **texCoords, GLushort **indices )
-{
-   int i;
-   int j;
-   int numParallels = numSlices / 2;
-   int numVertices = ( numParallels + 1 ) * ( numSlices + 1 );
-   int numIndices = numParallels * numSlices * 6;
-   float angleStep = (2.0f * ES_PI) / ((float) numSlices);
-
-   // Allocate memory for buffers
-   if ( vertices != NULL )
-      *vertices = malloc ( sizeof(GLfloat) * 3 * numVertices );
-   
-   if ( normals != NULL )
-      *normals = malloc ( sizeof(GLfloat) * 3 * numVertices );
-
-   if ( texCoords != NULL )
-      *texCoords = malloc ( sizeof(GLfloat) * 2 * numVertices );
-
-   if ( indices != NULL )
-      *indices = malloc ( sizeof(GLushort) * numIndices );
-
-   for ( i = 0; i < numParallels + 1; i++ )
-   {
-      for ( j = 0; j < numSlices + 1; j++ )
-      {
-         int vertex = ( i * (numSlices + 1) + j ) * 3; 
-
-         if ( vertices )
-         {
-            (*vertices)[vertex + 0] = radius * sinf ( angleStep * (float)i ) *
-                                               sinf ( angleStep * (float)j );
-            (*vertices)[vertex + 1] = radius * cosf ( angleStep * (float)i );
-            (*vertices)[vertex + 2] = radius * sinf ( angleStep * (float)i ) *
-                                               cosf ( angleStep * (float)j );
-         }
-
-         if ( normals )
-         {
-            (*normals)[vertex + 0] = (*vertices)[vertex + 0] / radius;
-            (*normals)[vertex + 1] = (*vertices)[vertex + 1] / radius;
-            (*normals)[vertex + 2] = (*vertices)[vertex + 2] / radius;
-         }
-
-         if ( texCoords )
-         {
-            int texIndex = ( i * (numSlices + 1) + j ) * 2;
-            (*texCoords)[texIndex + 0] = (float) j / (float) numSlices;
-            (*texCoords)[texIndex + 1] = ( 1.0f - (float) i ) / (float) (numParallels - 1 );
-         }
-      }
-   }
-
-   // Generate the indices
-   if ( indices != NULL )
-   {
-      GLushort *indexBuf = (*indices);
-      for ( i = 0; i < numParallels ; i++ ) 
-      {
-         for ( j = 0; j < numSlices; j++ )
-         {
-            *indexBuf++  = i * ( numSlices + 1 ) + j;
-            *indexBuf++ = ( i + 1 ) * ( numSlices + 1 ) + j;
-            *indexBuf++ = ( i + 1 ) * ( numSlices + 1 ) + ( j + 1 );
-
-            *indexBuf++ = i * ( numSlices + 1 ) + j;
-            *indexBuf++ = ( i + 1 ) * ( numSlices + 1 ) + ( j + 1 );
-            *indexBuf++ = i * ( numSlices + 1 ) + ( j + 1 );
-         }
-      }
-   }
-
-   return numIndices;
-}
-
-//
-/// \brief Generates geometry for a cube.  Allocates memory for the vertex data and stores 
-///        the results in the arrays.  Generate index list for a TRIANGLES
-/// \param scale The size of the cube, use 1.0 for a unit cube.
-/// \param vertices If not NULL, will contain array of float3 positions
-/// \param normals If not NULL, will contain array of float3 normals
-/// \param texCoords If not NULL, will contain array of float2 texCoords
-/// \param indices If not NULL, will contain the array of indices for the triangle strip
-/// \return The number of indices required for rendering the buffers (the number of indices stored in the indices array
-///         if it is not NULL ) as a GL_TRIANGLE_STRIP
-//
-int ESUTIL_API esGenCube ( float scale, GLfloat **vertices, GLfloat **normals, 
-                           GLfloat **texCoords, GLushort **indices )
-{
-   int i;
-   int numVertices = 24;
-   int numIndices = 36;
-   
-   GLfloat cubeVerts[] =
-   {
-      -0.5f, -0.5f, -0.5f,
-      -0.5f, -0.5f,  0.5f,
-      0.5f, -0.5f,  0.5f,
-      0.5f, -0.5f, -0.5f,
-      -0.5f,  0.5f, -0.5f,
-      -0.5f,  0.5f,  0.5f,
-      0.5f,  0.5f,  0.5f,
-      0.5f,  0.5f, -0.5f,
-      -0.5f, -0.5f, -0.5f,
-      -0.5f,  0.5f, -0.5f,
-      0.5f,  0.5f, -0.5f,
-      0.5f, -0.5f, -0.5f,
-      -0.5f, -0.5f, 0.5f,
-      -0.5f,  0.5f, 0.5f,
-      0.5f,  0.5f, 0.5f, 
-      0.5f, -0.5f, 0.5f,
-      -0.5f, -0.5f, -0.5f,
-      -0.5f, -0.5f,  0.5f,
-      -0.5f,  0.5f,  0.5f,
-      -0.5f,  0.5f, -0.5f,
-      0.5f, -0.5f, -0.5f,
-      0.5f, -0.5f,  0.5f,
-      0.5f,  0.5f,  0.5f,
-      0.5f,  0.5f, -0.5f,
-   };
-
-   GLfloat cubeNormals[] =
-   {
-      0.0f, -1.0f, 0.0f,
-      0.0f, -1.0f, 0.0f,
-      0.0f, -1.0f, 0.0f,
-      0.0f, -1.0f, 0.0f,
-      0.0f, 1.0f, 0.0f,
-      0.0f, 1.0f, 0.0f,
-      0.0f, 1.0f, 0.0f,
-      0.0f, 1.0f, 0.0f,
-      0.0f, 0.0f, -1.0f,
-      0.0f, 0.0f, -1.0f,
-      0.0f, 0.0f, -1.0f,
-      0.0f, 0.0f, -1.0f,
-      0.0f, 0.0f, 1.0f,
-      0.0f, 0.0f, 1.0f,
-      0.0f, 0.0f, 1.0f,
-      0.0f, 0.0f, 1.0f,
-      -1.0f, 0.0f, 0.0f,
-      -1.0f, 0.0f, 0.0f,
-      -1.0f, 0.0f, 0.0f,
-      -1.0f, 0.0f, 0.0f,
-      1.0f, 0.0f, 0.0f,
-      1.0f, 0.0f, 0.0f,
-      1.0f, 0.0f, 0.0f,
-      1.0f, 0.0f, 0.0f,
-   };
-
-   GLfloat cubeTex[] =
-   {
-      0.0f, 0.0f,
-      0.0f, 1.0f,
-      1.0f, 1.0f,
-      1.0f, 0.0f,
-      1.0f, 0.0f,
-      1.0f, 1.0f,
-      0.0f, 1.0f,
-      0.0f, 0.0f,
-      0.0f, 0.0f,
-      0.0f, 1.0f,
-      1.0f, 1.0f,
-      1.0f, 0.0f,
-      0.0f, 0.0f,
-      0.0f, 1.0f,
-      1.0f, 1.0f,
-      1.0f, 0.0f,
-      0.0f, 0.0f,
-      0.0f, 1.0f,
-      1.0f, 1.0f,
-      1.0f, 0.0f,
-      0.0f, 0.0f,
-      0.0f, 1.0f,
-      1.0f, 1.0f,
-      1.0f, 0.0f,
-   };
-   
-   // Allocate memory for buffers
-   if ( vertices != NULL )
-   {
-      *vertices = malloc ( sizeof(GLfloat) * 3 * numVertices );
-      memcpy( *vertices, cubeVerts, sizeof( cubeVerts ) );
-      for ( i = 0; i < numVertices; i++ )
-      {
-         (*vertices)[i] *= scale;
-      }
-   }
-
-   if ( normals != NULL )
-   {
-      *normals = malloc ( sizeof(GLfloat) * 3 * numVertices );
-      memcpy( *normals, cubeNormals, sizeof( cubeNormals ) );
-   }
-
-   if ( texCoords != NULL )
-   {
-      *texCoords = malloc ( sizeof(GLfloat) * 2 * numVertices );
-      memcpy( *texCoords, cubeTex, sizeof( cubeTex ) ) ;
-   }
-
-
-   // Generate the indices
-   if ( indices != NULL )
-   {
-      GLushort cubeIndices[] =
-      {
-         0, 2, 1,
-         0, 3, 2, 
-         4, 5, 6,
-         4, 6, 7,
-         8, 9, 10,
-         8, 10, 11, 
-         12, 15, 14,
-         12, 14, 13, 
-         16, 17, 18,
-         16, 18, 19, 
-         20, 23, 22,
-         20, 22, 21
-      };
-
-      *indices = malloc ( sizeof(GLushort) * numIndices );
-      memcpy( *indices, cubeIndices, sizeof( cubeIndices ) );
-   }
-
-   return numIndices;
-}
deleted file mode 100644
--- a/gfx/angle/samples/gles2_book/Common/esTransform.c
+++ /dev/null
@@ -1,212 +0,0 @@
-//
-// Book:      OpenGL(R) ES 2.0 Programming Guide
-// Authors:   Aaftab Munshi, Dan Ginsburg, Dave Shreiner
-// ISBN-10:   0321502795
-// ISBN-13:   9780321502797
-// Publisher: Addison-Wesley Professional
-// URLs:      http://safari.informit.com/9780321563835
-//            http://www.opengles-book.com
-//
-
-// ESUtil.c
-//
-//    A utility library for OpenGL ES.  This library provides a
-//    basic common framework for the example applications in the
-//    OpenGL ES 2.0 Programming Guide.
-//
-
-///
-//  Includes
-//
-#include "esUtil.h"
-#include <math.h>
-
-#define PI 3.1415926535897932384626433832795f
-
-void ESUTIL_API
-esScale(ESMatrix *result, GLfloat sx, GLfloat sy, GLfloat sz)
-{
-    result->m[0][0] *= sx;
-    result->m[0][1] *= sx;
-    result->m[0][2] *= sx;
-    result->m[0][3] *= sx;
-
-    result->m[1][0] *= sy;
-    result->m[1][1] *= sy;
-    result->m[1][2] *= sy;
-    result->m[1][3] *= sy;
-
-    result->m[2][0] *= sz;
-    result->m[2][1] *= sz;
-    result->m[2][2] *= sz;
-    result->m[2][3] *= sz;
-}
-
-void ESUTIL_API
-esTranslate(ESMatrix *result, GLfloat tx, GLfloat ty, GLfloat tz)
-{
-    result->m[3][0] += (result->m[0][0] * tx + result->m[1][0] * ty + result->m[2][0] * tz);
-    result->m[3][1] += (result->m[0][1] * tx + result->m[1][1] * ty + result->m[2][1] * tz);
-    result->m[3][2] += (result->m[0][2] * tx + result->m[1][2] * ty + result->m[2][2] * tz);
-    result->m[3][3] += (result->m[0][3] * tx + result->m[1][3] * ty + result->m[2][3] * tz);
-}
-
-void ESUTIL_API
-esRotate(ESMatrix *result, GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
-{
-   GLfloat sinAngle, cosAngle;
-   GLfloat mag = sqrtf(x * x + y * y + z * z);
-      
-   sinAngle = sinf ( angle * PI / 180.0f );
-   cosAngle = cosf ( angle * PI / 180.0f );
-   if ( mag > 0.0f )
-   {
-      GLfloat xx, yy, zz, xy, yz, zx, xs, ys, zs;
-      GLfloat oneMinusCos;
-      ESMatrix rotMat;
-   
-      x /= mag;
-      y /= mag;
-      z /= mag;
-
-      xx = x * x;
-      yy = y * y;
-      zz = z * z;
-      xy = x * y;
-      yz = y * z;
-      zx = z * x;
-      xs = x * sinAngle;
-      ys = y * sinAngle;
-      zs = z * sinAngle;
-      oneMinusCos = 1.0f - cosAngle;
-
-      rotMat.m[0][0] = (oneMinusCos * xx) + cosAngle;
-      rotMat.m[0][1] = (oneMinusCos * xy) - zs;
-      rotMat.m[0][2] = (oneMinusCos * zx) + ys;
-      rotMat.m[0][3] = 0.0F; 
-
-      rotMat.m[1][0] = (oneMinusCos * xy) + zs;
-      rotMat.m[1][1] = (oneMinusCos * yy) + cosAngle;
-      rotMat.m[1][2] = (oneMinusCos * yz) - xs;
-      rotMat.m[1][3] = 0.0F;
-
-      rotMat.m[2][0] = (oneMinusCos * zx) - ys;
-      rotMat.m[2][1] = (oneMinusCos * yz) + xs;
-      rotMat.m[2][2] = (oneMinusCos * zz) + cosAngle;
-      rotMat.m[2][3] = 0.0F; 
-
-      rotMat.m[3][0] = 0.0F;
-      rotMat.m[3][1] = 0.0F;
-      rotMat.m[3][2] = 0.0F;
-      rotMat.m[3][3] = 1.0F;
-
-      esMatrixMultiply( result, &rotMat, result );
-   }
-}
-
-void ESUTIL_API
-esFrustum(ESMatrix *result, float left, float right, float bottom, float top, float nearZ, float farZ)
-{
-    float       deltaX = right - left;
-    float       deltaY = top - bottom;
-    float       deltaZ = farZ - nearZ;
-    ESMatrix    frust;
-
-    if ( (nearZ <= 0.0f) || (farZ <= 0.0f) ||
-         (deltaX <= 0.0f) || (deltaY <= 0.0f) || (deltaZ <= 0.0f) )
-         return;
-
-    frust.m[0][0] = 2.0f * nearZ / deltaX;
-    frust.m[0][1] = frust.m[0][2] = frust.m[0][3] = 0.0f;
-
-    frust.m[1][1] = 2.0f * nearZ / deltaY;
-    frust.m[1][0] = frust.m[1][2] = frust.m[1][3] = 0.0f;
-
-    frust.m[2][0] = (right + left) / deltaX;
-    frust.m[2][1] = (top + bottom) / deltaY;
-    frust.m[2][2] = -(nearZ + farZ) / deltaZ;
-    frust.m[2][3] = -1.0f;
-
-    frust.m[3][2] = -2.0f * nearZ * farZ / deltaZ;
-    frust.m[3][0] = frust.m[3][1] = frust.m[3][3] = 0.0f;
-
-    esMatrixMultiply(result, &frust, result);
-}
-
-
-void ESUTIL_API 
-esPerspective(ESMatrix *result, float fovy, float aspect, float nearZ, float farZ)
-{
-   GLfloat frustumW, frustumH;
-   
-   frustumH = tanf( fovy / 360.0f * PI ) * nearZ;
-   frustumW = frustumH * aspect;
-
-   esFrustum( result, -frustumW, frustumW, -frustumH, frustumH, nearZ, farZ );
-}
-
-void ESUTIL_API
-esOrtho(ESMatrix *result, float left, float right, float bottom, float top, float nearZ, float farZ)
-{
-    float       deltaX = right - left;
-    float       deltaY = top - bottom;
-    float       deltaZ = farZ - nearZ;
-    ESMatrix    ortho;
-
-    if ( (deltaX == 0.0f) || (deltaY == 0.0f) || (deltaZ == 0.0f) )
-        return;
-
-    esMatrixLoadIdentity(&ortho);
-    ortho.m[0][0] = 2.0f / deltaX;
-    ortho.m[3][0] = -(right + left) / deltaX;
-    ortho.m[1][1] = 2.0f / deltaY;
-    ortho.m[3][1] = -(top + bottom) / deltaY;
-    ortho.m[2][2] = -2.0f / deltaZ;
-    ortho.m[3][2] = -(nearZ + farZ) / deltaZ;
-
-    esMatrixMultiply(result, &ortho, result);
-}
-
-
-void ESUTIL_API
-esMatrixMultiply(ESMatrix *result, ESMatrix *srcA, ESMatrix *srcB)
-{
-    ESMatrix    tmp = { 0.0f };
-    int         i;
-
-	for (i=0; i<4; i++)
-	{
-		tmp.m[i][0] =	(srcA->m[i][0] * srcB->m[0][0]) +
-						(srcA->m[i][1] * srcB->m[1][0]) +
-						(srcA->m[i][2] * srcB->m[2][0]) +
-						(srcA->m[i][3] * srcB->m[3][0]) ;
-
-		tmp.m[i][1] =	(srcA->m[i][0] * srcB->m[0][1]) + 
-						(srcA->m[i][1] * srcB->m[1][1]) +
-						(srcA->m[i][2] * srcB->m[2][1]) +
-						(srcA->m[i][3] * srcB->m[3][1]) ;
-
-		tmp.m[i][2] =	(srcA->m[i][0] * srcB->m[0][2]) + 
-						(srcA->m[i][1] * srcB->m[1][2]) +
-						(srcA->m[i][2] * srcB->m[2][2]) +
-						(srcA->m[i][3] * srcB->m[3][2]) ;
-
-		tmp.m[i][3] =	(srcA->m[i][0] * srcB->m[0][3]) + 
-						(srcA->m[i][1] * srcB->m[1][3]) +
-						(srcA->m[i][2] * srcB->m[2][3]) +
-						(srcA->m[i][3] * srcB->m[3][3]) ;
-	}
-    memcpy(result, &tmp, sizeof(ESMatrix));
-}
-
-
-void ESUTIL_API
-esMatrixLoadIdentity(ESMatrix *result)
-{
-    memset(result, 0x0, sizeof(ESMatrix));
-    result->m[0][0] = 1.0f;
-    result->m[1][1] = 1.0f;
-    result->m[2][2] = 1.0f;
-    result->m[3][3] = 1.0f;
-}
-
deleted file mode 100644
--- a/gfx/angle/samples/gles2_book/Common/esUtil.c
+++ /dev/null
@@ -1,290 +0,0 @@
-//
-// Book:      OpenGL(R) ES 2.0 Programming Guide
-// Authors:   Aaftab Munshi, Dan Ginsburg, Dave Shreiner
-// ISBN-10:   0321502795
-// ISBN-13:   9780321502797
-// Publisher: Addison-Wesley Professional
-// URLs:      http://safari.informit.com/9780321563835
-//            http://www.opengles-book.com
-//
-
-// ESUtil.c
-//
-//    A utility library for OpenGL ES.  This library provides a
-//    basic common framework for the example applications in the
-//    OpenGL ES 2.0 Programming Guide.
-//
-
-///
-//  Includes
-//
-#include <stdio.h>
-#include <stdlib.h>
-#include <GLES2/gl2.h>
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#include "esUtil.h"
-#include "esUtil_win.h"
-
-#if defined(_MSC_VER)
-#pragma warning(disable: 4204) // nonstandard extension used : non-constant aggregate initializer
-#endif
-
-///
-//  Extensions
-//
-
-PFNEGLCREATEIMAGEKHRPROC eglCreateImageKHR;
-PFNEGLDESTROYIMAGEKHRPROC eglDestroyImageKHR;
-
-PFNEGLPOSTSUBBUFFERNVPROC eglPostSubBufferNV;
-
-PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glEGLImageTargetTexture2DOES;
-
-PFNGLDELETEFENCESNVPROC glDeleteFencesNV;
-PFNGLGENFENCESNVPROC glGenFencesNV;
-PFNGLGETFENCEIVNVPROC glGetFenceivNV;
-PFNGLISFENCENVPROC glIsFenceNV;
-PFNGLFINISHFENCENVPROC glFinishFenceNV;
-PFNGLSETFENCENVPROC glSetFenceNV;
-PFNGLTESTFENCENVPROC glTestFenceNV;
-
-///
-// CreateEGLContext()
-//
-//    Creates an EGL rendering context and all associated elements
-//
-EGLBoolean CreateEGLContext ( EGLNativeWindowType hWnd, EGLDisplay* eglDisplay,
-                              EGLContext* eglContext, EGLSurface* eglSurface,
-                              EGLint* configAttribList, EGLint* surfaceAttribList)
-{
-   EGLint numConfigs;
-   EGLint majorVersion;
-   EGLint minorVersion;
-   EGLDisplay display;
-   EGLContext context;
-   EGLSurface surface;
-   EGLConfig config;
-   EGLint contextAttribs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE, EGL_NONE };
-   
-   // Get Display
-   display = eglGetDisplay(GetDC(hWnd));
-   if ( display == EGL_NO_DISPLAY )
-   {
-      return EGL_FALSE;
-   }
-
-   // Initialize EGL
-   if ( !eglInitialize(display, &majorVersion, &minorVersion) )
-   {
-      return EGL_FALSE;
-   }
-
-   // Bind to extensions
-   eglCreateImageKHR = (PFNEGLCREATEIMAGEKHRPROC) eglGetProcAddress("eglCreateImageKHR");
-   eglDestroyImageKHR = (PFNEGLDESTROYIMAGEKHRPROC) eglGetProcAddress("eglDestroyImageKHR");
-   
-   eglPostSubBufferNV = (PFNEGLPOSTSUBBUFFERNVPROC) eglGetProcAddress("eglPostSubBufferNV");
-
-   glEGLImageTargetTexture2DOES = (PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) eglGetProcAddress("glEGLImageTargetTexture2DOES");
-   
-   glDeleteFencesNV = (PFNGLDELETEFENCESNVPROC) eglGetProcAddress("glDeleteFencesNV");
-   glGenFencesNV = (PFNGLGENFENCESNVPROC) eglGetProcAddress("glGenFencesNV");
-   glGetFenceivNV = (PFNGLGETFENCEIVNVPROC) eglGetProcAddress("glGetFenceivNV");
-   glIsFenceNV = (PFNGLISFENCENVPROC) eglGetProcAddress("glIsFenceNV");
-   glFinishFenceNV = (PFNGLFINISHFENCENVPROC) eglGetProcAddress("glFinishFenceNV");
-   glSetFenceNV = (PFNGLSETFENCENVPROC) eglGetProcAddress("glSetFenceNV");
-   glTestFenceNV = (PFNGLTESTFENCENVPROC) eglGetProcAddress("glTestFenceNV");
-
-   // Get configs
-   if ( !eglGetConfigs(display, NULL, 0, &numConfigs) )
-   {
-      return EGL_FALSE;
-   }
-
-   // Choose config
-   if ( !eglChooseConfig(display, configAttribList, &config, 1, &numConfigs) )
-   {
-      return EGL_FALSE;
-   }
-
-   // Create a surface
-   surface = eglCreateWindowSurface(display, config, (EGLNativeWindowType)hWnd, surfaceAttribList);
-   if ( surface == EGL_NO_SURFACE )
-   {
-      return EGL_FALSE;
-   }
-
-   // Create a GL context
-   context = eglCreateContext(display, config, EGL_NO_CONTEXT, contextAttribs );
-   if ( context == EGL_NO_CONTEXT )
-   {
-      return EGL_FALSE;
-   }   
-   
-   // Make the context current
-   if ( !eglMakeCurrent(display, surface, surface, context) )
-   {
-      return EGL_FALSE;
-   }
-   
-   *eglDisplay = display;
-   *eglSurface = surface;
-   *eglContext = context;
-   return EGL_TRUE;
-} 
-
-//////////////////////////////////////////////////////////////////
-//
-//  Public Functions
-//
-//
-
-///
-//  esInitContext()
-//
-//      Initialize ES utility context.  This must be called before calling any other
-//      functions.
-//
-void ESUTIL_API esInitContext ( ESContext *esContext )
-{
-   if ( esContext != NULL )
-   {
-      memset( esContext, 0, sizeof( ESContext) );
-   }
-}
-
-///
-//  esCreateWindow()
-//
-//      title - name for title bar of window
-//      width - width of window to create
-//      height - height of window to create
-//      flags  - bitwise or of window creation flags 
-//          ES_WINDOW_ALPHA       - specifies that the framebuffer should have alpha
-//          ES_WINDOW_DEPTH       - specifies that a depth buffer should be created
-//          ES_WINDOW_STENCIL     - specifies that a stencil buffer should be created
-//          ES_WINDOW_MULTISAMPLE - specifies that a multi-sample buffer should be created
-//          ES_WINDOW_POST_SUB_BUFFER_SUPPORTED - specifies that EGL_POST_SUB_BUFFER_NV is supported.
-//
-GLboolean ESUTIL_API esCreateWindow ( ESContext *esContext, LPCTSTR title, GLint width, GLint height, GLuint flags )
-{
-   EGLint configAttribList[] =
-   {
-       EGL_RED_SIZE,       5,
-       EGL_GREEN_SIZE,     6,
-       EGL_BLUE_SIZE,      5,
-       EGL_ALPHA_SIZE,     (flags & ES_WINDOW_ALPHA) ? 8 : EGL_DONT_CARE,
-       EGL_DEPTH_SIZE,     (flags & ES_WINDOW_DEPTH) ? 8 : EGL_DONT_CARE,
-       EGL_STENCIL_SIZE,   (flags & ES_WINDOW_STENCIL) ? 8 : EGL_DONT_CARE,
-       EGL_SAMPLE_BUFFERS, (flags & ES_WINDOW_MULTISAMPLE) ? 1 : 0,
-       EGL_NONE
-   };
-   EGLint surfaceAttribList[] =
-   {
-       EGL_POST_SUB_BUFFER_SUPPORTED_NV, flags & (ES_WINDOW_POST_SUB_BUFFER_SUPPORTED) ? EGL_TRUE : EGL_FALSE,
-       EGL_NONE, EGL_NONE
-   };
-   
-   if ( esContext == NULL )
-   {
-      return GL_FALSE;
-   }
-
-   esContext->width = width;
-   esContext->height = height;
-
-   if ( !WinCreate ( esContext, title) )
-   {
-      return GL_FALSE;
-   }
-
-  
-   if ( !CreateEGLContext ( esContext->hWnd,
-                            &esContext->eglDisplay,
-                            &esContext->eglContext,
-                            &esContext->eglSurface,
-                            configAttribList,
-                            surfaceAttribList ) )
-   {
-      return GL_FALSE;
-   }
-   
-
-   return GL_TRUE;
-}
-
-///
-//  esMainLoop()
-//
-//    Start the main loop for the OpenGL ES application
-//
-void ESUTIL_API esMainLoop ( ESContext *esContext )
-{
-   WinLoop ( esContext );
-}
-
-
-///
-//  esRegisterDrawFunc()
-//
-void ESUTIL_API esRegisterDrawFunc ( ESContext *esContext, void (ESCALLBACK *drawFunc) (ESContext* ) )
-{
-   esContext->drawFunc = drawFunc;
-}
-
-
-///
-//  esRegisterUpdateFunc()
-//
-void ESUTIL_API esRegisterUpdateFunc ( ESContext *esContext, void (ESCALLBACK *updateFunc) ( ESContext*, float ) )
-{
-   esContext->updateFunc = updateFunc;
-}
-
-
-///
-//  esRegisterKeyFunc()
-//
-void ESUTIL_API esRegisterKeyFunc ( ESContext *esContext,
-                                    void (ESCALLBACK *keyFunc) (ESContext*, unsigned char, int, int ) )
-{
-   esContext->keyFunc = keyFunc;
-}
-
-
-///
-// esLogMessage()
-//
-//    Log an error message to the debug output for the platform
-//
-void ESUTIL_API esLogMessage ( const char *formatStr, ... )
-{
-    va_list params;
-    char buf[BUFSIZ];
-
-    va_start ( params, formatStr );
-    vsprintf_s ( buf, sizeof(buf),  formatStr, params );
-    
-    printf ( "%s", buf );
-    
-    va_end ( params );
-}
-
-
-///
-// esLoadTGA()
-//
-//    Loads a 24-bit TGA image from a file
-//
-char* ESUTIL_API esLoadTGA ( char *fileName, int *width, int *height )
-{
-   char *buffer;
-
-   if ( WinTGALoad ( fileName, &buffer, width, height ) )
-   {
-      return buffer;
-   }
-
-   return NULL;
-}
deleted file mode 100644
--- a/gfx/angle/samples/gles2_book/Common/esUtil.h
+++ /dev/null
@@ -1,297 +0,0 @@
-//
-// Book:      OpenGL(R) ES 2.0 Programming Guide
-// Authors:   Aaftab Munshi, Dan Ginsburg, Dave Shreiner
-// ISBN-10:   0321502795
-// ISBN-13:   9780321502797
-// Publisher: Addison-Wesley Professional
-// URLs:      http://safari.informit.com/9780321563835
-//            http://www.opengles-book.com
-//
-
-//
-/// \file ESUtil.h
-/// \brief A utility library for OpenGL ES.  This library provides a
-///        basic common framework for the example applications in the
-///        OpenGL ES 2.0 Programming Guide.
-//
-#ifndef ESUTIL_H
-#define ESUTIL_H
-
-///
-//  Includes
-//
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-
-#ifdef __cplusplus
-
-extern "C" {
-#endif
-
-   
-///
-//  Macros
-//
-#define ESUTIL_API  __cdecl
-#define ESCALLBACK  __cdecl
-
-
-/// esCreateWindow flag - RGB color buffer
-#define ES_WINDOW_RGB           0
-/// esCreateWindow flag - ALPHA color buffer
-#define ES_WINDOW_ALPHA         1 
-/// esCreateWindow flag - depth buffer
-#define ES_WINDOW_DEPTH         2 
-/// esCreateWindow flag - stencil buffer
-#define ES_WINDOW_STENCIL       4
-/// esCreateWindow flag - multi-sample buffer
-#define ES_WINDOW_MULTISAMPLE   8
-/// esCreateWindow flag - EGL_POST_SUB_BUFFER_NV supported.
-#define ES_WINDOW_POST_SUB_BUFFER_SUPPORTED 16
-
-///
-// Types
-//
-
-typedef struct
-{
-    GLfloat   m[4][4];
-} ESMatrix;
-
-typedef struct
-{
-   /// Put your user data here...
-   void*       userData;
-
-   /// Window width
-   GLint       width;
-
-   /// Window height
-   GLint       height;
-
-   /// Window handle
-   EGLNativeWindowType  hWnd;
-
-   /// EGL display
-   EGLDisplay  eglDisplay;
-      
-   /// EGL context
-   EGLContext  eglContext;
-
-   /// EGL surface
-   EGLSurface  eglSurface;
-
-   /// Callbacks
-   void (ESCALLBACK *drawFunc) ( void* );
-   void (ESCALLBACK *keyFunc) ( void*, unsigned char, int, int );
-   void (ESCALLBACK *updateFunc) ( void*, float deltaTime );
-} ESContext;
-
-
-///
-//  Extensions
-//
-
-extern PFNEGLCREATEIMAGEKHRPROC eglCreateImageKHR;
-extern PFNEGLDESTROYIMAGEKHRPROC eglDestroyImageKHR;
-
-extern PFNEGLPOSTSUBBUFFERNVPROC eglPostSubBufferNV;
-
-extern PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glEGLImageTargetTexture2DOES;
-
-extern PFNGLDELETEFENCESNVPROC glDeleteFencesNV;
-extern PFNGLGENFENCESNVPROC glGenFencesNV;
-extern PFNGLGETFENCEIVNVPROC glGetFenceivNV;
-extern PFNGLISFENCENVPROC glIsFenceNV;
-extern PFNGLFINISHFENCENVPROC glFinishFenceNV;
-extern PFNGLSETFENCENVPROC glSetFenceNV;
-extern PFNGLTESTFENCENVPROC glTestFenceNV;
-
-///
-//  Public Functions
-//
-
-//
-///
-/// \brief Initialize ES framework context.  This must be called before calling any other functions.
-/// \param esContext Application context
-//
-void ESUTIL_API esInitContext ( ESContext *esContext );
-
-//
-/// \brief Create a window with the specified parameters
-/// \param esContext Application context
-/// \param title Name for title bar of window
-/// \param width Width in pixels of window to create
-/// \param height Height in pixels of window to create
-/// \param flags Bitfield for the window creation flags 
-///         ES_WINDOW_RGB     - specifies that the color buffer should have R,G,B channels
-///         ES_WINDOW_ALPHA   - specifies that the color buffer should have alpha
-///         ES_WINDOW_DEPTH   - specifies that a depth buffer should be created
-///         ES_WINDOW_STENCIL - specifies that a stencil buffer should be created
-///         ES_WINDOW_MULTISAMPLE - specifies that a multi-sample buffer should be created
-///         ES_WINDOW_POST_SUB_BUFFER_SUPPORTED - specifies that EGL_POST_SUB_BUFFER_NV is supported.
-/// \return GL_TRUE if window creation is succesful, GL_FALSE otherwise
-GLboolean ESUTIL_API esCreateWindow ( ESContext *esContext, LPCTSTR title, GLint width, GLint height, GLuint flags );
-
-//
-/// \brief Start the main loop for the OpenGL ES application
-/// \param esContext Application context
-//
-void ESUTIL_API esMainLoop ( ESContext *esContext );
-
-//
-/// \brief Register a draw callback function to be used to render each frame
-/// \param esContext Application context
-/// \param drawFunc Draw callback function that will be used to render the scene
-//
-void ESUTIL_API esRegisterDrawFunc ( ESContext *esContext, void (ESCALLBACK *drawFunc) ( ESContext* ) );
-
-//
-/// \brief Register an update callback function to be used to update on each time step
-/// \param esContext Application context
-/// \param updateFunc Update callback function that will be used to render the scene
-//
-void ESUTIL_API esRegisterUpdateFunc ( ESContext *esContext, void (ESCALLBACK *updateFunc) ( ESContext*, float ) );
-
-//
-/// \brief Register an keyboard input processing callback function
-/// \param esContext Application context
-/// \param keyFunc Key callback function for application processing of keyboard input
-//
-void ESUTIL_API esRegisterKeyFunc ( ESContext *esContext, 
-                                    void (ESCALLBACK *drawFunc) ( ESContext*, unsigned char, int, int ) );
-//
-/// \brief Log a message to the debug output for the platform
-/// \param formatStr Format string for error log.  
-//
-void ESUTIL_API esLogMessage ( const char *formatStr, ... );
-
-//
-///
-/// \brief Load a shader, check for compile errors, print error messages to output log
-/// \param type Type of shader (GL_VERTEX_SHADER or GL_FRAGMENT_SHADER)
-/// \param shaderSrc Shader source string
-/// \return A new shader object on success, 0 on failure
-//
-GLuint ESUTIL_API esLoadShader ( GLenum type, const char *shaderSrc );
-
-//
-///
-/// \brief Load a vertex and fragment shader, create a program object, link program.
-///        Errors output to log.
-/// \param vertShaderSrc Vertex shader source code
-/// \param fragShaderSrc Fragment shader source code
-/// \return A new program object linked with the vertex/fragment shader pair, 0 on failure
-//
-GLuint ESUTIL_API esLoadProgram ( const char *vertShaderSrc, const char *fragShaderSrc );
-
-
-//
-/// \brief Generates geometry for a sphere.  Allocates memory for the vertex data and stores 
-///        the results in the arrays.  Generate index list for a TRIANGLE_STRIP
-/// \param numSlices The number of slices in the sphere
-/// \param vertices If not NULL, will contain array of float3 positions
-/// \param normals If not NULL, will contain array of float3 normals
-/// \param texCoords If not NULL, will contain array of float2 texCoords
-/// \param indices If not NULL, will contain the array of indices for the triangle strip
-/// \return The number of indices required for rendering the buffers (the number of indices stored in the indices array
-///         if it is not NULL ) as a GL_TRIANGLE_STRIP
-//
-int ESUTIL_API esGenSphere ( int numSlices, float radius, GLfloat **vertices, GLfloat **normals, 
-                             GLfloat **texCoords, GLushort **indices );
-
-//
-/// \brief Generates geometry for a cube.  Allocates memory for the vertex data and stores 
-///        the results in the arrays.  Generate index list for a TRIANGLES
-/// \param scale The size of the cube, use 1.0 for a unit cube.
-/// \param vertices If not NULL, will contain array of float3 positions
-/// \param normals If not NULL, will contain array of float3 normals
-/// \param texCoords If not NULL, will contain array of float2 texCoords
-/// \param indices If not NULL, will contain the array of indices for the triangle strip
-/// \return The number of indices required for rendering the buffers (the number of indices stored in the indices array
-///         if it is not NULL ) as a GL_TRIANGLES
-//
-int ESUTIL_API esGenCube ( float scale, GLfloat **vertices, GLfloat **normals, 
-                           GLfloat **texCoords, GLushort **indices );
-
-//
-/// \brief Loads a 24-bit TGA image from a file
-/// \param fileName Name of the file on disk
-/// \param width Width of loaded image in pixels
-/// \param height Height of loaded image in pixels
-///  \return Pointer to loaded image.  NULL on failure. 
-//
-char* ESUTIL_API esLoadTGA ( char *fileName, int *width, int *height );
-
-
-//
-/// \brief multiply matrix specified by result with a scaling matrix and return new matrix in result
-/// \param result Specifies the input matrix.  Scaled matrix is returned in result.
-/// \param sx, sy, sz Scale factors along the x, y and z axes respectively
-//
-void ESUTIL_API esScale(ESMatrix *result, GLfloat sx, GLfloat sy, GLfloat sz);
-
-//
-/// \brief multiply matrix specified by result with a translation matrix and return new matrix in result
-/// \param result Specifies the input matrix.  Translated matrix is returned in result.
-/// \param tx, ty, tz Scale factors along the x, y and z axes respectively
-//
-void ESUTIL_API esTranslate(ESMatrix *result, GLfloat tx, GLfloat ty, GLfloat tz);
-
-//
-/// \brief multiply matrix specified by result with a rotation matrix and return new matrix in result
-/// \param result Specifies the input matrix.  Rotated matrix is returned in result.
-/// \param angle Specifies the angle of rotation, in degrees.
-/// \param x, y, z Specify the x, y and z coordinates of a vector, respectively
-//
-void ESUTIL_API esRotate(ESMatrix *result, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
-
-//
-// \brief multiply matrix specified by result with a perspective matrix and return new matrix in result
-/// \param result Specifies the input matrix.  new matrix is returned in result.
-/// \param left, right Coordinates for the left and right vertical clipping planes
-/// \param bottom, top Coordinates for the bottom and top horizontal clipping planes
-/// \param nearZ, farZ Distances to the near and far depth clipping planes.  Both distances must be positive.
-//
-void ESUTIL_API esFrustum(ESMatrix *result, float left, float right, float bottom, float top, float nearZ, float farZ);
-
-//
-/// \brief multiply matrix specified by result with a perspective matrix and return new matrix in result
-/// \param result Specifies the input matrix.  new matrix is returned in result.
-/// \param fovy Field of view y angle in degrees
-/// \param aspect Aspect ratio of screen
-/// \param nearZ Near plane distance
-/// \param farZ Far plane distance
-//
-void ESUTIL_API esPerspective(ESMatrix *result, float fovy, float aspect, float nearZ, float farZ);
-
-//
-/// \brief multiply matrix specified by result with a perspective matrix and return new matrix in result
-/// \param result Specifies the input matrix.  new matrix is returned in result.
-/// \param left, right Coordinates for the left and right vertical clipping planes
-/// \param bottom, top Coordinates for the bottom and top horizontal clipping planes
-/// \param nearZ, farZ Distances to the near and far depth clipping planes.  These values are negative if plane is behind the viewer
-//
-void ESUTIL_API esOrtho(ESMatrix *result, float left, float right, float bottom, float top, float nearZ, float farZ);
-
-//
-/// \brief perform the following operation - result matrix = srcA matrix * srcB matrix
-/// \param result Returns multiplied matrix
-/// \param srcA, srcB Input matrices to be multiplied
-//
-void ESUTIL_API esMatrixMultiply(ESMatrix *result, ESMatrix *srcA, ESMatrix *srcB);
-
-//
-//// \brief return an indentity matrix 
-//// \param result returns identity matrix
-//
-void ESUTIL_API esMatrixLoadIdentity(ESMatrix *result);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ESUTIL_H
deleted file mode 100644
--- a/gfx/angle/samples/gles2_book/Common/esUtil.vcproj
+++ /dev/null
@@ -1,190 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="esUtil"
-	ProjectGUID="{47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}"
-	RootNamespace="esUtil"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="4"
-			CharacterSet="0"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="./;../../../include"
-				PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
-				MinimalRebuild="true"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="1"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="4"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="4"
-			CharacterSet="0"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="./;../../../include"
-				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
-				RuntimeLibrary="0"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLibrarianTool"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="Win32"
-			>
-			<File
-				RelativePath=".\Win32\esUtil_TGA.c"
-				>
-			</File>
-			<File
-				RelativePath=".\esUtil_win.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Win32\esUtil_win32.c"
-				>
-			</File>
-		</Filter>
-		<Filter
-			Name="Common"
-			>
-			<File
-				RelativePath=".\esShader.c"
-				>
-			</File>
-			<File
-				RelativePath=".\esShapes.c"
-				>
-			</File>
-			<File
-				RelativePath=".\esTransform.c"
-				>
-			</File>
-			<File
-				RelativePath=".\esUtil.c"
-				>
-			</File>
-			<File
-				RelativePath=".\esUtil.h"
-				>
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
deleted file mode 100644
--- a/gfx/angle/samples/gles2_book/Common/esUtil_win.h
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// Book:      OpenGL(R) ES 2.0 Programming Guide
-// Authors:   Aaftab Munshi, Dan Ginsburg, Dave Shreiner
-// ISBN-10:   0321502795
-// ISBN-13:   9780321502797
-// Publisher: Addison-Wesley Professional
-// URLs:      http://safari.informit.com/9780321563835
-//            http://www.opengles-book.com
-//
-
-// esUtil_win.h
-//
-//   API-neutral interface for creating windows.  Implementation needs to be provided per-platform.
-
-#ifndef ESUTIL_WIN_H
-#define ESUTIL_WIN_H
-
-///
-//  Includes
-//
-
-#ifdef __cplusplus
-
-extern "C" {
-#endif
-
-   
-///
-//  Macros
-//
-
-///
-// Types
-//
-
-///
-//  Public Functions
-//
-
-///
-//  WinCreate()
-//
-//      Create Win32 instance and window
-//
-GLboolean WinCreate ( ESContext *esContext, LPCTSTR title );
-
-///
-//  WinLoop()
-//
-//      Start main windows loop
-//
-void WinLoop ( ESContext *esContext );
-
-///
-//  WinTGALoad()
-//    
-//      TGA loader win32 implementation
-//
-int WinTGALoad ( const char *fileName, char **buffer, int *width, int *height );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ESUTIL_WIN_H
deleted file mode 100644
--- a/gfx/angle/samples/gles2_book/Hello_Triangle/Hello_Triangle.c
+++ /dev/null
@@ -1,194 +0,0 @@
-//
-// Book:      OpenGL(R) ES 2.0 Programming Guide
-// Authors:   Aaftab Munshi, Dan Ginsburg, Dave Shreiner
-// ISBN-10:   0321502795
-// ISBN-13:   9780321502797
-// Publisher: Addison-Wesley Professional
-// URLs:      http://safari.informit.com/9780321563835
-//            http://www.opengles-book.com
-//
-
-// Hello_Triangle.c
-//
-//    This is a simple example that draws a single triangle with
-//    a minimal vertex/fragment shader.  The purpose of this 
-//    example is to demonstrate the basic concepts of 
-//    OpenGL ES 2.0 rendering.
-#include <stdlib.h>
-#include "esUtil.h"
-
-typedef struct
-{
-   // Handle to a program object
-   GLuint programObject;
-
-} UserData;
-
-///
-// Create a shader object, load the shader source, and
-// compile the shader.
-//
-GLuint LoadShader ( GLenum type, const char *shaderSrc )
-{
-   GLuint shader;
-   GLint compiled;
-   
-   // Create the shader object
-   shader = glCreateShader ( type );
-
-   if ( shader == 0 )
-   	return 0;
-
-   // Load the shader source
-   glShaderSource ( shader, 1, &shaderSrc, NULL );
-   
-   // Compile the shader
-   glCompileShader ( shader );
-
-   // Check the compile status
-   glGetShaderiv ( shader, GL_COMPILE_STATUS, &compiled );
-
-   if ( !compiled ) 
-   {
-      GLint infoLen = 0;
-
-      glGetShaderiv ( shader, GL_INFO_LOG_LENGTH, &infoLen );
-      
-      if ( infoLen > 1 )
-      {
-         char* infoLog = malloc (sizeof(char) * infoLen );
-
-         glGetShaderInfoLog ( shader, infoLen, NULL, infoLog );
-         esLogMessage ( "Error compiling shader:\n%s\n", infoLog );            
-         
-         free ( infoLog );
-      }
-
-      glDeleteShader ( shader );
-      return 0;
-   }
-
-   return shader;
-
-}
-
-///
-// Initialize the shader and program object
-//
-int Init ( ESContext *esContext )
-{
-   UserData *userData = esContext->userData;
-   GLbyte vShaderStr[] =  
-      "attribute vec4 vPosition;    \n"
-      "void main()                  \n"
-      "{                            \n"
-      "   gl_Position = vPosition;  \n"
-      "}                            \n";
-   
-   GLbyte fShaderStr[] =  
-      "precision mediump float;\n"\
-      "void main()                                  \n"
-      "{                                            \n"
-      "  gl_FragColor = vec4 ( 1.0, 0.0, 0.0, 1.0 );\n"
-      "}                                            \n";
-
-   GLuint vertexShader;
-   GLuint fragmentShader;
-   GLuint programObject;
-   GLint linked;
-
-   // Load the vertex/fragment shaders
-   vertexShader = LoadShader ( GL_VERTEX_SHADER, vShaderStr );
-   fragmentShader = LoadShader ( GL_FRAGMENT_SHADER, fShaderStr );
-
-   // Create the program object
-   programObject = glCreateProgram ( );
-   
-   if ( programObject == 0 )
-      return 0;
-
-   glAttachShader ( programObject, vertexShader );
-   glAttachShader ( programObject, fragmentShader );
-
-   // Bind vPosition to attribute 0   
-   glBindAttribLocation ( programObject, 0, "vPosition" );
-
-   // Link the program
-   glLinkProgram ( programObject );
-
-   // Check the link status
-   glGetProgramiv ( programObject, GL_LINK_STATUS, &linked );
-
-   if ( !linked ) 
-   {
-      GLint infoLen = 0;
-
-      glGetProgramiv ( programObject, GL_INFO_LOG_LENGTH, &infoLen );
-      
-      if ( infoLen > 1 )
-      {
-         char* infoLog = malloc (sizeof(char) * infoLen );
-
-         glGetProgramInfoLog ( programObject, infoLen, NULL, infoLog );
-         esLogMessage ( "Error linking program:\n%s\n", infoLog );            
-         
-         free ( infoLog );
-      }
-
-      glDeleteProgram ( programObject );
-      return FALSE;
-   }
-
-   // Store the program object
-   userData->programObject = programObject;
-
-   glClearColor ( 0.0f, 0.0f, 0.0f, 0.0f );
-   return TRUE;
-}
-
-///
-// Draw a triangle using the shader pair created in Init()
-//
-void Draw ( ESContext *esContext )
-{
-   UserData *userData = esContext->userData;
-   GLfloat vVertices[] = {  0.0f,  0.5f, 0.0f, 
-                           -0.5f, -0.5f, 0.0f,
-                            0.5f, -0.5f, 0.0f };
-      
-   // Set the viewport
-   glViewport ( 0, 0, esContext->width, esContext->height );
-   
-   // Clear the color buffer
-   glClear ( GL_COLOR_BUFFER_BIT );
-
-   // Use the program object
-   glUseProgram ( userData->programObject );
-
-   // Load the vertex data
-   glVertexAttribPointer ( 0, 3, GL_FLOAT, GL_FALSE, 0, vVertices );
-   glEnableVertexAttribArray ( 0 );
-
-   glDrawArrays ( GL_TRIANGLES, 0, 3 );
-
-   eglSwapBuffers ( esContext->eglDisplay, esContext->eglSurface );
-}
-
-
-int main ( int argc, char *argv[] )
-{
-   ESContext esContext;
-   UserData  userData;
-
-   esInitContext ( &esContext );
-   esContext.userData = &userData;
-
-   esCreateWindow ( &esContext, TEXT("Hello Triangle"), 320, 240, ES_WINDOW_RGB );
-   
-   if ( !Init ( &esContext ) )
-      return 0;
-
-   esRegisterDrawFunc ( &esContext, Draw );
-   
-   esMainLoop ( &esContext );
-}
deleted file mode 100644
--- a/gfx/angle/samples/gles2_book/Hello_Triangle/Hello_Triangle.vcproj
+++ /dev/null
@@ -1,182 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="Hello_Triangle"
-	ProjectGUID="{8278251F-6C1F-4D80-8499-FA7B590FAFE6}"
-	RootNamespace="Hello_Triangle"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="0"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../Common;../../../include"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
-				MinimalRebuild="true"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="1"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				DebugInformationFormat="4"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="2"
-				AdditionalLibraryDirectories=""
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-				EmbedManifest="true"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="0"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../Common;../../../include"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
-				RuntimeLibrary="0"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath=".\Hello_Triangle.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
deleted file mode 100644
--- a/gfx/angle/samples/gles2_book/MipMap2D/MipMap2D.c
+++ /dev/null
@@ -1,346 +0,0 @@
-//
-// Book:      OpenGL(R) ES 2.0 Programming Guide
-// Authors:   Aaftab Munshi, Dan Ginsburg, Dave Shreiner
-// ISBN-10:   0321502795
-// ISBN-13:   9780321502797
-// Publisher: Addison-Wesley Professional
-// URLs:      http://safari.informit.com/9780321563835
-//            http://www.opengles-book.com
-//
-
-// MipMap2D.c
-//
-//    This is a simple example that demonstrates generating a mipmap chain
-//    and rendering with it
-//
-#include <stdlib.h>
-#include "esUtil.h"
-
-typedef struct
-{
-   // Handle to a program object
-   GLuint programObject;
-
-   // Attribute locations
-   GLint  positionLoc;
-   GLint  texCoordLoc;
-
-   // Sampler location
-   GLint samplerLoc;
-
-   // Offset location
-   GLint offsetLoc;
-
-   // Texture handle
-   GLuint textureId;
-
-} UserData;
-
-
-///
-//  From an RGB8 source image, generate the next level mipmap
-//
-GLboolean GenMipMap2D( GLubyte *src, GLubyte **dst, int srcWidth, int srcHeight, int *dstWidth, int *dstHeight )
-{
-   int x,
-       y;
-   int texelSize = 3;
-
-   *dstWidth = srcWidth / 2;
-   if ( *dstWidth <= 0 )
-      *dstWidth = 1;
-
-   *dstHeight = srcHeight / 2;
-   if ( *dstHeight <= 0 )
-      *dstHeight = 1;
-
-   *dst = malloc ( sizeof(GLubyte) * texelSize * (*dstWidth) * (*dstHeight) );
-   if ( *dst == NULL )
-      return GL_FALSE;
-
-   for ( y = 0; y < *dstHeight; y++ )
-   {
-      for( x = 0; x < *dstWidth; x++ )
-      {
-         int srcIndex[4];
-         float r = 0.0f,
-               g = 0.0f,
-               b = 0.0f;
-         int sample;
-
-         // Compute the offsets for 2x2 grid of pixels in previous
-         // image to perform box filter
-         srcIndex[0] = 
-            (((y * 2) * srcWidth) + (x * 2)) * texelSize;
-         srcIndex[1] = 
-            (((y * 2) * srcWidth) + (x * 2 + 1)) * texelSize; 
-         srcIndex[2] = 
-            ((((y * 2) + 1) * srcWidth) + (x * 2)) * texelSize;
-         srcIndex[3] = 
-            ((((y * 2) + 1) * srcWidth) + (x * 2 + 1)) * texelSize;
-
-         // Sum all pixels
-         for ( sample = 0; sample < 4; sample++ )
-         {
-            r += src[srcIndex[sample]];
-            g += src[srcIndex[sample] + 1];
-            b += src[srcIndex[sample] + 2];
-         }
-
-         // Average results
-         r /= 4.0;
-         g /= 4.0;
-         b /= 4.0;
-
-         // Store resulting pixels
-         (*dst)[ ( y * (*dstWidth) + x ) * texelSize ] = (GLubyte)( r );
-         (*dst)[ ( y * (*dstWidth) + x ) * texelSize + 1] = (GLubyte)( g );
-         (*dst)[ ( y * (*dstWidth) + x ) * texelSize + 2] = (GLubyte)( b );
-      }
-   }
-
-   return GL_TRUE;
-}
-
-///
-//  Generate an RGB8 checkerboard image
-//
-GLubyte* GenCheckImage( int width, int height, int checkSize )
-{
-   int x,
-       y;
-   GLubyte *pixels = malloc( width * height * 3 );
-   
-   if ( pixels == NULL )
-      return NULL;
-
-   for ( y = 0; y < height; y++ )
-      for ( x = 0; x < width; x++ )
-      {
-         GLubyte rColor = 0;
-         GLubyte bColor = 0;
-
-         if ( ( x / checkSize ) % 2 == 0 )
-         {
-            rColor = 255 * ( ( y / checkSize ) % 2 );
-            bColor = 255 * ( 1 - ( ( y / checkSize ) % 2 ) );
-         }
-         else
-         {
-            bColor = 255 * ( ( y / checkSize ) % 2 );
-            rColor = 255 * ( 1 - ( ( y / checkSize ) % 2 ) );
-         }
-
-         pixels[(y * height + x) * 3] = rColor;
-         pixels[(y * height + x) * 3 + 1] = 0;
-         pixels[(y * height + x) * 3 + 2] = bColor; 
-      } 
-
-   return pixels;
-}
-
-///
-// Create a mipmapped 2D texture image 
-//
-GLuint CreateMipMappedTexture2D( )
-{
-   // Texture object handle
-   GLuint textureId;
-   int    width = 256,
-          height = 256;
-   int    level;
-   GLubyte *pixels;
-   GLubyte *prevImage;
-   GLubyte *newImage = NULL;
-      
-   pixels = GenCheckImage( width, height, 8 );
-   if ( pixels == NULL )
-      return 0;
-
-   // Generate a texture object
-   glGenTextures ( 1, &textureId );
-
-   // Bind the texture object
-   glBindTexture ( GL_TEXTURE_2D, textureId );
-
-   // Load mipmap level 0
-   glTexImage2D ( GL_TEXTURE_2D, 0, GL_RGB, width, height, 
-                  0, GL_RGB, GL_UNSIGNED_BYTE, pixels );
-   
-   level = 1;
-   prevImage = &pixels[0];
-   
-   while ( width > 1 && height > 1 )
-   {
-      int newWidth,
-          newHeight;
-
-      // Generate the next mipmap level
-      GenMipMap2D( prevImage, &newImage, width, height, 
-                   &newWidth, &newHeight );
-
-      // Load the mipmap level
-      glTexImage2D( GL_TEXTURE_2D, level, GL_RGB, 
-                    newWidth, newHeight, 0, GL_RGB,
-                    GL_UNSIGNED_BYTE, newImage );
-
-      // Free the previous image
-      free ( prevImage );
-
-      // Set the previous image for the next iteration
-      prevImage = newImage;
-      level++;
-
-      // Half the width and height
-      width = newWidth;
-      height = newHeight;
-   }
-
-   free ( newImage );
-
-   // Set the filtering mode
-   glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST );
-   glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
-
-   return textureId;
-
-}
-
-
-///
-// Initialize the shader and program object
-//
-int Init ( ESContext *esContext )
-{
-   UserData *userData = esContext->userData;
-   GLbyte vShaderStr[] =
-      "uniform float u_offset;      \n"
-      "attribute vec4 a_position;   \n"
-      "attribute vec2 a_texCoord;   \n"
-      "varying vec2 v_texCoord;     \n"
-      "void main()                  \n"
-      "{                            \n"
-      "   gl_Position = a_position; \n"
-      "   gl_Position.x += u_offset;\n"
-      "   v_texCoord = a_texCoord;  \n"
-      "}                            \n";
-   
-   GLbyte fShaderStr[] =  
-      "precision mediump float;                            \n"
-      "varying vec2 v_texCoord;                            \n"
-      "uniform sampler2D s_texture;                        \n"
-      "void main()                                         \n"
-      "{                                                   \n"
-      "  gl_FragColor = texture2D( s_texture, v_texCoord );\n"
-      "}                                                   \n";
-
-   // Load the shaders and get a linked program object
-   userData->programObject = esLoadProgram ( vShaderStr, fShaderStr );
-
-   // Get the attribute locations
-   userData->positionLoc = glGetAttribLocation ( userData->programObject, "a_position" );
-   userData->texCoordLoc = glGetAttribLocation ( userData->programObject, "a_texCoord" );
-   
-   // Get the sampler location
-   userData->samplerLoc = glGetUniformLocation ( userData->programObject, "s_texture" );
-
-   // Get the offset location
-   userData->offsetLoc = glGetUniformLocation( userData->programObject, "u_offset" );
-
-   // Load the texture
-   userData->textureId = CreateMipMappedTexture2D ();
-
-   glClearColor ( 0.0f, 0.0f, 0.0f, 0.0f );
-   return TRUE;
-}
-
-///
-// Draw a triangle using the shader pair created in Init()
-//
-void Draw ( ESContext *esContext )
-{
-   UserData *userData = esContext->userData;
-   GLfloat vVertices[] = { -0.5f,  0.5f, 0.0f, 1.5f,  // Position 0
-                            0.0f,  0.0f,              // TexCoord 0 
-                           -0.5f, -0.5f, 0.0f, 0.75f, // Position 1
-                            0.0f,  1.0f,              // TexCoord 1
-                            0.5f, -0.5f, 0.0f, 0.75f, // Position 2
-                            1.0f,  1.0f,              // TexCoord 2
-                            0.5f,  0.5f, 0.0f, 1.5f,  // Position 3
-                            1.0f,  0.0f               // TexCoord 3
-                         };
-   GLushort indices[] = { 0, 1, 2, 0, 2, 3 };
-      
-   // Set the viewport
-   glViewport ( 0, 0, esContext->width, esContext->height );
-   
-   // Clear the color buffer
-   glClear ( GL_COLOR_BUFFER_BIT );
-
-   // Use the program object
-   glUseProgram ( userData->programObject );
-
-   // Load the vertex position
-   glVertexAttribPointer ( userData->positionLoc, 4, GL_FLOAT, 
-                           GL_FALSE, 6 * sizeof(GLfloat), vVertices );
-   // Load the texture coordinate
-   glVertexAttribPointer ( userData->texCoordLoc, 2, GL_FLOAT,
-                           GL_FALSE, 6 * sizeof(GLfloat), &vVertices[4] );
-
-   glEnableVertexAttribArray ( userData->positionLoc );
-   glEnableVertexAttribArray ( userData->texCoordLoc );
-
-   // Bind the texture
-   glActiveTexture ( GL_TEXTURE0 );
-   glBindTexture ( GL_TEXTURE_2D, userData->textureId );
-
-   // Set the sampler texture unit to 0
-   glUniform1i ( userData->samplerLoc, 0 );
-
-   // Draw quad with nearest sampling
-   glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
-   glUniform1f ( userData->offsetLoc, -0.6f );   
-   glDrawElements ( GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, indices );
-
-   // Draw quad with trilinear filtering
-   glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR );
-   glUniform1f ( userData->offsetLoc, 0.6f );
-   glDrawElements ( GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, indices );
-
-   eglSwapBuffers ( esContext->eglDisplay, esContext->eglSurface );
-}
-
-///
-// Cleanup
-//
-void ShutDown ( ESContext *esContext )
-{
-   UserData *userData = esContext->userData;
-
-   // Delete texture object
-   glDeleteTextures ( 1, &userData->textureId );
-
-   // Delete program object
-   glDeleteProgram ( userData->programObject );
-}
-
-
-int main ( int argc, char *argv[] )
-{
-   ESContext esContext;
-   UserData  userData;
-
-   esInitContext ( &esContext );
-   esContext.userData = &userData;
-
-   esCreateWindow ( &esContext, TEXT("MipMap 2D"), 320, 240, ES_WINDOW_RGB );
-   
-   if ( !Init ( &esContext ) )
-      return 0;
-
-   esRegisterDrawFunc ( &esContext, Draw );
-   
-   esMainLoop ( &esContext );
-
-   ShutDown ( &esContext );
-}
deleted file mode 100644
--- a/gfx/angle/samples/gles2_book/MipMap2D/MipMap2D.vcproj
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="MipMap2D"
-	ProjectGUID="{4E69AC1F-1C7A-4D58-917C-E764FBEB489A}"
-	RootNamespace="MipMap2D"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="0"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../Common;../../../include"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
-				MinimalRebuild="true"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="1"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="4"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="2"
-				AdditionalLibraryDirectories=""
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-				EmbedManifest="true"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="0"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../Common;../../../include"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
-				RuntimeLibrary="0"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath=".\MipMap2D.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
deleted file mode 100644
--- a/gfx/angle/samples/gles2_book/MultiTexture/MultiTexture.c
+++ /dev/null
@@ -1,213 +0,0 @@
-//
-// Book:      OpenGL(R) ES 2.0 Programming Guide
-// Authors:   Aaftab Munshi, Dan Ginsburg, Dave Shreiner
-// ISBN-10:   0321502795
-// ISBN-13:   9780321502797
-// Publisher: Addison-Wesley Professional
-// URLs:      http://safari.informit.com/9780321563835
-//            http://www.opengles-book.com
-//
-
-// MultiTexture.c
-//
-//    This is an example that draws a quad with a basemap and
-//    lightmap to demonstrate multitexturing.
-//
-#include <stdlib.h>
-#include "esUtil.h"
-
-typedef struct
-{
-   // Handle to a program object
-   GLuint programObject;
-
-   // Attribute locations
-   GLint  positionLoc;
-   GLint  texCoordLoc;
-
-   // Sampler locations
-   GLint baseMapLoc;
-   GLint lightMapLoc;
-
-   // Texture handle
-   GLuint baseMapTexId;
-   GLuint lightMapTexId;
-
-} UserData;
-
-
-///
-// Load texture from disk
-//
-GLuint LoadTexture ( char *fileName )
-{
-   int width,
-       height;
-   char *buffer = esLoadTGA ( fileName, &width, &height );
-   GLuint texId;
-
-   if ( buffer == NULL )
-   {
-      esLogMessage ( "Error loading (%s) image.\n", fileName );
-      return 0;
-   }
-
-   glGenTextures ( 1, &texId );
-   glBindTexture ( GL_TEXTURE_2D, texId );
-
-   glTexImage2D ( GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, buffer );
-   glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
-   glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
-   glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
-   glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
-
-   free ( buffer );
-
-   return texId;
-}
-
-
-
-///
-// Initialize the shader and program object
-//
-int Init ( ESContext *esContext )
-{
-   UserData *userData = esContext->userData;
-   GLbyte vShaderStr[] =  
-      "attribute vec4 a_position;   \n"
-      "attribute vec2 a_texCoord;   \n"
-      "varying vec2 v_texCoord;     \n"
-      "void main()                  \n"
-      "{                            \n"
-      "   gl_Position = a_position; \n"
-      "   v_texCoord = a_texCoord;  \n"
-      "}                            \n";
-   
-   GLbyte fShaderStr[] =  
-      "precision mediump float;                            \n"
-      "varying vec2 v_texCoord;                            \n"
-      "uniform sampler2D s_baseMap;                        \n"
-      "uniform sampler2D s_lightMap;                       \n"
-      "void main()                                         \n"
-      "{                                                   \n"
-      "  vec4 baseColor;                                   \n"
-      "  vec4 lightColor;                                  \n"
-      "                                                    \n"
-      "  baseColor = texture2D( s_baseMap, v_texCoord );   \n"
-      "  lightColor = texture2D( s_lightMap, v_texCoord ); \n"
-      "  gl_FragColor = baseColor * (lightColor + 0.25);   \n"
-      "}                                                   \n";
-
-   // Load the shaders and get a linked program object
-   userData->programObject = esLoadProgram ( vShaderStr, fShaderStr );
-
-   // Get the attribute locations
-   userData->positionLoc = glGetAttribLocation ( userData->programObject, "a_position" );
-   userData->texCoordLoc = glGetAttribLocation ( userData->programObject, "a_texCoord" );
-   
-   // Get the sampler location
-   userData->baseMapLoc = glGetUniformLocation ( userData->programObject, "s_baseMap" );
-   userData->lightMapLoc = glGetUniformLocation ( userData->programObject, "s_lightMap" );
-
-   // Load the textures
-   userData->baseMapTexId = LoadTexture ( "basemap.tga" );
-   userData->lightMapTexId = LoadTexture ( "lightmap.tga" );
-
-   if ( userData->baseMapTexId == 0 || userData->lightMapTexId == 0 )
-      return FALSE;
-
-   glClearColor ( 0.0f, 0.0f, 0.0f, 0.0f );
-   return TRUE;
-}
-
-///
-// Draw a triangle using the shader pair created in Init()
-//
-void Draw ( ESContext *esContext )
-{
-   UserData *userData = esContext->userData;
-   GLfloat vVertices[] = { -0.5f,  0.5f, 0.0f,  // Position 0
-                            0.0f,  0.0f,        // TexCoord 0 
-                           -0.5f, -0.5f, 0.0f,  // Position 1
-                            0.0f,  1.0f,        // TexCoord 1
-                            0.5f, -0.5f, 0.0f,  // Position 2
-                            1.0f,  1.0f,        // TexCoord 2
-                            0.5f,  0.5f, 0.0f,  // Position 3
-                            1.0f,  0.0f         // TexCoord 3
-                         };
-   GLushort indices[] = { 0, 1, 2, 0, 2, 3 };
-      
-   // Set the viewport
-   glViewport ( 0, 0, esContext->width, esContext->height );
-   
-   // Clear the color buffer
-   glClear ( GL_COLOR_BUFFER_BIT );
-
-   // Use the program object
-   glUseProgram ( userData->programObject );
-
-   // Load the vertex position
-   glVertexAttribPointer ( userData->positionLoc, 3, GL_FLOAT, 
-                           GL_FALSE, 5 * sizeof(GLfloat), vVertices );
-   // Load the texture coordinate
-   glVertexAttribPointer ( userData->texCoordLoc, 2, GL_FLOAT,
-                           GL_FALSE, 5 * sizeof(GLfloat), &vVertices[3] );
-
-   glEnableVertexAttribArray ( userData->positionLoc );
-   glEnableVertexAttribArray ( userData->texCoordLoc );
-
-   // Bind the base map
-   glActiveTexture ( GL_TEXTURE0 );
-   glBindTexture ( GL_TEXTURE_2D, userData->baseMapTexId );
-
-   // Set the base map sampler to texture unit to 0
-   glUniform1i ( userData->baseMapLoc, 0 );
-
-   // Bind the light map
-   glActiveTexture ( GL_TEXTURE1 );
-   glBindTexture ( GL_TEXTURE_2D, userData->lightMapTexId );
-   
-   // Set the light map sampler to texture unit 1
-   glUniform1i ( userData->lightMapLoc, 1 );
-
-   glDrawElements ( GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, indices );
-
-   eglSwapBuffers ( esContext->eglDisplay, esContext->eglSurface );
-}
-
-///
-// Cleanup
-//
-void ShutDown ( ESContext *esContext )
-{
-   UserData *userData = esContext->userData;
-
-   // Delete texture object
-   glDeleteTextures ( 1, &userData->baseMapTexId );
-   glDeleteTextures ( 1, &userData->lightMapTexId );
-
-   // Delete program object
-   glDeleteProgram ( userData->programObject );
-}
-
-
-int main ( int argc, char *argv[] )
-{
-   ESContext esContext;
-   UserData  userData;
-
-   esInitContext ( &esContext );
-   esContext.userData = &userData;
-
-   esCreateWindow ( &esContext, TEXT("MultiTexture"), 320, 240, ES_WINDOW_RGB );
-   
-   if ( !Init ( &esContext ) )
-      return 0;
-
-   esRegisterDrawFunc ( &esContext, Draw );
-   
-   esMainLoop ( &esContext );
-
-   ShutDown ( &esContext );
-}
deleted file mode 100644
--- a/gfx/angle/samples/gles2_book/MultiTexture/MultiTexture.vcproj
+++ /dev/null
@@ -1,185 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="MultiTexture"
-	ProjectGUID="{120CFF94-ED4B-4C5B-9587-9E40889F15F7}"
-	RootNamespace="MultiTexture"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="0"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../Common;../../../include"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
-				MinimalRebuild="true"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="1"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="4"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="2"
-				AdditionalLibraryDirectories=""
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-				EmbedManifest="true"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				CommandLine="xcopy /D /Y basemap.tga &quot;$(OutDir)&quot;&#x0D;&#x0A;xcopy /D /Y lightmap.tga &quot;$(OutDir)&quot;&#x0D;&#x0A;"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="0"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../Common;../../../include"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
-				RuntimeLibrary="0"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				CommandLine="xcopy /D /Y basemap.tga &quot;$(OutDir)&quot;&#x0D;&#x0A;xcopy /D /Y lightmap.tga &quot;$(OutDir)&quot;&#x0D;&#x0A;"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath=".\MultiTexture.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
deleted file mode 100644
index 8acafae236cd36a7aca10bca4f044fed842d6894..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index d95b262837d7e694a000783e3d1f4ba96a695651..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/gfx/angle/samples/gles2_book/ParticleSystem/ParticleSystem.c
+++ /dev/null
@@ -1,294 +0,0 @@
-//
-// Book:      OpenGL(R) ES 2.0 Programming Guide
-// Authors:   Aaftab Munshi, Dan Ginsburg, Dave Shreiner
-// ISBN-10:   0321502795
-// ISBN-13:   9780321502797
-// Publisher: Addison-Wesley Professional
-// URLs:      http://safari.informit.com/9780321563835
-//            http://www.opengles-book.com
-//
-
-// ParticleSystem.c
-//
-//    This is an example that demonstrates rendering a particle system
-//    using a vertex shader and point sprites.
-//
-#include <stdlib.h>
-#include <math.h>
-#include "esUtil.h"
-
-#define NUM_PARTICLES	1000
-#define PARTICLE_SIZE   7
-
-typedef struct
-{
-   // Handle to a program object
-   GLuint programObject;
-
-   // Attribute locations
-   GLint  lifetimeLoc;
-   GLint  startPositionLoc;
-   GLint  endPositionLoc;
-   
-   // Uniform location
-   GLint timeLoc;
-   GLint colorLoc;
-   GLint centerPositionLoc;
-   GLint samplerLoc;
-
-   // Texture handle
-   GLuint textureId;
-
-   // Particle vertex data
-   float particleData[ NUM_PARTICLES * PARTICLE_SIZE ];
-
-   // Current time
-   float time;
-
-} UserData;
-
-///
-// Load texture from disk
-//
-GLuint LoadTexture ( char *fileName )
-{
-   int width,
-       height;
-   char *buffer = esLoadTGA ( fileName, &width, &height );
-   GLuint texId;
-
-   if ( buffer == NULL )
-   {
-      esLogMessage ( "Error loading (%s) image.\n", fileName );
-      return 0;
-   }
-
-   glGenTextures ( 1, &texId );
-   glBindTexture ( GL_TEXTURE_2D, texId );
-
-   glTexImage2D ( GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, buffer );
-   glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
-   glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
-   glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
-   glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
-
-   free ( buffer );
-
-   return texId;
-}
-
-
-///
-// Initialize the shader and program object
-//
-int Init ( ESContext *esContext )
-{
-   UserData *userData = esContext->userData;
-   int i;
-   
-   GLbyte vShaderStr[] =
-      "uniform float u_time;		                           \n"
-      "uniform vec3 u_centerPosition;                       \n"
-      "attribute float a_lifetime;                          \n"
-      "attribute vec3 a_startPosition;                      \n"
-      "attribute vec3 a_endPosition;                        \n"
-      "varying float v_lifetime;                            \n"
-      "void main()                                          \n"
-      "{                                                    \n"
-      "  if ( u_time <= a_lifetime )                        \n"
-      "  {                                                  \n"
-      "    gl_Position.xyz = a_startPosition +              \n"
-      "                      (u_time * a_endPosition);      \n"
-      "    gl_Position.xyz += u_centerPosition;             \n"
-      "    gl_Position.w = 1.0;                             \n"
-      "  }                                                  \n"
-      "  else                                               \n"
-      "     gl_Position = vec4( -1000, -1000, 0, 0 );       \n"
-      "  v_lifetime = 1.0 - ( u_time / a_lifetime );        \n"
-      "  v_lifetime = clamp ( v_lifetime, 0.0, 1.0 );       \n"
-      "  gl_PointSize = ( v_lifetime * v_lifetime ) * 40.0; \n"
-      "}";
-      
-   GLbyte fShaderStr[] =  
-      "precision mediump float;                             \n"
-      "uniform vec4 u_color;		                           \n"
-      "varying float v_lifetime;                            \n"
-      "uniform sampler2D s_texture;                         \n"
-      "void main()                                          \n"
-      "{                                                    \n"
-      "  vec4 texColor;                                     \n"
-      "  texColor = texture2D( s_texture, gl_PointCoord );  \n"
-      "  gl_FragColor = vec4( u_color ) * texColor;         \n"
-      "  gl_FragColor.a *= v_lifetime;                      \n"
-      "}                                                    \n";
-
-   // Load the shaders and get a linked program object
-   userData->programObject = esLoadProgram ( vShaderStr, fShaderStr );
-
-   // Get the attribute locations
-   userData->lifetimeLoc = glGetAttribLocation ( userData->programObject, "a_lifetime" );
-   userData->startPositionLoc = glGetAttribLocation ( userData->programObject, "a_startPosition" );
-   userData->endPositionLoc = glGetAttribLocation ( userData->programObject, "a_endPosition" );
-   
-   // Get the uniform locations
-   userData->timeLoc = glGetUniformLocation ( userData->programObject, "u_time" );
-   userData->centerPositionLoc = glGetUniformLocation ( userData->programObject, "u_centerPosition" );
-   userData->colorLoc = glGetUniformLocation ( userData->programObject, "u_color" );
-   userData->samplerLoc = glGetUniformLocation ( userData->programObject, "s_texture" );
-
-   glClearColor ( 0.0f, 0.0f, 0.0f, 0.0f );
-
-   // Fill in particle data array
-   srand ( 0 );
-   for ( i = 0; i < NUM_PARTICLES; i++ )
-   {
-      float *particleData = &userData->particleData[i * PARTICLE_SIZE];
-   
-      // Lifetime of particle
-      (*particleData++) = ( (float)(rand() % 10000) / 10000.0f );
-
-      // End position of particle
-      (*particleData++) = ( (float)(rand() % 10000) / 5000.0f ) - 1.0f;
-      (*particleData++) = ( (float)(rand() % 10000) / 5000.0f ) - 1.0f;
-      (*particleData++) = ( (float)(rand() % 10000) / 5000.0f ) - 1.0f;
-
-      // Start position of particle
-      (*particleData++) = ( (float)(rand() % 10000) / 40000.0f ) - 0.125f;
-      (*particleData++) = ( (float)(rand() % 10000) / 40000.0f ) - 0.125f;
-      (*particleData++) = ( (float)(rand() % 10000) / 40000.0f ) - 0.125f;
-
-   }
-
-   // Initialize time to cause reset on first update
-   userData->time = 1.0f;
-
-   userData->textureId = LoadTexture ( "smoke.tga" );
-   if ( userData->textureId <= 0 )
-   {
-      return FALSE;
-   }
-   
-   return TRUE;
-}
-
-///
-//  Update time-based variables
-//
-void Update ( ESContext *esContext, float deltaTime )
-{
-   UserData *userData = esContext->userData;
-  
-   userData->time += deltaTime;
-
-   if ( userData->time >= 1.0f )
-   {
-      float centerPos[3];
-      float color[4];
-
-      userData->time = 0.0f;
-
-      // Pick a new start location and color
-      centerPos[0] = ( (float)(rand() % 10000) / 10000.0f ) - 0.5f;
-      centerPos[1] = ( (float)(rand() % 10000) / 10000.0f ) - 0.5f;
-      centerPos[2] = ( (float)(rand() % 10000) / 10000.0f ) - 0.5f;
-      
-      glUniform3fv ( userData->centerPositionLoc, 1, &centerPos[0] );
-
-      // Random color
-      color[0] = ( (float)(rand() % 10000) / 20000.0f ) + 0.5f;
-      color[1] = ( (float)(rand() % 10000) / 20000.0f ) + 0.5f;
-      color[2] = ( (float)(rand() % 10000) / 20000.0f ) + 0.5f;
-      color[3] = 0.5;
-
-      glUniform4fv ( userData->colorLoc, 1, &color[0] );
-   }
-
-   // Load uniform time variable
-   glUniform1f ( userData->timeLoc, userData->time );
-}
-
-///
-// Draw a triangle using the shader pair created in Init()
-//
-void Draw ( ESContext *esContext )
-{
-   UserData *userData = esContext->userData;
-      
-   // Set the viewport
-   glViewport ( 0, 0, esContext->width, esContext->height );
-   
-   // Clear the color buffer
-   glClear ( GL_COLOR_BUFFER_BIT );
-
-   // Use the program object
-   glUseProgram ( userData->programObject );
-
-   // Load the vertex attributes
-   glVertexAttribPointer ( userData->lifetimeLoc, 1, GL_FLOAT, 
-                           GL_FALSE, PARTICLE_SIZE * sizeof(GLfloat), 
-                           userData->particleData );
-   
-   glVertexAttribPointer ( userData->endPositionLoc, 3, GL_FLOAT,
-                           GL_FALSE, PARTICLE_SIZE * sizeof(GLfloat),
-                           &userData->particleData[1] );
-
-   glVertexAttribPointer ( userData->startPositionLoc, 3, GL_FLOAT,
-                           GL_FALSE, PARTICLE_SIZE * sizeof(GLfloat),
-                           &userData->particleData[4] );
-
-   
-   glEnableVertexAttribArray ( userData->lifetimeLoc );
-   glEnableVertexAttribArray ( userData->endPositionLoc );
-   glEnableVertexAttribArray ( userData->startPositionLoc );
-   // Blend particles
-   glEnable ( GL_BLEND );
-   glBlendFunc ( GL_SRC_ALPHA, GL_ONE );
-
-   // Bind the texture
-   glActiveTexture ( GL_TEXTURE0 );
-   glBindTexture ( GL_TEXTURE_2D, userData->textureId );
-   glEnable ( GL_TEXTURE_2D );
-
-   // Set the sampler texture unit to 0
-   glUniform1i ( userData->samplerLoc, 0 );
-
-   glDrawArrays( GL_POINTS, 0, NUM_PARTICLES );
-   
-   eglSwapBuffers ( esContext->eglDisplay, esContext->eglSurface );
-}
-
-///
-// Cleanup
-//
-void ShutDown ( ESContext *esContext )
-{
-   UserData *userData = esContext->userData;
-
-   // Delete texture object
-   glDeleteTextures ( 1, &userData->textureId );
-
-   // Delete program object
-   glDeleteProgram ( userData->programObject );
-}
-
-
-int main ( int argc, char *argv[] )
-{
-   ESContext esContext;
-   UserData  userData;
-
-   esInitContext ( &esContext );
-   esContext.userData = &userData;
-
-   esCreateWindow ( &esContext, TEXT("ParticleSystem"), 640, 480, ES_WINDOW_RGB );
-   
-   if ( !Init ( &esContext ) )
-      return 0;
-
-   esRegisterDrawFunc ( &esContext, Draw );
-   esRegisterUpdateFunc ( &esContext, Update );
-   
-   esMainLoop ( &esContext );
-
-   ShutDown ( &esContext );
-}
deleted file mode 100644
--- a/gfx/angle/samples/gles2_book/ParticleSystem/ParticleSystem.vcproj
+++ /dev/null
@@ -1,185 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="ParticleSystem"
-	ProjectGUID="{B9E5BFFC-D843-4E0E-9D3E-23913A613473}"
-	RootNamespace="ParticleSystem"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="0"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../Common;../../../include"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
-				MinimalRebuild="true"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="1"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="4"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="2"
-				AdditionalLibraryDirectories=""
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-				EmbedManifest="true"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				CommandLine="xcopy /D /Y smoke.tga &quot;$(outDir)&quot;"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="0"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../Common;../../../include"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
-				RuntimeLibrary="0"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-				CommandLine="xcopy /D /Y smoke.tga &quot;$(outDir)&quot;"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath=".\ParticleSystem.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
deleted file mode 100644
index 06a0705c7e6713811ede783858a7f084dcd81a60..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/gfx/angle/samples/gles2_book/PostSubBuffer/PostSubBuffer.c
+++ /dev/null
@@ -1,204 +0,0 @@
-// Based on a sample from:
-//
-// Book:      OpenGL(R) ES 2.0 Programming Guide
-// Authors:   Aaftab Munshi, Dan Ginsburg, Dave Shreiner
-// ISBN-10:   0321502795
-// ISBN-13:   9780321502797
-// Publisher: Addison-Wesley Professional
-// URLs:      http://safari.informit.com/9780321563835
-//            http://www.opengles-book.com
-//
-
-// PostSubBuffer.c
-//
-//    This is a simple example that draws a rotating cube in perspective
-//    using a vertex shader to transform the object, posting only a subrectangle
-//    to the window surface.
-//
-#include <stdlib.h>
-#include "esUtil.h"
-
-#define WINDOW_WIDTH 320
-#define WINDOW_HEIGHT 240
-
-typedef struct
-{
-   // Handle to a program object
-   GLuint programObject;
-
-   // Attribute locations
-   GLint  positionLoc;
-
-   // Uniform locations
-   GLint  mvpLoc;
-   
-   // Vertex daata
-   GLfloat  *vertices;
-   GLushort   *indices;
-   int       numIndices;
-
-   // Rotation angle
-   GLfloat   angle;
-
-   // MVP matrix
-   ESMatrix  mvpMatrix;
-} UserData;
-
-///
-// Initialize the shader and program object
-//
-int Init ( ESContext *esContext )
-{
-   UserData *userData = esContext->userData;
-   GLbyte vShaderStr[] =  
-      "uniform mat4 u_mvpMatrix;                   \n"
-      "attribute vec4 a_position;                  \n"
-      "void main()                                 \n"
-      "{                                           \n"
-      "   gl_Position = u_mvpMatrix * a_position;  \n"
-      "}                                           \n";
-   
-   GLbyte fShaderStr[] =  
-      "precision mediump float;                            \n"
-      "void main()                                         \n"
-      "{                                                   \n"
-      "  gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );        \n"
-      "}                                                   \n";
-
-   // Load the shaders and get a linked program object
-   userData->programObject = esLoadProgram ( vShaderStr, fShaderStr );
-
-   // Get the attribute locations
-   userData->positionLoc = glGetAttribLocation ( userData->programObject, "a_position" );
-
-   // Get the uniform locations
-   userData->mvpLoc = glGetUniformLocation( userData->programObject, "u_mvpMatrix" );
-   
-   // Generate the vertex data
-   userData->numIndices = esGenCube( 1.0, &userData->vertices,
-                                     NULL, NULL, &userData->indices );
-   
-   // Starting rotation angle for the cube
-   userData->angle = 45.0f;
-
-   // Clear the whole window surface.
-   glClearColor ( 0.0f, 0.0f, 1.0f, 0.0f );
-   glClear ( GL_COLOR_BUFFER_BIT );
-   eglSwapBuffers ( esContext->eglDisplay, esContext->eglSurface );
-
-   glClearColor ( 0.0f, 0.0f, 0.0f, 0.0f );
-   return TRUE;
-}
-
-
-///
-// Update MVP matrix based on time
-//
-void Update ( ESContext *esContext, float deltaTime )
-{
-   UserData *userData = (UserData*) esContext->userData;
-   ESMatrix perspective;
-   ESMatrix modelview;
-   float    aspect;
-   
-   // Compute a rotation angle based on time to rotate the cube
-   userData->angle += ( deltaTime * 40.0f );
-   if( userData->angle >= 360.0f )
-      userData->angle -= 360.0f;
-
-   // Compute the window aspect ratio
-   aspect = (GLfloat) esContext->width / (GLfloat) esContext->height;
-   
-   // Generate a perspective matrix with a 60 degree FOV
-   esMatrixLoadIdentity( &perspective );
-   esPerspective( &perspective, 60.0f, aspect, 1.0f, 20.0f );
-
-   // Generate a model view matrix to rotate/translate the cube
-   esMatrixLoadIdentity( &modelview );
-
-   // Translate away from the viewer
-   esTranslate( &modelview, 0.0, 0.0, -2.0 );
-
-   // Rotate the cube
-   esRotate( &modelview, userData->angle, 1.0, 0.0, 1.0 );
-   
-   // Compute the final MVP by multiplying the 
-   // modevleiw and perspective matrices together
-   esMatrixMultiply( &userData->mvpMatrix, &modelview, &perspective );
-}
-
-///
-// Draw a triangle using the shader pair created in Init()
-//
-void Draw ( ESContext *esContext )
-{
-   UserData *userData = esContext->userData;
-   
-   // Set the viewport
-   glViewport ( 0, 0, esContext->width, esContext->height );
-   
-   
-   // Clear the color buffer
-   glClear ( GL_COLOR_BUFFER_BIT );
-
-   // Use the program object
-   glUseProgram ( userData->programObject );
-
-   // Load the vertex position
-   glVertexAttribPointer ( userData->positionLoc, 3, GL_FLOAT, 
-                           GL_FALSE, 3 * sizeof(GLfloat), userData->vertices );
-   
-   glEnableVertexAttribArray ( userData->positionLoc );
-   
-   
-   // Load the MVP matrix
-   glUniformMatrix4fv( userData->mvpLoc, 1, GL_FALSE, (GLfloat*) &userData->mvpMatrix.m[0][0] );
-   
-   // Draw the cube
-   glDrawElements ( GL_TRIANGLES, userData->numIndices, GL_UNSIGNED_SHORT, userData->indices );
-
-   eglPostSubBufferNV ( esContext->eglDisplay, esContext->eglSurface, 60, 60, WINDOW_WIDTH - 120, WINDOW_HEIGHT - 120 );
-}
-
-///
-// Cleanup
-//
-void ShutDown ( ESContext *esContext )
-{
-   UserData *userData = esContext->userData;
-
-   if ( userData->vertices != NULL )
-   {
-      free ( userData->vertices );
-   }
-
-   if ( userData->indices != NULL )
-   {
-      free ( userData->indices );
-   }
-
-   // Delete program object
-   glDeleteProgram ( userData->programObject );
-}
-
-
-int main ( int argc, char *argv[] )
-{
-   ESContext esContext;
-   UserData  userData;
-
-   esInitContext ( &esContext );
-   esContext.userData = &userData;
-
-   esCreateWindow ( &esContext, TEXT("Simple Vertex Shader"), WINDOW_WIDTH, WINDOW_HEIGHT, ES_WINDOW_RGB | ES_WINDOW_POST_SUB_BUFFER_SUPPORTED );
-   
-   if ( !Init ( &esContext ) )
-      return 0;
-
-   esRegisterDrawFunc ( &esContext, Draw );
-   esRegisterUpdateFunc ( &esContext, Update );
-   
-   esMainLoop ( &esContext );
-
-   ShutDown ( &esContext );
-}
deleted file mode 100644
--- a/gfx/angle/samples/gles2_book/PostSubBuffer/PostSubBuffer.vcproj
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="9.00"
-	Name="PostSubBuffer"
-	ProjectGUID="{667CE95F-5DD8-4495-8C18-5CA8A175B12D}"
-	RootNamespace="Simple_VertexShader"
-	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="0"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="../Common;../../../include"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
-				MinimalRebuild="true"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="1"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="4"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="2"
-				AdditionalLibraryDirectories=""
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-				EmbedManifest="true"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="0"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="../Common;../../../include"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
-				RuntimeLibrary="0"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				LinkIncremental="1"
-				AdditionalLibraryDirectories=""
-				GenerateDebugInformation="true"
-				SubSystem="1"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<File
-			RelativePath=".\PostSubBuffer.c"
-			>
-		</File>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>
deleted file mode 100644
--- a/gfx/angle/samples/gles2_book/Simple_Texture2D/Simple_Texture2D.c
+++ /dev/null
@@ -1,198 +0,0 @@
-//
-// Book:      OpenGL(R) ES 2.0 Programming Guide
-// Authors:   Aaftab Munshi, Dan Ginsburg, Dave Shreiner
-// ISBN-10:   0321502795
-// ISBN-13:   9780321502797
-// Publisher: Addison-Wesley Professional
-// URLs:      http://safari.informit.com/9780321563835
-//            http://www.opengles-book.com
-//
-
-// Simple_Texture2D.c
-//
-//    This is a simple example that draws a quad with a 2D
-//    texture image. The purpose of this example is to demonstrate 
-//    the basics of 2D texturing
-//
-#include <stdlib.h>
-#include "esUtil.h"
-
-typedef struct
-{
-   // Handle to a program object
-   GLuint programObject;
-
-   // Attribute locations
-   GLint  positionLoc;
-   GLint  texCoordLoc;
-
-   // Sampler location
-   GLint samplerLoc;
-
-   // Texture handle
-   GLuint textureId;
-
-} UserData;
-
-///
-// Create a simple 2x2 texture image with four different colors
-//
-GLuint CreateSimpleTexture2D( )
-{
-   // Texture object handle
-   GLuint textureId;
-   
-   // 2x2 Image, 3 bytes per pixel (R, G, B)
-   GLubyte pixels[4 * 3] =
-   {  
-      255,   0,   0, // Red
-        0, 255,   0, // Green
-        0,   0, 255, // Blue
-      255, 255,   0  // Yellow
-   };
-
-   // Use tightly packed data
-   glPixelStorei ( GL_UNPACK_ALIGNMENT, 1 );
-
-   // Generate a texture object
-   glGenTextures ( 1, &textureId );
-
-   // Bind the texture object
-   glBindTexture ( GL_TEXTURE_2D, textureId );
-
-   // Load the texture
-   glTexImage2D ( GL_TEXTURE_2D, 0, GL_RGB, 2, 2, 0, GL_RGB, GL_UNSIGNED_BYTE, pixels );
-
-   // Set the filtering mode
-   glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
-   glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
-
-   return textureId;
-
-}
-
-
-///
-// Initialize the shader and program object
-//
-int Init ( ESContext *esContext )
-{
-   UserData *userData = esContext->userData;
-   GLbyte vShaderStr[] =  
-      "attribute vec4 a_position;   \n"
-      "attribute vec2 a_texCoord;   \n"
-      "varying vec2 v_texCoord;     \n"
-      "void main()                  \n"
-      "{                            \n"
-      "   gl_Position = a_position; \n"
-      "   v_texCoord = a_texCoord;  \n"
-      "}                            \n";
-   
-   GLbyte fShaderStr[] =  
-      "precision mediump float;                            \n"
-      "varying vec2 v_texCoord;                            \n"
-      "uniform sampler2D s_texture;                        \n"
-      "void main()                                         \n"
-      "{                                                   \n"
-      "  gl_FragColor = texture2D( s_texture, v_texCoord );\n"
-      "}                                                   \n";
-
-   // Load the shaders and get a linked program object
-   userData->programObject = esLoadProgram ( vShaderStr, fShaderStr );
-
-   // Get the attribute locations
-   userData->positionLoc = glGetAttribLocation ( userData->programObject, "a_position" );
-   userData->texCoordLoc = glGetAttribLocation ( userData->programObject, "a_texCoord" );
-   
-   // Get the sampler location
-   userData->samplerLoc = glGetUniformLocation ( userData->programObject, "s_texture" );
-
-   // Load the texture
-   userData->textureId = CreateSimpleTexture2D ();
-
-   glClearColor ( 0.0f, 0.0f, 0.0f, 0.0f );
-   return TRUE;
-}
-
-///
-// Draw a triangle using the shader pair created in Init()
-//
-void Draw ( ESContext *esContext )
-{
-   UserData *userData = esContext->userData;
-   GLfloat vVertices[] = { -0.5f,  0.5f, 0.0f,  // Position 0
-                            0.0f,  0.0f,        // TexCoord 0 
-                           -0.5f, -0.5f, 0.0f,  // Position 1
-                            0.0f,  1.0f,        // TexCoord 1
-                            0.5f, -0.5f, 0.0f,  // Position 2
-                            1.0f,  1.0f,        // TexCoord 2
-                            0.5f,  0.5f, 0.0f,  // Position 3
-                            1.0f,  0.0f         // TexCoord 3
-                         };
-   GLushort indices[] = { 0, 1, 2, 0, 2, 3 };
-      
-   // Set the viewport
-   glViewport ( 0, 0, esContext->width, esContext->height );
-   
-   // Clear the color buffer
-   glClear ( GL_COLOR_BUFFER_BIT );
-
-   // Use the program object
-   glUseProgram ( userData->programObject );
-
-   // Load the vertex position
-   glVertexAttribPointer ( userData->positionLoc, 3, GL_FLOAT, 
-                           GL_FALSE, 5 * sizeof(GLfloat), vVertices );
-   // Load the texture coordinate
-   glVertexAttribPointer ( userData->texCoordLoc, 2, GL_FLOAT,
-                           GL_FALSE, 5 * sizeof(GLfloat), &vVertices[3] );
-
-   glEnableVertexAttribArray ( userData->positionLoc );
-   glEnableVertexAttribArray ( userData->texCoordLoc );
-
-   // Bind the texture
-   glActiveTexture ( GL_TEXTURE0 );
-   glBindTexture ( GL_TEXTURE_2D, userData->textureId );
-
-   // Set the sampler texture unit to 0
-   glUniform1i ( userData->samplerLoc, 0 );
-
-   glDrawElements ( GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, indices );
-
-   eglSwapBuffers ( esContext->eglDisplay, esContext->eglSurface );
-}
-
-///
-// Cleanup
-//
-void ShutDown ( ESContext *esContext )
-{
-   UserData *userData = esContext->userData;
-
-   // Delete texture object
-   glDeleteTextures ( 1, &userData->textureId );
-
-   // Delete program object
-   glDeleteProgram ( userData->programObject );
-}
-
-
-int main ( int argc, char *argv[] )
-{
-   ESContext esContext;
-   UserData  userData;
-
-   esInitContext ( &esContext );
-   esContext.userData = &userData;
-
-   esCreateWindow ( &esContext, TEXT("Simple Texture 2D"), 320, 240, ES_WINDOW_RGB );