Commit 3cfea475 authored by Iulian Moraru's avatar Iulian Moraru
Browse files

Backed out changeset 9fce1abd1c50 (bug 1833244) for causing build bustages on...

Backed out changeset 9fce1abd1c50 (bug 1833244) for causing build bustages on nsDeviceContextAndroid.h. CLOSED TREE
parent d4e8510c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -327,14 +327,14 @@ nsresult nsDeviceContext::AbortDocument() {
  return rv;
}

nsresult nsDeviceContext::BeginPage(const IntSize& aSizeInPoints) {
nsresult nsDeviceContext::BeginPage() {
  MOZ_DIAGNOSTIC_ASSERT(!mIsCurrentlyPrintingDoc || mPrintTarget,
                        "What nulled out our print target while printing?");
  if (mDeviceContextSpec) {
    MOZ_TRY(mDeviceContextSpec->BeginPage(aSizeInPoints));
    MOZ_TRY(mDeviceContextSpec->BeginPage());
  }
  if (mPrintTarget) {
    MOZ_TRY(mPrintTarget->BeginPage(aSizeInPoints));
    MOZ_TRY(mPrintTarget->BeginPage());
  }
  return NS_OK;
}
+2 −12
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@
#include "nscore.h"                   // for char16_t, nsAString
#include "mozilla/AppUnits.h"         // for AppUnits
#include "nsFontMetrics.h"            // for nsFontMetrics::Params
#include "mozilla/gfx/Point.h"        // for IntSize
#include "mozilla/gfx/PrintTarget.h"  // for PrintTarget::PageDoneCallback
#include "mozilla/gfx/PrintPromise.h"

@@ -49,8 +48,7 @@ class Screen;

class nsDeviceContext final {
 public:
  using IntSize = mozilla::gfx::IntSize;
  using PrintTarget = mozilla::gfx::PrintTarget;
  typedef mozilla::gfx::PrintTarget PrintTarget;

  nsDeviceContext();

@@ -225,17 +223,9 @@ class nsDeviceContext final {
   * Inform the output device that output of a page is beginning
   * Used for print related device contexts. Must be matched 1:1 with
   * EndPage() and within a BeginDocument()/EndDocument() pair.
   *
   * @param aSizeInPoints - The physical dimensions of the page in points.
   *                        Currently only supported (used) by print-to-PDF
   *                        print targets, and then only to switch the
   *                        orientation for a specific page (arbitrary page
   *                        sizes are not supported by the Core Graphics print-
   *                        to-PDF APIs, for example).
   *
   * @return error status
   */
  nsresult BeginPage(const IntSize& aSizeInPoints);
  nsresult BeginPage();

  /**
   * Inform the output device that output of a page is ending
+1 −5
Original line number Diff line number Diff line
@@ -43,11 +43,7 @@ class PrintTarget {
#endif
    return NS_OK;
  }
  /**
   * Note: not all print devices implement mixed page sizing. Most PrintTarget
   * subclasses will ignore `aSizeInPoints`.
   */
  virtual nsresult BeginPage(const IntSize& aSizeInPoints) {
  virtual nsresult BeginPage() {
#ifdef DEBUG
    MOZ_ASSERT(!mHasActivePage, "Missing EndPage() call");
    mHasActivePage = true;
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ class PrintTargetCG final : public PrintTarget {
                         int32_t aEndPage) final;
  nsresult EndPrinting() final;
  nsresult AbortPrinting() final;
  nsresult BeginPage(const IntSize& aSizeInPoints) final;
  nsresult BeginPage() final;
  nsresult EndPage() final;

  already_AddRefed<DrawTarget> GetReferenceDrawTarget() final;
+2 −2
Original line number Diff line number Diff line
@@ -210,7 +210,7 @@ nsresult PrintTargetCG::AbortPrinting() {
  return EndPrinting();
}

nsresult PrintTargetCG::BeginPage(const IntSize& aSizeInPoints) {
nsresult PrintTargetCG::BeginPage() {
  NS_OBJC_BEGIN_TRY_BLOCK_RETURN;

  CGContextRef context;
@@ -249,7 +249,7 @@ nsresult PrintTargetCG::BeginPage(const IntSize& aSizeInPoints) {

  mCairoSurface = surface;

  return PrintTarget::BeginPage(aSizeInPoints);
  return PrintTarget::BeginPage();

  NS_OBJC_END_TRY_BLOCK_RETURN(NS_ERROR_FAILURE);
}
Loading