зеркало из https://github.com/mozilla/gecko-dev.git
b=488692; full page zoom broken with canvas; r=roc
This commit is contained in:
Родитель
c5cc1fe250
Коммит
02c46cf7f7
|
@ -236,19 +236,17 @@ nsHTMLCanvasFrame::PaintCanvas(nsIRenderingContext& aRenderingContext,
|
|||
if (inner.width == 0 || inner.height == 0)
|
||||
return;
|
||||
|
||||
gfxRect devInner(presContext->AppUnitsToGfxUnits(inner));
|
||||
|
||||
nsIntSize sizeCSSPixels = GetCanvasSize();
|
||||
nsSize sizeAppUnits(nsPresContext::CSSPixelsToAppUnits(sizeCSSPixels.width),
|
||||
nsPresContext::CSSPixelsToAppUnits(sizeCSSPixels.height));
|
||||
gfxFloat sx = devInner.size.width / (gfxFloat) sizeCSSPixels.width;
|
||||
gfxFloat sy = devInner.size.height / (gfxFloat) sizeCSSPixels.height;
|
||||
|
||||
gfxContext *ctx = aRenderingContext.ThebesContext();
|
||||
|
||||
gfxFloat sx = inner.width / (gfxFloat) sizeAppUnits.width;
|
||||
gfxFloat sy = inner.height / (gfxFloat) sizeAppUnits.height;
|
||||
|
||||
ctx->Save();
|
||||
|
||||
ctx->Translate(gfxPoint(presContext->AppUnitsToGfxUnits(inner.x),
|
||||
presContext->AppUnitsToGfxUnits(inner.y)));
|
||||
ctx->Translate(devInner.pos);
|
||||
ctx->Scale(sx, sy);
|
||||
|
||||
canvas->RenderContexts(ctx);
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html reftest-zoom="2.0">
|
||||
<body style="background: black">
|
||||
<div style="width: 100px; height: 100px; background: #00ff00"></div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html reftest-zoom="2.0">
|
||||
<body style="background: black">
|
||||
<canvas width="100" height="100" id="c"></canvas>
|
||||
<script type="text/javascript">
|
||||
var cx = document.getElementById("c").getContext("2d");
|
||||
cx.fillStyle = "#00ff00";
|
||||
cx.fillRect(0, 0, 100, 100);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1229,3 +1229,4 @@ fails-if(MOZ_WIDGET_TOOLKIT=="gtk2") == 481948-3.html 481948-3-ref.html # differ
|
|||
== 487539-1.html about:blank
|
||||
== 488390-1.html 488390-1-ref.html
|
||||
== 488685-1.html 488685-1-ref.html
|
||||
== 488692-1.html 488692-1-ref.html
|
||||
|
|
Загрузка…
Ссылка в новой задаче