Context: Use Observer pattern for container objects.

Container objects in this case are the Vertex Array and Read and Draw
Framebuffers. Instead of using a mutable dirty bit state with a const
function to notify of dirty bits we can use the Observer/Subject
pattern. This more cleanly allows us to do cache updates.

Bug: angleproject:1391
Change-Id: I88f863894ec3efa00322038f323a84850166107d
Reviewed-on: https://chromium-review.googlesource.com/1153399
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/VertexArray.cpp b/src/libANGLE/VertexArray.cpp
index 18885be..30fb447 100644
--- a/src/libANGLE/VertexArray.cpp
+++ b/src/libANGLE/VertexArray.cpp
@@ -438,7 +438,7 @@
     DirtyBitType dirtyBit = getDirtyBitFromIndex(contentsChanged, index);
     ASSERT(!mDirtyBitsGuard.valid() || mDirtyBitsGuard.value().test(dirtyBit));
     mDirtyBits.set(dirtyBit);
-    context->getGLState().setVertexArrayDirty(this);
+    onStateChange(context, angle::SubjectMessage::CONTENTS_CHANGED);
 }
 
 void VertexArray::updateObserverBinding(size_t bindingIndex)