Move Buffer Subject/Observer to front end.

This makes BufferImpl into an Observer Subject. It also refactors
the Vertex Array updates for the D3D11 backend use more of a dirty
bit coding style.

This change makes it so Buffer contents changes trigger front-end
dirty bits from the back-end, which may be undesirable.

Bug: angleproject:2389
Change-Id: Iac8ce1171284a86851c18cd1373ddf24fcefe40b
Reviewed-on: https://chromium-review.googlesource.com/979812
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/MemoryProgramCache.cpp b/src/libANGLE/MemoryProgramCache.cpp
index 83d7348..809edca 100644
--- a/src/libANGLE/MemoryProgramCache.cpp
+++ b/src/libANGLE/MemoryProgramCache.cpp
@@ -244,11 +244,11 @@
     static_assert(MAX_VERTEX_ATTRIBS * 2 <= sizeof(uint32_t) * 8,
                   "All bits of mAttributesTypeMask types and mask fit into 32 bits each");
     state->mAttributesTypeMask.from_ulong(stream.readInt<uint32_t>());
-    state->mAttributesMask = stream.readInt<uint32_t>();
+    state->mAttributesMask = stream.readInt<gl::AttributesMask>();
 
     static_assert(MAX_VERTEX_ATTRIBS <= sizeof(unsigned long) * 8,
                   "Too many vertex attribs for mask");
-    state->mActiveAttribLocationsMask = stream.readInt<unsigned long>();
+    state->mActiveAttribLocationsMask = stream.readInt<gl::AttributesMask>();
 
     unsigned int attribCount = stream.readInt<unsigned int>();
     ASSERT(state->mAttributes.empty());
@@ -390,7 +390,7 @@
                   "All bits of mDrawBufferTypeMask and mActiveOutputVariables types and mask fit "
                   "into 32 bits each");
     state->mDrawBufferTypeMask.from_ulong(stream.readInt<uint32_t>());
-    state->mActiveOutputVariables = stream.readInt<uint32_t>();
+    state->mActiveOutputVariables = stream.readInt<gl::DrawBufferMask>();
 
     unsigned int samplerRangeLow  = stream.readInt<unsigned int>();
     unsigned int samplerRangeHigh = stream.readInt<unsigned int>();
@@ -426,7 +426,7 @@
 
     static_assert(static_cast<unsigned long>(ShaderType::EnumCount) <= sizeof(unsigned long) * 8,
                   "Too many shader types");
-    state->mLinkedShaderStages = stream.readInt<unsigned long>();
+    state->mLinkedShaderStages = stream.readInt<gl::ShaderStagesMask>();
 
     state->updateTransformFeedbackStrides();