Bug 637852. Part 24: Fix scale/translate order in DrawThebesLayer. r=tnikkel

This commit is contained in:
Robert O'Callahan 2011-06-23 00:11:28 +12:00
Родитель 9d4ace85bf
Коммит 4bf1c2993b
4 изменённых файлов: 32 добавлений и 1 удалений

Просмотреть файл

@ -2041,11 +2041,11 @@ FrameLayerBuilder::DrawThebesLayer(ThebesLayer* aLayer,
// ThebesLayer
gfxContextMatrixAutoSaveRestore saveMatrix(aContext);
nsIntPoint offset = GetTranslationForThebesLayer(aLayer);
aContext->Scale(userData->mXScale, userData->mYScale);
// Apply the residual transform if it has been enabled, to ensure that
// snapping when we draw into aContext exactly matches the ideal transform.
// See above for why this is OK.
aContext->Translate(aLayer->GetResidualTranslation() - gfxPoint(offset.x, offset.y));
aContext->Scale(userData->mXScale, userData->mYScale);
nsPresContext* presContext = containerLayerFrame->PresContext();
PRInt32 appUnitsPerDevPixel = presContext->AppUnitsPerDevPixel();

Просмотреть файл

@ -0,0 +1,11 @@
<!DOCTYPE HTML>
<html>
<body>
<div id="d" style="border:20px solid black; height:200px; width:200px;">
<div style="width:200px; height:50px; background:yellow"></div>
<div style="height:100px; background:blue;"></div>
<div style="height:50px; background:orange;"></div>
</div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,19 @@
<!DOCTYPE HTML>
<html>
<body>
<div id="d" style="-moz-transform:scale(2); -moz-transform-origin:top left; border:10px solid black; height:100px; width:100px; overflow:hidden">
<canvas width="100" height="100" id="c" style="display:block"></canvas>
<div style="height:50px; background:blue;"></div>
<div style="height:50px; background:orange;"></div>
</div>
<script>
var c = document.getElementById("c");
var ctx = c.getContext("2d");
ctx.fillStyle = "yellow";
ctx.fillRect(0, 0, c.width, c.height);
var d = document.getElementById("d");
d.scrollTop = 75;
</script>
</body>
</html>

Просмотреть файл

@ -1633,6 +1633,7 @@ HTTP(..) == 635639-2.html 635639-2-ref.html
== 637597-1.html 637597-1-ref.html
== 637852-1.html 637852-1-ref.html
== 637852-2.html 637852-2-ref.html
== 637852-3.html 637852-3-ref.html
== 641770-1.html 641770-1-ref.html
== 641856-1.html 641856-1-ref.html
== 645491-1.html 645491-1-ref.html