Skip to content

Commit

Permalink
Bug 913999 - DrawWindow() - Remove hard-coded 1.0f in DrawOptions and…
Browse files Browse the repository at this point in the history
… only use Azure if alpha is not needed. r=mattwoodrow
  • Loading branch information
waltermoz committed Jul 2, 2014
1 parent 94679ac commit b74634d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions content/canvas/src/CanvasRenderingContext2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3660,7 +3660,11 @@ CanvasRenderingContext2D::DrawWindow(nsGlobalWindow& window, double x,
}
nsRefPtr<gfxContext> thebes;
RefPtr<DrawTarget> drawDT;
if (gfxPlatform::GetPlatform()->SupportsAzureContentForDrawTarget(mTarget)) {
// Rendering directly is faster and can be done if mTarget supports Azure
// and does not need alpha blending.
if (gfxPlatform::GetPlatform()->SupportsAzureContentForDrawTarget(mTarget) &&
GlobalAlpha() == 1.0f)
{
thebes = new gfxContext(mTarget);
thebes->SetMatrix(gfxMatrix(matrix._11, matrix._12, matrix._21,
matrix._22, matrix._31, matrix._32));
Expand Down Expand Up @@ -3698,7 +3702,7 @@ CanvasRenderingContext2D::DrawWindow(nsGlobalWindow& window, double x,
mgfx::Rect sourceRect(0, 0, sw, sh);
mTarget->DrawSurface(source, destRect, sourceRect,
DrawSurfaceOptions(mgfx::Filter::POINT),
DrawOptions(1.0f, CompositionOp::OP_OVER,
DrawOptions(GlobalAlpha(), CompositionOp::OP_OVER,
AntialiasMode::NONE));
mTarget->Flush();
} else {
Expand Down

0 comments on commit b74634d

Please sign in to comment.