Backed out 7 changesets (bug 1316750, bug 1317295, bug 1316299) for windows vm debug reftest failures a=backout
authorWes Kocher <wkocher@mozilla.com>
Mon, 14 Nov 2016 16:44:52 -0800
changeset 322462 91b1add28ef64ca507a1c1c14db2031ae37c992b
parent 322461 039eb9887533e5a33d33f4a655ff988c2f38e348
child 322463 b59d2d54fc63e453544f98b8270c196815a45582
push id83881
push userkwierso@gmail.com
push dateTue, 15 Nov 2016 00:45:06 +0000
treeherdermozilla-inbound@91b1add28ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1316750, 1317295, 1316299
milestone52.0a1
backs outc0d0caa11f5a56edbede98532513861c61f7de34
e222819961af854aed85dfccc346b03e3de0d477
fb46a1dc34f92d6c8d9a2244edd73e2d394af5db
732a96ceaf9f42a05419d9df487566d33aa61715
5b62b77eb236e81ad833cfa57dad77902c51b823
ac5ea2dc6c60ba42d900b81051161110232c9949
9508c116ecd7df49d5380d1a7478e9994ca47a15
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 7 changesets (bug 1316750, bug 1317295, bug 1316299) for windows vm debug reftest failures a=backout Backed out changeset c0d0caa11f5a (bug 1316750) Backed out changeset e222819961af (bug 1316750) Backed out changeset fb46a1dc34f9 (bug 1316750) Backed out changeset 732a96ceaf9f (bug 1316750) Backed out changeset 5b62b77eb236 (bug 1316299) Backed out changeset ac5ea2dc6c60 (bug 1317295) Backed out changeset 9508c116ecd7 (bug 1316750)
gfx/2d/DrawTargetSkia.cpp
gfx/2d/HelpersCairo.h
gfx/src/nsDeviceContext.cpp
gfx/thebes/PrintTarget.cpp
gfx/thebes/PrintTarget.h
gfx/thebes/PrintTargetThebes.cpp
gfx/thebes/PrintTargetThebes.h
--- a/gfx/2d/DrawTargetSkia.cpp
+++ b/gfx/2d/DrawTargetSkia.cpp
@@ -1568,17 +1568,17 @@ DrawTargetSkia::CreateSimilarDrawTarget(
   }
 #endif
 
 #ifdef DEBUG
   // Check that our SkCanvas isn't backed by vector storage such as PDF.  If it
   // is then we want similar storage to avoid losing fidelity (if and when this
   // DrawTarget is Snapshot()'ed, drawning a raster back into this DrawTarget
   // will lose fidelity).
-  if (mCanvas->imageInfo().colorType() == kUnknown_SkColorType) {
+  if (mCanvas->imageInfo().colorType() != kUnknown_SkColorType) {
     NS_WARNING("Not backed by pixels - we need to handle PDF backed SkCanvas");
   }
 #endif
 
   if (!target->Init(aSize, aFormat)) {
     return nullptr;
   }
   return target.forget();
--- a/gfx/2d/HelpersCairo.h
+++ b/gfx/2d/HelpersCairo.h
@@ -160,33 +160,16 @@ GfxFormatToCairoFormat(SurfaceFormat for
     case SurfaceFormat::R5G6B5_UINT16:
       return CAIRO_FORMAT_RGB16_565;
     default:
       gfxCriticalError() << "Unknown image format " << (int)format;
       return CAIRO_FORMAT_ARGB32;
   }
 }
 
