Fix bug with Fbo layer clipping

Rendering views with alpha causes the creation of Fbo layers. These layers
are created at the size of the view, clipped by the current clip rect.
However, if the view lies completely outside the current clip rect, the
Fbo layer is created at the full size of the view and copied into place
outside of its container, causing artifacts like notification items showing
up outside the notification panel.

Fix is to note when the intersect() operation fails and to set an empty bounds
on the layer.

Issue #7069881 Bottom notification sometimes shows below bottom of notification panel shade

Change-Id: Ib52f7c4e503bbe9204cb808755ab269195aa94c1
diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h
index d3b98a4..2369f47 100644
--- a/libs/hwui/OpenGLRenderer.h
+++ b/libs/hwui/OpenGLRenderer.h
@@ -380,7 +380,7 @@
      *
      * @return True if the layer was successfully created, false otherwise
      */
-    bool createLayer(sp<Snapshot> snapshot, float left, float top, float right, float bottom,
+    bool createLayer(float left, float top, float right, float bottom,
             int alpha, SkXfermode::Mode mode, int flags, GLuint previousFbo);
 
     /**
@@ -391,8 +391,7 @@
      * @param bounds The bounds of the layer
      * @param previousFbo The name of the current framebuffer
      */
-    bool createFboLayer(Layer* layer, Rect& bounds, sp<Snapshot> snapshot,
-            GLuint previousFbo);
+    bool createFboLayer(Layer* layer, Rect& bounds, Rect& clip, GLuint previousFbo);
 
     /**
      * Compose the specified layer as a region.