reformat Rect.{cpp|h}

Change-Id: I45b1f6646541a1abacce1e70df00a770e47b820e
diff --git a/services/surfaceflinger/DisplayDevice.cpp b/services/surfaceflinger/DisplayDevice.cpp
index 42b30cc..b001bdb 100644
--- a/services/surfaceflinger/DisplayDevice.cpp
+++ b/services/surfaceflinger/DisplayDevice.cpp
@@ -416,7 +416,7 @@
 
     mScissor = mGlobalTransform.transform(viewport);
     if (mScissor.isEmpty()) {
-        mScissor.set(getBounds());
+        mScissor = getBounds();
     }
 
     mOrientation = orientation;
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 9896581..07f9b8b 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -276,6 +276,8 @@
     if (!s.active.crop.isEmpty()) {
         win.intersect(s.active.crop, &win);
     }
+    // subtract the transparent region and snap to the bounds
+    win = Region(win).subtract(s.activeTransparentRegion).getBounds();
     return win;
 }
 
@@ -666,6 +668,8 @@
     if (!s.active.crop.isEmpty()) {
         win.intersect(s.active.crop, &win);
     }
+    // subtract the transparent region and snap to the bounds
+    win = Region(win).subtract(s.activeTransparentRegion).getBounds();
     if (mesh) {
         tr.transform(mesh->mVertices[0], win.left,  win.top);
         tr.transform(mesh->mVertices[1], win.left,  win.bottom);