Bug 1316299 - Change assertion in DrawTargetSkia::CreateSimilarDrawTarget to a warning. r=lsalzman
authorJonathan Watt <jwatt@jwatt.org>
Mon, 31 Oct 2016 15:05:30 +0000
changeset 351959 b3d68ce32250fbaeb3ce452fb7e40746cee6d431
parent 351958 fba4215e5201bb4028be3b9e93dbbeae767f6ad4
child 351960 e53f60855051805aa7bf0a1875e7e246c84db997
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslsalzman
bugs1316299
milestone52.0a1
Bug 1316299 - Change assertion in DrawTargetSkia::CreateSimilarDrawTarget to a warning. r=lsalzman
gfx/2d/DrawTargetSkia.cpp
--- a/gfx/2d/DrawTargetSkia.cpp
+++ b/gfx/2d/DrawTargetSkia.cpp
@@ -1562,20 +1562,27 @@ DrawTargetSkia::CreateSimilarDrawTarget(
     // Try to create a GPU draw target first if we're currently using the GPU.
     // Mark the DT as cached so that shadow DTs, extracted subrects, and similar can be reused.
     if (target->InitWithGrContext(mGrContext.get(), aSize, aFormat, true)) {
       return target.forget();
     }
     // Otherwise, just fall back to a software draw target.
   }
 #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.
-  MOZ_ASSERT(mCanvas->imageInfo().colorType() != kUnknown_SkColorType,
-             "Not backed by pixels - we need to handle PDF backed SkCanvas");
+  // 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) {
+    NS_WARNING("Not backed by pixels - we need to handle PDF backed SkCanvas");
+  }
+#endif
+
   if (!target->Init(aSize, aFormat)) {
     return nullptr;
   }
   return target.forget();
 }
 
 bool
 DrawTargetSkia::UsingSkiaGPU() const