зеркало из https://github.com/mozilla/gecko-dev.git
initialize the Rendering Context from a GrafPort to fix a crash on print
This commit is contained in:
Родитель
6da61fa838
Коммит
abd275880c
|
@ -80,7 +80,7 @@ double pix_inch;
|
|||
*/
|
||||
NS_IMETHODIMP nsDeviceContextMac :: CreateRenderingContext(nsIRenderingContext *&aContext)
|
||||
{
|
||||
nsIRenderingContext *pContext;
|
||||
nsRenderingContextMac *pContext;
|
||||
nsresult rv;
|
||||
GrafPtr thePort;
|
||||
|
||||
|
|
|
@ -464,6 +464,24 @@ NS_IMETHODIMP nsRenderingContextMac::Init(nsIDeviceContext* aContext, nsDrawingS
|
|||
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
// used by nsDeviceContextMac::CreateRenderingContext() for printing
|
||||
nsresult nsRenderingContextMac::Init(nsIDeviceContext* aContext, GrafPtr aPort)
|
||||
{
|
||||
mContext = aContext;
|
||||
NS_IF_ADDREF(mContext);
|
||||
|
||||
if (mOriginalSurface->GetPort() == nsnull)
|
||||
mOriginalSurface->Init(aPort);
|
||||
|
||||
// select the surface
|
||||
mFrontSurface->Init(aPort);
|
||||
SelectDrawingSurface(mFrontSurface);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
void nsRenderingContextMac::SelectDrawingSurface(DrawingSurface* aSurface)
|
||||
{
|
||||
if (! aSurface)
|
||||
|
|
|
@ -111,6 +111,7 @@ public:
|
|||
//locals
|
||||
NS_IMETHOD SetClipRectInPixels(const nsRect& aRect, nsClipCombine aCombine, PRBool &aClipEmpty);
|
||||
NS_IMETHOD SetPortTextState();
|
||||
nsresult Init(nsIDeviceContext* aContext, GrafPtr aPort);
|
||||
|
||||
protected:
|
||||
void SelectDrawingSurface(DrawingSurface* aSurface);
|
||||
|
|
|
@ -80,7 +80,7 @@ double pix_inch;
|
|||
*/
|
||||
NS_IMETHODIMP nsDeviceContextMac :: CreateRenderingContext(nsIRenderingContext *&aContext)
|
||||
{
|
||||
nsIRenderingContext *pContext;
|
||||
nsRenderingContextMac *pContext;
|
||||
nsresult rv;
|
||||
GrafPtr thePort;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче