OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. |
3 * | 3 * |
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
5 * | 5 * |
6 * Other contributors: | 6 * Other contributors: |
7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 // If the previous block is absolutely positioned, then we can't be paginate
d by the columns block. | 626 // If the previous block is absolutely positioned, then we can't be paginate
d by the columns block. |
627 if (prevBlock->isOutOfFlowPositioned()) | 627 if (prevBlock->isOutOfFlowPositioned()) |
628 return false; | 628 return false; |
629 | 629 |
630 // Otherwise we are paginated by the columns block. | 630 // Otherwise we are paginated by the columns block. |
631 return true; | 631 return true; |
632 } | 632 } |
633 | 633 |
634 bool RenderLayer::useRegionBasedColumns() const | 634 bool RenderLayer::useRegionBasedColumns() const |
635 { | 635 { |
636 const Settings* settings = renderer()->document().settings(); | 636 return renderer()->document().regionBasedColumnsEnabled(); |
637 return settings && settings->regionBasedColumnsEnabled(); | |
638 } | 637 } |
639 | 638 |
640 void RenderLayer::updatePagination() | 639 void RenderLayer::updatePagination() |
641 { | 640 { |
642 m_isPaginated = false; | 641 m_isPaginated = false; |
643 m_enclosingPaginationLayer = 0; | 642 m_enclosingPaginationLayer = 0; |
644 | 643 |
645 if (hasCompositedLayerMapping() || !parent()) | 644 if (hasCompositedLayerMapping() || !parent()) |
646 return; // FIXME: We will have to deal with paginated compositing layers
someday. | 645 return; // FIXME: We will have to deal with paginated compositing layers
someday. |
647 // FIXME: For now the RenderView can't be paginated. Eventually
printing will move to a model where it is though. | 646 // FIXME: For now the RenderView can't be paginated. Eventually
printing will move to a model where it is though. |
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1508 EPosition position = renderer->style()->position(); | 1507 EPosition position = renderer->style()->position(); |
1509 | 1508 |
1510 // FIXME: Special casing RenderFlowThread so much for fixed positioning here
is not great. | 1509 // FIXME: Special casing RenderFlowThread so much for fixed positioning here
is not great. |
1511 RenderFlowThread* fixedFlowThreadContainer = position == FixedPosition ? ren
derer->flowThreadContainingBlock() : 0; | 1510 RenderFlowThread* fixedFlowThreadContainer = position == FixedPosition ? ren
derer->flowThreadContainingBlock() : 0; |
1512 if (fixedFlowThreadContainer && !fixedFlowThreadContainer->isOutOfFlowPositi
oned()) | 1511 if (fixedFlowThreadContainer && !fixedFlowThreadContainer->isOutOfFlowPositi
oned()) |
1513 fixedFlowThreadContainer = 0; | 1512 fixedFlowThreadContainer = 0; |
1514 | 1513 |
1515 // FIXME: Positioning of out-of-flow(fixed, absolute) elements collected in
a RenderFlowThread | 1514 // FIXME: Positioning of out-of-flow(fixed, absolute) elements collected in
a RenderFlowThread |
1516 // may need to be revisited in a future patch. | 1515 // may need to be revisited in a future patch. |
1517 // If the fixed renderer is inside a RenderFlowThread, we should not compute
location using localToAbsolute, | 1516 // If the fixed renderer is inside a RenderFlowThread, we should not compute
location using localToAbsolute, |
1518 // since localToAbsolute maps the coordinates from named flow to regions coo
rdinates and regions can be | 1517 // since localToAbsolute maps the coordinates from flow thread to regions co
ordinates and regions can be |
1519 // positioned in a completely different place in the viewport (RenderView). | 1518 // positioned in a completely different place in the viewport (RenderView). |
1520 if (position == FixedPosition && !fixedFlowThreadContainer && (!ancestorLaye
r || ancestorLayer == renderer->view()->layer())) { | 1519 if (position == FixedPosition && !fixedFlowThreadContainer && (!ancestorLaye
r || ancestorLayer == renderer->view()->layer())) { |
1521 // If the fixed layer's container is the root, just add in the offset of
the view. We can obtain this by calling | 1520 // If the fixed layer's container is the root, just add in the offset of
the view. We can obtain this by calling |
1522 // localToAbsolute() on the RenderView. | 1521 // localToAbsolute() on the RenderView. |
1523 FloatPoint absPos = renderer->localToAbsolute(FloatPoint(), IsFixed); | 1522 FloatPoint absPos = renderer->localToAbsolute(FloatPoint(), IsFixed); |
1524 location += LayoutSize(absPos.x(), absPos.y()); | 1523 location += LayoutSize(absPos.x(), absPos.y()); |
1525 return ancestorLayer; | 1524 return ancestorLayer; |
1526 } | 1525 } |
1527 | 1526 |
1528 // For the fixed positioned elements inside a render flow thread, we should
also skip the code path below | 1527 // For the fixed positioned elements inside a render flow thread, we should
also skip the code path below |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1726 if (hasCompositedLayerMapping()) | 1725 if (hasCompositedLayerMapping()) |
1727 return compositedLayerMapping()->collectTrackedRepaintRects(); | 1726 return compositedLayerMapping()->collectTrackedRepaintRects(); |
1728 return nullptr; | 1727 return nullptr; |
1729 } | 1728 } |
1730 | 1729 |
1731 bool RenderLayer::hasOverflowControls() const | 1730 bool RenderLayer::hasOverflowControls() const |
1732 { | 1731 { |
1733 return m_scrollableArea && (m_scrollableArea->hasScrollbar() || m_scrollable
Area->hasScrollCorner() || renderer()->style()->resize() != RESIZE_NONE); | 1732 return m_scrollableArea && (m_scrollableArea->hasScrollbar() || m_scrollable
Area->hasScrollCorner() || renderer()->style()->resize() != RESIZE_NONE); |
1734 } | 1733 } |
1735 | 1734 |
1736 void RenderLayer::paint(GraphicsContext* context, const LayoutRect& damageRect,
PaintBehavior paintBehavior, RenderObject* paintingRoot, RenderRegion* region, P
aintLayerFlags paintFlags) | 1735 void RenderLayer::paint(GraphicsContext* context, const LayoutRect& damageRect,
PaintBehavior paintBehavior, RenderObject* paintingRoot, PaintLayerFlags paintFl
ags) |
1737 { | 1736 { |
1738 OverlapTestRequestMap overlapTestRequests; | 1737 OverlapTestRequestMap overlapTestRequests; |
1739 | 1738 |
1740 LayerPaintingInfo paintingInfo(this, enclosingIntRect(damageRect), paintBeha
vior, LayoutSize(), paintingRoot, region, &overlapTestRequests); | 1739 LayerPaintingInfo paintingInfo(this, enclosingIntRect(damageRect), paintBeha
vior, LayoutSize(), paintingRoot, &overlapTestRequests); |
1741 paintLayer(context, paintingInfo, paintFlags); | 1740 paintLayer(context, paintingInfo, paintFlags); |
1742 | 1741 |
1743 OverlapTestRequestMap::iterator end = overlapTestRequests.end(); | 1742 OverlapTestRequestMap::iterator end = overlapTestRequests.end(); |
1744 for (OverlapTestRequestMap::iterator it = overlapTestRequests.begin(); it !=
end; ++it) | 1743 for (OverlapTestRequestMap::iterator it = overlapTestRequests.begin(); it !=
end; ++it) |
1745 it->key->setIsOverlapped(false); | 1744 it->key->setIsOverlapped(false); |
1746 } | 1745 } |
1747 | 1746 |
1748 void RenderLayer::paintOverlayScrollbars(GraphicsContext* context, const LayoutR
ect& damageRect, PaintBehavior paintBehavior, RenderObject* paintingRoot) | 1747 void RenderLayer::paintOverlayScrollbars(GraphicsContext* context, const LayoutR
ect& damageRect, PaintBehavior paintBehavior, RenderObject* paintingRoot) |
1749 { | 1748 { |
1750 if (!m_containsDirtyOverlayScrollbars) | 1749 if (!m_containsDirtyOverlayScrollbars) |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1892 } | 1891 } |
1893 | 1892 |
1894 if (enclosingPaginationLayer()) { | 1893 if (enclosingPaginationLayer()) { |
1895 paintTransformedLayerIntoFragments(context, paintingInfo, paintFlags
); | 1894 paintTransformedLayerIntoFragments(context, paintingInfo, paintFlags
); |
1896 return; | 1895 return; |
1897 } | 1896 } |
1898 | 1897 |
1899 // Make sure the parent's clip rects have been calculated. | 1898 // Make sure the parent's clip rects have been calculated. |
1900 ClipRect clipRect = paintingInfo.paintDirtyRect; | 1899 ClipRect clipRect = paintingInfo.paintDirtyRect; |
1901 if (parent()) { | 1900 if (parent()) { |
1902 ClipRectsContext clipRectsContext(paintingInfo.rootLayer, paintingIn
fo.region, (paintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : Pa
intingClipRects, | 1901 ClipRectsContext clipRectsContext(paintingInfo.rootLayer, (paintFlag
s & PaintLayerTemporaryClipRects) ? TemporaryClipRects : PaintingClipRects, |
1903 IgnoreOverlayScrollbarSize, (paintFlags & PaintLayerPaintingOver
flowContents) ? IgnoreOverflowClip : RespectOverflowClip); | 1902 IgnoreOverlayScrollbarSize, (paintFlags & PaintLayerPaintingOver
flowContents) ? IgnoreOverflowClip : RespectOverflowClip); |
1904 clipRect = clipper().backgroundClipRect(clipRectsContext); | 1903 clipRect = clipper().backgroundClipRect(clipRectsContext); |
1905 clipRect.intersect(paintingInfo.paintDirtyRect); | 1904 clipRect.intersect(paintingInfo.paintDirtyRect); |
1906 | 1905 |
1907 // Push the parent coordinate space's clip. | 1906 // Push the parent coordinate space's clip. |
1908 parent()->clipToRect(paintingInfo.rootLayer, context, paintingInfo.p
aintDirtyRect, clipRect); | 1907 parent()->clipToRect(paintingInfo.rootLayer, context, paintingInfo.p
aintDirtyRect, clipRect); |
1909 } | 1908 } |
1910 | 1909 |
1911 paintLayerByApplyingTransform(context, paintingInfo, paintFlags); | 1910 paintLayerByApplyingTransform(context, paintingInfo, paintFlags); |
1912 | 1911 |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2085 PaintBehavior paintBehavior = PaintBehaviorNormal; | 2084 PaintBehavior paintBehavior = PaintBehaviorNormal; |
2086 if (paintFlags & PaintLayerPaintingSkipRootBackground) | 2085 if (paintFlags & PaintLayerPaintingSkipRootBackground) |
2087 paintBehavior |= PaintBehaviorSkipRootBackground; | 2086 paintBehavior |= PaintBehaviorSkipRootBackground; |
2088 else if (paintFlags & PaintLayerPaintingRootBackgroundOnly) | 2087 else if (paintFlags & PaintLayerPaintingRootBackgroundOnly) |
2089 paintBehavior |= PaintBehaviorRootBackgroundOnly; | 2088 paintBehavior |= PaintBehaviorRootBackgroundOnly; |
2090 | 2089 |
2091 LayerFragments layerFragments; | 2090 LayerFragments layerFragments; |
2092 if (shouldPaintContent || shouldPaintOutline || isPaintingOverlayScrollbars)
{ | 2091 if (shouldPaintContent || shouldPaintOutline || isPaintingOverlayScrollbars)
{ |
2093 // Collect the fragments. This will compute the clip rectangles and pain
t offsets for each layer fragment, as well as whether or not the content of each | 2092 // Collect the fragments. This will compute the clip rectangles and pain
t offsets for each layer fragment, as well as whether or not the content of each |
2094 // fragment should paint. | 2093 // fragment should paint. |
2095 collectFragments(layerFragments, localPaintingInfo.rootLayer, localPaint
ingInfo.region, localPaintingInfo.paintDirtyRect, | 2094 collectFragments(layerFragments, localPaintingInfo.rootLayer, localPaint
ingInfo.paintDirtyRect, |
2096 (paintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : P
aintingClipRects, IgnoreOverlayScrollbarSize, | 2095 (paintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : P
aintingClipRects, IgnoreOverlayScrollbarSize, |
2097 (isPaintingOverflowContents) ? IgnoreOverflowClip : RespectOverflowC
lip, &offsetFromRoot, localPaintingInfo.subPixelAccumulation); | 2096 (isPaintingOverflowContents) ? IgnoreOverflowClip : RespectOverflowC
lip, &offsetFromRoot, localPaintingInfo.subPixelAccumulation); |
2098 updatePaintingInfoForFragments(layerFragments, localPaintingInfo, paintF
lags, shouldPaintContent, &offsetFromRoot); | 2097 updatePaintingInfoForFragments(layerFragments, localPaintingInfo, paintF
lags, shouldPaintContent, &offsetFromRoot); |
2099 } | 2098 } |
2100 | 2099 |
2101 if (shouldPaintBackground) | 2100 if (shouldPaintBackground) |
2102 paintBackgroundForFragments(layerFragments, context, transparencyLayerCo
ntext, paintingInfo.paintDirtyRect, haveTransparency, | 2101 paintBackgroundForFragments(layerFragments, context, transparencyLayerCo
ntext, paintingInfo.paintDirtyRect, haveTransparency, |
2103 localPaintingInfo, paintBehavior, paintingRootForRenderer); | 2102 localPaintingInfo, paintBehavior, paintingRootForRenderer); |
2104 | 2103 |
2105 if (shouldPaintNegZOrderList) | 2104 if (shouldPaintNegZOrderList) |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2166 | 2165 |
2167 // Apply the transform. | 2166 // Apply the transform. |
2168 GraphicsContextStateSaver stateSaver(*context, false); | 2167 GraphicsContextStateSaver stateSaver(*context, false); |
2169 if (!transform.isIdentity()) { | 2168 if (!transform.isIdentity()) { |
2170 stateSaver.save(); | 2169 stateSaver.save(); |
2171 context->concatCTM(transform.toAffineTransform()); | 2170 context->concatCTM(transform.toAffineTransform()); |
2172 } | 2171 } |
2173 | 2172 |
2174 // Now do a paint with the root layer shifted to be us. | 2173 // Now do a paint with the root layer shifted to be us. |
2175 LayerPaintingInfo transformedPaintingInfo(this, enclosingIntRect(transform.i
nverse().mapRect(paintingInfo.paintDirtyRect)), paintingInfo.paintBehavior, | 2174 LayerPaintingInfo transformedPaintingInfo(this, enclosingIntRect(transform.i
nverse().mapRect(paintingInfo.paintDirtyRect)), paintingInfo.paintBehavior, |
2176 adjustedSubPixelAccumulation, paintingInfo.paintingRoot, paintingInfo.re
gion, paintingInfo.overlapTestRequests); | 2175 adjustedSubPixelAccumulation, paintingInfo.paintingRoot, paintingInfo.ov
erlapTestRequests); |
2177 paintLayerContentsAndReflection(context, transformedPaintingInfo, paintFlags
); | 2176 paintLayerContentsAndReflection(context, transformedPaintingInfo, paintFlags
); |
2178 } | 2177 } |
2179 | 2178 |
2180 void RenderLayer::paintChildren(unsigned childrenToVisit, GraphicsContext* conte
xt, const LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags) | 2179 void RenderLayer::paintChildren(unsigned childrenToVisit, GraphicsContext* conte
xt, const LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags) |
2181 { | 2180 { |
2182 if (!hasSelfPaintingLayerDescendant()) | 2181 if (!hasSelfPaintingLayerDescendant()) |
2183 return; | 2182 return; |
2184 | 2183 |
2185 #if !ASSERT_DISABLED | 2184 #if !ASSERT_DISABLED |
2186 LayerListMutationDetector mutationChecker(m_stackingNode.get()); | 2185 LayerListMutationDetector mutationChecker(m_stackingNode.get()); |
2187 #endif | 2186 #endif |
2188 | 2187 |
2189 RenderLayerStackingNodeIterator iterator(*m_stackingNode, childrenToVisit); | 2188 RenderLayerStackingNodeIterator iterator(*m_stackingNode, childrenToVisit); |
2190 while (RenderLayerStackingNode* child = iterator.next()) { | 2189 while (RenderLayerStackingNode* child = iterator.next()) { |
2191 RenderLayer* childLayer = child->layer(); | 2190 RenderLayer* childLayer = child->layer(); |
2192 | 2191 |
2193 // Squashed RenderLayers should not paint into their ancestor. | 2192 // Squashed RenderLayers should not paint into their ancestor. |
2194 if (childLayer->compositingState() == PaintsIntoGroupedBacking) | 2193 if (childLayer->compositingState() == PaintsIntoGroupedBacking) |
2195 continue; | 2194 continue; |
2196 | 2195 |
2197 if (!childLayer->isPaginated()) | 2196 if (!childLayer->isPaginated()) |
2198 childLayer->paintLayer(context, paintingInfo, paintFlags); | 2197 childLayer->paintLayer(context, paintingInfo, paintFlags); |
2199 else | 2198 else |
2200 paintPaginatedChildLayer(childLayer, context, paintingInfo, paintFla
gs); | 2199 paintPaginatedChildLayer(childLayer, context, paintingInfo, paintFla
gs); |
2201 } | 2200 } |
2202 } | 2201 } |
2203 | 2202 |
2204 void RenderLayer::collectFragments(LayerFragments& fragments, const RenderLayer*
rootLayer, RenderRegion* region, const LayoutRect& dirtyRect, | 2203 void RenderLayer::collectFragments(LayerFragments& fragments, const RenderLayer*
rootLayer, const LayoutRect& dirtyRect, |
2205 ClipRectsType clipRectsType, OverlayScrollbarSizeRelevancy inOverlayScrollba
rSizeRelevancy, ShouldRespectOverflowClip respectOverflowClip, const LayoutPoint
* offsetFromRoot, | 2204 ClipRectsType clipRectsType, OverlayScrollbarSizeRelevancy inOverlayScrollba
rSizeRelevancy, ShouldRespectOverflowClip respectOverflowClip, const LayoutPoint
* offsetFromRoot, |
2206 const LayoutSize& subPixelAccumulation, const LayoutRect* layerBoundingBox) | 2205 const LayoutSize& subPixelAccumulation, const LayoutRect* layerBoundingBox) |
2207 { | 2206 { |
2208 if (!enclosingPaginationLayer() || hasTransform()) { | 2207 if (!enclosingPaginationLayer() || hasTransform()) { |
2209 // For unpaginated layers, there is only one fragment. | 2208 // For unpaginated layers, there is only one fragment. |
2210 LayerFragment fragment; | 2209 LayerFragment fragment; |
2211 ClipRectsContext clipRectsContext(rootLayer, region, clipRectsType, inOv
erlayScrollbarSizeRelevancy, respectOverflowClip, subPixelAccumulation); | 2210 ClipRectsContext clipRectsContext(rootLayer, clipRectsType, inOverlayScr
ollbarSizeRelevancy, respectOverflowClip, subPixelAccumulation); |
2212 clipper().calculateRects(clipRectsContext, dirtyRect, fragment.layerBoun
ds, fragment.backgroundRect, fragment.foregroundRect, fragment.outlineRect, offs
etFromRoot); | 2211 clipper().calculateRects(clipRectsContext, dirtyRect, fragment.layerBoun
ds, fragment.backgroundRect, fragment.foregroundRect, fragment.outlineRect, offs
etFromRoot); |
2213 fragments.append(fragment); | 2212 fragments.append(fragment); |
2214 return; | 2213 return; |
2215 } | 2214 } |
2216 | 2215 |
2217 // Compute our offset within the enclosing pagination layer. | 2216 // Compute our offset within the enclosing pagination layer. |
2218 LayoutPoint offsetWithinPaginatedLayer; | 2217 LayoutPoint offsetWithinPaginatedLayer; |
2219 convertToLayerCoords(enclosingPaginationLayer(), offsetWithinPaginatedLayer)
; | 2218 convertToLayerCoords(enclosingPaginationLayer(), offsetWithinPaginatedLayer)
; |
2220 | 2219 |
2221 // Calculate clip rects relative to the enclosingPaginationLayer. The purpos
e of this call is to determine our bounds clipped to intermediate | 2220 // Calculate clip rects relative to the enclosingPaginationLayer. The purpos
e of this call is to determine our bounds clipped to intermediate |
2222 // layers between us and the pagination context. It's important to minimize
the number of fragments we need to create and this helps with that. | 2221 // layers between us and the pagination context. It's important to minimize
the number of fragments we need to create and this helps with that. |
2223 ClipRectsContext paginationClipRectsContext(enclosingPaginationLayer(), regi
on, clipRectsType, inOverlayScrollbarSizeRelevancy, respectOverflowClip); | 2222 ClipRectsContext paginationClipRectsContext(enclosingPaginationLayer(), clip
RectsType, inOverlayScrollbarSizeRelevancy, respectOverflowClip); |
2224 LayoutRect layerBoundsInFlowThread; | 2223 LayoutRect layerBoundsInFlowThread; |
2225 ClipRect backgroundRectInFlowThread; | 2224 ClipRect backgroundRectInFlowThread; |
2226 ClipRect foregroundRectInFlowThread; | 2225 ClipRect foregroundRectInFlowThread; |
2227 ClipRect outlineRectInFlowThread; | 2226 ClipRect outlineRectInFlowThread; |
2228 clipper().calculateRects(paginationClipRectsContext, PaintInfo::infiniteRect
(), layerBoundsInFlowThread, backgroundRectInFlowThread, foregroundRectInFlowThr
ead, | 2227 clipper().calculateRects(paginationClipRectsContext, PaintInfo::infiniteRect
(), layerBoundsInFlowThread, backgroundRectInFlowThread, foregroundRectInFlowThr
ead, |
2229 outlineRectInFlowThread, &offsetWithinPaginatedLayer); | 2228 outlineRectInFlowThread, &offsetWithinPaginatedLayer); |
2230 | 2229 |
2231 // Take our bounding box within the flow thread and clip it. | 2230 // Take our bounding box within the flow thread and clip it. |
2232 LayoutRect layerBoundingBoxInFlowThread = layerBoundingBox ? *layerBoundingB
ox : boundingBox(enclosingPaginationLayer(), 0, &offsetWithinPaginatedLayer); | 2231 LayoutRect layerBoundingBoxInFlowThread = layerBoundingBox ? *layerBoundingB
ox : boundingBox(enclosingPaginationLayer(), 0, &offsetWithinPaginatedLayer); |
2233 layerBoundingBoxInFlowThread.intersect(backgroundRectInFlowThread.rect()); | 2232 layerBoundingBoxInFlowThread.intersect(backgroundRectInFlowThread.rect()); |
2234 | 2233 |
2235 // Shift the dirty rect into flow thread coordinates. | 2234 // Shift the dirty rect into flow thread coordinates. |
2236 LayoutPoint offsetOfPaginationLayerFromRoot; | 2235 LayoutPoint offsetOfPaginationLayerFromRoot; |
2237 enclosingPaginationLayer()->convertToLayerCoords(rootLayer, offsetOfPaginati
onLayerFromRoot); | 2236 enclosingPaginationLayer()->convertToLayerCoords(rootLayer, offsetOfPaginati
onLayerFromRoot); |
2238 LayoutRect dirtyRectInFlowThread(dirtyRect); | 2237 LayoutRect dirtyRectInFlowThread(dirtyRect); |
2239 dirtyRectInFlowThread.moveBy(-offsetOfPaginationLayerFromRoot); | 2238 dirtyRectInFlowThread.moveBy(-offsetOfPaginationLayerFromRoot); |
2240 | 2239 |
2241 // Tell the flow thread to collect the fragments. We pass enough information
to create a minimal number of fragments based off the pages/columns | 2240 // Tell the flow thread to collect the fragments. We pass enough information
to create a minimal number of fragments based off the pages/columns |
2242 // that intersect the actual dirtyRect as well as the pages/columns that int
ersect our layer's bounding box. | 2241 // that intersect the actual dirtyRect as well as the pages/columns that int
ersect our layer's bounding box. |
2243 RenderFlowThread* enclosingFlowThread = toRenderFlowThread(enclosingPaginati
onLayer()->renderer()); | 2242 RenderFlowThread* enclosingFlowThread = toRenderFlowThread(enclosingPaginati
onLayer()->renderer()); |
2244 enclosingFlowThread->collectLayerFragments(fragments, layerBoundingBoxInFlow
Thread, dirtyRectInFlowThread); | 2243 enclosingFlowThread->collectLayerFragments(fragments, layerBoundingBoxInFlow
Thread, dirtyRectInFlowThread); |
2245 | 2244 |
2246 if (fragments.isEmpty()) | 2245 if (fragments.isEmpty()) |
2247 return; | 2246 return; |
2248 | 2247 |
2249 // Get the parent clip rects of the pagination layer, since we need to inter
sect with that when painting column contents. | 2248 // Get the parent clip rects of the pagination layer, since we need to inter
sect with that when painting column contents. |
2250 ClipRect ancestorClipRect = dirtyRect; | 2249 ClipRect ancestorClipRect = dirtyRect; |
2251 if (enclosingPaginationLayer()->parent()) { | 2250 if (enclosingPaginationLayer()->parent()) { |
2252 ClipRectsContext clipRectsContext(rootLayer, region, clipRectsType, inOv
erlayScrollbarSizeRelevancy, respectOverflowClip); | 2251 ClipRectsContext clipRectsContext(rootLayer, clipRectsType, inOverlayScr
ollbarSizeRelevancy, respectOverflowClip); |
2253 ancestorClipRect = enclosingPaginationLayer()->clipper().backgroundClipR
ect(clipRectsContext); | 2252 ancestorClipRect = enclosingPaginationLayer()->clipper().backgroundClipR
ect(clipRectsContext); |
2254 ancestorClipRect.intersect(dirtyRect); | 2253 ancestorClipRect.intersect(dirtyRect); |
2255 } | 2254 } |
2256 | 2255 |
2257 for (size_t i = 0; i < fragments.size(); ++i) { | 2256 for (size_t i = 0; i < fragments.size(); ++i) { |
2258 LayerFragment& fragment = fragments.at(i); | 2257 LayerFragment& fragment = fragments.at(i); |
2259 | 2258 |
2260 // Set our four rects with all clipping applied that was internal to the
flow thread. | 2259 // Set our four rects with all clipping applied that was internal to the
flow thread. |
2261 fragment.setRects(layerBoundsInFlowThread, backgroundRectInFlowThread, f
oregroundRectInFlowThread, outlineRectInFlowThread); | 2260 fragment.setRects(layerBoundsInFlowThread, backgroundRectInFlowThread, f
oregroundRectInFlowThread, outlineRectInFlowThread); |
2262 | 2261 |
(...skipping 22 matching lines...) Expand all Loading... |
2285 fragment.shouldPaintContent &= intersectsDamageRect(fragment.layerBo
unds, fragment.backgroundRect.rect(), localPaintingInfo.rootLayer, &newOffsetFro
mRoot); | 2284 fragment.shouldPaintContent &= intersectsDamageRect(fragment.layerBo
unds, fragment.backgroundRect.rect(), localPaintingInfo.rootLayer, &newOffsetFro
mRoot); |
2286 } | 2285 } |
2287 } | 2286 } |
2288 } | 2287 } |
2289 | 2288 |
2290 void RenderLayer::paintTransformedLayerIntoFragments(GraphicsContext* context, c
onst LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags) | 2289 void RenderLayer::paintTransformedLayerIntoFragments(GraphicsContext* context, c
onst LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags) |
2291 { | 2290 { |
2292 LayerFragments enclosingPaginationFragments; | 2291 LayerFragments enclosingPaginationFragments; |
2293 LayoutPoint offsetOfPaginationLayerFromRoot; | 2292 LayoutPoint offsetOfPaginationLayerFromRoot; |
2294 LayoutRect transformedExtent = transparencyClipBox(this, enclosingPagination
Layer(), PaintingTransparencyClipBox, RootOfTransparencyClipBox, paintingInfo.pa
intBehavior); | 2293 LayoutRect transformedExtent = transparencyClipBox(this, enclosingPagination
Layer(), PaintingTransparencyClipBox, RootOfTransparencyClipBox, paintingInfo.pa
intBehavior); |
2295 enclosingPaginationLayer()->collectFragments(enclosingPaginationFragments, p
aintingInfo.rootLayer, paintingInfo.region, paintingInfo.paintDirtyRect, | 2294 enclosingPaginationLayer()->collectFragments(enclosingPaginationFragments, p
aintingInfo.rootLayer, paintingInfo.paintDirtyRect, |
2296 (paintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : Paint
ingClipRects, IgnoreOverlayScrollbarSize, | 2295 (paintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : Paint
ingClipRects, IgnoreOverlayScrollbarSize, |
2297 (paintFlags & PaintLayerPaintingOverflowContents) ? IgnoreOverflowClip :
RespectOverflowClip, &offsetOfPaginationLayerFromRoot, paintingInfo.subPixelAcc
umulation, &transformedExtent); | 2296 (paintFlags & PaintLayerPaintingOverflowContents) ? IgnoreOverflowClip :
RespectOverflowClip, &offsetOfPaginationLayerFromRoot, paintingInfo.subPixelAcc
umulation, &transformedExtent); |
2298 | 2297 |
2299 for (size_t i = 0; i < enclosingPaginationFragments.size(); ++i) { | 2298 for (size_t i = 0; i < enclosingPaginationFragments.size(); ++i) { |
2300 const LayerFragment& fragment = enclosingPaginationFragments.at(i); | 2299 const LayerFragment& fragment = enclosingPaginationFragments.at(i); |
2301 | 2300 |
2302 // Apply the page/column clip for this fragment, as well as any clips es
tablished by layers in between us and | 2301 // Apply the page/column clip for this fragment, as well as any clips es
tablished by layers in between us and |
2303 // the enclosing pagination layer. | 2302 // the enclosing pagination layer. |
2304 LayoutRect clipRect = fragment.backgroundRect.rect(); | 2303 LayoutRect clipRect = fragment.backgroundRect.rect(); |
2305 | 2304 |
2306 // Now compute the clips within a given fragment | 2305 // Now compute the clips within a given fragment |
2307 if (parent() != enclosingPaginationLayer()) { | 2306 if (parent() != enclosingPaginationLayer()) { |
2308 enclosingPaginationLayer()->convertToLayerCoords(paintingInfo.rootLa
yer, offsetOfPaginationLayerFromRoot); | 2307 enclosingPaginationLayer()->convertToLayerCoords(paintingInfo.rootLa
yer, offsetOfPaginationLayerFromRoot); |
2309 | 2308 |
2310 ClipRectsContext clipRectsContext(enclosingPaginationLayer(), painti
ngInfo.region, (paintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects
: PaintingClipRects, | 2309 ClipRectsContext clipRectsContext(enclosingPaginationLayer(), (paint
Flags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : PaintingClipRects, |
2311 IgnoreOverlayScrollbarSize, (paintFlags & PaintLayerPaintingOver
flowContents) ? IgnoreOverflowClip : RespectOverflowClip); | 2310 IgnoreOverlayScrollbarSize, (paintFlags & PaintLayerPaintingOver
flowContents) ? IgnoreOverflowClip : RespectOverflowClip); |
2312 LayoutRect parentClipRect = clipper().backgroundClipRect(clipRectsCo
ntext).rect(); | 2311 LayoutRect parentClipRect = clipper().backgroundClipRect(clipRectsCo
ntext).rect(); |
2313 parentClipRect.moveBy(fragment.paginationOffset + offsetOfPagination
LayerFromRoot); | 2312 parentClipRect.moveBy(fragment.paginationOffset + offsetOfPagination
LayerFromRoot); |
2314 clipRect.intersect(parentClipRect); | 2313 clipRect.intersect(parentClipRect); |
2315 } | 2314 } |
2316 | 2315 |
2317 parent()->clipToRect(paintingInfo.rootLayer, context, paintingInfo.paint
DirtyRect, clipRect); | 2316 parent()->clipToRect(paintingInfo.rootLayer, context, paintingInfo.paint
DirtyRect, clipRect); |
2318 paintLayerByApplyingTransform(context, paintingInfo, paintFlags, fragmen
t.paginationOffset); | 2317 paintLayerByApplyingTransform(context, paintingInfo, paintFlags, fragmen
t.paginationOffset); |
2319 parent()->restoreClip(context, paintingInfo.paintDirtyRect, clipRect); | 2318 parent()->restoreClip(context, paintingInfo.paintDirtyRect, clipRect); |
2320 } | 2319 } |
(...skipping 22 matching lines...) Expand all Loading... |
2343 beginTransparencyLayers(transparencyLayerContext, localPaintingInfo.
rootLayer, transparencyPaintDirtyRect, localPaintingInfo.paintBehavior); | 2342 beginTransparencyLayers(transparencyLayerContext, localPaintingInfo.
rootLayer, transparencyPaintDirtyRect, localPaintingInfo.paintBehavior); |
2344 | 2343 |
2345 if (localPaintingInfo.clipToDirtyRect) { | 2344 if (localPaintingInfo.clipToDirtyRect) { |
2346 // Paint our background first, before painting any child layers. | 2345 // Paint our background first, before painting any child layers. |
2347 // Establish the clip used to paint our background. | 2346 // Establish the clip used to paint our background. |
2348 clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.p
aintDirtyRect, fragment.backgroundRect, DoNotIncludeSelfForBorderRadius); // Bac
kground painting will handle clipping to self. | 2347 clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.p
aintDirtyRect, fragment.backgroundRect, DoNotIncludeSelfForBorderRadius); // Bac
kground painting will handle clipping to self. |
2349 } | 2348 } |
2350 | 2349 |
2351 // Paint the background. | 2350 // Paint the background. |
2352 // FIXME: Eventually we will collect the region from the fragment itself
instead of just from the paint info. | 2351 // FIXME: Eventually we will collect the region from the fragment itself
instead of just from the paint info. |
2353 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.backgroundRect
.rect()), PaintPhaseBlockBackground, paintBehavior, paintingRootForRenderer, loc
alPaintingInfo.region, 0, 0, localPaintingInfo.rootLayer->renderer()); | 2352 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.backgroundRect
.rect()), PaintPhaseBlockBackground, paintBehavior, paintingRootForRenderer, 0,
0, localPaintingInfo.rootLayer->renderer()); |
2354 renderer()->paint(paintInfo, toPoint(fragment.layerBounds.location() - r
enderBoxLocation() + subPixelAccumulationIfNeeded(localPaintingInfo.subPixelAccu
mulation, compositingState()))); | 2353 renderer()->paint(paintInfo, toPoint(fragment.layerBounds.location() - r
enderBoxLocation() + subPixelAccumulationIfNeeded(localPaintingInfo.subPixelAccu
mulation, compositingState()))); |
2355 | 2354 |
2356 if (localPaintingInfo.clipToDirtyRect) | 2355 if (localPaintingInfo.clipToDirtyRect) |
2357 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.back
groundRect); | 2356 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.back
groundRect); |
2358 } | 2357 } |
2359 } | 2358 } |
2360 | 2359 |
2361 void RenderLayer::paintForegroundForFragments(const LayerFragments& layerFragmen
ts, GraphicsContext* context, GraphicsContext* transparencyLayerContext, | 2360 void RenderLayer::paintForegroundForFragments(const LayerFragments& layerFragmen
ts, GraphicsContext* context, GraphicsContext* transparencyLayerContext, |
2362 const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, const L
ayerPaintingInfo& localPaintingInfo, PaintBehavior paintBehavior, | 2361 const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, const L
ayerPaintingInfo& localPaintingInfo, PaintBehavior paintBehavior, |
2363 RenderObject* paintingRootForRenderer, bool selectionOnly, bool forceBlackTe
xt) | 2362 RenderObject* paintingRootForRenderer, bool selectionOnly, bool forceBlackTe
xt) |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2401 bool shouldClip = localPaintingInfo.clipToDirtyRect && layerFragments.size()
> 1; | 2400 bool shouldClip = localPaintingInfo.clipToDirtyRect && layerFragments.size()
> 1; |
2402 | 2401 |
2403 for (size_t i = 0; i < layerFragments.size(); ++i) { | 2402 for (size_t i = 0; i < layerFragments.size(); ++i) { |
2404 const LayerFragment& fragment = layerFragments.at(i); | 2403 const LayerFragment& fragment = layerFragments.at(i); |
2405 if (!fragment.shouldPaintContent || fragment.foregroundRect.isEmpty()) | 2404 if (!fragment.shouldPaintContent || fragment.foregroundRect.isEmpty()) |
2406 continue; | 2405 continue; |
2407 | 2406 |
2408 if (shouldClip) | 2407 if (shouldClip) |
2409 clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.p
aintDirtyRect, fragment.foregroundRect); | 2408 clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.p
aintDirtyRect, fragment.foregroundRect); |
2410 | 2409 |
2411 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.foregroundRect
.rect()), phase, paintBehavior, paintingRootForRenderer, localPaintingInfo.regio
n, 0, 0, localPaintingInfo.rootLayer->renderer()); | 2410 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.foregroundRect
.rect()), phase, paintBehavior, paintingRootForRenderer, 0, 0, localPaintingInfo
.rootLayer->renderer()); |
2412 if (phase == PaintPhaseForeground) | 2411 if (phase == PaintPhaseForeground) |
2413 paintInfo.overlapTestRequests = localPaintingInfo.overlapTestRequest
s; | 2412 paintInfo.overlapTestRequests = localPaintingInfo.overlapTestRequest
s; |
2414 renderer()->paint(paintInfo, toPoint(fragment.layerBounds.location() - r
enderBoxLocation() + subPixelAccumulationIfNeeded(localPaintingInfo.subPixelAccu
mulation, compositingState()))); | 2413 renderer()->paint(paintInfo, toPoint(fragment.layerBounds.location() - r
enderBoxLocation() + subPixelAccumulationIfNeeded(localPaintingInfo.subPixelAccu
mulation, compositingState()))); |
2415 | 2414 |
2416 if (shouldClip) | 2415 if (shouldClip) |
2417 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.fore
groundRect); | 2416 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.fore
groundRect); |
2418 } | 2417 } |
2419 } | 2418 } |
2420 | 2419 |
2421 void RenderLayer::paintOutlineForFragments(const LayerFragments& layerFragments,
GraphicsContext* context, const LayerPaintingInfo& localPaintingInfo, | 2420 void RenderLayer::paintOutlineForFragments(const LayerFragments& layerFragments,
GraphicsContext* context, const LayerPaintingInfo& localPaintingInfo, |
2422 PaintBehavior paintBehavior, RenderObject* paintingRootForRenderer) | 2421 PaintBehavior paintBehavior, RenderObject* paintingRootForRenderer) |
2423 { | 2422 { |
2424 for (size_t i = 0; i < layerFragments.size(); ++i) { | 2423 for (size_t i = 0; i < layerFragments.size(); ++i) { |
2425 const LayerFragment& fragment = layerFragments.at(i); | 2424 const LayerFragment& fragment = layerFragments.at(i); |
2426 if (fragment.outlineRect.isEmpty()) | 2425 if (fragment.outlineRect.isEmpty()) |
2427 continue; | 2426 continue; |
2428 | 2427 |
2429 // Paint our own outline | 2428 // Paint our own outline |
2430 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.outlineRect.re
ct()), PaintPhaseSelfOutline, paintBehavior, paintingRootForRenderer, localPaint
ingInfo.region, 0, 0, localPaintingInfo.rootLayer->renderer()); | 2429 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.outlineRect.re
ct()), PaintPhaseSelfOutline, paintBehavior, paintingRootForRenderer, 0, 0, loca
lPaintingInfo.rootLayer->renderer()); |
2431 clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.paint
DirtyRect, fragment.outlineRect, DoNotIncludeSelfForBorderRadius); | 2430 clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.paint
DirtyRect, fragment.outlineRect, DoNotIncludeSelfForBorderRadius); |
2432 renderer()->paint(paintInfo, toPoint(fragment.layerBounds.location() - r
enderBoxLocation() + subPixelAccumulationIfNeeded(localPaintingInfo.subPixelAccu
mulation, compositingState()))); | 2431 renderer()->paint(paintInfo, toPoint(fragment.layerBounds.location() - r
enderBoxLocation() + subPixelAccumulationIfNeeded(localPaintingInfo.subPixelAccu
mulation, compositingState()))); |
2433 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.outlineR
ect); | 2432 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.outlineR
ect); |
2434 } | 2433 } |
2435 } | 2434 } |
2436 | 2435 |
2437 void RenderLayer::paintMaskForFragments(const LayerFragments& layerFragments, Gr
aphicsContext* context, const LayerPaintingInfo& localPaintingInfo, | 2436 void RenderLayer::paintMaskForFragments(const LayerFragments& layerFragments, Gr
aphicsContext* context, const LayerPaintingInfo& localPaintingInfo, |
2438 RenderObject* paintingRootForRenderer) | 2437 RenderObject* paintingRootForRenderer) |
2439 { | 2438 { |
2440 for (size_t i = 0; i < layerFragments.size(); ++i) { | 2439 for (size_t i = 0; i < layerFragments.size(); ++i) { |
2441 const LayerFragment& fragment = layerFragments.at(i); | 2440 const LayerFragment& fragment = layerFragments.at(i); |
2442 if (!fragment.shouldPaintContent) | 2441 if (!fragment.shouldPaintContent) |
2443 continue; | 2442 continue; |
2444 | 2443 |
2445 if (localPaintingInfo.clipToDirtyRect) | 2444 if (localPaintingInfo.clipToDirtyRect) |
2446 clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.p
aintDirtyRect, fragment.backgroundRect, DoNotIncludeSelfForBorderRadius); // Mas
k painting will handle clipping to self. | 2445 clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.p
aintDirtyRect, fragment.backgroundRect, DoNotIncludeSelfForBorderRadius); // Mas
k painting will handle clipping to self. |
2447 | 2446 |
2448 // Paint the mask. | 2447 // Paint the mask. |
2449 // FIXME: Eventually we will collect the region from the fragment itself
instead of just from the paint info. | 2448 // FIXME: Eventually we will collect the region from the fragment itself
instead of just from the paint info. |
2450 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.backgroundRect
.rect()), PaintPhaseMask, PaintBehaviorNormal, paintingRootForRenderer, localPai
ntingInfo.region, 0, 0, localPaintingInfo.rootLayer->renderer()); | 2449 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.backgroundRect
.rect()), PaintPhaseMask, PaintBehaviorNormal, paintingRootForRenderer, 0, 0, lo
calPaintingInfo.rootLayer->renderer()); |
2451 renderer()->paint(paintInfo, toPoint(fragment.layerBounds.location() - r
enderBoxLocation() + subPixelAccumulationIfNeeded(localPaintingInfo.subPixelAccu
mulation, compositingState()))); | 2450 renderer()->paint(paintInfo, toPoint(fragment.layerBounds.location() - r
enderBoxLocation() + subPixelAccumulationIfNeeded(localPaintingInfo.subPixelAccu
mulation, compositingState()))); |
2452 | 2451 |
2453 if (localPaintingInfo.clipToDirtyRect) | 2452 if (localPaintingInfo.clipToDirtyRect) |
2454 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.back
groundRect); | 2453 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.back
groundRect); |
2455 } | 2454 } |
2456 } | 2455 } |
2457 | 2456 |
2458 void RenderLayer::paintChildClippingMaskForFragments(const LayerFragments& layer
Fragments, GraphicsContext* context, const LayerPaintingInfo& localPaintingInfo, | 2457 void RenderLayer::paintChildClippingMaskForFragments(const LayerFragments& layer
Fragments, GraphicsContext* context, const LayerPaintingInfo& localPaintingInfo, |
2459 RenderObject* paintingRootForRenderer) | 2458 RenderObject* paintingRootForRenderer) |
2460 { | 2459 { |
2461 for (size_t i = 0; i < layerFragments.size(); ++i) { | 2460 for (size_t i = 0; i < layerFragments.size(); ++i) { |
2462 const LayerFragment& fragment = layerFragments.at(i); | 2461 const LayerFragment& fragment = layerFragments.at(i); |
2463 if (!fragment.shouldPaintContent) | 2462 if (!fragment.shouldPaintContent) |
2464 continue; | 2463 continue; |
2465 | 2464 |
2466 if (localPaintingInfo.clipToDirtyRect) | 2465 if (localPaintingInfo.clipToDirtyRect) |
2467 clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.p
aintDirtyRect, fragment.foregroundRect, IncludeSelfForBorderRadius); // Child cl
ipping mask painting will handle clipping to self. | 2466 clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.p
aintDirtyRect, fragment.foregroundRect, IncludeSelfForBorderRadius); // Child cl
ipping mask painting will handle clipping to self. |
2468 | 2467 |
2469 // Paint the the clipped mask. | 2468 // Paint the the clipped mask. |
2470 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.backgroundRect
.rect()), PaintPhaseClippingMask, PaintBehaviorNormal, paintingRootForRenderer,
localPaintingInfo.region, 0, 0, localPaintingInfo.rootLayer->renderer()); | 2469 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.backgroundRect
.rect()), PaintPhaseClippingMask, PaintBehaviorNormal, paintingRootForRenderer,
0, 0, localPaintingInfo.rootLayer->renderer()); |
2471 renderer()->paint(paintInfo, toPoint(fragment.layerBounds.location() - r
enderBoxLocation() + subPixelAccumulationIfNeeded(localPaintingInfo.subPixelAccu
mulation, compositingState()))); | 2470 renderer()->paint(paintInfo, toPoint(fragment.layerBounds.location() - r
enderBoxLocation() + subPixelAccumulationIfNeeded(localPaintingInfo.subPixelAccu
mulation, compositingState()))); |
2472 | 2471 |
2473 if (localPaintingInfo.clipToDirtyRect) | 2472 if (localPaintingInfo.clipToDirtyRect) |
2474 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.fore
groundRect); | 2473 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.fore
groundRect); |
2475 } | 2474 } |
2476 } | 2475 } |
2477 | 2476 |
2478 void RenderLayer::paintOverflowControlsForFragments(const LayerFragments& layerF
ragments, GraphicsContext* context, const LayerPaintingInfo& localPaintingInfo) | 2477 void RenderLayer::paintOverflowControlsForFragments(const LayerFragments& layerF
ragments, GraphicsContext* context, const LayerPaintingInfo& localPaintingInfo) |
2479 { | 2478 { |
2480 for (size_t i = 0; i < layerFragments.size(); ++i) { | 2479 for (size_t i = 0; i < layerFragments.size(); ++i) { |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2769 | 2768 |
2770 // The natural thing would be to keep HitTestingTransformState on the stack,
but it's big, so we heap-allocate. | 2769 // The natural thing would be to keep HitTestingTransformState on the stack,
but it's big, so we heap-allocate. |
2771 | 2770 |
2772 // Apply a transform if we have one. | 2771 // Apply a transform if we have one. |
2773 if (transform() && !appliedTransform) { | 2772 if (transform() && !appliedTransform) { |
2774 if (enclosingPaginationLayer()) | 2773 if (enclosingPaginationLayer()) |
2775 return hitTestTransformedLayerInFragments(rootLayer, containerLayer,
request, result, hitTestRect, hitTestLocation, transformState, zOffset); | 2774 return hitTestTransformedLayerInFragments(rootLayer, containerLayer,
request, result, hitTestRect, hitTestLocation, transformState, zOffset); |
2776 | 2775 |
2777 // Make sure the parent's clip rects have been calculated. | 2776 // Make sure the parent's clip rects have been calculated. |
2778 if (parent()) { | 2777 if (parent()) { |
2779 ClipRectsContext clipRectsContext(rootLayer, hitTestLocation.region(
), RootRelativeClipRects, IncludeOverlayScrollbarSize); | 2778 ClipRectsContext clipRectsContext(rootLayer, RootRelativeClipRects,
IncludeOverlayScrollbarSize); |
2780 ClipRect clipRect = clipper().backgroundClipRect(clipRectsContext); | 2779 ClipRect clipRect = clipper().backgroundClipRect(clipRectsContext); |
2781 // Go ahead and test the enclosing clip now. | 2780 // Go ahead and test the enclosing clip now. |
2782 if (!clipRect.intersects(hitTestLocation)) | 2781 if (!clipRect.intersects(hitTestLocation)) |
2783 return 0; | 2782 return 0; |
2784 } | 2783 } |
2785 | 2784 |
2786 return hitTestLayerByApplyingTransform(rootLayer, containerLayer, reques
t, result, hitTestRect, hitTestLocation, transformState, zOffset); | 2785 return hitTestLayerByApplyingTransform(rootLayer, containerLayer, reques
t, result, hitTestRect, hitTestLocation, transformState, zOffset); |
2787 } | 2786 } |
2788 | 2787 |
2789 // Ensure our lists and 3d status are up-to-date. | 2788 // Ensure our lists and 3d status are up-to-date. |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2855 hitLayer = hitTestChildren(NormalFlowChildren, rootLayer, request, result, h
itTestRect, hitTestLocation, | 2854 hitLayer = hitTestChildren(NormalFlowChildren, rootLayer, request, result, h
itTestRect, hitTestLocation, |
2856 localTransformState.get(), zOffsetForDescendantsPtr,
zOffset, unflattenedTransformState.get(), depthSortDescendants); | 2855 localTransformState.get(), zOffsetForDescendantsPtr,
zOffset, unflattenedTransformState.get(), depthSortDescendants); |
2857 if (hitLayer) { | 2856 if (hitLayer) { |
2858 if (!depthSortDescendants) | 2857 if (!depthSortDescendants) |
2859 return hitLayer; | 2858 return hitLayer; |
2860 candidateLayer = hitLayer; | 2859 candidateLayer = hitLayer; |
2861 } | 2860 } |
2862 | 2861 |
2863 // Collect the fragments. This will compute the clip rectangles for each lay
er fragment. | 2862 // Collect the fragments. This will compute the clip rectangles for each lay
er fragment. |
2864 LayerFragments layerFragments; | 2863 LayerFragments layerFragments; |
2865 collectFragments(layerFragments, rootLayer, hitTestLocation.region(), hitTes
tRect, RootRelativeClipRects, IncludeOverlayScrollbarSize); | 2864 collectFragments(layerFragments, rootLayer, hitTestRect, RootRelativeClipRec
ts, IncludeOverlayScrollbarSize); |
2866 | 2865 |
2867 if (m_scrollableArea && m_scrollableArea->hitTestResizerInFragments(layerFra
gments, hitTestLocation)) { | 2866 if (m_scrollableArea && m_scrollableArea->hitTestResizerInFragments(layerFra
gments, hitTestLocation)) { |
2868 renderer()->updateHitTestResult(result, hitTestLocation.point()); | 2867 renderer()->updateHitTestResult(result, hitTestLocation.point()); |
2869 return this; | 2868 return this; |
2870 } | 2869 } |
2871 | 2870 |
2872 // Next we want to see if the mouse pos is inside the child RenderObjects of
the layer. Check | 2871 // Next we want to see if the mouse pos is inside the child RenderObjects of
the layer. Check |
2873 // every fragment in reverse order. | 2872 // every fragment in reverse order. |
2874 if (isSelfPaintingLayer()) { | 2873 if (isSelfPaintingLayer()) { |
2875 // Hit test with a temporary HitTestResult, because we only want to comm
it to 'result' if we know we're frontmost. | 2874 // Hit test with a temporary HitTestResult, because we only want to comm
it to 'result' if we know we're frontmost. |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2938 | 2937 |
2939 return false; | 2938 return false; |
2940 } | 2939 } |
2941 | 2940 |
2942 RenderLayer* RenderLayer::hitTestTransformedLayerInFragments(RenderLayer* rootLa
yer, RenderLayer* containerLayer, const HitTestRequest& request, HitTestResult&
result, | 2941 RenderLayer* RenderLayer::hitTestTransformedLayerInFragments(RenderLayer* rootLa
yer, RenderLayer* containerLayer, const HitTestRequest& request, HitTestResult&
result, |
2943 const LayoutRect& hitTestRect, const HitTestLocation& hitTestLocation, const
HitTestingTransformState* transformState, double* zOffset) | 2942 const LayoutRect& hitTestRect, const HitTestLocation& hitTestLocation, const
HitTestingTransformState* transformState, double* zOffset) |
2944 { | 2943 { |
2945 LayerFragments enclosingPaginationFragments; | 2944 LayerFragments enclosingPaginationFragments; |
2946 LayoutPoint offsetOfPaginationLayerFromRoot; | 2945 LayoutPoint offsetOfPaginationLayerFromRoot; |
2947 LayoutRect transformedExtent = transparencyClipBox(this, enclosingPagination
Layer(), HitTestingTransparencyClipBox, RootOfTransparencyClipBox); | 2946 LayoutRect transformedExtent = transparencyClipBox(this, enclosingPagination
Layer(), HitTestingTransparencyClipBox, RootOfTransparencyClipBox); |
2948 enclosingPaginationLayer()->collectFragments(enclosingPaginationFragments, r
ootLayer, hitTestLocation.region(), hitTestRect, | 2947 enclosingPaginationLayer()->collectFragments(enclosingPaginationFragments, r
ootLayer, hitTestRect, |
2949 RootRelativeClipRects, IncludeOverlayScrollbarSize, RespectOverflowClip,
&offsetOfPaginationLayerFromRoot, LayoutSize(), &transformedExtent); | 2948 RootRelativeClipRects, IncludeOverlayScrollbarSize, RespectOverflowClip,
&offsetOfPaginationLayerFromRoot, LayoutSize(), &transformedExtent); |
2950 | 2949 |
2951 for (int i = enclosingPaginationFragments.size() - 1; i >= 0; --i) { | 2950 for (int i = enclosingPaginationFragments.size() - 1; i >= 0; --i) { |
2952 const LayerFragment& fragment = enclosingPaginationFragments.at(i); | 2951 const LayerFragment& fragment = enclosingPaginationFragments.at(i); |
2953 | 2952 |
2954 // Apply the page/column clip for this fragment, as well as any clips es
tablished by layers in between us and | 2953 // Apply the page/column clip for this fragment, as well as any clips es
tablished by layers in between us and |
2955 // the enclosing pagination layer. | 2954 // the enclosing pagination layer. |
2956 LayoutRect clipRect = fragment.backgroundRect.rect(); | 2955 LayoutRect clipRect = fragment.backgroundRect.rect(); |
2957 | 2956 |
2958 // Now compute the clips within a given fragment | 2957 // Now compute the clips within a given fragment |
2959 if (parent() != enclosingPaginationLayer()) { | 2958 if (parent() != enclosingPaginationLayer()) { |
2960 enclosingPaginationLayer()->convertToLayerCoords(rootLayer, offsetOf
PaginationLayerFromRoot); | 2959 enclosingPaginationLayer()->convertToLayerCoords(rootLayer, offsetOf
PaginationLayerFromRoot); |
2961 | 2960 |
2962 ClipRectsContext clipRectsContext(enclosingPaginationLayer(), hitTes
tLocation.region(), RootRelativeClipRects, IncludeOverlayScrollbarSize); | 2961 ClipRectsContext clipRectsContext(enclosingPaginationLayer(), RootRe
lativeClipRects, IncludeOverlayScrollbarSize); |
2963 LayoutRect parentClipRect = clipper().backgroundClipRect(clipRectsCo
ntext).rect(); | 2962 LayoutRect parentClipRect = clipper().backgroundClipRect(clipRectsCo
ntext).rect(); |
2964 parentClipRect.moveBy(fragment.paginationOffset + offsetOfPagination
LayerFromRoot); | 2963 parentClipRect.moveBy(fragment.paginationOffset + offsetOfPagination
LayerFromRoot); |
2965 clipRect.intersect(parentClipRect); | 2964 clipRect.intersect(parentClipRect); |
2966 } | 2965 } |
2967 | 2966 |
2968 if (!hitTestLocation.intersects(clipRect)) | 2967 if (!hitTestLocation.intersects(clipRect)) |
2969 continue; | 2968 continue; |
2970 | 2969 |
2971 RenderLayer* hitLayer = hitTestLayerByApplyingTransform(rootLayer, conta
inerLayer, request, result, hitTestRect, hitTestLocation, | 2970 RenderLayer* hitLayer = hitTestLayerByApplyingTransform(rootLayer, conta
inerLayer, request, result, hitTestRect, hitTestLocation, |
2972 transformState, zOffset, fragment.paginationOffset); | 2971 transformState, zOffset, fragment.paginationOffset); |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3210 child->repaintBlockSelectionGaps(); | 3209 child->repaintBlockSelectionGaps(); |
3211 | 3210 |
3212 if (m_blockSelectionGapsBounds.isEmpty()) | 3211 if (m_blockSelectionGapsBounds.isEmpty()) |
3213 return; | 3212 return; |
3214 | 3213 |
3215 LayoutRect rect = m_blockSelectionGapsBounds; | 3214 LayoutRect rect = m_blockSelectionGapsBounds; |
3216 if (renderer()->hasOverflowClip()) { | 3215 if (renderer()->hasOverflowClip()) { |
3217 RenderBox* box = renderBox(); | 3216 RenderBox* box = renderBox(); |
3218 rect.move(-box->scrolledContentOffset()); | 3217 rect.move(-box->scrolledContentOffset()); |
3219 if (!scrollableArea()->usesCompositedScrolling()) | 3218 if (!scrollableArea()->usesCompositedScrolling()) |
3220 rect.intersect(box->overflowClipRect(LayoutPoint(), 0)); // FIXME: R
egions not accounted for. | 3219 rect.intersect(box->overflowClipRect(LayoutPoint())); |
3221 } | 3220 } |
3222 if (renderer()->hasClip()) | 3221 if (renderer()->hasClip()) |
3223 rect.intersect(toRenderBox(renderer())->clipRect(LayoutPoint(), 0)); //
FIXME: Regions not accounted for. | 3222 rect.intersect(toRenderBox(renderer())->clipRect(LayoutPoint())); |
3224 if (!rect.isEmpty()) | 3223 if (!rect.isEmpty()) |
3225 renderer()->repaintRectangle(rect); | 3224 renderer()->repaintRectangle(rect); |
3226 } | 3225 } |
3227 | 3226 |
3228 bool RenderLayer::hasBlockSelectionGapBounds() const | 3227 bool RenderLayer::hasBlockSelectionGapBounds() const |
3229 { | 3228 { |
3230 return !m_blockSelectionGapsBounds.isEmpty(); | 3229 return !m_blockSelectionGapsBounds.isEmpty(); |
3231 } | 3230 } |
3232 | 3231 |
3233 bool RenderLayer::intersectsDamageRect(const LayoutRect& layerBounds, const Layo
utRect& damageRect, const RenderLayer* rootLayer, const LayoutPoint* offsetFromR
oot) const | 3232 bool RenderLayer::intersectsDamageRect(const LayoutRect& layerBounds, const Layo
utRect& damageRect, const RenderLayer* rootLayer, const LayoutPoint* offsetFromR
oot) const |
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4015 } | 4014 } |
4016 } | 4015 } |
4017 | 4016 |
4018 void showLayerTree(const WebCore::RenderObject* renderer) | 4017 void showLayerTree(const WebCore::RenderObject* renderer) |
4019 { | 4018 { |
4020 if (!renderer) | 4019 if (!renderer) |
4021 return; | 4020 return; |
4022 showLayerTree(renderer->enclosingLayer()); | 4021 showLayerTree(renderer->enclosingLayer()); |
4023 } | 4022 } |
4024 #endif | 4023 #endif |
OLD | NEW |