Bug 454407, use offscreen buffer instead of image buffer for drag feedback, r+sr=roc
--- 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;