Backout changeset ba7021170544 (bug 539356) because of performance and correctness regressions
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 03 Jul 2012 20:12:45 -0400
changeset 103031 6baef7642626b4c3179fd8713d75691ac9fb66a5
parent 103030 6bfde067f70044d6445e3cd72084e7d5527dadeb
child 103032 d6c612f340545e7f152fd7bcbfd020b58a6b3835
push idunknown
push userunknown
push dateunknown
bugs539356
milestone16.0a1
backs outba7021170544272ea019fce1323e3475b70a85ff
Backout changeset ba7021170544 (bug 539356) because of performance and correctness regressions
layout/tools/reftest/reftest.js
widget/android/nsLookAndFeel.cpp
widget/android/nsWindow.cpp
widget/android/nsWindow.h
--- a/layout/tools/reftest/reftest.js
+++ b/layout/tools/reftest/reftest.js
@@ -255,20 +255,16 @@ function InitAndStartRefTests()
 {
     /* These prefs are optional, so we don't need to spit an error to the log */
     try {
         var prefs = Components.classes["@mozilla.org/preferences-service;1"].
                     getService(Components.interfaces.nsIPrefBranch);
     } catch(e) {
         gDumpLog("REFTEST TEST-UNEXPECTED-FAIL | | EXCEPTION: " + e + "\n");
     }
-
-    try {
-      prefs.setBoolPref("android.widget_paints_background", false);
-    } catch (e) {}
     
     /* set the gLoadTimeout */
     try {
         gLoadTimeout = prefs.getIntPref("reftest.timeout");
     } catch(e) { 
         gLoadTimeout = 5 * 60 * 1000; //5 minutes as per bug 479518
     }
     
--- a/widget/android/nsLookAndFeel.cpp
+++ b/widget/android/nsLookAndFeel.cpp
@@ -93,17 +93,17 @@ nsLookAndFeel::NativeGetColor(ColorID aI
     // XXX we'll want to use context.obtainStyledAttributes on the java side to
     // get all of these; see TextView.java for a good exmaple.
 
     switch (aID) {
         // These colors don't seem to be used for anything anymore in Mozilla
         // (except here at least TextSelectBackground and TextSelectForeground)
         // The CSS2 colors below are used.
     case eColorID_WindowBackground:
-        aColor = NS_RGB(0xFF, 0xFF, 0xFF);
+        aColor = mSystemColors.colorBackground;
         break;
     case eColorID_WindowForeground:
         aColor = mSystemColors.textColorPrimary;
         break;
     case eColorID_WidgetBackground:
         aColor = mSystemColors.colorBackground;
         break;
     case eColorID_WidgetForeground:
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -2242,20 +2242,16 @@ nsWindow::DrawWindowUnderlay(LayerManage
     NS_ABORT_IF_FALSE(env, "No JNI environment at DrawWindowUnderlay()!");
     if (!env)
         return;
 
     AutoLocalJNIFrame jniFrame(env);
 
     AndroidGeckoLayerClient& client = AndroidBridge::Bridge()->GetLayerClient();
     if (!client.CreateFrame(&jniFrame, mLayerRendererFrame)) return;
-    
-    if (!WidgetPaintsBackground())
-        return;
-
     if (!client.ActivateProgram(&jniFrame)) return;
     if (!mLayerRendererFrame.BeginDrawing(&jniFrame)) return;
     if (!mLayerRendererFrame.DrawBackground(&jniFrame)) return;
     if (!client.DeactivateProgram(&jniFrame)) return; // redundant, but in case somebody adds code after this...
 }
 
 void
 nsWindow::DrawWindowOverlay(LayerManager* aManager, nsIntRect aRect)
@@ -2315,26 +2311,10 @@ nsWindow::SchedulePauseComposition()
 void
 nsWindow::ScheduleResumeComposition(int width, int height)
 {
     if (sCompositorParent) {
         sCompositorParent->ScheduleResumeOnCompositorThread(width, height);
     }
 }
 
-bool
-nsWindow::WidgetPaintsBackground()
-{
-    static bool sWidgetPaintsBackground = true;
-    static bool sWidgetPaintsBackgroundPrefCached = false;
-
-    if (!sWidgetPaintsBackgroundPrefCached) {
-        sWidgetPaintsBackgroundPrefCached = true;
-        mozilla::Preferences::AddBoolVarCache(&sWidgetPaintsBackground,
-                                              "android.widget_paints_background",
-                                              true);
-    }
-
-    return sWidgetPaintsBackground;
-}
-
 #endif
 
--- a/widget/android/nsWindow.h
+++ b/widget/android/nsWindow.h
@@ -153,17 +153,17 @@ public:
 
     static void SetCompositor(mozilla::layers::CompositorParent* aCompositorParent,
                               mozilla::layers::CompositorChild* aCompositorChild,
                               ::base::Thread* aCompositorThread);
     static void ScheduleComposite();
     static void SchedulePauseComposition();
     static void ScheduleResumeComposition(int width, int height);
 
-    virtual bool WidgetPaintsBackground();
+    virtual bool WidgetPaintsBackground() { return true; }
 #endif
 
 protected:
     void BringToFront();
     nsWindow *FindTopLevel();
     bool DrawTo(gfxASurface *targetSurface);
     bool DrawTo(gfxASurface *targetSurface, const nsIntRect &aRect);
     bool IsTopLevel();