Fix transform hints

The hints were being set a little too late, so the pre-rotation stuff
wasn't quite working.

Bug 7054997

Change-Id: Id8d5c626db7a76f768ba762a145b315878ee08e6
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index da15248..f1d790d 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -988,6 +988,18 @@
                             disp->setProjection(state.orientation,
                                     state.viewport, state.frame);
                         }
+
+                        // Walk through all the layers in currentLayers,
+                        // and update their transform hint.
+                        //
+                        // TODO: we could be much more clever about which
+                        // layers we touch and how often we do these updates
+                        // (e.g. only touch the layers associated with this
+                        // display, and only on a rotation).
+                        for (size_t i = 0; i < count; i++) {
+                            const sp<LayerBase>& layerBase = currentLayers[i];
+                            layerBase->updateTransformHint();
+                        }
                     }
                 }
             }