Bug 1358053 - Remove DataSourceSurface assertion when doing snapshot in WebGL; r?jgilbert draft
authorDaosheng Mu <daoshengmu@gmail.com>
Thu, 27 Apr 2017 17:38:37 +0800
changeset 569291 572aebca992c0e28f48f4f8cd2623e513eb95c2b
parent 569138 0b77ed3f26c5335503bc16e85b8c067382e7bb1e
child 626168 33be1d6e83bf986ca8c46891d29225b28062fbd1
push id56131
push userbmo:dmu@mozilla.com
push dateThu, 27 Apr 2017 09:45:27 +0000
reviewersjgilbert
bugs1358053
milestone55.0a1
Bug 1358053 - Remove DataSourceSurface assertion when doing snapshot in WebGL; r?jgilbert MozReview-Commit-ID: 6LhmY1ouNZ9
dom/canvas/ImageBitmap.cpp
--- a/dom/canvas/ImageBitmap.cpp
+++ b/dom/canvas/ImageBitmap.cpp
@@ -863,20 +863,16 @@ ImageBitmap::CreateInternal(nsIGlobalObj
 
   // If the HTMLCanvasElement's rendering context is WebGL, then the snapshot
   // we got from the HTMLCanvasElement is a DataSourceSurface which is a copy
   // of the rendering context. We handle cropping in this case.
   bool needToReportMemoryAllocation = false;
   if ((aCanvasEl.GetCurrentContextType() == CanvasContextType::WebGL1 ||
        aCanvasEl.GetCurrentContextType() == CanvasContextType::WebGL2) &&
       aCropRect.isSome()) {
-    // The _surface_ must be a DataSourceSurface.
-    MOZ_ASSERT(surface->IsDataSourceSurface(),
-               "The snapshot SourceSurface from WebGL rendering contest is not \
-               DataSourceSurface.");
     RefPtr<DataSourceSurface> dataSurface = surface->GetDataSurface();
     croppedSurface = CropAndCopyDataSourceSurface(dataSurface, cropRect);
     cropRect.MoveTo(0, 0);
     needToReportMemoryAllocation = true;
   }
   else {
     croppedSurface = surface;
   }