mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 651858 - Part 7: Allow choosing the Azure canvas implementation. r=roc
This commit is contained in:
parent
50ad28ab7f
commit
001a090937
@ -48,6 +48,7 @@
|
|||||||
#include "jsapi.h"
|
#include "jsapi.h"
|
||||||
#include "nsJSUtils.h"
|
#include "nsJSUtils.h"
|
||||||
#include "nsMathUtils.h"
|
#include "nsMathUtils.h"
|
||||||
|
#include "mozilla/Preferences.h"
|
||||||
|
|
||||||
#include "nsFrameManager.h"
|
#include "nsFrameManager.h"
|
||||||
#include "nsDisplayList.h"
|
#include "nsDisplayList.h"
|
||||||
@ -722,3 +723,23 @@ nsHTMLCanvasElement::RenderContextsExternal(gfxContext *aContext, gfxPattern::Gr
|
|||||||
|
|
||||||
return mCurrentContext->Render(aContext, aFilter);
|
return mCurrentContext->Render(aContext, aFilter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nsresult NS_NewCanvasRenderingContext2DThebes(nsIDOMCanvasRenderingContext2D** aResult);
|
||||||
|
nsresult NS_NewCanvasRenderingContext2DAzure(nsIDOMCanvasRenderingContext2D** aResult);
|
||||||
|
|
||||||
|
nsresult
|
||||||
|
NS_NewCanvasRenderingContext2D(nsIDOMCanvasRenderingContext2D** aResult)
|
||||||
|
{
|
||||||
|
PRBool azure = PR_FALSE;
|
||||||
|
nsresult rv = mozilla::Preferences::GetBool("gfx.canvas.azure.enabled", &azure);
|
||||||
|
|
||||||
|
if (azure) {
|
||||||
|
nsresult rv = NS_NewCanvasRenderingContext2DAzure(aResult);
|
||||||
|
// If Azure fails, fall back to a classic canvas.
|
||||||
|
if (NS_SUCCEEDED(rv)) {
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NS_NewCanvasRenderingContext2DThebes(aResult);
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user