mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Bug 913999 - DrawWindow() - Remove hard-coded 1.0f in DrawOptions and only use Azure if alpha is not needed. r=mattwoodrow
This commit is contained in:
parent
94679ac4ab
commit
b74634d801
@ -3660,7 +3660,11 @@ CanvasRenderingContext2D::DrawWindow(nsGlobalWindow& window, double x,
|
|||||||
}
|
}
|
||||||
nsRefPtr<gfxContext> thebes;
|
nsRefPtr<gfxContext> thebes;
|
||||||
RefPtr<DrawTarget> drawDT;
|
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 = new gfxContext(mTarget);
|
||||||
thebes->SetMatrix(gfxMatrix(matrix._11, matrix._12, matrix._21,
|
thebes->SetMatrix(gfxMatrix(matrix._11, matrix._12, matrix._21,
|
||||||
matrix._22, matrix._31, matrix._32));
|
matrix._22, matrix._31, matrix._32));
|
||||||
@ -3698,7 +3702,7 @@ CanvasRenderingContext2D::DrawWindow(nsGlobalWindow& window, double x,
|
|||||||
mgfx::Rect sourceRect(0, 0, sw, sh);
|
mgfx::Rect sourceRect(0, 0, sw, sh);
|
||||||
mTarget->DrawSurface(source, destRect, sourceRect,
|
mTarget->DrawSurface(source, destRect, sourceRect,
|
||||||
DrawSurfaceOptions(mgfx::Filter::POINT),
|
DrawSurfaceOptions(mgfx::Filter::POINT),
|
||||||
DrawOptions(1.0f, CompositionOp::OP_OVER,
|
DrawOptions(GlobalAlpha(), CompositionOp::OP_OVER,
|
||||||
AntialiasMode::NONE));
|
AntialiasMode::NONE));
|
||||||
mTarget->Flush();
|
mTarget->Flush();
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user