<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[170873] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/170873">170873</a></dd>
<dt>Author</dt> <dd>zalan@apple.com</dd>
<dt>Date</dt> <dd>2014-07-07 20:22:03 -0700 (Mon, 07 Jul 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Pass RenderLayer reference instead of pointer to RenderLayer::paintingExtent().
https://bugs.webkit.org/show_bug.cgi?id=134714
Reviewed by Simon Fraser.
No change in functionality.
* rendering/RenderLayer.cpp: * -> &
(WebCore::expandClipRectForRegionAndReflection):
(WebCore::expandClipRectForDescendantsAndReflection):
(WebCore::transparencyClipBox):
(WebCore::paintingExtent):
(WebCore::RenderLayer::beginTransparencyLayers):
(WebCore::RenderLayer::paintTransformedLayerIntoFragments):
(WebCore::RenderLayer::hitTestTransformedLayerInFragments):
(WebCore::RenderLayer::paintingExtent): Deleted.
* rendering/RenderLayer.h:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayercpp">trunk/Source/WebCore/rendering/RenderLayer.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerh">trunk/Source/WebCore/rendering/RenderLayer.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (170872 => 170873)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-07-08 02:40:11 UTC (rev 170872)
+++ trunk/Source/WebCore/ChangeLog        2014-07-08 03:22:03 UTC (rev 170873)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2014-07-07 Zalan Bujtas <zalan@apple.com>
+
+ Pass RenderLayer reference instead of pointer to RenderLayer::paintingExtent().
+ https://bugs.webkit.org/show_bug.cgi?id=134714
+
+ Reviewed by Simon Fraser.
+
+ No change in functionality.
+
+ * rendering/RenderLayer.cpp: * -> &
+ (WebCore::expandClipRectForRegionAndReflection):
+ (WebCore::expandClipRectForDescendantsAndReflection):
+ (WebCore::transparencyClipBox):
+ (WebCore::paintingExtent):
+ (WebCore::RenderLayer::beginTransparencyLayers):
+ (WebCore::RenderLayer::paintTransformedLayerIntoFragments):
+ (WebCore::RenderLayer::hitTestTransformedLayerInFragments):
+ (WebCore::RenderLayer::paintingExtent): Deleted.
+ * rendering/RenderLayer.h:
+
</ins><span class="cx"> 2014-07-07 Myles C. Maxfield <mmaxfield@apple.com>
</span><span class="cx">
</span><span class="cx"> Remove misleadingly-named Font::isSVGFont()
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (170872 => 170873)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-07-08 02:40:11 UTC (rev 170872)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-07-08 03:22:03 UTC (rev 170873)
</span><span class="lines">@@ -1548,19 +1548,19 @@
</span><span class="cx"> RootOfTransparencyClipBox
</span><span class="cx"> };
</span><span class="cx">
</span><del>-static LayoutRect transparencyClipBox(const RenderLayer*, const RenderLayer* rootLayer, TransparencyClipBoxBehavior, TransparencyClipBoxMode, PaintBehavior = 0);
</del><ins>+static LayoutRect transparencyClipBox(const RenderLayer&, const RenderLayer* rootLayer, TransparencyClipBoxBehavior, TransparencyClipBoxMode, PaintBehavior = 0);
</ins><span class="cx">
</span><del>-static void expandClipRectForRegionAndReflection(LayoutRect& clipRect, const RenderLayer* layer, const RenderLayer* rootLayer,
</del><ins>+static void expandClipRectForRegionAndReflection(LayoutRect& clipRect, const RenderLayer& layer, const RenderLayer* rootLayer,
</ins><span class="cx"> TransparencyClipBoxBehavior transparencyBehavior, PaintBehavior paintBehavior)
</span><span class="cx"> {
</span><span class="cx"> // If this is a region, then the painting is actually done by its flow thread's layer.
</span><del>- if (layer->renderer().isRenderNamedFlowFragmentContainer()) {
- RenderBlockFlow* regionContainer = toRenderBlockFlow(&layer->renderer());
</del><ins>+ if (layer.renderer().isRenderNamedFlowFragmentContainer()) {
+ RenderBlockFlow* regionContainer = toRenderBlockFlow(&layer.renderer());
</ins><span class="cx"> RenderNamedFlowFragment* region = regionContainer->renderNamedFlowFragment();
</span><span class="cx"> RenderLayer* flowThreadLayer = region->flowThread()->layer();
</span><del>- if (!layer->reflection() || layer->reflectionLayer() != flowThreadLayer) {
- LayoutRect flowThreadClipRect = transparencyClipBox(flowThreadLayer, rootLayer, transparencyBehavior, DescendantsOfTransparencyClipBox, paintBehavior);
- LayoutSize moveOffset = (regionContainer->contentBoxRect().location() + layer->offsetFromAncestor(flowThreadLayer)) - region->flowThreadPortionRect().location();
</del><ins>+ if (flowThreadLayer && (!layer.reflection() || layer.reflectionLayer() != flowThreadLayer)) {
+ LayoutRect flowThreadClipRect = transparencyClipBox(*flowThreadLayer, rootLayer, transparencyBehavior, DescendantsOfTransparencyClipBox, paintBehavior);
+ LayoutSize moveOffset = (regionContainer->contentBoxRect().location() + layer.offsetFromAncestor(flowThreadLayer)) - region->flowThreadPortionRect().location();
</ins><span class="cx"> flowThreadClipRect.move(moveOffset);
</span><span class="cx">
</span><span class="cx"> clipRect.unite(flowThreadClipRect);
</span><span class="lines">@@ -1568,17 +1568,17 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void expandClipRectForDescendantsAndReflection(LayoutRect& clipRect, const RenderLayer* layer, const RenderLayer* rootLayer,
</del><ins>+static void expandClipRectForDescendantsAndReflection(LayoutRect& clipRect, const RenderLayer& layer, const RenderLayer* rootLayer,
</ins><span class="cx"> TransparencyClipBoxBehavior transparencyBehavior, PaintBehavior paintBehavior)
</span><span class="cx"> {
</span><span class="cx"> // If we have a mask, then the clip is limited to the border box area (and there is
</span><span class="cx"> // no need to examine child layers).
</span><del>- if (!layer->renderer().hasMask()) {
</del><ins>+ if (!layer.renderer().hasMask()) {
</ins><span class="cx"> // Note: we don't have to walk z-order lists since transparent elements always establish
</span><span class="cx"> // a stacking container. This means we can just walk the layer tree directly.
</span><del>- for (RenderLayer* curr = layer->firstChild(); curr; curr = curr->nextSibling()) {
- if (!layer->reflection() || layer->reflectionLayer() != curr)
- clipRect.unite(transparencyClipBox(curr, rootLayer, transparencyBehavior, DescendantsOfTransparencyClipBox, paintBehavior));
</del><ins>+ for (RenderLayer* curr = layer.firstChild(); curr; curr = curr->nextSibling()) {
+ if (!layer.reflection() || layer.reflectionLayer() != curr)
+ clipRect.unite(transparencyClipBox(*curr, rootLayer, transparencyBehavior, DescendantsOfTransparencyClipBox, paintBehavior));
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1588,40 +1588,40 @@
</span><span class="cx"> // current transparencyClipBox to catch all child layers.
</span><span class="cx"> // FIXME: Accelerated compositing will eventually want to do something smart here to avoid incorporating this
</span><span class="cx"> // size into the parent layer.
</span><del>- if (layer->renderer().hasReflection()) {
- LayoutSize delta = layer->offsetFromAncestor(rootLayer);
</del><ins>+ if (layer.renderer().hasReflection()) {
+ LayoutSize delta = layer.offsetFromAncestor(rootLayer);
</ins><span class="cx"> clipRect.move(-delta);
</span><del>- clipRect.unite(layer->renderBox()->reflectedRect(clipRect));
</del><ins>+ clipRect.unite(layer.renderBox()->reflectedRect(clipRect));
</ins><span class="cx"> clipRect.move(delta);
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static LayoutRect transparencyClipBox(const RenderLayer* layer, const RenderLayer* rootLayer, TransparencyClipBoxBehavior transparencyBehavior,
</del><ins>+static LayoutRect transparencyClipBox(const RenderLayer& layer, const RenderLayer* rootLayer, TransparencyClipBoxBehavior transparencyBehavior,
</ins><span class="cx"> TransparencyClipBoxMode transparencyMode, PaintBehavior paintBehavior)
</span><span class="cx"> {
</span><span class="cx"> // FIXME: Although this function completely ignores CSS-imposed clipping, we did already intersect with the
</span><span class="cx"> // paintDirtyRect, and that should cut down on the amount we have to paint. Still it
</span><span class="cx"> // would be better to respect clips.
</span><span class="cx">
</span><del>- if (rootLayer != layer && ((transparencyBehavior == PaintingTransparencyClipBox && layer->paintsWithTransform(paintBehavior))
- || (transparencyBehavior == HitTestingTransparencyClipBox && layer->hasTransform()))) {
</del><ins>+ if (rootLayer != &layer && ((transparencyBehavior == PaintingTransparencyClipBox && layer.paintsWithTransform(paintBehavior))
+ || (transparencyBehavior == HitTestingTransparencyClipBox && layer.hasTransform()))) {
</ins><span class="cx"> // The best we can do here is to use enclosed bounding boxes to establish a "fuzzy" enough clip to encompass
</span><span class="cx"> // the transformed layer and all of its children.
</span><span class="cx"> RenderLayer::PaginationInclusionMode mode = transparencyBehavior == HitTestingTransparencyClipBox ? RenderLayer::IncludeCompositedPaginatedLayers : RenderLayer::ExcludeCompositedPaginatedLayers;
</span><del>- const RenderLayer* paginationLayer = transparencyMode == DescendantsOfTransparencyClipBox ? layer->enclosingPaginationLayer(mode) : 0;
</del><ins>+ const RenderLayer* paginationLayer = transparencyMode == DescendantsOfTransparencyClipBox ? layer.enclosingPaginationLayer(mode) : 0;
</ins><span class="cx"> const RenderLayer* rootLayerForTransform = paginationLayer ? paginationLayer : rootLayer;
</span><del>- LayoutSize delta = layer->offsetFromAncestor(rootLayerForTransform);
</del><ins>+ LayoutSize delta = layer.offsetFromAncestor(rootLayerForTransform);
</ins><span class="cx">
</span><span class="cx"> TransformationMatrix transform;
</span><span class="cx"> transform.translate(delta.width(), delta.height());
</span><del>- transform = transform * *layer->transform();
</del><ins>+ transform = transform * *layer.transform();
</ins><span class="cx">
</span><span class="cx"> // We don't use fragment boxes when collecting a transformed layer's bounding box, since it always
</span><span class="cx"> // paints unfragmented.
</span><del>- LayoutRect clipRect = layer->boundingBox(layer);
- expandClipRectForDescendantsAndReflection(clipRect, layer, layer, transparencyBehavior, paintBehavior);
</del><ins>+ LayoutRect clipRect = layer.boundingBox(&layer);
+ expandClipRectForDescendantsAndReflection(clipRect, layer, &layer, transparencyBehavior, paintBehavior);
</ins><span class="cx"> #if ENABLE(CSS_FILTERS)
</span><del>- layer->renderer().style().filterOutsets().expandRect(clipRect);
</del><ins>+ layer.renderer().style().filterOutsets().expandRect(clipRect);
</ins><span class="cx"> #endif
</span><span class="cx"> LayoutRect result = transform.mapRect(clipRect);
</span><span class="cx"> if (!paginationLayer)
</span><span class="lines">@@ -1636,17 +1636,17 @@
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- LayoutRect clipRect = layer->boundingBox(rootLayer, layer->offsetFromAncestor(rootLayer), transparencyBehavior == HitTestingTransparencyClipBox ? RenderLayer::UseFragmentBoxesIncludingCompositing : RenderLayer::UseFragmentBoxesExcludingCompositing);
</del><ins>+ LayoutRect clipRect = layer.boundingBox(rootLayer, layer.offsetFromAncestor(rootLayer), transparencyBehavior == HitTestingTransparencyClipBox ? RenderLayer::UseFragmentBoxesIncludingCompositing : RenderLayer::UseFragmentBoxesExcludingCompositing);
</ins><span class="cx"> expandClipRectForDescendantsAndReflection(clipRect, layer, rootLayer, transparencyBehavior, paintBehavior);
</span><span class="cx"> #if ENABLE(CSS_FILTERS)
</span><del>- layer->renderer().style().filterOutsets().expandRect(clipRect);
</del><ins>+ layer.renderer().style().filterOutsets().expandRect(clipRect);
</ins><span class="cx"> #endif
</span><span class="cx"> return clipRect;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-LayoutRect RenderLayer::paintingExtent(const RenderLayer* rootLayer, const LayoutRect& paintDirtyRect, PaintBehavior paintBehavior)
</del><ins>+static LayoutRect paintingExtent(const RenderLayer& currentLayer, const RenderLayer* rootLayer, const LayoutRect& paintDirtyRect, PaintBehavior paintBehavior)
</ins><span class="cx"> {
</span><del>- return intersection(transparencyClipBox(this, rootLayer, PaintingTransparencyClipBox, RootOfTransparencyClipBox, paintBehavior), paintDirtyRect);
</del><ins>+ return intersection(transparencyClipBox(currentLayer, rootLayer, PaintingTransparencyClipBox, RootOfTransparencyClipBox, paintBehavior), paintDirtyRect);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void RenderLayer::beginTransparencyLayers(GraphicsContext* context, const RenderLayer* rootLayer, const LayoutRect& paintDirtyRect, PaintBehavior paintBehavior)
</span><span class="lines">@@ -1661,7 +1661,7 @@
</span><span class="cx"> if (paintsWithTransparency(paintBehavior)) {
</span><span class="cx"> m_usedTransparency = true;
</span><span class="cx"> context->save();
</span><del>- LayoutRect clipRect = paintingExtent(rootLayer, paintDirtyRect, paintBehavior);
</del><ins>+ LayoutRect clipRect = paintingExtent(*this, rootLayer, paintDirtyRect, paintBehavior);
</ins><span class="cx"> context->clip(clipRect);
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CSS_COMPOSITING)
</span><span class="lines">@@ -4331,7 +4331,7 @@
</span><span class="cx"> LayerFragments enclosingPaginationFragments;
</span><span class="cx"> LayoutSize offsetOfPaginationLayerFromRoot;
</span><span class="cx"> RenderLayer* paginatedLayer = enclosingPaginationLayer(ExcludeCompositedPaginatedLayers);
</span><del>- LayoutRect transformedExtent = transparencyClipBox(this, paginatedLayer, PaintingTransparencyClipBox, RootOfTransparencyClipBox, paintingInfo.paintBehavior);
</del><ins>+ LayoutRect transformedExtent = transparencyClipBox(*this, paginatedLayer, PaintingTransparencyClipBox, RootOfTransparencyClipBox, paintingInfo.paintBehavior);
</ins><span class="cx"> paginatedLayer->collectFragments(enclosingPaginationFragments, paintingInfo.rootLayer, paintingInfo.paintDirtyRect, ExcludeCompositedPaginatedLayers,
</span><span class="cx"> (paintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : PaintingClipRects, IgnoreOverlayScrollbarSize,
</span><span class="cx"> (paintFlags & PaintLayerPaintingOverflowContents) ? IgnoreOverflowClip : RespectOverflowClip, offsetOfPaginationLayerFromRoot, &transformedExtent);
</span><span class="lines">@@ -4932,7 +4932,7 @@
</span><span class="cx"> LayerFragments enclosingPaginationFragments;
</span><span class="cx"> LayoutSize offsetOfPaginationLayerFromRoot;
</span><span class="cx"> RenderLayer* paginatedLayer = enclosingPaginationLayer(IncludeCompositedPaginatedLayers);
</span><del>- LayoutRect transformedExtent = transparencyClipBox(this, paginatedLayer, HitTestingTransparencyClipBox, RootOfTransparencyClipBox);
</del><ins>+ LayoutRect transformedExtent = transparencyClipBox(*this, paginatedLayer, HitTestingTransparencyClipBox, RootOfTransparencyClipBox);
</ins><span class="cx"> paginatedLayer->collectFragments(enclosingPaginationFragments, rootLayer, hitTestRect, IncludeCompositedPaginatedLayers,
</span><span class="cx"> RootRelativeClipRects, IncludeOverlayScrollbarSize, RespectOverflowClip, offsetOfPaginationLayerFromRoot, &transformedExtent);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.h (170872 => 170873)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.h        2014-07-08 02:40:11 UTC (rev 170872)
+++ trunk/Source/WebCore/rendering/RenderLayer.h        2014-07-08 03:22:03 UTC (rev 170873)
</span><span class="lines">@@ -1134,8 +1134,6 @@
</span><span class="cx"> void parentClipRects(const ClipRectsContext&, ClipRects&) const;
</span><span class="cx"> ClipRect backgroundClipRect(const ClipRectsContext&) const;
</span><span class="cx">
</span><del>- LayoutRect paintingExtent(const RenderLayer* rootLayer, const LayoutRect& paintDirtyRect, PaintBehavior);
-
</del><span class="cx"> RenderLayer* enclosingTransformedAncestor() const;
</span><span class="cx">
</span><span class="cx"> // Convert a point in absolute coords into layer coords, taking transforms into account
</span></span></pre>
</div>
</div>
</body>
</html>