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

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

Issue 878023002: Merge outline paint phases 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
Index: sky/engine/core/rendering/RenderBlock.cpp
diff --git a/sky/engine/core/rendering/RenderBlock.cpp b/sky/engine/core/rendering/RenderBlock.cpp
index 2314f3b0b79704f69283e4e2d508f3816d9b436c..686107f406f4e918da8ec89292f73c53e5b4e221 100644
--- a/sky/engine/core/rendering/RenderBlock.cpp
+++ b/sky/engine/core/rendering/RenderBlock.cpp
@@ -551,11 +551,8 @@ void RenderBlock::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
void RenderBlock::paintContents(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
- PaintPhase newPhase = (paintInfo.phase == PaintPhaseChildOutlines) ? PaintPhaseOutline : paintInfo.phase;
-
// 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);
paintChildren(paintInfoForChild, paintOffset);
}
@@ -594,8 +591,6 @@ void RenderBlock::paintAsInlineBlock(RenderObject* renderer, PaintInfo& paintInf
} else {
info.phase = PaintPhaseForeground;
renderer->paint(info, childPoint);
- info.phase = PaintPhaseOutline;
- renderer->paint(info, childPoint);
}
}
@@ -646,20 +641,17 @@ void RenderBlock::paintObject(PaintInfo& paintInfo, const LayoutPoint& paintOffs
return;
}
- if (paintPhase != PaintPhaseSelfOutline)
- paintContents(paintInfo, scrolledOffset);
-
+ paintContents(paintInfo, scrolledOffset);
paintSelection(paintInfo, scrolledOffset); // Fill in gaps in selection on lines and between blocks.
- if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseSelfOutline)
- && style()->hasOutline() && !style()->outlineStyleIsAuto()) {
- paintOutline(paintInfo, LayoutRect(paintOffset, size()));
- }
+ if (paintPhase == PaintPhaseForeground) {
+ if (style()->hasOutline() && !style()->outlineStyleIsAuto())
+ paintOutline(paintInfo, LayoutRect(paintOffset, size()));
- // If the caret's node's render object's containing block is this block, and the paint action is PaintPhaseForeground,
- // then paint the caret.
- if (paintPhase == PaintPhaseForeground)
+ // If the caret's node's render object's containing block is this block, and the paint action is PaintPhaseForeground,
+ // then paint the caret.
paintCarets(paintInfo, paintOffset);
+ }
}
bool RenderBlock::shouldPaintSelectionGaps() const

Powered by Google App Engine
This is Rietveld 408576698