Commit 1b135621 authored by Cosmin Sabou's avatar Cosmin Sabou
Browse files

Merge mozilla-inbound to mozilla-central. a=merge

parents 3ef458c2 85c590de
Loading
Loading
Loading
Loading
+37 −5
Original line number Diff line number Diff line
@@ -144,8 +144,22 @@ static void TexSubImage2DWithoutUnpackSubimage(
  // isn't supported. We make a copy of the texture data we're using,
  // such that we're using the whole row of data in the copy. This turns
  // out to be more efficient than uploading row-by-row; see bug 698197.
  unsigned char* newPixels =
      new (fallible) unsigned char[width * height * pixelsize];

  // Width and height are never more than 16384. At 16Ki*16Ki, 4bpp is 1GiB, but
  // if we allow 8bpp (or higher) here, that's 2GiB, which would overflow on
  // 32-bit.
  MOZ_ASSERT(width <= 16384);
  MOZ_ASSERT(height <= 16384);
  MOZ_ASSERT(pixelsize < 8);

  const auto size = CheckedInt<size_t>(width) * height * pixelsize;
  if (!size.isValid()) {
    // This should never happen, but we use a defensive check.
    MOZ_ASSERT_UNREACHABLE("Unacceptable size calculated.!");
    return;
  }

  unsigned char* newPixels = new (fallible) unsigned char[size.value()];

  if (newPixels) {
    unsigned char* rowDest = newPixels;
@@ -240,8 +254,22 @@ static void TexImage2DHelper(GLContext* gl, GLenum target, GLint level,
      GLsizei paddedWidth = RoundUpPow2((uint32_t)width);
      GLsizei paddedHeight = RoundUpPow2((uint32_t)height);

      GLvoid* paddedPixels =
          new unsigned char[paddedWidth * paddedHeight * pixelsize];
      // Width and height are never more than 16384. At 16Ki*16Ki, 4bpp is 1GiB,
      // but if we allow 8bpp (or higher) here, that's 2GiB, which would
      // overflow on 32-bit.
      MOZ_ASSERT(width <= 16384);
      MOZ_ASSERT(height <= 16384);
      MOZ_ASSERT(pixelsize < 8);

      const auto size =
          CheckedInt<size_t>(paddedWidth) * paddedHeight * pixelsize;
      if (!size.isValid()) {
        // This should never happen, but we use a defensive check.
        MOZ_ASSERT_UNREACHABLE("Unacceptable size calculated.!");
        return;
      }

      GLvoid* paddedPixels = new unsigned char[size.value()];

      // Pad out texture data to be in a POT sized buffer for uploading to
      // a POT sized texture
@@ -383,13 +411,17 @@ SurfaceFormat UploadImageDataToTexture(
      pixelSize = 2;
      break;
    default:
      NS_ASSERTION(false, "Unhandled image surface format!");
      MOZ_ASSERT_UNREACHABLE("Unhandled image surface format!");
  }

  if (aOutUploadSize) {
    *aOutUploadSize = 0;
  }

  if (surfaceFormat == gfx::SurfaceFormat::UNKNOWN) {
    return gfx::SurfaceFormat::UNKNOWN;
  }

  if (aNeedInit || !CanUploadSubTextures(gl)) {
    // If the texture needs initialized, or we are unable to
    // upload sub textures, then initialize and upload the entire
+1 −1
Original line number Diff line number Diff line
@@ -1232,7 +1232,7 @@ void nsPrintJob::ShowPrintProgress(bool aIsForPrinting, bool& aDoNotify) {
      nsCOMPtr<nsIWebProgressListener> printProgressListener;

      nsCOMPtr<nsIWebBrowserPrint> wbp(do_QueryInterface(mDocViewerPrint));
      nsresult rv = printPromptService->ShowProgress(
      nsresult rv = printPromptService->ShowPrintProgressDialog(
          domWin, wbp, printData->mPrintSettings, this, aIsForPrinting,
          getter_AddRefs(printProgressListener),
          getter_AddRefs(printData->mPrintProgressParams), &aDoNotify);
+20 −25
Original line number Diff line number Diff line
@@ -36,8 +36,8 @@ interface nsIPrintingPromptService : nsISupports
   *
   *           Defaults for platform service:           
   *             showPrintDialog           - displays a native dialog
   *             showPageSetup         - displays a XUL dialog
   *             showProgress          - displays a XUL dialog
   *             showPrintProgressDialog   - displays a XUL dialog
   *             showPageSetupDialog       - displays a XUL dialog
   *
   *           Summary for Windows Embedders:
   *             Stated once again: There is no "fallback" native platform support in GFX for the
@@ -68,21 +68,16 @@ interface nsIPrintingPromptService : nsISupports
   *       If an embedder implemented service returns NS_ERROR_NOT_IMPLEMENTED for "showPrintDialog"
   *       The toolkit will display the native print dialog.
   *
   *       Defaults for platform service:           
   *       Mac OS9: showPrintDialog       - displays a native dialog
   *                showPageSetup         - displays a native dialog
   *                showProgress          - displays a XUL dialog
   *
   *       Mac OSX: showPrintDialog           - displays a native dialog
   *                showPageSetup         - displays a native dialog
   *                showProgress          - not implemented (provided by OS)
   *                showPrintProgressDialog   - not implemented (provided by OS)
   *                showPageSetupDialog       - displays a native dialog
   *
   *  GTK: There are no native dialog for GTK.
   *
   *       Defaults for platform service:
   *         showPrintDialog           - displays a native dialog
   *         showPageSetup         - displays a native dialog
   *         showProgress          - displays a XUL dialog
   *         showPrintProgressDialog   - displays a XUL dialog
   *         showPageSetupDialog       - displays a native dialog
   *
   */
 
@@ -115,7 +110,7 @@ interface nsIPrintingPromptService : nsISupports
   *                        (usually the caller) shouldn't wait
   *                        For Print Preview Progress there is intermediate progress
   */
  void showProgress(in mozIDOMWindowProxy parent,
  void showPrintProgressDialog(in mozIDOMWindowProxy parent,
                               in nsIWebBrowserPrint webBrowserPrint,
                               in nsIPrintSettings printSettings,
                               in nsIObserver openDialogObserver,
@@ -125,12 +120,12 @@ interface nsIPrintingPromptService : nsISupports
                               out boolean notifyOnOpen);

  /**
   *  Shows the print progress dialog
   *  Shows the print page setup dialog
   *
   *  @param parent - a DOM windows the dialog will be parented to (required)
   *  @param printSettings - PrintSettings for page setup (required)
   */
  void showPageSetup(in mozIDOMWindowProxy parent,
  void showPageSetupDialog(in mozIDOMWindowProxy parent,
                           in nsIPrintSettings printSettings);

};
+4 −4
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ var PrintUtils = {
      var printSettings = this.getPrintSettings();
      var PRINTPROMPTSVC = Cc["@mozilla.org/embedcomp/printingprompt-service;1"]
                             .getService(Ci.nsIPrintingPromptService);
      PRINTPROMPTSVC.showPageSetup(window, printSettings, null);
      PRINTPROMPTSVC.showPageSetupDialog(window, printSettings, null);
      if (gSavePrintSettings) {
        // Page Setup data is a "native" setting on the Mac
        var PSSVC = Cc["@mozilla.org/gfx/printsettings-service;1"]
@@ -217,7 +217,7 @@ var PrintUtils = {
    // just in case we are already printing,
    // an error code could be returned if the Progress Dialog is already displayed
    try {
      PPROMPTSVC.showProgress(window, null, printSettings, this._obsPP, false,
      PPROMPTSVC.showPrintProgressDialog(window, null, printSettings, this._obsPP, false,
                                         this._webProgressPP, ppParams, notifyOnOpen);
      if (ppParams.value) {
        ppParams.value.docTitle = this._originalTitle;
@@ -424,7 +424,7 @@ var PrintUtils = {
  enterPrintPreview() {
    // Send a message to the print preview browser to initialize
    // print preview. If we happen to have gotten a print preview
    // progress listener from nsIPrintingPromptService.showProgress
    // progress listener from nsIPrintingPromptService.showPrintProgressDialog
    // in printPreview, we add listeners to feed that progress
    // listener.
    let ppBrowser = this._shouldSimplify ?
+4 −3
Original line number Diff line number Diff line
@@ -47,7 +47,8 @@ mozilla::ipc::IPCResult PrintingParent::RecvShowProgress(

  nsresult rv = NS_ERROR_INVALID_ARG;
  if (parentWin && pps) {
    rv = pps->ShowProgress(parentWin, nullptr, nullptr, observer, isForPrinting,
    rv = pps->ShowPrintProgressDialog(
        parentWin, nullptr, nullptr, observer, isForPrinting,
        getter_AddRefs(printProgressListener),
        getter_AddRefs(printProgressParams), &notifyOnOpen);
  }
Loading