Bug 1169331 - Always clip rotated buffer quadrant drawing to the fill rect. r=jrmuizel

This commit is contained in:
Markus Stange 2015-06-05 13:34:54 -04:00
parent c8056f28c1
commit a1602b0b0d
4 changed files with 109 additions and 10 deletions

View File

@ -113,13 +113,13 @@ RotatedBuffer::DrawBufferQuadrant(gfx::DrawTarget* aTarget,
}
}
if (aOperator == CompositionOp::OP_SOURCE) {
// OP_SOURCE is unbounded in Azure, and we really don't want that behaviour here.
// We also can't do a ClearRect+FillRect since we need the drawing to happen
// as an atomic operation (to prevent flickering).
aTarget->PushClipRect(gfx::Rect(fillRect.x, fillRect.y,
fillRect.width, fillRect.height));
}
// OP_SOURCE is unbounded in Azure, and we really don't want that behaviour here.
// We also can't do a ClearRect+FillRect since we need the drawing to happen
// as an atomic operation (to prevent flickering).
// We also need this clip in the case where we have a mask, since the mask surface
// might cover more than fillRect, but we only want to touch the pixels inside
// fillRect.
aTarget->PushClipRect(gfx::ToRect(fillRect));
if (aMask) {
Matrix oldTransform = aTarget->GetTransform();
@ -155,9 +155,7 @@ RotatedBuffer::DrawBufferQuadrant(gfx::DrawTarget* aTarget,
DrawOptions(aOpacity, aOperator));
}
if (aOperator == CompositionOp::OP_SOURCE) {
aTarget->PopClip();
}
aTarget->PopClip();
}
void

View File

@ -0,0 +1,46 @@
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>Rotated buffer with mask</title>
<style>
body {
margin: 0;
}
.outer {
padding: 50px;
}
.scrollbox {
width: 200px;
height: 200px;
overflow: auto;
}
.scrolled {
box-sizing: border-box;
border: 1px solid transparent;
height: 200px;
}
</style>
<div class="outer">
<div class="scrollbox">
<div class="scrolled" style="background-color: blue;"></div>
<div class="scrolled" style="background-color: lime;"></div>
</div>
</div>
<script>
var scrollbox = document.querySelector(".scrollbox");
scrollbox.scrollTop = 199;
</script>

View File

@ -0,0 +1,54 @@
<!DOCTYPE html>
<html lang="en" class="reftest-wait">
<meta charset="utf-8">
<title>Rotated buffer with mask</title>
<style>
body {
margin: 0;
}
.outer {
overflow: hidden;
border-radius: 10px;
padding: 50px;
}
.scrollbox {
width: 200px;
height: 200px;
overflow: auto;
}
.scrolled {
box-sizing: border-box;
border: 1px solid transparent;
height: 200px;
}
</style>
<div class="outer">
<div class="scrollbox">
<div class="scrolled" style="background-color: blue;"></div>
<div class="scrolled" style="background-color: lime;"></div>
</div>
</div>
<script>
var scrollbox = document.querySelector(".scrollbox");
scrollbox.scrollTop = 1;
scrollbox.scrollTop = 0;
window.addEventListener("MozReftestInvalidate", function (e) {
scrollbox.scrollTop = 199;
document.documentElement.removeAttribute("class");
});
</script>

View File

@ -1925,3 +1925,4 @@ skip-if(B2G||Mulet) == 1150021-1.xul 1150021-1-ref.xul
== 1151306-1.html 1151306-1-ref.html
== 1153845-1.html 1153845-1-ref.html
== 1156129-1.html 1156129-1-ref.html
== 1169331-1.html 1169331-1-ref.html