Revert "Revert "SF: Add support for screen captures""

This reverts commit 2156613b58e6a792e3ab504ed0b7a0b189ff041b.

Test: Manual and cts -m ViewTestCases

Change-Id: Ia1de956a2f41ecd3e019c8540a60d42c37bc343e
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 03720a9..f724096 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -374,6 +374,16 @@
     void draw(const RenderArea& renderArea) const;
 
     /*
+     * drawNow uses the renderEngine to draw the layer.  This is different than the
+     * draw function as with the FE/BE split, the draw function runs in the FE and
+     * sets up state for the BE to do the actual drawing.  drawNow is used to tell
+     * the layer to skip the state setup and just go ahead and draw the layer.  This
+     * is used for screen captures which happens separately from the frame
+     * compositing path.
+     */
+    virtual void drawNow(const RenderArea& renderArea, bool useIdentityTransform) const = 0;
+
+    /*
      * doTransaction - process the transaction. This is a good place to figure
      * out which attributes of the surface have changed.
      */