Bug 454407, use offscreen buffer instead of image buffer for drag feedback, r+sr=roc
authorNeil Deakin <neil@mozilla.com>
Wed, 22 Apr 2009 08:55:51 -0400
changeset 27618 d02c0b3b889475b09862ab168b0d2458afe5f7c0
parent 27617 d0699dd384f0ed6c4577b3f7730dccc8c5c44130
child 27619 0b355aff0abdb772438f68cc8d7481755eec8cc9
push id6654
push userneil@mozilla.com
push dateWed, 22 Apr 2009 12:57:00 +0000
treeherdermozilla-central@0b355aff0abd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs454407
milestone1.9.2a1pre
Bug 454407, use offscreen buffer instead of image buffer for drag feedback, r+sr=roc
widget/src/xpwidgets/nsBaseDragService.cpp
--- a/widget/src/xpwidgets/nsBaseDragService.cpp
+++ b/widget/src/xpwidgets/nsBaseDragService.cpp
@@ -68,17 +68,17 @@
 #include "imgIContainer.h"
 #include "imgIRequest.h"
 #include "nsIViewObserver.h"
 #include "nsRegion.h"
 #include "nsGUIEvent.h"
 #include "nsIPrefService.h"
 
 #include "gfxContext.h"
-#include "gfxImageSurface.h"
+#include "gfxPlatform.h"
 
 #define DRAGIMAGES_PREF "nglayout.enable_drag_images"
 
 nsBaseDragService::nsBaseDragService()
   : mCanDrop(PR_FALSE), mDoingDrag(PR_FALSE), mHasImage(PR_FALSE), mUserCancelled(PR_FALSE),
     mDragAction(DRAGDROP_ACTION_NONE), mTargetSize(0,0),
     mImageX(0), mImageY(0), mScreenX(-1), mScreenY(-1), mSuppressLevel(0)
 {
@@ -591,19 +591,19 @@ nsBaseDragService::DrawDragForImage(nsPr
     destSize.height = NSToIntFloor(float(destSize.height) * scale);
 
     aScreenDragRect->x = NSToIntFloor(aScreenX - float(mImageX) * scale);
     aScreenDragRect->y = NSToIntFloor(aScreenY - float(mImageY) * scale);
     aScreenDragRect->width = destSize.width;
     aScreenDragRect->height = destSize.height;
   }
 
-  nsRefPtr<gfxImageSurface> surface =
-    new gfxImageSurface(gfxIntSize(destSize.width, destSize.height),
-                        gfxImageSurface::ImageFormatARGB32);
+  nsRefPtr<gfxASurface> surface =
+    gfxPlatform::GetPlatform()->CreateOffscreenSurface(gfxIntSize(destSize.width, destSize.height),
+                                                       gfxASurface::ImageFormatARGB32);
   if (!surface)
     return NS_ERROR_FAILURE;
 
   nsRefPtr<gfxContext> ctx = new gfxContext(surface);
   if (!ctx)
     return NS_ERROR_FAILURE;
 
   *aSurface = surface;