Bug 1285857 - Switch to SKIA from D2D1 when rendering mask image with luminance mode. r=mstange
authorEthan Lin <ethlin@mozilla.com>
Thu, 14 Jul 2016 23:09:00 +0200
changeset 346865 0bae57fa83b7203b893a810da7907b8d160869b8
parent 346864 23acad9c31c780b4fea54fb1501fcce61d530409
child 346866 737a34eee8e6d108eab6046d720f41505a35091d
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1285857
milestone50.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 1285857 - Switch to SKIA from D2D1 when rendering mask image with luminance mode. r=mstange
layout/base/nsCSSRendering.cpp
--- a/layout/base/nsCSSRendering.cpp
+++ b/layout/base/nsCSSRendering.cpp
@@ -5315,18 +5315,20 @@ nsImageRenderer::Draw(nsPresContext*    
   DrawResult result = DrawResult::SUCCESS;
   RefPtr<gfxContext> ctx = aRenderingContext.ThebesContext();
   IntRect tmpDTRect;
 
   if (ctx->CurrentOp() != CompositionOp::OP_OVER || mMaskOp == NS_STYLE_MASK_MODE_LUMINANCE) {
     gfxRect clipRect = ctx->GetClipExtents();
     tmpDTRect = RoundedOut(ToRect(clipRect));
     RefPtr<DrawTarget> tempDT =
+      Factory::DoesBackendSupportDataDrawtarget(ctx->GetDrawTarget()->GetBackendType()) ?
       ctx->GetDrawTarget()->CreateSimilarDrawTarget(tmpDTRect.Size(),
-                                                    SurfaceFormat::B8G8R8A8);
+                                                    SurfaceFormat::B8G8R8A8) :
+      Factory::CreateDrawTarget(BackendType::SKIA, tmpDTRect.Size(), SurfaceFormat::B8G8R8A8);
     if (!tempDT || !tempDT->IsValid()) {
       gfxDevCrash(LogReason::InvalidContext) << "ImageRenderer::Draw problem " << gfx::hexa(tempDT);
       return DrawResult::TEMPORARY_ERROR;
     }
     tempDT->SetTransform(Matrix::Translation(-tmpDTRect.TopLeft()));
     ctx = gfxContext::CreatePreservingTransformOrNull(tempDT);
     if (!ctx) {
       gfxDevCrash(LogReason::InvalidContext) << "ImageRenderer::Draw problem " << gfx::hexa(tempDT);