Bug 1053934 - Don't use the cairo context to create similar surfaces since it might be in an error state. r=jrmuizel, a=sledru
authorMatt Woodrow <mwoodrow@mozilla.com>
Thu, 28 Aug 2014 16:07:43 +1200
changeset 216817 9337f5dcf107
parent 216816 0ae1af037f6e
child 216818 d508b53c3dee
push id3924
push userryanvm@gmail.com
push date2014-09-22 17:55 +0000
treeherdermozilla-beta@9337f5dcf107 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel, sledru
bugs1053934
milestone33.0
Bug 1053934 - Don't use the cairo context to create similar surfaces since it might be in an error state. r=jrmuizel, a=sledru
gfx/2d/DrawTargetCairo.cpp
--- a/gfx/2d/DrawTargetCairo.cpp
+++ b/gfx/2d/DrawTargetCairo.cpp
@@ -1264,17 +1264,17 @@ DrawTargetCairo::CreateSourceSurfaceFrom
   }
 
   return nullptr;
 }
 
 TemporaryRef<DrawTarget>
 DrawTargetCairo::CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const
 {
-  cairo_surface_t* similar = cairo_surface_create_similar(cairo_get_target(mContext),
+  cairo_surface_t* similar = cairo_surface_create_similar(mSurface,
                                                           GfxFormatToCairoContent(aFormat),
                                                           aSize.width, aSize.height);
 
   if (!cairo_surface_status(similar)) {
     RefPtr<DrawTargetCairo> target = new DrawTargetCairo();
     target->InitAlreadyReferenced(similar, aSize);
     return target.forget();
   }