Call addRef when creating a new Fence Sync object.

BUG=angle:728

Change-Id: Iafd838c3ceb1a88afd4d3b0994e8d841945df499
Reviewed-on: https://chromium-review.googlesource.com/213142
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Rename intermediate.h to Intermediate.h.

This was breaking the Linux build.

Change-Id: I8f63527cfa37ee774ea5d1e6eb0043a4c7ccc734
Reviewed-on: https://chromium-review.googlesource.com/213300
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Moved some validation back to Texture, unified all TextureImpl variants

BUG=angle:688
Change-Id: Ie2df18277c84345fceaa31d4f63f5cbbb47540c6
Reviewed-on: https://chromium-review.googlesource.com/211387
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Brandon Jones <bajones@chromium.org>
Add a getNamedVariable helper method to TParseContext.

This method will be useful in more than one place, since we need
to get a TType from an indentifier when parsing invariant
declarations.

BUG=angle:711

Change-Id: I1c1befbdcc93ea626428fb4e313b8c6326c158f6
Reviewed-on: https://chromium-review.googlesource.com/212937
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
Add a helper method to parse invariant declarations.

This pulls out more functionality from the grammar into simple
c++ source files.

BUG=angle:711

Change-Id: I19121d710dc1543585361cb53a0deb2ea0479db9
Reviewed-on: https://chromium-review.googlesource.com/212938
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
Only set declaration operator if not already set.

This allows us to return different operators from single
declarations, which will be useful for treating invariant
declarations as different operators.

BUG=angle:711

Change-Id: Id278b91854bbefe8e635380d7b27198198236fef
Reviewed-on: https://chromium-review.googlesource.com/212939
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
Add a util project to share between samples and tests.

This code shares the Window and EGL logic between the two
projects.

BUG=angle:730

Change-Id: I8940371226a8f7b02579c332f51679c4a5d0e2a5
Reviewed-on: https://chromium-review.googlesource.com/212799
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Make the sample app own the OS Window object.

This allows us to use OS Windows and EGL contexts differently
for different implementations - eg, tests and samples.

BUG=angle:730

Change-Id: I65e69fd829c3dbf2f1b406d90045bc296798ebb6
Reviewed-on: https://chromium-review.googlesource.com/213290
Reviewed-by: Brandon Jones <bajones@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Make the EGLDisplay a non-static member of ANGLETest.

We would create and destroy the display with every test, as it
was not part of the environment.

BUG=angle:730

Change-Id: Iae003f13c8e975ae57d3af2d74f9f058a560046f
Reviewed-on: https://chromium-review.googlesource.com/213291
Reviewed-by: Brandon Jones <bajones@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Fix "Reize" to "Re*s*izeWindow".

BUG=angle:730

Change-Id: I7d4e5a36cec2b3a5c61ae768ec4c816553031baf
Reviewed-on: https://chromium-review.googlesource.com/213292
Reviewed-by: Brandon Jones <bajones@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Split vertex translation into helper methods.

Refactoring patch only.

BUG=angle:571

Change-Id: I17e8c1eb80bdf7c3ec7cc4bad4e70e81590e4a89
Reviewed-on: https://chromium-review.googlesource.com/210644
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Use Range type for index ranges.

This compacts a lot of parameter passing. Refactoring patch only.

BUG=angle:571

Change-Id: Ic918478d0c6b81093bfea6154ce0f6bf1d2b5be2
Reviewed-on: https://chromium-review.googlesource.com/210645
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Prevent accessing more arguments than provided.

BUG=390111

Change-Id: Iecc2ac2354a82cca937a823e5c588c662264e36c
Reviewed-on: https://chromium-review.googlesource.com/213551
Tested-by: Nicolas Capens <capn@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Fix std140 UBO layouts.

A call to "prePadding" instaed of "prePaddingString" was confusing
the HLSL output engine.

A separate bug was causing HLSL errors because HLSL puts all cbuffer
members in a flattened namespace, which caused our internal padding
variables to overlap.

BUG=angle:725

Change-Id: I69a01fefa430a83e433385c64a532a69e6851ae8
Reviewed-on: https://chromium-review.googlesource.com/212930
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
Move the index range cache to gl::Buffer.

Because we want to move all validation to the API layer, we need to
move the index validation to the API layer. This means exposing the
index cache to the validation layer.

In the future we will probably want a way to skip index validation
when it's not necessary, or the chosen back-end handles index
validation on its own.

BUG=angle:571

Change-Id: Iee1618e669bc28abf7e0709ca4a03b4727b1383e
Reviewed-on: https://chromium-review.googlesource.com/210646
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Create an Error object to represent GL errors.

BUG=angle:520

Change-Id: I1a54e6f308b5b0f310c725a7771af737a77ecd42
Reviewed-on: https://chromium-review.googlesource.com/209619
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Fixed memory leak in  Renderbuffer class. Offscreen objects backbuffer texture /shader resource view, depth stencil texture/shader resource views were leaking during swapchain resize operations.

Change-Id: Iee83a14d043eecc465e6ffb8e21a6449def38e9b
Reviewed-on: https://chromium-review.googlesource.com/211834
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Added check to avoid accessing possible NULL renderer pointer.

Change-Id: I38524e7d3c74656902151e004d3aa47555531fd5
Reviewed-on: https://chromium-review.googlesource.com/211203
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Fix compilation error due to bad merge.

Change-Id: I54b3e0423e41b86b28d93fdce8d4d2d3304d56cf
Reviewed-on: https://chromium-review.googlesource.com/213822
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Add caps from the 6.29 table.

BUG=angle:658

Change-Id: I392f581b1aea445d60f507c1fa897c4348c1a137
Reviewed-on: https://chromium-review.googlesource.com/207371
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>