Bug 952977: Remove Gonk's sRotationMatrix r=mwu
authorDavid Zbarsky <dzbarsky@gmail.com>
Thu, 26 Dec 2013 13:06:55 -0500
changeset 161797 4a2a444ec574320919843d360535e0c2ee97fd6f
parent 161796 b04bd18e5692e4f86815b6d0652c3843069784d7
child 161798 f8a179a84a9cfda21288e6ca5ab6cc1670db1bf6
push id37986
push userdzbarsky@gmail.com
push dateThu, 26 Dec 2013 18:07:19 +0000
treeherdermozilla-inbound@4a2a444ec574 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmwu
bugs952977
milestone29.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 952977: Remove Gonk's sRotationMatrix r=mwu
widget/gonk/nsWindow.cpp
--- a/widget/gonk/nsWindow.cpp
+++ b/widget/gonk/nsWindow.cpp
@@ -60,17 +60,16 @@ using namespace mozilla::hal;
 using namespace mozilla::gl;
 using namespace mozilla::layers;
 using namespace mozilla::widget;
 
 nsIntRect gScreenBounds;
 static uint32_t sScreenRotation;
 static uint32_t sPhysicalScreenRotation;
 static nsIntRect sVirtualBounds;
-static gfxMatrix sRotationMatrix;
 
 static nsRefPtr<GLContext> sGLContext;
 static nsTArray<nsWindow *> sTopWindows;
 static nsWindow *gWindowToRedraw = nullptr;
 static nsWindow *gFocusedWindow = nullptr;
 static bool sFramebufferOpen;
 static bool sUsingOMTC;
 static bool sUsingHwc;
@@ -142,29 +141,16 @@ nsWindow::nsWindow()
             NS_RUNTIMEABORT("Failed to get size from framebuffer, aborting...");
         }
         gScreenBounds = nsIntRect(nsIntPoint(0, 0), screenSize);
 
         char propValue[PROPERTY_VALUE_MAX];
         property_get("ro.sf.hwrotation", propValue, "0");
         sPhysicalScreenRotation = atoi(propValue) / 90;
 
-        // Unlike nsScreenGonk::SetRotation(), only support 0 and 180 as there
-        // are no known screens that are mounted at 90 or 270 at the moment.
-        switch (sPhysicalScreenRotation) {
-        case nsIScreen::ROTATION_0_DEG:
-            break;
-        case nsIScreen::ROTATION_180_DEG:
-            sRotationMatrix.Translate(gfxPoint(gScreenBounds.width,
-                                               gScreenBounds.height));
-            sRotationMatrix.Rotate(M_PI);
-            break;
-        default:
-            MOZ_CRASH("Unknown rotation");
-        }
         sVirtualBounds = gScreenBounds;
 
         sScreenInitialized = true;
 
         nsAppShell::NotifyScreenInitialized();
 
         // This is a hack to force initialization of the compositor
         // resources, if we're going to use omtc.
@@ -764,19 +750,16 @@ nsScreenGonk::SetRotation(uint32_t aRota
 {
     if (!(aRotation <= ROTATION_270_DEG))
         return NS_ERROR_ILLEGAL_VALUE;
 
     if (sScreenRotation == aRotation)
         return NS_OK;
 
     sScreenRotation = aRotation;
-    sRotationMatrix =
-        ComputeTransformForRotation(gScreenBounds,
-                                    ScreenRotation(EffectiveScreenRotation()));
     uint32_t rotation = EffectiveScreenRotation();
     if (rotation == nsIScreen::ROTATION_90_DEG ||
         rotation == nsIScreen::ROTATION_270_DEG) {
         sVirtualBounds = nsIntRect(0, 0, gScreenBounds.height,
                                    gScreenBounds.width);
     } else {
         sVirtualBounds = gScreenBounds;
     }