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

Unified Diff: sky/engine/core/rendering/RenderBlock.cpp

Issue 899753003: Walk render tree instead of render layers for paint. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sky/engine/core/rendering/RenderBlock.cpp
diff --git a/sky/engine/core/rendering/RenderBlock.cpp b/sky/engine/core/rendering/RenderBlock.cpp
index 5f6fd6d48e6eae8efc0d79f7b07e6669e2226fba..f250c2e5d504ee09193e5fe6689651b8bdb18c23 100644
--- a/sky/engine/core/rendering/RenderBlock.cpp
+++ b/sky/engine/core/rendering/RenderBlock.cpp
@@ -446,7 +446,7 @@ void RenderBlock::markPositionedObjectsForLayout()
}
}
-void RenderBlock::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
+void RenderBlock::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, Vector<RenderBox*>& layers)
{
LayoutPoint adjustedPaintOffset = paintOffset + location();
@@ -468,16 +468,18 @@ void RenderBlock::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
contentsClipBehavior = SkipContentsClipIfPossible;
bool pushedClip = pushContentsClip(paintInfo, adjustedPaintOffset, contentsClipBehavior);
- paintObject(paintInfo, adjustedPaintOffset);
+ paintObject(paintInfo, adjustedPaintOffset, layers);
if (pushedClip)
popContentsClip(paintInfo, adjustedPaintOffset);
}
-void RenderBlock::paintChildren(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
+void RenderBlock::paintChildren(PaintInfo& paintInfo, const LayoutPoint& paintOffset, Vector<RenderBox*>& layers)
{
for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
- if (!child->hasSelfPaintingLayer())
- child->paint(paintInfo, paintOffset);
+ if (child->hasSelfPaintingLayer())
+ layers.append(child);
+ else
+ child->paint(paintInfo, paintOffset, layers);
}
}
@@ -510,12 +512,12 @@ void RenderBlock::paintCarets(PaintInfo& paintInfo, const LayoutPoint& paintOffs
}
}
-void RenderBlock::paintObject(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
+void RenderBlock::paintObject(PaintInfo& paintInfo, const LayoutPoint& paintOffset, Vector<RenderBox*>& layers)
{
if (hasBoxDecorationBackground())
paintBoxDecorationBackground(paintInfo, paintOffset);
- paintChildren(paintInfo, paintOffset);
+ paintChildren(paintInfo, paintOffset, layers);
paintSelection(paintInfo, paintOffset); // Fill in gaps in selection on lines and between blocks.
if (style()->hasOutline() && !style()->outlineStyleIsAuto())

Powered by Google App Engine
This is Rietveld 408576698