mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 922942 - Use Moz2D for android snapshots. r=roc
This commit is contained in:
parent
8fcf41be6c
commit
e74644cd8e
@ -25,7 +25,9 @@
|
|||||||
#include "nsIThreadManager.h"
|
#include "nsIThreadManager.h"
|
||||||
#include "mozilla/dom/mobilemessage/PSms.h"
|
#include "mozilla/dom/mobilemessage/PSms.h"
|
||||||
#include "gfxImageSurface.h"
|
#include "gfxImageSurface.h"
|
||||||
|
#include "gfxPlatform.h"
|
||||||
#include "gfxContext.h"
|
#include "gfxContext.h"
|
||||||
|
#include "mozilla/gfx/2D.h"
|
||||||
#include "gfxUtils.h"
|
#include "gfxUtils.h"
|
||||||
#include "nsPresContext.h"
|
#include "nsPresContext.h"
|
||||||
#include "nsIDocShell.h"
|
#include "nsIDocShell.h"
|
||||||
@ -44,6 +46,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
|
using namespace mozilla::gfx;
|
||||||
|
|
||||||
NS_IMPL_ISUPPORTS0(nsFilePickerCallback)
|
NS_IMPL_ISUPPORTS0(nsFilePickerCallback)
|
||||||
|
|
||||||
@ -1848,7 +1851,20 @@ nsresult AndroidBridge::CaptureThumbnail(nsIDOMWindow *window, int32_t bufW, int
|
|||||||
ALOG_BRIDGE("Error creating gfxImageSurface");
|
ALOG_BRIDGE("Error creating gfxImageSurface");
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
nsRefPtr<gfxContext> context = new gfxContext(surf);
|
|
||||||
|
nsRefPtr<gfxContext> context;
|
||||||
|
if (gfxPlatform::GetPlatform()->SupportsAzureContentForType(BACKEND_CAIRO)) {
|
||||||
|
RefPtr<DrawTarget> dt =
|
||||||
|
gfxPlatform::GetPlatform()->CreateDrawTargetForSurface(surf, IntSize(bufW, bufH));
|
||||||
|
|
||||||
|
if (!dt) {
|
||||||
|
ALOG_BRIDGE("Error creating DrawTarget");
|
||||||
|
return NS_ERROR_FAILURE;
|
||||||
|
}
|
||||||
|
context = new gfxContext(dt);
|
||||||
|
} else {
|
||||||
|
context = new gfxContext(surf);
|
||||||
|
}
|
||||||
gfxPoint pt(0, 0);
|
gfxPoint pt(0, 0);
|
||||||
context->Translate(pt);
|
context->Translate(pt);
|
||||||
context->Scale(scale * bufW / srcW, scale * bufH / srcH);
|
context->Scale(scale * bufW / srcW, scale * bufH / srcH);
|
||||||
|
Loading…
Reference in New Issue
Block a user