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

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

Issue 867463005: Merge the background paint phase into the foreground phase. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/core/rendering/PaintPhase.h ('k') | sky/engine/core/rendering/RenderBox.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/rendering/RenderBlock.cpp
diff --git a/sky/engine/core/rendering/RenderBlock.cpp b/sky/engine/core/rendering/RenderBlock.cpp
index e819e5df16d6609aed186fd8561eeab959851936..61a1c722e11a6fc23076ff089cba725f6027fd6a 100644
--- a/sky/engine/core/rendering/RenderBlock.cpp
+++ b/sky/engine/core/rendering/RenderBlock.cpp
@@ -545,14 +545,13 @@ void RenderBlock::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
// Our scrollbar widgets paint exactly when we tell them to, so that they work properly with
// z-index. We paint after we painted the background/border, so that the scrollbars will
// sit above the background/border.
- if (hasOverflowClip() && (phase == PaintPhaseBlockBackground || phase == PaintPhaseChildBlockBackground) && paintInfo.shouldPaintWithinRoot(this))
+ if (hasOverflowClip() && phase == PaintPhaseForeground && paintInfo.shouldPaintWithinRoot(this))
layer()->scrollableArea()->paintOverflowControls(paintInfo.context, roundedIntPoint(adjustedPaintOffset), paintInfo.rect, false /* paintingOverlayControls */);
}
void RenderBlock::paintContents(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
PaintPhase newPhase = (paintInfo.phase == PaintPhaseChildOutlines) ? PaintPhaseOutline : paintInfo.phase;
- newPhase = (newPhase == PaintPhaseChildBlockBackgrounds) ? PaintPhaseChildBlockBackground : newPhase;
// We don't paint our own background, but we do let the kids paint their backgrounds.
PaintInfo paintInfoForChild(paintInfo);
@@ -588,13 +587,11 @@ void RenderBlock::paintAsInlineBlock(RenderObject* renderer, PaintInfo& paintInf
// stacking context. (See Appendix E.2, section 7.2.1.4 on
// inline block/table/replaced elements in the CSS2.1 specification.)
// This is also used by other elements (e.g. flex items).
- bool preservePhase = paintInfo.phase == PaintPhaseSelection;
PaintInfo info(paintInfo);
- info.phase = preservePhase ? paintInfo.phase : PaintPhaseBlockBackground;
- renderer->paint(info, childPoint);
- if (!preservePhase) {
- info.phase = PaintPhaseChildBlockBackgrounds;
+
+ if (paintInfo.phase == PaintPhaseSelection) {
renderer->paint(info, childPoint);
+ } else {
info.phase = PaintPhaseForeground;
renderer->paint(info, childPoint);
info.phase = PaintPhaseOutline;
@@ -639,7 +636,7 @@ void RenderBlock::paintObject(PaintInfo& paintInfo, const LayoutPoint& paintOffs
if (hasOverflowClip())
scrolledOffset.move(-scrolledContentOffset());
- if (paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChildBlockBackground) {
+ if (paintPhase == PaintPhaseForeground) {
if (hasBoxDecorationBackground())
paintBoxDecorationBackground(paintInfo, paintOffset);
}
@@ -649,10 +646,6 @@ void RenderBlock::paintObject(PaintInfo& paintInfo, const LayoutPoint& paintOffs
return;
}
- // We're done. We don't bother painting any children.
- if (paintPhase == PaintPhaseBlockBackground)
- return;
-
if (paintPhase != PaintPhaseSelfOutline)
paintContents(paintInfo, scrolledOffset);
« no previous file with comments | « sky/engine/core/rendering/PaintPhase.h ('k') | sky/engine/core/rendering/RenderBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698