Add a LayerScreenshot

A LayerScreenshot is a special type of layer that contains a screenshot of
the screen acquired when its created. It works just like LayerDim.

Make sure to call compositionComplete() after rendering into a FBO.

Bug: 5446982, 5467587, 5466259
Change-Id: I5d8a1b4c327f9973d950cd4f4c0bca7f62825cd4
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 34a0d73..f885fc7 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -88,16 +88,8 @@
 
 Layer::~Layer()
 {
-    class MessageDestroyGLState : public MessageBase {
-        GLuint texture;
-    public:
-        MessageDestroyGLState(GLuint texture) : texture(texture) { }
-        virtual bool handler() {
-            glDeleteTextures(1, &texture);
-            return true;
-        }
-    };
-    mFlinger->postMessageAsync( new MessageDestroyGLState(mTextureName) );
+    mFlinger->postMessageAsync(
+            new SurfaceFlinger::MessageDestroyGLTexture(mTextureName) );
 }
 
 void Layer::onFrameQueued() {