mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 12:55:46 +00:00
bug = 50795 Use factory to create the nsRendering Context. r/sr=buster a=mcklusky r=erik [rtm++]
This commit is contained in:
parent
736310b247
commit
7975c4af8d
@ -29,6 +29,7 @@
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIScreenManager.h"
|
||||
#include "nsIScreen.h"
|
||||
#include "nsGfxCIID.h"
|
||||
|
||||
|
||||
// Size of the color cube
|
||||
@ -259,18 +260,18 @@ nsDeviceContextWin :: FindScreen ( nsIScreen** outScreen )
|
||||
} // FindScreen
|
||||
|
||||
|
||||
static NS_DEFINE_CID(kRCCID,NS_RENDERING_CONTEXT_CID);
|
||||
|
||||
NS_IMETHODIMP nsDeviceContextWin :: CreateRenderingContext(nsIRenderingContext *&aContext)
|
||||
{
|
||||
nsIRenderingContext *pContext;
|
||||
nsresult rv;
|
||||
nsDrawingSurfaceWin *surf;
|
||||
|
||||
pContext = new nsRenderingContextWin();
|
||||
rv = nsComponentManager::CreateInstance(kRCCID,nsnull,NS_GET_IID(nsIRenderingContext),(void**)&pContext);
|
||||
|
||||
if (nsnull != pContext)
|
||||
if ( (NS_SUCCEEDED(rv)) && (nsnull != pContext))
|
||||
{
|
||||
NS_ADDREF(pContext);
|
||||
|
||||
surf = new nsDrawingSurfaceWin();
|
||||
|
||||
if (nsnull != surf)
|
||||
|
Loading…
Reference in New Issue
Block a user