Bug 1275478 - Workaround for svg mask on windows. r=mstange
authorEthan Lin <ethlin@mozilla.com>
Tue, 31 May 2016 16:07:38 +0800
changeset 340692 d813f7d5f90cba36d4401e970f4b559cb3153f72
parent 340691 2c86039b1c6868c2606d343e0906c645468c3fcc
child 340693 373e67c2caaddfec3d3901e038804543c3da9afb
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1275478
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1275478 - Workaround for svg mask on windows. r=mstange MozReview-Commit-ID: GilZz7AJTQX
layout/svg/nsSVGIntegrationUtils.cpp
--- a/layout/svg/nsSVGIntegrationUtils.cpp
+++ b/layout/svg/nsSVGIntegrationUtils.cpp
@@ -459,17 +459,18 @@ GenerateMaskSurface(const nsSVGIntegrati
   gfxRect clipExtents = ctx.GetClipExtents();
   IntRect maskSurfaceRect = RoundedOut(ToRect(clipExtents));
   ctx.Restore();
 
   // Mask composition result on CoreGraphic::A8 surface is not correct
   // when mask-mode is not add(source over). Switch to skia when CG backend
   // detected.
   RefPtr<DrawTarget> maskDT =
-    (ctx.GetDrawTarget()->GetBackendType() == BackendType::COREGRAPHICS)
+    (ctx.GetDrawTarget()->GetBackendType() == BackendType::COREGRAPHICS ||
+     ctx.GetDrawTarget()->GetBackendType() == BackendType::DIRECT2D1_1)
     ? Factory::CreateDrawTarget(BackendType::SKIA, maskSurfaceRect.Size(),
                                 SurfaceFormat::A8)
     : ctx.GetDrawTarget()->CreateSimilarDrawTarget(maskSurfaceRect.Size(),
                                                    SurfaceFormat::A8);
   RefPtr<gfxContext> maskContext = gfxContext::ForDrawTarget(maskDT);
 
   // Set ctx's matrix on maskContext, offset by the maskSurfaceRect's position.
   // This makes sure that we combine the masks in device space.