StateManager11: Cache impl objects.

Also requires putting the Framebuffer ID in the shared state object.

Bug: angleproject:2575
Change-Id: I68e3af839a85798e01050560a67624a165d3ed2c
Reviewed-on: https://chromium-review.googlesource.com/1067119
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/Framebuffer.h b/src/libANGLE/Framebuffer.h
index e03bb0d..aa6e1b0 100644
--- a/src/libANGLE/Framebuffer.h
+++ b/src/libANGLE/Framebuffer.h
@@ -53,7 +53,7 @@
 {
   public:
     FramebufferState();
-    explicit FramebufferState(const Caps &caps);
+    explicit FramebufferState(const Caps &caps, GLuint id);
     ~FramebufferState();
 
     const std::string &getLabel();
@@ -99,6 +99,8 @@
     const std::vector<Offset> *getViewportOffsets() const;
     GLint getBaseViewIndex() const;
 
+    GLuint id() const { return mId; }
+
   private:
     const FramebufferAttachment *getWebGLDepthStencilAttachment() const;
     const FramebufferAttachment *getWebGLDepthAttachment() const;
@@ -106,6 +108,7 @@
 
     friend class Framebuffer;
 
+    GLuint mId;
     std::string mLabel;
 
     std::vector<FramebufferAttachment> mColorAttachments;
@@ -152,7 +155,7 @@
 
     rx::FramebufferImpl *getImplementation() const { return mImpl; }
 
-    GLuint id() const { return mId; }
+    GLuint id() const { return mState.mId; }
 
     void setAttachment(const Context *context,
                        GLenum type,
@@ -386,7 +389,6 @@
 
     FramebufferState mState;
     rx::FramebufferImpl *mImpl;
-    GLuint mId;
 
     Optional<GLenum> mCachedStatus;
     std::vector<angle::ObserverBinding> mDirtyColorAttachmentBindings;