Bug 996828 - Remove dirty region tracking in gonk widget backend, r=roc
authorMichael Wu <mwu@mozilla.com>
Tue, 15 Apr 2014 15:34:14 -0400
changeset 179312 83ef37a324fe744f77c24869b891488d9a847a1c
parent 179311 ed8ebf8ff00f00eed02407952f8ff3d65af226ea
child 179313 aaf25cacd5b490421df9f91c40d1805f06211d38
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersroc
bugs996828
milestone31.0a1
Bug 996828 - Remove dirty region tracking in gonk widget backend, r=roc
widget/gonk/nsWindow.cpp
widget/gonk/nsWindow.h
--- a/widget/gonk/nsWindow.cpp
+++ b/widget/gonk/nsWindow.cpp
@@ -189,19 +189,16 @@ nsWindow::DoDraw(void)
         LOG("  no window to draw, bailing");
         return;
     }
 
     nsWindow *targetWindow = (nsWindow *)sTopWindows[0];
     while (targetWindow->GetLastChild())
         targetWindow = (nsWindow *)targetWindow->GetLastChild();
 
-    nsIntRegion region = sTopWindows[0]->mDirtyRegion;
-    sTopWindows[0]->mDirtyRegion.SetEmpty();
-
     nsIWidgetListener* listener = targetWindow->GetWidgetListener();
     if (listener) {
         listener->WillPaintWindow(targetWindow);
     }
 
     LayerManager* lm = targetWindow->GetLayerManager();
     if (mozilla::layers::LayersBackend::LAYERS_CLIENT == lm->GetBackendType()) {
       // No need to do anything, the compositor will handle drawing
@@ -211,33 +208,33 @@ nsWindow::DoDraw(void)
 
         if(sUsingOMTC)
             targetSurface = sOMTCSurface;
         else
             targetSurface = Framebuffer::BackBuffer();
 
         {
             nsRefPtr<gfxContext> ctx = new gfxContext(targetSurface);
-            gfxUtils::PathFromRegion(ctx, region);
+            gfxUtils::PathFromRegion(ctx, sVirtualBounds);
             ctx->Clip();
 
             // No double-buffering needed.
             AutoLayerManagerSetup setupLayerManager(
                 targetWindow, ctx, mozilla::layers::BufferMode::BUFFER_NONE,
                 ScreenRotation(EffectiveScreenRotation()));
 
             listener = targetWindow->GetWidgetListener();
             if (listener) {
-                listener->PaintWindow(targetWindow, region);
+                listener->PaintWindow(targetWindow, sVirtualBounds);
             }
         }
 
         if (!sUsingOMTC) {
             targetSurface->Flush();
-            Framebuffer::Present(region);
+            Framebuffer::Present(sVirtualBounds);
         }
     } else {
         NS_RUNTIMEABORT("Unexpected layer manager type");
     }
 
     listener = targetWindow->GetWidgetListener();
     if (listener) {
         listener->DidPaintWindow();
@@ -420,17 +417,16 @@ NS_IMETHODIMP
 nsWindow::Invalidate(const nsIntRect &aRect)
 {
     nsWindow *top = mParent;
     while (top && top->mParent)
         top = top->mParent;
     if (top != sTopWindows[0] && this != sTopWindows[0])
         return NS_OK;
 
-    mDirtyRegion.Or(mDirtyRegion, aRect);
     gDrawRequest = true;
     mozilla::NotifyEvent();
     return NS_OK;
 }
 
 nsIntPoint
 nsWindow::WidgetToScreenOffset()
 {
--- a/widget/gonk/nsWindow.h
+++ b/widget/gonk/nsWindow.h
@@ -112,17 +112,16 @@ public:
     virtual nsIntRect GetNaturalBounds() MOZ_OVERRIDE;
     virtual bool NeedsPaint();
 
     virtual Composer2D* GetComposer2D() MOZ_OVERRIDE;
 
 protected:
     nsWindow* mParent;
     bool mVisible;
-    nsIntRegion mDirtyRegion;
     InputContext mInputContext;
     nsCOMPtr<nsIIdleServiceInternal> mIdleService;
 
     void BringToTop();
 
     // Call this function when the users activity is the direct cause of an
     // event (like a keypress or mouse click).
     void UserActivity();