зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1156742 Part 8: Change gfxWindowsSurface, so that a non-printing surface can be used when recording a print. r=roc
This commit is contained in:
Родитель
f35de7e1be
Коммит
b8e80a4a76
|
@ -208,6 +208,10 @@ gfxWindowsSurface::BeginPrinting(const nsAString& aTitle,
|
|||
{
|
||||
#ifdef NS_PRINTING
|
||||
#define DOC_TITLE_LENGTH (MAX_PATH-1)
|
||||
if (!mForPrinting) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
DOCINFOW docinfo;
|
||||
|
||||
nsString titleStr(aTitle);
|
||||
|
@ -235,6 +239,10 @@ nsresult
|
|||
gfxWindowsSurface::EndPrinting()
|
||||
{
|
||||
#ifdef NS_PRINTING
|
||||
if (!mForPrinting) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
int result = ::EndDoc(mDC);
|
||||
if (result <= 0)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -249,6 +257,10 @@ nsresult
|
|||
gfxWindowsSurface::AbortPrinting()
|
||||
{
|
||||
#ifdef NS_PRINTING
|
||||
if (!mForPrinting) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
int result = ::AbortDoc(mDC);
|
||||
if (result <= 0)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -262,6 +274,10 @@ nsresult
|
|||
gfxWindowsSurface::BeginPage()
|
||||
{
|
||||
#ifdef NS_PRINTING
|
||||
if (!mForPrinting) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
int result = ::StartPage(mDC);
|
||||
if (result <= 0)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -275,8 +291,11 @@ nsresult
|
|||
gfxWindowsSurface::EndPage()
|
||||
{
|
||||
#ifdef NS_PRINTING
|
||||
if (mForPrinting)
|
||||
cairo_surface_show_page(CairoSurface());
|
||||
if (!mForPrinting) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
cairo_surface_show_page(CairoSurface());
|
||||
int result = ::EndPage(mDC);
|
||||
if (result <= 0)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
|
Загрузка…
Ссылка в новой задаче