Calculate correct clip foregroundBound and backgroundBound

This is a followup CL of https://codereview.chromium.org/976543002/. In
that CL, sub-pixel accumulation is considered to calculate layerBounds,
foregroundBounds and backgroundBounds if renderLayer doesn't paint into
its own backing layer. But in that CL, sub-pixel accumulation didn't
apply to foregroundBounds and backgroundBounds for unpaginated layers.
This CL fixes above issue.

BUG=515395

Review URL: https://codereview.chromium.org/1278113003

git-svn-id: svn://svn.chromium.org/blink/trunk@201030 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 2af6397c
<!DOCTYPE html>
<html>
<head>
<style>
body {
zoom:1.75;
}
.container {
left: 10.5px;
width: 52.7px;
height: 100px;
position: relative;
transform: translateZ(0);
}
.test {
border: solid 1px;
position: absolute;
width: 50px;
right: 0px;
height: 50px;
}
</style>
</head>
<body>
<div class="container">
<div class="test"></div>
</div>
<!DOCTYPE html>
<html>
<head>
<style>
body {
zoom:1.75;
}
.container {
left: 10.5px;
width: 52.7px;
height: 100px;
position: relative;
transform: translateZ(0);
overflow: hidden;
}
.test {
border: solid 1px;
position: absolute;
width: 50px;
right: 0px;
height: 50px;
}
</style>
</head>
<body>
<div class="container">
<div class="test"></div>
</div>
......@@ -1445,7 +1445,7 @@ void DeprecatedPaintLayer::collectFragments(DeprecatedPaintLayerFragments& fragm
ancestorClipRect.intersect(dirtyRect);
}
const LayoutSize subPixelAccumulationIfNeeded = compositingState() == PaintsIntoOwnBacking ? LayoutSize() : subPixelAccumulation;
const LayoutSize subPixelAccumulationIfNeeded = offsetFromRoot ? subPixelAccumulation : LayoutSize();
for (size_t i = 0; i < fragments.size(); ++i) {
DeprecatedPaintLayerFragment& fragment = fragments.at(i);
......
......@@ -112,7 +112,7 @@ void DeprecatedPaintLayerClipper::calculateRects(const ClipRectsContext& context
if (!isClippingRoot && m_layoutObject.layer()->parent()) {
backgroundRect = backgroundClipRect(context);
backgroundRect.move(roundedIntSize(context.subPixelAccumulation));
backgroundRect.move(context.subPixelAccumulation);
backgroundRect.intersect(paintDirtyRect);
} else {
backgroundRect = paintDirtyRect;
......
......@@ -228,6 +228,8 @@ void DeprecatedPaintLayerPainter::paintLayerContents(GraphicsContext* context, c
}
DeprecatedPaintLayerPaintingInfo localPaintingInfo(paintingInfo);
if (m_paintLayer.compositingState() == PaintsIntoOwnBacking)
localPaintingInfo.subPixelAccumulation = m_paintLayer.subpixelAccumulation();
DeprecatedPaintLayerFragments layerFragments;
if (shouldPaintContent || shouldPaintOutline || isPaintingOverlayScrollbars) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment