Bug 1358053 - Remove DataSourceSurface assertion when doing snapshot in WebGL; r?jgilbert
MozReview-Commit-ID: 6LhmY1ouNZ9
--- 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;
}