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

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

Issue 891573002: Removed a bunch of unneeded paint phase checks. (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 0fd4879e467386989d8e12bd418a828658569149..34711bfafc54420699a8d8ff79e9c5089977858b 100644
--- a/sky/engine/core/rendering/RenderBlock.cpp
+++ b/sky/engine/core/rendering/RenderBlock.cpp
@@ -470,9 +470,7 @@ void RenderBlock::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
contentsClipBehavior = SkipContentsClipIfPossible;
bool pushedClip = pushContentsClip(paintInfo, adjustedPaintOffset, contentsClipBehavior);
- {
- paintObject(paintInfo, adjustedPaintOffset);
- }
+ paintObject(paintInfo, adjustedPaintOffset);
if (pushedClip)
popContentsClip(paintInfo, phase, adjustedPaintOffset);
}
@@ -540,29 +538,21 @@ void RenderBlock::paintCarets(PaintInfo& paintInfo, const LayoutPoint& paintOffs
void RenderBlock::paintObject(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
- PaintPhase paintPhase = paintInfo.phase;
-
- if (paintPhase == PaintPhaseForeground) {
- if (hasBoxDecorationBackground())
- paintBoxDecorationBackground(paintInfo, paintOffset);
- }
-
- if (paintPhase == PaintPhaseMask) {
+ if (paintInfo.phase == PaintPhaseMask) {
paintMask(paintInfo, paintOffset);
return;
}
+ if (hasBoxDecorationBackground())
+ paintBoxDecorationBackground(paintInfo, paintOffset);
+
paintContents(paintInfo, paintOffset);
paintSelection(paintInfo, paintOffset); // Fill in gaps in selection on lines and between blocks.
- if (paintPhase == PaintPhaseForeground) {
- if (style()->hasOutline() && !style()->outlineStyleIsAuto())
- paintOutline(paintInfo, LayoutRect(paintOffset, size()));
+ 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.
- paintCarets(paintInfo, paintOffset);
- }
+ paintCarets(paintInfo, paintOffset);
}
bool RenderBlock::shouldPaintSelectionGaps() const
@@ -592,7 +582,7 @@ bool RenderBlock::isSelectionRoot() const
void RenderBlock::paintSelection(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
- if (shouldPaintSelectionGaps() && paintInfo.phase == PaintPhaseForeground) {
+ if (shouldPaintSelectionGaps()) {
ojan 2015/01/30 01:25:59 The caller already does this check.
LayoutUnit lastTop = 0;
LayoutUnit lastLeft = logicalLeftSelectionOffset(this, lastTop);
LayoutUnit lastRight = logicalRightSelectionOffset(this, lastTop);

Powered by Google App Engine
This is Rietveld 408576698