Bug 1303534: Make sure to pop all clips before grappig the image for the top-level 'layer'. r=jrmuizel a=ritu
authorBas Schouten <bschouten@mozilla.com>
Tue, 27 Sep 2016 17:11:39 +0200
changeset 358120 6414a3001705218a78ca1a24b7ddffd689742ed3
parent 358119 55842eb51ab146662abf938022a1d8d97c5d2630
child 358121 dd846f56708c948c09a8c55b42de4f5848913aef
push id1324
push usermtabara@mozilla.com
push dateMon, 16 Jan 2017 13:07:44 +0000
treeherdermozilla-release@a01c49833940 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel, ritu
bugs1303534
milestone51.0a2
Bug 1303534: Make sure to pop all clips before grappig the image for the top-level 'layer'. r=jrmuizel a=ritu MozReview-Commit-ID: 2nHV0v7MInD
gfx/2d/DrawTargetD2D1.cpp
--- a/gfx/2d/DrawTargetD2D1.cpp
+++ b/gfx/2d/DrawTargetD2D1.cpp
@@ -1404,32 +1404,32 @@ DrawTargetD2D1::GetDeviceSpaceClipRect(D
     }
   }
   return true;
 }
 
 already_AddRefed<ID2D1Image>
 DrawTargetD2D1::GetImageForLayerContent()
 {
+  PopAllClips();
+
   if (!CurrentLayer().mCurrentList) {
     RefPtr<ID2D1Bitmap> tmpBitmap;
     HRESULT hr = mDC->CreateBitmap(D2DIntSize(mSize), D2D1::BitmapProperties(D2DPixelFormat(mFormat)), getter_AddRefs(tmpBitmap));
     if (FAILED(hr)) {
       gfxCriticalError(CriticalLog::DefaultOptions(Factory::ReasonableSurfaceSize(mSize))) << "[D2D1.1] 6CreateBitmap failure " << mSize << " Code: " << hexa(hr) << " format " << (int)mFormat;
       // For now, crash in this scenario; this should happen because tmpBitmap is
       // null and CopyFromBitmap call below dereferences it.
       // return;
     }
     mDC->Flush();
 
     tmpBitmap->CopyFromBitmap(nullptr, mBitmap, nullptr);
     return tmpBitmap.forget();
   } else {
-    PopAllClips();
-
     RefPtr<ID2D1CommandList> list = CurrentLayer().mCurrentList;
     mDC->CreateCommandList(getter_AddRefs(CurrentLayer().mCurrentList));
     mDC->SetTarget(CurrentTarget());
     list->Close();
 
     RefPtr<ID2D1Bitmap1> tmpBitmap;
     if (mDidComplexBlendWithListInList) {
       D2D1_BITMAP_PROPERTIES1 props =