Extract validation from VertexDataManager.cpp to the API.

We can check for buffer overflow at draw validation time, before
processing any vertex data.

BUG=angle:571

Change-Id: I4f49629b98c17ca28e25baed74cad4ae5341b20f
Reviewed-on: https://chromium-review.googlesource.com/210647
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Add a Resize method to OSWindow.

BUG=angle:730

Change-Id: I64106f05eb4188305eb34bbabe7d1cde037e1948
Reviewed-on: https://chromium-review.googlesource.com/213293
Reviewed-by: Brandon Jones <bajones@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Add OSWindow::setVisible.

BUG=angle:730

Change-Id: I9c9e2f3b694ba57df359906cd8517ede60af632d
Reviewed-on: https://chromium-review.googlesource.com/213294
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Move validation from IndexDataManager to the API.

This validates all necessary buffer sizes for element array
buffers in the validation layer, before we start the draw.

BUG=angle:571

Change-Id: I602744ca1ea493e9f0f7e1ccbeb85fc4ae5c9f5a
Reviewed-on: https://chromium-review.googlesource.com/210648
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Move some methods of VertexDataManager to helper methods.

Refactoring patch only.

BUG=angle:571

Change-Id: Ic318b4c4366e33b8d33f6003dd39f660f40d354a
Reviewed-on: https://chromium-review.googlesource.com/210649
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Refactored TransformFeedback for multi-platform ANGLE and added tests.

Added angle_implementation_unit_tests target designed for testing the
cross-platform code in libGLESv2, and libGLESv2_static target as a
dependency. The goal is to incorporate these tests into Chromium's
angle_unittests target on all platforms; however, more work is needed
to make libGLESv2's common code compile on non-Windows platforms, so
this is an intermediate step.

BUG=angle:719

Change-Id: Ifc44a779352294e857d6e913d9b997a60674c443
Reviewed-on: https://chromium-review.googlesource.com/214105
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Kenneth Russell <kbr@chromium.org>
Fix some MSVC warnings about possible truncation of int -> char.

BUG=81439
TEST=none

Change-Id: Iedf02bf374e4992fc4c8ee050eff76f4f05708ac
Reviewed-on: https://chromium-review.googlesource.com/214065
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Tested-by: Peter Kasting <pkasting@chromium.org>
Reduce CPU texture usage in D3D11 where possible

Change-Id: I3186d78fa0a5c676611806c6f553c5c7ad06f56a
Reviewed-on: https://chromium-review.googlesource.com/212118
Tested-by: Austin Kinross <aukinros@microsoft.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Refactor ShaderVariables to store fields in the base.

Instead of only storing structure information in Varyings, Uniforms
and Interface Block Fields, store it in the base class. Also only
store base variable information for struct fields, instead of fully
typed information. This works because stuff like interpolation type,
invariance, and other properties are for the entire variable, not
individual fields.

Also add new fields for interface block instance name, varying
invariance and structure name for all struct types.

BUG=angle:466

Change-Id: If03fc071e6becb7aad6dea5093989bba7daee69e
Reviewed-on: https://chromium-review.googlesource.com/213501
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
Fix interface block static use tracking.

The current code couldn't handle some uses of interface blocks,
such as blocks with instance names.

BUG=angle:466

Change-Id: I0a3746f277af0538cede30232532c6788412da1c
Reviewed-on: https://chromium-review.googlesource.com/213502
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
Use OSWindow with angle_tests for Window management.

BUG=angle:730

Change-Id: I409fd4f4e00eb0d8d964b0ac199fa6f675a36df8
Reviewed-on: https://chromium-review.googlesource.com/213295
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Allow app to specify EGL Window extra parameters.

Extra parameters include pixel bit sizes, swap interval
and if we want multisampling. This gives parity between
the tests and samples EGL creation options.

BUG=angle:730

Change-Id: I68d619c2ea141794f0089456bb6bba3d3b1c2a07
Reviewed-on: https://chromium-review.googlesource.com/213296
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Fixes a compilation error when ANGLE_DEFAULT_D3D11 is defined.

Change-Id: I09853b4565d5458ce4c318611a6495ec265fa8de
Reviewed-on: https://chromium-review.googlesource.com/213899
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Shannon Woods <shannonwoods@chromium.org>
Move GetUniform validation to the validation layer.

BUG=angle:571

Change-Id: Id1b7afb22d8bd52dbf7f95f4e8cac3fc8f798596
Reviewed-on: https://chromium-review.googlesource.com/212931
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Use EGLWindow in ANGLETests.

This completes the refactor to use the same code for EGL and OS
Window creation for samples and tests.

BUG=angle:730
TEST=angle_tests

Change-Id: Ib6de89f5bf83c0730a66f662cd1f87351f36a5f7
Reviewed-on: https://chromium-review.googlesource.com/213297
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Add some shared utility methods to the utils project.

BUG=angle:730

Change-Id: I268c7f76ee9a14ab82f646ae8ebf4eed100bf86d
Reviewed-on: https://chromium-review.googlesource.com/213509
Reviewed-by: Brandon Jones <bajones@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Use shared compile helpers in the ANGLE tests.

BUG=angle:730

Change-Id: Ib3bd646c73355449105e6cf79bdcf0a14b391fd2
Reviewed-on: https://chromium-review.googlesource.com/213550
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Move GetUniform size validation to top layer.

BUG=angle:571

Change-Id: Ie7064cf85f6a125ccd6cdf1bff89443520e2a06d
Reviewed-on: https://chromium-review.googlesource.com/212932
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Refactor GetUniform validator helpers.

BUG=angle:571

Change-Id: I7b36c7af38b102a24dc0e5d5d87fc042533e90af
Reviewed-on: https://chromium-review.googlesource.com/212933
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Fix GetUniform validation.

We were missing a check for an out-of-bounds Uniform, which could
cause us to miss an error and also give assertion failures.

BUG=angle:571

Change-Id: I844658a82ce13ea179a2358a202733c54bc2c0c7
Reviewed-on: https://chromium-review.googlesource.com/212934
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>