haikuwebkit/LayoutTests/fast/sub-pixel/simple-clipping.html

55 lines
1.2 KiB
HTML
Raw Permalink Normal View History

Subpixel rendering: Enable compositing RenderLayer painting on device pixel position. https://bugs.webkit.org/show_bug.cgi?id=128509 Reviewed by Simon Fraser. GraphicsLayer is now positioned on device pixel boundary. This enables us to put compositing layers on a subpixel position and animate them with device pixel precision. Source/WebCore: Tests: fast/sub-pixel/compositing-layers-on-subpixel-position.html fast/sub-pixel/simple-clipping.html * platform/LayoutUnit.h: (WebCore::ceilToDevicePixel): * platform/graphics/LayoutPoint.h: (WebCore::flooredForPainting): (WebCore::ceiledForPainting): * platform/graphics/LayoutRect.cpp: (WebCore::enclosingRectForPainting): * platform/graphics/LayoutRect.h: * rendering/RenderLayer.cpp: (WebCore::RenderLayer::clipToRect): * rendering/RenderLayerBacking.cpp: (WebCore::clipBox): (WebCore::pixelFractionForLayerPainting): (WebCore::calculateDevicePixelOffsetFromRenderer): (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): (WebCore::RenderLayerBacking::paintIntoLayer): * rendering/RenderLayerBacking.h: LayoutTests: * TestExpectations: * fast/sub-pixel/compositing-layers-on-subpixel-position-expected.html: Added. * fast/sub-pixel/compositing-layers-on-subpixel-position.html: Added. * fast/sub-pixel/simple-clipping-expected.html: Added. * fast/sub-pixel/simple-clipping.html: Added. * platform/mac/compositing/layer-creation/overlap-animation-container-expected.txt: Canonical link: https://commits.webkit.org/147157@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@164449 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-02-20 23:04:20 +00:00
<!DOCTYPE html>
<html>
<head>
<title>Simple clipping. This tests that we properly clip device pixel positioned elements.</title>
<style>
div {
width: 20px;
height: 20px;
border: solid 1px red;
position: absolute;
top: 0px;
-webkit-transform: translateZ(0);
}
</style>
<script>
if (window.testRunner)
window.testRunner.waitUntilDone();
function moveBoxes() {
var boxes = document.getElementsByTagName("div");
for (var i = 0; i < boxes.length; i++)
boxes[i].style.left = parseFloat(boxes[i].style.left) + 100.5 + 'px';
if (window.testRunner)
window.testRunner.notifyDone();
}
</script>
</head>
<body onload="setTimeout(moveBoxes, 0);">
<p id="container"></p>
<script>
var container = document.getElementById("container");
for (i = 0; i < 100; i = i + 21) {
var e1 = document.createElement("div");
var e2 = document.createElement("div");
var e3 = document.createElement("div");
e1.style.left = i + 0.5 + "px";
e2.style.top = "22px";
e2.style.left = i + 1 +"px";
e3.style.top = "44px";
e3.style.left = i + 1.5 + "px";
container.appendChild(e1);
container.appendChild(e2);
container.appendChild(e3);
}
</script>
</body>
</html>