Bug 667298: Allow taskbar previews to explicitly create a thebes canvas. r=roc

This commit is contained in:
Bas Schouten 2011-06-30 03:00:12 +02:00
parent 7ef8a6c28e
commit 6fdd8fb73c
3 changed files with 10 additions and 1 deletions

View File

@ -91,6 +91,10 @@
#define NS_CANVASRENDERINGCONTEXT2D_CID \
{ 0xa35d1cd4, 0xc505, 0x4d2d, { 0xa0, 0xf9, 0xae, 0xf0, 0x0b, 0x7c, 0xe5, 0xa5 } }
// {BCD923C0-9788-4350-AC48-365F473161EB}
#define NS_CANVASRENDERINGCONTEXT2DTHEBES_CID \
{ 0xbcd923c0, 0x9788, 0x4350, { 0xac, 0x48, 0x36, 0x5f, 0x47, 0x31, 0x61, 0xeb } }
// {9052bb12-79b0-4bdd-8e60-7bf078026b6d}
#define NS_CANVASRENDERINGCONTEXT2DAZURE_CID \
{0x9052bb12, 0x79b0, 0x4bdd, {0x8e, 0x60, 0x7b, 0xf0, 0x78, 0x02, 0x6b, 0x6d}}

View File

@ -440,6 +440,7 @@ nsresult NS_NewTreeBoxObject(nsIBoxObject** aResult);
#endif
nsresult NS_NewCanvasRenderingContext2D(nsIDOMCanvasRenderingContext2D** aResult);
nsresult NS_NewCanvasRenderingContext2DThebes(nsIDOMCanvasRenderingContext2D** aResult);
nsresult NS_NewCanvasRenderingContextWebGL(nsIDOMWebGLRenderingContext** aResult);
nsresult NS_CreateFrameTraversal(nsIFrameTraversal** aResult);
@ -568,6 +569,7 @@ MAKE_CTOR(CreateVideoDocument, nsIDocument, NS_NewVid
MAKE_CTOR(CreateFocusManager, nsIFocusManager, NS_NewFocusManager)
MAKE_CTOR(CreateCanvasRenderingContext2D, nsIDOMCanvasRenderingContext2D, NS_NewCanvasRenderingContext2D)
MAKE_CTOR(CreateCanvasRenderingContext2DThebes, nsIDOMCanvasRenderingContext2D, NS_NewCanvasRenderingContext2DThebes)
MAKE_CTOR(CreateCanvasRenderingContextWebGL, nsIDOMWebGLRenderingContext, NS_NewCanvasRenderingContextWebGL)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsStyleSheetService, Init)
@ -771,6 +773,7 @@ NS_DEFINE_NAMED_CID(NS_HTMLOPTIONELEMENT_CID);
NS_DEFINE_NAMED_CID(NS_HTMLAUDIOELEMENT_CID);
#endif
NS_DEFINE_NAMED_CID(NS_CANVASRENDERINGCONTEXT2D_CID);
NS_DEFINE_NAMED_CID(NS_CANVASRENDERINGCONTEXT2DTHEBES_CID);
NS_DEFINE_NAMED_CID(NS_CANVASRENDERINGCONTEXT2DAZURE_CID);
NS_DEFINE_NAMED_CID(NS_CANVASRENDERINGCONTEXTWEBGL_CID);
NS_DEFINE_NAMED_CID(NS_TEXT_ENCODER_CID);
@ -914,6 +917,7 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = {
#ifdef MOZ_MEDIA
{ &kNS_HTMLAUDIOELEMENT_CID, false, NULL, CreateHTMLAudioElement },
#endif
{ &kNS_CANVASRENDERINGCONTEXT2DTHEBES_CID, false, NULL, CreateCanvasRenderingContext2DThebes },
{ &kNS_CANVASRENDERINGCONTEXT2D_CID, false, NULL, CreateCanvasRenderingContext2D },
{ &kNS_CANVASRENDERINGCONTEXTWEBGL_CID, false, NULL, CreateCanvasRenderingContextWebGL },
{ &kNS_TEXT_ENCODER_CID, false, NULL, CreateTextEncoder },
@ -1049,6 +1053,7 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = {
{ NS_HTMLAUDIOELEMENT_CONTRACTID, &kNS_HTMLAUDIOELEMENT_CID },
#endif
{ "@mozilla.org/content/canvas-rendering-context;1?id=2d", &kNS_CANVASRENDERINGCONTEXT2D_CID },
{ "@mozilla.org/content/canvas-rendering-context;1?id=2dthebes", &kNS_CANVASRENDERINGCONTEXT2DTHEBES_CID },
{ "@mozilla.org/content/canvas-rendering-context;1?id=moz-webgl", &kNS_CANVASRENDERINGCONTEXTWEBGL_CID },
{ "@mozilla.org/content/canvas-rendering-context;1?id=experimental-webgl", &kNS_CANVASRENDERINGCONTEXTWEBGL_CID },
{ NS_DOC_ENCODER_CONTRACTID_BASE "text/xml", &kNS_TEXT_ENCODER_CID },

View File

@ -96,7 +96,7 @@ GetRenderingContext(nsIDocShell *shell, gfxASurface *surface,
if (!ctx) {
// create the canvas rendering context
ctx = do_CreateInstance("@mozilla.org/content/canvas-rendering-context;1?id=2d", &rv);
ctx = do_CreateInstance("@mozilla.org/content/canvas-rendering-context;1?id=2dthebes", &rv);
if (NS_FAILED(rv)) {
NS_WARNING("Could not create nsICanvasRenderingContextInternal for tab previews!");
return rv;