Bug 1157669 - Assert aGroupTarget is not null in PaintSelfOrChildren method. r=nical
authorAmanda Sambath <amanda.sambath@phelma.grenoble-inp.fr>
Wed, 20 May 2015 10:47:29 +0200
changeset 266259 fd77898fed812d263c8599ab14cd99e364ee4bc6
parent 266258 547838f45357b8ba03a31afae9f23dc21402256a
child 266260 8964d03d95993a35709cc524e1d02df586b0cb87
push id2231
push usermichael.l.comella@gmail.com
push dateFri, 22 May 2015 20:04:59 +0000
reviewersnical
bugs1157669
milestone41.0a1
Bug 1157669 - Assert aGroupTarget is not null in PaintSelfOrChildren method. r=nical
gfx/layers/basic/BasicLayerManager.cpp
--- a/gfx/layers/basic/BasicLayerManager.cpp
+++ b/gfx/layers/basic/BasicLayerManager.cpp
@@ -788,16 +788,17 @@ Transform3D(RefPtr<SourceSurface> aSourc
   // that the caller can do this.
   return destImage.forget();
 }
 
 void
 BasicLayerManager::PaintSelfOrChildren(PaintLayerContext& aPaintContext,
                                        gfxContext* aGroupTarget)
 {
+  MOZ_ASSERT(aGroupTarget);
   BasicImplData* data = ToData(aPaintContext.mLayer);
 
   /* Only paint ourself, or our children - This optimization relies on this! */
   Layer* child = aPaintContext.mLayer->GetFirstChild();
   if (!child) {
     if (aPaintContext.mLayer->AsPaintedLayer()) {
       data->PaintThebes(aGroupTarget, aPaintContext.mLayer->GetMaskLayer(),
           aPaintContext.mCallback, aPaintContext.mCallbackData);
@@ -847,16 +848,18 @@ BasicLayerManager::FlushGroup(PaintLayer
 }
 
 void
 BasicLayerManager::PaintLayer(gfxContext* aTarget,
                               Layer* aLayer,
                               DrawPaintedLayerCallback aCallback,
                               void* aCallbackData)
 {
+  MOZ_ASSERT(aTarget);
+
   PROFILER_LABEL("BasicLayerManager", "PaintLayer",
     js::ProfileEntry::Category::GRAPHICS);
 
   PaintLayerContext paintLayerContext(aTarget, aLayer, aCallback, aCallbackData);
 
   // Don't attempt to paint layers with a singular transform, cairo will
   // just throw an error.
   if (aLayer->GetEffectiveTransform().IsSingular()) {
@@ -906,17 +909,17 @@ BasicLayerManager::PaintLayer(gfxContext
     // Don't need to clip to visible region again
     needsClipToVisibleRegion = false;
   }
   
   if (is2D) {
     paintLayerContext.AnnotateOpaqueRect();
   }
 
-  bool clipIsEmpty = !aTarget || aTarget->GetClipExtents().IsEmpty();
+  bool clipIsEmpty = aTarget->GetClipExtents().IsEmpty();
   if (clipIsEmpty) {
     PaintSelfOrChildren(paintLayerContext, aTarget);
     return;
   }
 
   if (is2D) {
     if (needsGroup) {
       nsRefPtr<gfxContext> groupTarget = PushGroupForLayer(aTarget, aLayer, aLayer->GetEffectiveVisibleRegion(),