From 39f1eb287e0b37db238c444df8176f2efc94d325 Mon Sep 17 00:00:00 2001 From: "L. David Baron" Date: Mon, 14 Apr 2014 11:11:59 -0700 Subject: [PATCH] Bug 995661 patch 1 - Remove dead code resulting from removal of gfxPlatform::SupportsAzureContent(). r=mattwoodrow This should have been removed in bug 985049. The changes here can be understood as a simplification based on drawSurf always being null. --- .../canvas/src/CanvasRenderingContext2D.cpp | 36 +++++-------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/content/canvas/src/CanvasRenderingContext2D.cpp b/content/canvas/src/CanvasRenderingContext2D.cpp index b9d470382ae..78feab03bbc 100755 --- a/content/canvas/src/CanvasRenderingContext2D.cpp +++ b/content/canvas/src/CanvasRenderingContext2D.cpp @@ -3635,7 +3635,6 @@ CanvasRenderingContext2D::DrawWindow(nsGlobalWindow& window, double x, return; } nsRefPtr thebes; - nsRefPtr drawSurf; RefPtr drawDT; if (gfxPlatform::GetPlatform()->SupportsAzureContentForDrawTarget(mTarget)) { thebes = new gfxContext(mTarget); @@ -3656,34 +3655,15 @@ CanvasRenderingContext2D::DrawWindow(nsGlobalWindow& window, double x, nsCOMPtr shell = presContext->PresShell(); unused << shell->RenderDocument(r, renderDocFlags, backgroundColor, thebes); - if (drawSurf || drawDT) { - RefPtr source; + if (drawDT) { + RefPtr snapshot = drawDT->Snapshot(); + RefPtr data = snapshot->GetDataSurface(); - if (drawSurf) { - gfxIntSize size = drawSurf->GetSize(); - - drawSurf->SetDeviceOffset(gfxPoint(0, 0)); - nsRefPtr img = drawSurf->GetAsReadableARGB32ImageSurface(); - if (!img || !img->Data()) { - error.Throw(NS_ERROR_FAILURE); - return; - } - - source = - mTarget->CreateSourceSurfaceFromData(img->Data(), - IntSize(size.width, size.height), - img->Stride(), - SurfaceFormat::B8G8R8A8); - } else { - RefPtr snapshot = drawDT->Snapshot(); - RefPtr data = snapshot->GetDataSurface(); - - source = - mTarget->CreateSourceSurfaceFromData(data->GetData(), - data->GetSize(), - data->Stride(), - data->GetFormat()); - } + RefPtr source = + mTarget->CreateSourceSurfaceFromData(data->GetData(), + data->GetSize(), + data->Stride(), + data->GetFormat()); if (!source) { error.Throw(NS_ERROR_FAILURE);