-static inline cairo_format_t
-CairoContentToCairoFormat(cairo_content_t content)
-{
-  switch (content)
-  {
-    case CAIRO_CONTENT_COLOR:
-      return CAIRO_FORMAT_RGB24;
-    case CAIRO_CONTENT_ALPHA:
-      return CAIRO_FORMAT_A8;
-    case CAIRO_CONTENT_COLOR_ALPHA:
-      return CAIRO_FORMAT_ARGB32;
-    default:
-      gfxCriticalError() << "Unknown cairo content type " << (int)content;
-      return CAIRO_FORMAT_A8; // least likely to cause OOB reads
-  }
-}
-
 static inline cairo_content_t
 GfxFormatToCairoContent(SurfaceFormat format)
 {
   switch (format)
   {
     case SurfaceFormat::A8R8G8B8_UINT32:
       return CAIRO_CONTENT_COLOR_ALPHA;
     case SurfaceFormat::X8R8G8B8_UINT32:
--- a/gfx/src/nsDeviceContext.cpp
+++ b/gfx/src/nsDeviceContext.cpp
@@ -361,17 +361,17 @@ nsDeviceContext::CreateRenderingContextC
 #endif
 
     // This will usually be null, depending on the pref print.print_via_parent.
     RefPtr<DrawEventRecorder> recorder;
     mDeviceContextSpec->GetDrawEventRecorder(getter_AddRefs(recorder));
 
     RefPtr<gfx::DrawTarget> dt;
     if (aWantReferenceContext) {
-      dt = printingTarget->GetReferenceDrawTarget(recorder);
+      dt = printingTarget->GetReferenceDrawTarget();
     } else {
       dt = printingTarget->MakeDrawTarget(gfx::IntSize(mWidth, mHeight), recorder);
     }
 
     if (!dt || !dt->IsValid()) {
       gfxCriticalNote
         << "Failed to create draw target in device context sized "
         << mWidth << "x" << mHeight << " and pointers "
--- a/gfx/thebes/PrintTarget.cpp
+++ b/gfx/thebes/PrintTarget.cpp
@@ -1,24 +1,17 @@
 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "PrintTarget.h"
 
 #include "cairo.h"
-#ifdef CAIRO_HAS_QUARTZ_SURFACE
-#include "cairo-quartz.h"
-#endif
-#ifdef CAIRO_HAS_WIN32_SURFACE
-#include "cairo-win32.h"
-#endif
 #include "mozilla/gfx/2D.h"
-#include "mozilla/gfx/HelpersCairo.h"
 #include "mozilla/gfx/Logging.h"
 
 namespace mozilla {
 namespace gfx {
 
 PrintTarget::PrintTarget(cairo_surface_t* aCairoSurface, const IntSize& aSize)
   : mCairoSurface(aCairoSurface)
   , mSize(aSize)
@@ -86,65 +79,40 @@ PrintTarget::MakeDrawTarget(const IntSiz
       return nullptr;
     }
   }
 
   return dt.forget();
 }
 
 already_AddRefed<DrawTarget>
-PrintTarget::GetReferenceDrawTarget(DrawEventRecorder* aRecorder)
+PrintTarget::GetReferenceDrawTarget()
 {
   if (!mRefDT) {
-    const IntSize size(1, 1);
+    IntSize size(1, 1);
 
-    cairo_surface_t* similar;
-    switch (cairo_surface_get_type(mCairoSurface)) {
-#ifdef CAIRO_HAS_WIN32_SURFACE
-    case CAIRO_SURFACE_TYPE_WIN32:
-      similar = cairo_win32_surface_create_with_dib(
-        CairoContentToCairoFormat(cairo_surface_get_content(mCairoSurface)),
-        size.width, size.height);
-      break;
-#endif
-#ifdef CAIRO_HAS_QUARTZ_SURFACE
-    case CAIRO_SURFACE_TYPE_QUARTZ:
-      similar = cairo_quartz_surface_create_cg_layer(
-                  mCairoSurface, cairo_surface_get_content(mCairoSurface),
-                  size.width, size.height);
-      break;
-#endif
-    default:
-      similar = cairo_surface_create_similar(
-                  mCairoSurface, cairo_surface_get_content(mCairoSurface),
-                  size.width, size.height);
-      break;
-    }
+    cairo_surface_t* surface =
+      cairo_surface_create_similar(mCairoSurface,
+                                   cairo_surface_get_content(mCairoSurface),
+                                   size.width, size.height);
 
-    if (cairo_surface_status(similar)) {
+    if (cairo_surface_status(surface)) {
       return nullptr;
     }
 
     RefPtr<DrawTarget> dt =
-      Factory::CreateDrawTargetForCairoSurface(similar, size);
+      Factory::CreateDrawTargetForCairoSurface(surface, size);
 
     // The DT addrefs the surface, so we need drop our own reference to it:
-    cairo_surface_destroy(similar);
+    cairo_surface_destroy(surface);
 
     if (!dt || !dt->IsValid()) {
       return nullptr;
     }
 
-    if (aRecorder) {
-      dt = CreateRecordingDrawTarget(aRecorder, dt);
-      if (!dt || !dt->IsValid()) {
-        return nullptr;
-      }
-    }
-
     mRefDT = dt.forget();
   }
   return do_AddRef(mRefDT);
 }
 
 already_AddRefed<DrawTarget>
 PrintTarget::CreateRecordingDrawTarget(DrawEventRecorder* aRecorder,
                                        DrawTarget* aDrawTarget)
--- a/gfx/thebes/PrintTarget.h
+++ b/gfx/thebes/PrintTarget.h
@@ -126,17 +126,17 @@ public:
                  DrawEventRecorder* aRecorder = nullptr);
 
   /**
    * Returns a reference DrawTarget. Unlike MakeDrawTarget, this method is not
    * restricted to being called between BeginPage()/EndPage() calls, and the
    * returned DrawTarget it is still valid to use after EndPage() has been
    * called.
    */
-  virtual already_AddRefed<DrawTarget> GetReferenceDrawTarget(DrawEventRecorder* aRecorder);
+  virtual already_AddRefed<DrawTarget> GetReferenceDrawTarget();
 
 protected:
 
   // Only created via subclass's constructors
   explicit PrintTarget(cairo_surface_t* aCairoSurface, const IntSize& aSize);
 
   // Protected because we're refcounted
   virtual ~PrintTarget();
--- a/gfx/thebes/PrintTargetThebes.cpp
+++ b/gfx/thebes/PrintTargetThebes.cpp
@@ -52,30 +52,24 @@ PrintTargetThebes::MakeDrawTarget(const 
       return nullptr;
     }
   }
 
   return dt.forget();
 }
 
 already_AddRefed<DrawTarget>
-PrintTargetThebes::GetReferenceDrawTarget(DrawEventRecorder* aRecorder)
+PrintTargetThebes::GetReferenceDrawTarget()
 {
   if (!mRefDT) {
     RefPtr<gfx::DrawTarget> dt =
       gfxPlatform::GetPlatform()->CreateDrawTargetForSurface(mGfxSurface, mSize);
     if (!dt || !dt->IsValid()) {
       return nullptr;
     }
-    if (aRecorder) {
-      dt = CreateRecordingDrawTarget(aRecorder, dt);
-      if (!dt || !dt->IsValid()) {
-        return nullptr;
-      }
-    }
     mRefDT = dt->CreateSimilarDrawTarget(IntSize(1,1), dt->GetFormat());
   }
   return do_AddRef(mRefDT);
 }
 
 nsresult
 PrintTargetThebes::BeginPrinting(const nsAString& aTitle,
                                  const nsAString& aPrintToFileName)
--- a/gfx/thebes/PrintTargetThebes.h
+++ b/gfx/thebes/PrintTargetThebes.h
@@ -36,17 +36,17 @@ public:
   virtual nsresult BeginPage() override;
   virtual nsresult EndPage() override;
   virtual void Finish() override;
 
   virtual already_AddRefed<DrawTarget>
   MakeDrawTarget(const IntSize& aSize,
                  DrawEventRecorder* aRecorder = nullptr) override;
 
-  virtual already_AddRefed<DrawTarget> GetReferenceDrawTarget(DrawEventRecorder* aRecorder) final;
+  virtual already_AddRefed<DrawTarget> GetReferenceDrawTarget() final;
 
 private:
 
   // Only created via CreateOrNull
   explicit PrintTargetThebes(gfxASurface* aSurface);
 
   RefPtr<gfxASurface> mGfxSurface;
 };