Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1292)

Unified Diff: Source/core/paint/DeprecatedPaintLayerPainter.cpp

Issue 1158183006: Remove the old multicol implementation. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase master Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/paint/DeprecatedPaintLayerPainter.h ('k') | Source/core/paint/ViewPainter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/DeprecatedPaintLayerPainter.cpp
diff --git a/Source/core/paint/DeprecatedPaintLayerPainter.cpp b/Source/core/paint/DeprecatedPaintLayerPainter.cpp
index c8c67799c9cc3253604e9bb36b4b3a471107433d..a4c5cc94fbd6ca7320357f448de0235fa7863ede 100644
--- a/Source/core/paint/DeprecatedPaintLayerPainter.cpp
+++ b/Source/core/paint/DeprecatedPaintLayerPainter.cpp
@@ -444,10 +444,7 @@ void DeprecatedPaintLayerPainter::paintChildren(unsigned childrenToVisit, Graphi
childPaintingInfo.scrollOffsetAccumulation += parentLayer->layoutBox()->scrolledContentOffset();
}
- if (!child->layer()->isPaginated())
- childPainter.paintLayer(context, childPaintingInfo, paintFlags);
- else
- childPainter.paintPaginatedChildLayer(context, childPaintingInfo, paintFlags);
+ childPainter.paintLayer(context, childPaintingInfo, paintFlags);
}
}
@@ -484,143 +481,6 @@ void DeprecatedPaintLayerPainter::paintOverflowControlsForFragments(const Deprec
}
}
-static bool checkContainingBlockChainForPagination(LayoutBoxModelObject* layoutObject, LayoutBox* ancestorColumnsLayoutObject)
-{
- LayoutView* view = layoutObject->view();
- LayoutBoxModelObject* prevBlock = layoutObject;
- LayoutBlock* containingBlock;
- for (containingBlock = layoutObject->containingBlock();
- containingBlock && containingBlock != view && containingBlock != ancestorColumnsLayoutObject;
- containingBlock = containingBlock->containingBlock())
- prevBlock = containingBlock;
-
- // If the columns block wasn't in our containing block chain, then we aren't paginated by it.
- if (containingBlock != ancestorColumnsLayoutObject)
- return false;
-
- // If the previous block is absolutely positioned, then we can't be paginated by the columns block.
- if (prevBlock->isOutOfFlowPositioned())
- return false;
-
- // Otherwise we are paginated by the columns block.
- return true;
-}
-
-void DeprecatedPaintLayerPainter::paintPaginatedChildLayer(GraphicsContext* context, const DeprecatedPaintLayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags)
-{
- // We need to do multiple passes, breaking up our child layer into strips.
- Vector<DeprecatedPaintLayer*> columnLayers;
- DeprecatedPaintLayerStackingNode* ancestorNode = m_paintLayer.stackingNode()->isNormalFlowOnly() ? m_paintLayer.parent()->stackingNode() : m_paintLayer.stackingNode()->ancestorStackingContextNode();
- for (DeprecatedPaintLayer* curr = m_paintLayer.parent(); curr; curr = curr->parent()) {
- if (curr->layoutObject()->hasColumns() && checkContainingBlockChainForPagination(m_paintLayer.layoutObject(), curr->layoutBox()))
- columnLayers.append(curr);
- if (curr->stackingNode() == ancestorNode)
- break;
- }
-
- // It is possible for paintLayer() to be called after the child layer ceases to be paginated but before
- // updatePaginationRecusive() is called and resets the isPaginated() flag, see <rdar://problem/10098679>.
- // If this is the case, just bail out, since the upcoming call to updatePaginationRecusive() will paint invalidate the layer.
- // FIXME: Is this true anymore? This seems very suspicious.
- if (!columnLayers.size())
- return;
-
- paintChildLayerIntoColumns(context, paintingInfo, paintFlags, columnLayers, columnLayers.size() - 1);
-}
-
-void DeprecatedPaintLayerPainter::paintChildLayerIntoColumns(GraphicsContext* context, const DeprecatedPaintLayerPaintingInfo& paintingInfo,
- PaintLayerFlags paintFlags, const Vector<DeprecatedPaintLayer*>& columnLayers, size_t colIndex)
-{
- LayoutBlock* columnBlock = toLayoutBlock(columnLayers[colIndex]->layoutObject());
-
- ASSERT(columnBlock && columnBlock->hasColumns());
- if (!columnBlock || !columnBlock->hasColumns())
- return;
-
- LayoutPoint layerOffset;
- // FIXME: It looks suspicious to call convertToLayerCoords here
- // as canUseConvertToLayerCoords is true for this layer.
- columnBlock->layer()->convertToLayerCoords(paintingInfo.rootLayer, layerOffset);
-
- bool isHorizontal = columnBlock->style()->isHorizontalWritingMode();
-
- ColumnInfo* colInfo = columnBlock->columnInfo();
- unsigned colCount = columnBlock->columnCount(colInfo);
- LayoutUnit currLogicalTopOffset = 0;
- for (unsigned i = 0; i < colCount; i++) {
- // For each rect, we clip to the rect, and then we adjust our coords.
- LayoutRect colRect = columnBlock->columnRectAt(colInfo, i);
- columnBlock->flipForWritingMode(colRect);
- LayoutUnit logicalLeftOffset = (isHorizontal ? colRect.x() : colRect.y()) - columnBlock->logicalLeftOffsetForContent();
- LayoutSize offset;
- if (isHorizontal) {
- if (colInfo->progressionAxis() == ColumnInfo::InlineAxis)
- offset = LayoutSize(logicalLeftOffset, currLogicalTopOffset);
- else
- offset = LayoutSize(0, colRect.y() + currLogicalTopOffset - columnBlock->borderTop() - columnBlock->paddingTop());
- } else {
- if (colInfo->progressionAxis() == ColumnInfo::InlineAxis)
- offset = LayoutSize(currLogicalTopOffset, logicalLeftOffset);
- else
- offset = LayoutSize(colRect.x() + currLogicalTopOffset - columnBlock->borderLeft() - columnBlock->paddingLeft(), 0);
- }
-
- colRect.moveBy(layerOffset);
-
- LayoutRect localDirtyRect(paintingInfo.paintDirtyRect);
- localDirtyRect.intersect(colRect);
-
- if (!localDirtyRect.isEmpty()) {
- // Each strip pushes a clip, since column boxes are specified as being
- // like overflow:hidden.
- ClipRecorder clipRecorder(*context, *m_paintLayer.layoutObject(), DisplayItem::ClipLayerColumnBounds, LayoutRect(enclosingIntRect(colRect)));
-
- if (!colIndex) {
- // Apply a translation transform to change where the layer paints.
- TransformationMatrix oldTransform;
- bool oldHasTransform = m_paintLayer.transform();
- if (oldHasTransform)
- oldTransform = *m_paintLayer.transform();
- TransformationMatrix newTransform(oldTransform);
- newTransform.translateRight(roundToInt(offset.width()), roundToInt(offset.height()));
-
- m_paintLayer.setTransform(adoptPtr(new TransformationMatrix(newTransform)));
-
- DeprecatedPaintLayerPaintingInfo localPaintingInfo(paintingInfo);
- localPaintingInfo.paintDirtyRect = localDirtyRect;
- paintLayer(context, localPaintingInfo, paintFlags);
-
- if (oldHasTransform)
- m_paintLayer.setTransform(adoptPtr(new TransformationMatrix(oldTransform)));
- else
- m_paintLayer.clearTransform();
- } else {
- // Adjust the transform such that the layoutObject's upper left corner will paint at (0,0) in user space.
- // This involves subtracting out the position of the layer in our current coordinate space.
- LayoutPoint childOffset;
- columnLayers[colIndex - 1]->convertToLayerCoords(paintingInfo.rootLayer, childOffset);
- TransformationMatrix transform;
- transform.translateRight(roundToInt(childOffset.x() + offset.width()), roundToInt(childOffset.y() + offset.height()));
-
- Transform3DRecorder transform3DRecorder(*context, *m_paintLayer.layoutObject(), DisplayItem::Transform3DElementTransform, transform);
-
- // Now do a paint with the root layer shifted to be the next multicol block.
- DeprecatedPaintLayerPaintingInfo columnPaintingInfo(paintingInfo);
- columnPaintingInfo.rootLayer = columnLayers[colIndex - 1];
- columnPaintingInfo.paintDirtyRect = transform.inverse().mapRect(localDirtyRect);
- paintChildLayerIntoColumns(context, columnPaintingInfo, paintFlags, columnLayers, colIndex - 1);
- }
- }
-
- // Move to the next position.
- LayoutUnit blockDelta = isHorizontal ? colRect.height() : colRect.width();
- if (columnBlock->style()->isFlippedBlocksWritingMode())
- currLogicalTopOffset += blockDelta;
- else
- currLogicalTopOffset -= blockDelta;
- }
-}
-
void DeprecatedPaintLayerPainter::paintFragmentWithPhase(PaintPhase phase, const DeprecatedPaintLayerFragment& fragment, GraphicsContext* context, const ClipRect& clipRect, const DeprecatedPaintLayerPaintingInfo& paintingInfo, PaintBehavior paintBehavior, LayoutObject* paintingRootForLayoutObject, PaintLayerFlags paintFlags, ClipState clipState)
{
ASSERT(m_paintLayer.isSelfPaintingLayer());
« no previous file with comments | « Source/core/paint/DeprecatedPaintLayerPainter.h ('k') | Source/core/paint/ViewPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698