Change the terminology used by rendering code when painting a given node and...

Change the terminology used by rendering code when painting a given node and its children from "paintingRoot" to "subtreePaintRoot"
https://bugs.webkit.org/show_bug.cgi?id=116417

Reviewed by Sam Weinig.

PaintInfo and RenderLayer code referred to a "paintingRoot". This is only set when
FrameView::setNodeToDraw() has been called and is used to restrict painting to
some part of the subtree, but it could easily be misinterpreted, and confused with
the "rootLayer" used by RenderLayer (which is usually not the layer associated with
the paintingRoot).

Change the terminology from "paintingRoot" to "subtreePaintRoot" root to make the
purpose of this variable more obvious.

No behavior change.

* page/FrameView.cpp: Add a comment for setNodeToDraw(); in future this should
be called setSubtreePaintRoot() or something. Not done in this patch to avoid
risk; this function is exported from WebCore.
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::paint):
* rendering/PaintInfo.h:
(WebCore::PaintInfo::PaintInfo):
(WebCore::PaintInfo::updateSubtreePaintRootForChildren):
(WebCore::PaintInfo::shouldPaintWithinRoot):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintContents):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paint):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paint):
(WebCore::RenderLayer::paintOverlayScrollbars):
(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::paintLayerByApplyingTransform):
(WebCore::RenderLayer::paintBackgroundForFragments):
(WebCore::RenderLayer::paintForegroundForFragments):
(WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
(WebCore::RenderLayer::paintOutlineForFragments):
(WebCore::RenderLayer::paintMaskForFragments):
* rendering/RenderLayer.h:
(WebCore::RenderLayer::LayerPaintingInfo::LayerPaintingInfo):
* rendering/RenderObject.cpp: Add a comment to recommend changing the name of
paintingRootRect() to refer to a subtree paint. Not done in this patch to avoid
risk; this function is exported from WebCore.
* rendering/RenderSnapshottedPlugIn.cpp:
(WebCore::RenderSnapshottedPlugIn::paint):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::paintObject):
* rendering/svg/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::paint):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150355 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent fd6ff3dc
2013-05-19 Simon Fraser <simon.fraser@apple.com>
Change the terminology used by rendering code when painting a given node and its children from "paintingRoot" to "subtreePaintRoot"
https://bugs.webkit.org/show_bug.cgi?id=116417
Reviewed by Sam Weinig.
PaintInfo and RenderLayer code referred to a "paintingRoot". This is only set when
FrameView::setNodeToDraw() has been called and is used to restrict painting to
some part of the subtree, but it could easily be misinterpreted, and confused with
the "rootLayer" used by RenderLayer (which is usually not the layer associated with
the paintingRoot).
Change the terminology from "paintingRoot" to "subtreePaintRoot" root to make the
purpose of this variable more obvious.
No behavior change.
* page/FrameView.cpp: Add a comment for setNodeToDraw(); in future this should
be called setSubtreePaintRoot() or something. Not done in this patch to avoid
risk; this function is exported from WebCore.
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::paint):
* rendering/PaintInfo.h:
(WebCore::PaintInfo::PaintInfo):
(WebCore::PaintInfo::updateSubtreePaintRootForChildren):
(WebCore::PaintInfo::shouldPaintWithinRoot):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintContents):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paint):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paint):
(WebCore::RenderLayer::paintOverlayScrollbars):
(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::paintLayerByApplyingTransform):
(WebCore::RenderLayer::paintBackgroundForFragments):
(WebCore::RenderLayer::paintForegroundForFragments):
(WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
(WebCore::RenderLayer::paintOutlineForFragments):
(WebCore::RenderLayer::paintMaskForFragments):
* rendering/RenderLayer.h:
(WebCore::RenderLayer::LayerPaintingInfo::LayerPaintingInfo):
* rendering/RenderObject.cpp: Add a comment to recommend changing the name of
paintingRootRect() to refer to a subtree paint. Not done in this patch to avoid
risk; this function is exported from WebCore.
* rendering/RenderSnapshottedPlugIn.cpp:
(WebCore::RenderSnapshottedPlugIn::paint):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::paintObject):
* rendering/svg/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::paint):
2013-05-19 Darin Adler <darin@apple.com>
Use Element instead of Node in DragState, also redo DragState struct
......
......@@ -3581,6 +3581,7 @@ bool FrameView::isPainting() const
return m_isPainting;
}
// FIXME: change this to use the subtreePaint terminology.
void FrameView::setNodeToDraw(Node* node)
{
m_nodeToDraw = node;
......
......@@ -1141,7 +1141,7 @@ void InlineFlowBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset,
PaintPhase paintPhase = paintInfo.phase == PaintPhaseChildOutlines ? PaintPhaseOutline : paintInfo.phase;
PaintInfo childInfo(paintInfo);
childInfo.phase = paintPhase;
childInfo.updatePaintingRootForChildren(renderer());
childInfo.updateSubtreePaintRootForChildren(renderer());
// Paint our children.
if (paintPhase != PaintPhaseSelfOutline) {
......
......@@ -54,13 +54,13 @@ typedef HashMap<OverlapTestRequestClient*, IntRect> OverlapTestRequestMap;
*/
struct PaintInfo {
PaintInfo(GraphicsContext* newContext, const IntRect& newRect, PaintPhase newPhase, PaintBehavior newPaintBehavior,
RenderObject* newPaintingRoot = 0, RenderRegion* region = 0, ListHashSet<RenderInline*>* newOutlineObjects = 0,
RenderObject* newSubtreePaintRoot = 0, RenderRegion* region = 0, ListHashSet<RenderInline*>* newOutlineObjects = 0,
OverlapTestRequestMap* overlapTestRequests = 0, const RenderLayerModelObject* newPaintContainer = 0)
: context(newContext)
, rect(newRect)
, phase(newPhase)
, paintBehavior(newPaintBehavior)
, paintingRoot(newPaintingRoot)
, subtreePaintRoot(newSubtreePaintRoot)
, renderRegion(region)
, outlineObjects(newOutlineObjects)
, overlapTestRequests(overlapTestRequests)
......@@ -68,21 +68,21 @@ struct PaintInfo {
{
}
void updatePaintingRootForChildren(const RenderObject* renderer)
void updateSubtreePaintRootForChildren(const RenderObject* renderer)
{
if (!paintingRoot)
if (!subtreePaintRoot)
return;
// If we're the painting root, kids draw normally, and see root of 0.
if (paintingRoot == renderer) {
paintingRoot = 0;
if (subtreePaintRoot == renderer) {
subtreePaintRoot = 0;
return;
}
}
bool shouldPaintWithinRoot(const RenderObject* renderer) const
{
return !paintingRoot || paintingRoot == renderer;
return !subtreePaintRoot || subtreePaintRoot == renderer;
}
bool forceBlackText() const { return paintBehavior & PaintBehaviorForceBlackText; }
......@@ -112,7 +112,7 @@ struct PaintInfo {
IntRect rect;
PaintPhase phase;
PaintBehavior paintBehavior;
RenderObject* paintingRoot; // used to draw just one element and its visual kids
RenderObject* subtreePaintRoot; // used to draw just one element and its visual children
RenderRegion* renderRegion;
ListHashSet<RenderInline*>* outlineObjects; // used to list outlines that should be painted by a block with inline children
OverlapTestRequestMap* overlapTestRequests;
......
......@@ -3116,7 +3116,7 @@ void RenderBlock::paintContents(PaintInfo& paintInfo, const LayoutPoint& paintOf
// We don't paint our own background, but we do let the kids paint their backgrounds.
PaintInfo paintInfoForChild(paintInfo);
paintInfoForChild.phase = newPhase;
paintInfoForChild.updatePaintingRootForChildren(this);
paintInfoForChild.updateSubtreePaintRootForChildren(this);
// FIXME: Paint-time pagination is obsolete and is now only used by embedded WebViews inside AppKit
// NSViews. Do not add any more code for this.
......
......@@ -1030,7 +1030,7 @@ void RenderBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
LayoutPoint adjustedPaintOffset = paintOffset + location();
// default implementation. Just pass paint through to the children
PaintInfo childInfo(paintInfo);
childInfo.updatePaintingRootForChildren(this);
childInfo.updateSubtreePaintRootForChildren(this);
for (RenderObject* child = firstChild(); child; child = child->nextSibling())
child->paint(childInfo, adjustedPaintOffset);
}
......
......@@ -3471,11 +3471,11 @@ bool RenderLayer::scroll(ScrollDirection direction, ScrollGranularity granularit
return ScrollableArea::scroll(direction, granularity, multiplier);
}
void RenderLayer::paint(GraphicsContext* context, const LayoutRect& damageRect, PaintBehavior paintBehavior, RenderObject* paintingRoot, RenderRegion* region, PaintLayerFlags paintFlags)
void RenderLayer::paint(GraphicsContext* context, const LayoutRect& damageRect, PaintBehavior paintBehavior, RenderObject* subtreePaintRoot, RenderRegion* region, PaintLayerFlags paintFlags)
{
OverlapTestRequestMap overlapTestRequests;
LayerPaintingInfo paintingInfo(this, enclosingIntRect(damageRect), paintBehavior, LayoutSize(), paintingRoot, region, &overlapTestRequests);
LayerPaintingInfo paintingInfo(this, enclosingIntRect(damageRect), paintBehavior, LayoutSize(), subtreePaintRoot, region, &overlapTestRequests);
paintLayer(context, paintingInfo, paintFlags);
OverlapTestRequestMap::iterator end = overlapTestRequests.end();
......@@ -3483,12 +3483,12 @@ void RenderLayer::paint(GraphicsContext* context, const LayoutRect& damageRect,
it->key->setOverlapTestResult(false);
}
void RenderLayer::paintOverlayScrollbars(GraphicsContext* context, const LayoutRect& damageRect, PaintBehavior paintBehavior, RenderObject* paintingRoot)
void RenderLayer::paintOverlayScrollbars(GraphicsContext* context, const LayoutRect& damageRect, PaintBehavior paintBehavior, RenderObject* subtreePaintRoot)
{
if (!m_containsDirtyOverlayScrollbars)
return;
LayerPaintingInfo paintingInfo(this, enclosingIntRect(damageRect), paintBehavior, LayoutSize(), paintingRoot);
LayerPaintingInfo paintingInfo(this, enclosingIntRect(damageRect), paintBehavior, LayoutSize(), subtreePaintRoot);
paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars);
m_containsDirtyOverlayScrollbars = false;
......@@ -3871,13 +3871,13 @@ void RenderLayer::paintLayerContents(GraphicsContext* context, const LayerPainti
}
#endif
// If this layer's renderer is a child of the paintingRoot, we render unconditionally, which
// is done by passing a nil paintingRoot down to our renderer (as if no paintingRoot was ever set).
// Else, our renderer tree may or may not contain the painting root, so we pass that root along
// If this layer's renderer is a child of the subtreePaintRoot, we render unconditionally, which
// is done by passing a nil subtreePaintRoot down to our renderer (as if no subtreePaintRoot was ever set).
// Otherwise, our renderer tree may or may not contain the subtreePaintRoot root, so we pass that root along
// so it will be tested against as we descend through the renderers.
RenderObject* paintingRootForRenderer = 0;
if (localPaintingInfo.paintingRoot && !renderer()->isDescendantOf(localPaintingInfo.paintingRoot))
paintingRootForRenderer = localPaintingInfo.paintingRoot;
RenderObject* subtreePaintRootForRenderer = 0;
if (localPaintingInfo.subtreePaintRoot && !renderer()->isDescendantOf(localPaintingInfo.subtreePaintRoot))
subtreePaintRootForRenderer = localPaintingInfo.subtreePaintRoot;
if (localPaintingInfo.overlapTestRequests && isSelfPaintingLayer)
performOverlapTests(*localPaintingInfo.overlapTestRequests, localPaintingInfo.rootLayer, this);
......@@ -3905,7 +3905,7 @@ void RenderLayer::paintLayerContents(GraphicsContext* context, const LayerPainti
// Paint only the backgrounds for all of the fragments of the layer.
if (shouldPaintContent && !selectionOnly)
paintBackgroundForFragments(layerFragments, context, transparencyLayerContext, paintingInfo.paintDirtyRect, haveTransparency,
localPaintingInfo, paintBehavior, paintingRootForRenderer);
localPaintingInfo, paintBehavior, subtreePaintRootForRenderer);
}
// Now walk the sorted list of children with negative z-indices.
......@@ -3915,11 +3915,11 @@ void RenderLayer::paintLayerContents(GraphicsContext* context, const LayerPainti
if (isPaintingCompositedForeground) {
if (shouldPaintContent)
paintForegroundForFragments(layerFragments, context, transparencyLayerContext, paintingInfo.paintDirtyRect, haveTransparency,
localPaintingInfo, paintBehavior, paintingRootForRenderer, selectionOnly, forceBlackText);
localPaintingInfo, paintBehavior, subtreePaintRootForRenderer, selectionOnly, forceBlackText);
}
if (shouldPaintOutline)
paintOutlineForFragments(layerFragments, context, localPaintingInfo, paintBehavior, paintingRootForRenderer);
paintOutlineForFragments(layerFragments, context, localPaintingInfo, paintBehavior, subtreePaintRootForRenderer);
if (isPaintingCompositedForeground) {
// Paint any child layers that have overflow.
......@@ -3944,7 +3944,7 @@ void RenderLayer::paintLayerContents(GraphicsContext* context, const LayerPainti
if ((localPaintFlags & PaintLayerPaintingCompositingMaskPhase) && shouldPaintContent && renderer()->hasMask() && !selectionOnly) {
// Paint the mask for the fragments.
paintMaskForFragments(layerFragments, context, localPaintingInfo, paintingRootForRenderer);
paintMaskForFragments(layerFragments, context, localPaintingInfo, subtreePaintRootForRenderer);
}
// End our transparency layer
......@@ -3980,7 +3980,7 @@ void RenderLayer::paintLayerByApplyingTransform(GraphicsContext* context, const
// Now do a paint with the root layer shifted to be us.
LayerPaintingInfo transformedPaintingInfo(this, enclosingIntRect(transform.inverse().mapRect(paintingInfo.paintDirtyRect)), paintingInfo.paintBehavior,
adjustedSubPixelAccumulation, paintingInfo.paintingRoot, paintingInfo.region, paintingInfo.overlapTestRequests);
adjustedSubPixelAccumulation, paintingInfo.subtreePaintRoot, paintingInfo.region, paintingInfo.overlapTestRequests);
paintLayerContentsAndReflection(context, transformedPaintingInfo, paintFlags);
}
......@@ -4126,7 +4126,7 @@ void RenderLayer::paintTransformedLayerIntoFragments(GraphicsContext* context, c
void RenderLayer::paintBackgroundForFragments(const LayerFragments& layerFragments, GraphicsContext* context, GraphicsContext* transparencyLayerContext,
const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, const LayerPaintingInfo& localPaintingInfo, PaintBehavior paintBehavior,
RenderObject* paintingRootForRenderer)
RenderObject* subtreePaintRootForRenderer)
{
for (size_t i = 0; i < layerFragments.size(); ++i) {
const LayerFragment& fragment = layerFragments.at(i);
......@@ -4145,7 +4145,7 @@ void RenderLayer::paintBackgroundForFragments(const LayerFragments& layerFragmen
// Paint the background.
// FIXME: Eventually we will collect the region from the fragment itself instead of just from the paint info.
PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.backgroundRect.rect()), PaintPhaseBlockBackground, paintBehavior, paintingRootForRenderer, localPaintingInfo.region, 0, 0, localPaintingInfo.rootLayer->renderer());
PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.backgroundRect.rect()), PaintPhaseBlockBackground, paintBehavior, subtreePaintRootForRenderer, localPaintingInfo.region, 0, 0, localPaintingInfo.rootLayer->renderer());
renderer()->paint(paintInfo, toPoint(fragment.layerBounds.location() - renderBoxLocation() + localPaintingInfo.subPixelAccumulation));
if (localPaintingInfo.clipToDirtyRect)
......@@ -4155,7 +4155,7 @@ void RenderLayer::paintBackgroundForFragments(const LayerFragments& layerFragmen
void RenderLayer::paintForegroundForFragments(const LayerFragments& layerFragments, GraphicsContext* context, GraphicsContext* transparencyLayerContext,
const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, const LayerPaintingInfo& localPaintingInfo, PaintBehavior paintBehavior,
RenderObject* paintingRootForRenderer, bool selectionOnly, bool forceBlackText)
RenderObject* subtreePaintRootForRenderer, bool selectionOnly, bool forceBlackText)
{
// Begin transparency if we have something to paint.
if (haveTransparency) {
......@@ -4178,12 +4178,12 @@ void RenderLayer::paintForegroundForFragments(const LayerFragments& layerFragmen
// We have to loop through every fragment multiple times, since we have to repaint in each specific phase in order for
// interleaving of the fragments to work properly.
paintForegroundForFragmentsWithPhase(selectionOnly ? PaintPhaseSelection : PaintPhaseChildBlockBackgrounds, layerFragments,
context, localPaintingInfo, localPaintBehavior, paintingRootForRenderer);
context, localPaintingInfo, localPaintBehavior, subtreePaintRootForRenderer);
if (!selectionOnly) {
paintForegroundForFragmentsWithPhase(PaintPhaseFloat, layerFragments, context, localPaintingInfo, localPaintBehavior, paintingRootForRenderer);
paintForegroundForFragmentsWithPhase(PaintPhaseForeground, layerFragments, context, localPaintingInfo, localPaintBehavior, paintingRootForRenderer);
paintForegroundForFragmentsWithPhase(PaintPhaseChildOutlines, layerFragments, context, localPaintingInfo, localPaintBehavior, paintingRootForRenderer);
paintForegroundForFragmentsWithPhase(PaintPhaseFloat, layerFragments, context, localPaintingInfo, localPaintBehavior, subtreePaintRootForRenderer);
paintForegroundForFragmentsWithPhase(PaintPhaseForeground, layerFragments, context, localPaintingInfo, localPaintBehavior, subtreePaintRootForRenderer);
paintForegroundForFragmentsWithPhase(PaintPhaseChildOutlines, layerFragments, context, localPaintingInfo, localPaintBehavior, subtreePaintRootForRenderer);
}
if (shouldClip)
......@@ -4191,7 +4191,7 @@ void RenderLayer::paintForegroundForFragments(const LayerFragments& layerFragmen
}
void RenderLayer::paintForegroundForFragmentsWithPhase(PaintPhase phase, const LayerFragments& layerFragments, GraphicsContext* context,
const LayerPaintingInfo& localPaintingInfo, PaintBehavior paintBehavior, RenderObject* paintingRootForRenderer)
const LayerPaintingInfo& localPaintingInfo, PaintBehavior paintBehavior, RenderObject* subtreePaintRootForRenderer)
{
bool shouldClip = localPaintingInfo.clipToDirtyRect && layerFragments.size() > 1;
......@@ -4203,7 +4203,7 @@ void RenderLayer::paintForegroundForFragmentsWithPhase(PaintPhase phase, const L
if (shouldClip)
clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.paintDirtyRect, fragment.foregroundRect);
PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.foregroundRect.rect()), phase, paintBehavior, paintingRootForRenderer, localPaintingInfo.region, 0, 0, localPaintingInfo.rootLayer->renderer());
PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.foregroundRect.rect()), phase, paintBehavior, subtreePaintRootForRenderer, localPaintingInfo.region, 0, 0, localPaintingInfo.rootLayer->renderer());
if (phase == PaintPhaseForeground)
paintInfo.overlapTestRequests = localPaintingInfo.overlapTestRequests;
renderer()->paint(paintInfo, toPoint(fragment.layerBounds.location() - renderBoxLocation() + localPaintingInfo.subPixelAccumulation));
......@@ -4214,7 +4214,7 @@ void RenderLayer::paintForegroundForFragmentsWithPhase(PaintPhase phase, const L
}
void RenderLayer::paintOutlineForFragments(const LayerFragments& layerFragments, GraphicsContext* context, const LayerPaintingInfo& localPaintingInfo,
PaintBehavior paintBehavior, RenderObject* paintingRootForRenderer)
PaintBehavior paintBehavior, RenderObject* subtreePaintRootForRenderer)
{
for (size_t i = 0; i < layerFragments.size(); ++i) {
const LayerFragment& fragment = layerFragments.at(i);
......@@ -4222,7 +4222,7 @@ void RenderLayer::paintOutlineForFragments(const LayerFragments& layerFragments,
continue;
// Paint our own outline
PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.outlineRect.rect()), PaintPhaseSelfOutline, paintBehavior, paintingRootForRenderer, localPaintingInfo.region, 0, 0, localPaintingInfo.rootLayer->renderer());
PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.outlineRect.rect()), PaintPhaseSelfOutline, paintBehavior, subtreePaintRootForRenderer, localPaintingInfo.region, 0, 0, localPaintingInfo.rootLayer->renderer());
clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.paintDirtyRect, fragment.outlineRect, DoNotIncludeSelfForBorderRadius);
renderer()->paint(paintInfo, toPoint(fragment.layerBounds.location() - renderBoxLocation() + localPaintingInfo.subPixelAccumulation));
restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.outlineRect);
......@@ -4230,7 +4230,7 @@ void RenderLayer::paintOutlineForFragments(const LayerFragments& layerFragments,
}
void RenderLayer::paintMaskForFragments(const LayerFragments& layerFragments, GraphicsContext* context, const LayerPaintingInfo& localPaintingInfo,
RenderObject* paintingRootForRenderer)
RenderObject* subtreePaintRootForRenderer)
{
for (size_t i = 0; i < layerFragments.size(); ++i) {
const LayerFragment& fragment = layerFragments.at(i);
......@@ -4242,7 +4242,7 @@ void RenderLayer::paintMaskForFragments(const LayerFragments& layerFragments, Gr
// Paint the mask.
// FIXME: Eventually we will collect the region from the fragment itself instead of just from the paint info.
PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.backgroundRect.rect()), PaintPhaseMask, PaintBehaviorNormal, paintingRootForRenderer, localPaintingInfo.region, 0, 0, localPaintingInfo.rootLayer->renderer());
PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.backgroundRect.rect()), PaintPhaseMask, PaintBehaviorNormal, subtreePaintRootForRenderer, localPaintingInfo.region, 0, 0, localPaintingInfo.rootLayer->renderer());
renderer()->paint(paintInfo, toPoint(fragment.layerBounds.location() - renderBoxLocation() + localPaintingInfo.subPixelAccumulation));
if (localPaintingInfo.clipToDirtyRect)
......
......@@ -624,11 +624,11 @@ public:
// paints the layers that intersect the damage rect from back to
// front. The hitTest method looks for mouse events by walking
// layers that intersect the point from front to back.
void paint(GraphicsContext*, const LayoutRect& damageRect, PaintBehavior = PaintBehaviorNormal, RenderObject* paintingRoot = 0,
void paint(GraphicsContext*, const LayoutRect& damageRect, PaintBehavior = PaintBehaviorNormal, RenderObject* subtreePaintRoot = 0,
RenderRegion* = 0, PaintLayerFlags = 0);
bool hitTest(const HitTestRequest&, HitTestResult&);
bool hitTest(const HitTestRequest&, const HitTestLocation&, HitTestResult&);
void paintOverlayScrollbars(GraphicsContext*, const LayoutRect& damageRect, PaintBehavior, RenderObject* paintingRoot = 0);
void paintOverlayScrollbars(GraphicsContext*, const LayoutRect& damageRect, PaintBehavior, RenderObject* subtreePaintRoot = 0);
struct ClipRectsContext {
ClipRectsContext(const RenderLayer* inRootLayer, RenderRegion* inRegion, ClipRectsType inClipRectsType, OverlayScrollbarSizeRelevancy inOverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize, ShouldRespectOverflowClip inRespectOverflowClip = RespectOverflowClip)
......@@ -916,9 +916,9 @@ private:
void updateCompositingAndLayerListsIfNeeded();
struct LayerPaintingInfo {
LayerPaintingInfo(RenderLayer* inRootLayer, const LayoutRect& inDirtyRect, PaintBehavior inPaintBehavior, const LayoutSize& inSubPixelAccumulation, RenderObject* inPaintingRoot = 0, RenderRegion*inRegion = 0, OverlapTestRequestMap* inOverlapTestRequests = 0)
LayerPaintingInfo(RenderLayer* inRootLayer, const LayoutRect& inDirtyRect, PaintBehavior inPaintBehavior, const LayoutSize& inSubPixelAccumulation, RenderObject* inSubtreePaintRoot = 0, RenderRegion*inRegion = 0, OverlapTestRequestMap* inOverlapTestRequests = 0)
: rootLayer(inRootLayer)
, paintingRoot(inPaintingRoot)
, subtreePaintRoot(inSubtreePaintRoot)
, paintDirtyRect(inDirtyRect)
, subPixelAccumulation(inSubPixelAccumulation)
, region(inRegion)
......@@ -927,7 +927,7 @@ private:
, clipToDirtyRect(true)
{ }
RenderLayer* rootLayer;
RenderObject* paintingRoot; // only paint descendants of this object
RenderObject* subtreePaintRoot; // only paint descendants of this object
LayoutRect paintDirtyRect; // relative to rootLayer;
LayoutSize subPixelAccumulation;
RenderRegion* region; // May be null.
......
......@@ -1236,6 +1236,7 @@ void RenderObject::addAbsoluteRectForLayer(LayoutRect& result)
current->addAbsoluteRectForLayer(result);
}
// FIXME: change this to use the subtreePaint terminology
LayoutRect RenderObject::paintingRootRect(LayoutRect& topLevelRect)
{
LayoutRect result = absoluteBoundingBoxRectIgnoringTransforms();
......
......@@ -101,7 +101,7 @@ void RenderSnapshottedPlugIn::paint(PaintInfo& paintInfo, const LayoutPoint& pai
PaintInfo paintInfoForChild(paintInfo);
paintInfoForChild.phase = newPhase;
paintInfoForChild.updatePaintingRootForChildren(this);
paintInfoForChild.updateSubtreePaintRootForChildren(this);
for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
LayoutPoint childPoint = flipForWritingModeForChild(child, paintOffset);
......
......@@ -653,7 +653,7 @@ void RenderTable::paintObject(PaintInfo& paintInfo, const LayoutPoint& paintOffs
PaintInfo info(paintInfo);
info.phase = paintPhase;
info.updatePaintingRootForChildren(this);
info.updateSubtreePaintRootForChildren(this);
for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
if (child->isBox() && !toRenderBox(child)->hasSelfPaintingLayer() && (child->isTableSection() || child->isTableCaption())) {
......
......@@ -138,7 +138,7 @@ void RenderSVGContainer::paint(PaintInfo& paintInfo, const LayoutPoint&)
}
if (continueRendering) {
childPaintInfo.updatePaintingRootForChildren(this);
childPaintInfo.updateSubtreePaintRootForChildren(this);
for (RenderObject* child = firstChild(); child; child = child->nextSibling())
child->paint(childPaintInfo, IntPoint());
}
......
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