summaryrefslogtreecommitdiff
path: root/gfx/src
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-05-02 20:28:36 +0000
committerMoonchild <moonchild@palemoon.org>2021-05-02 20:28:36 +0000
commit616b39413d570fd98a9a300483a3b657a00fa43b (patch)
tree8398d6fb6f9a491c871532e91aaf84ef1b50d1c7 /gfx/src
parentcd1f7241353c35627672dc3f6f73eb8bbd5f4925 (diff)
downloaduxp-616b39413d570fd98a9a300483a3b657a00fa43b.tar.gz
Issue #1751 -- Remove XP_MACOSX conditionals and support files from /gfx
Diffstat (limited to 'gfx/src')
-rw-r--r--gfx/src/nsDeviceContext.cpp38
-rw-r--r--gfx/src/nsDeviceContext.h3
2 files changed, 1 insertions, 40 deletions
diff --git a/gfx/src/nsDeviceContext.cpp b/gfx/src/nsDeviceContext.cpp
index db69e21e98..e4288e47e3 100644
--- a/gfx/src/nsDeviceContext.cpp
+++ b/gfx/src/nsDeviceContext.cpp
@@ -239,11 +239,7 @@ nsDeviceContext::FontMetricsDeleted(const nsFontMetrics* aFontMetrics)
bool
nsDeviceContext::IsPrinterContext()
{
- return mPrintTarget != nullptr
-#ifdef XP_MACOSX
- || mCachedPrintTarget != nullptr
-#endif
- ;
+ return mPrintTarget != nullptr;
}
void
@@ -347,17 +343,6 @@ nsDeviceContext::CreateRenderingContextCommon(bool aWantReferenceContext)
MOZ_ASSERT(mWidth > 0 && mHeight > 0);
RefPtr<PrintTarget> printingTarget = mPrintTarget;
-#ifdef XP_MACOSX
- // CreateRenderingContext() can be called (on reflow) after EndPage()
- // but before BeginPage(). On OS X (and only there) mPrintTarget
- // will in this case be null, because OS X printing surfaces are
- // per-page, and therefore only truly valid between calls to BeginPage()
- // and EndPage(). But we can get away with fudging things here, if need
- // be, by using a cached copy.
- if (!printingTarget) {
- printingTarget = mCachedPrintTarget;
- }
-#endif
// This will usually be null, depending on the pref print.print_via_parent.
RefPtr<DrawEventRecorder> recorder;
@@ -378,9 +363,6 @@ nsDeviceContext::CreateRenderingContextCommon(bool aWantReferenceContext)
return nullptr;
}
-#ifdef XP_MACOSX
- dt->AddUserData(&gfxContext::sDontUseAsSourceKey, dt, nullptr);
-#endif
dt->AddUserData(&sDisablePixelSnapping, (void*)0x1, nullptr);
RefPtr<gfxContext> pContext = gfxContext::CreateOrNull(dt);
@@ -543,12 +525,6 @@ nsDeviceContext::BeginPage(void)
if (NS_FAILED(rv)) return rv;
-#ifdef XP_MACOSX
- // We need to get a new surface for each page on the Mac, as the
- // CGContextRefs are only good for one page.
- mPrintTarget = mDeviceContextSpec->MakePrintTarget();
-#endif
-
rv = mPrintTarget->BeginPage();
return rv;
@@ -559,18 +535,6 @@ nsDeviceContext::EndPage(void)
{
nsresult rv = mPrintTarget->EndPage();
-#ifdef XP_MACOSX
- // We need to release the CGContextRef in the surface here, plus it's
- // not something you would want anyway, as these CGContextRefs are only
- // good for one page. But we need to keep a cached reference to it, since
- // CreateRenderingContext() may try to access it when mPrintTarget
- // would normally be null. See bug 665218. If we just stop nulling out
- // mPrintTarget here (and thereby make that our cached copy), we'll
- // break all our null checks on mPrintTarget. See bug 684622.
- mCachedPrintTarget = mPrintTarget;
- mPrintTarget = nullptr;
-#endif
-
if (mDeviceContextSpec)
mDeviceContextSpec->EndPage();
diff --git a/gfx/src/nsDeviceContext.h b/gfx/src/nsDeviceContext.h
index 1115757eb1..edb3f5d6a8 100644
--- a/gfx/src/nsDeviceContext.h
+++ b/gfx/src/nsDeviceContext.h
@@ -300,9 +300,6 @@ private:
nsCOMPtr<nsIScreenManager> mScreenManager;
nsCOMPtr<nsIDeviceContextSpec> mDeviceContextSpec;
RefPtr<PrintTarget> mPrintTarget;
-#ifdef XP_MACOSX
- RefPtr<PrintTarget> mCachedPrintTarget;
-#endif
#ifdef DEBUG
bool mIsInitialized;
#endif