Backout 467595d39929 (bug 1118328) for build bustage on a CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Wed, 07 Jan 2015 16:53:13 -0800
changeset 235595 92190a900cb0b1a5407f347cdd17a5d6b5d5b0d8
parent 235594 9e0680f301a418b77cc56220a72ef48ae2a18329
child 235596 b30f55f7f94cf1c3f1be50e90d90c9fa79c2145c
push id366
push usercmanchester@mozilla.com
push dateThu, 08 Jan 2015 16:40:24 +0000
bugs1118328
milestone37.0a1
backs out467595d3992901497c87fa93b465b9079b22bc5b
Backout 467595d39929 (bug 1118328) for build bustage on a CLOSED TREE
gfx/thebes/gfxPlatform.cpp
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -1177,22 +1177,26 @@ gfxPlatform::CreateOffscreenContentDrawT
   return CreateDrawTargetForBackend(mContentBackend, aSize, aFormat);
 }
 
 TemporaryRef<DrawTarget>
 gfxPlatform::CreateDrawTargetForData(unsigned char* aData, const IntSize& aSize, int32_t aStride, SurfaceFormat aFormat)
 {
   NS_ASSERTION(mContentBackend != BackendType::NONE, "No backend.");
 
-  BackendType backendType = Factory::DoesBackendSupportDataDrawtarget(mContentBackend) ? mContentBackend : BackendType::CAIRO;
-
-  RefPtr<DrawTarget> dt = Factory::CreateDrawTargetForData(backendType,
+  RefPtr<DrawTarget> dt = Factory::CreateDrawTargetForData(mContentBackend,
                                                            aData, aSize,
                                                            aStride, aFormat);
-
+  if (!dt) {
+    // Factory::CreateDrawTargetForData does not support mContentBackend; retry
+    // with BackendType::CAIRO:
+    dt = Factory::CreateDrawTargetForData(BackendType::CAIRO,
+                                          aData, aSize,
+                                          aStride, aFormat);
+  }
   return dt.forget();
 }
 
 /* static */ BackendType
 gfxPlatform::BackendTypeForName(const nsCString& aName)
 {
   if (aName.EqualsLiteral("cairo"))
     return BackendType::CAIRO;