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

Side by Side Diff: sky/engine/core/rendering/RenderReplaced.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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2000 Dirk Mueller (mueller@kde.org) 3 * Copyright (C) 2000 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
5 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. 5 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 95
96 if (hasBoxDecorationBackground() && (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection)) 96 if (hasBoxDecorationBackground() && (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection))
97 paintBoxDecorationBackground(paintInfo, adjustedPaintOffset); 97 paintBoxDecorationBackground(paintInfo, adjustedPaintOffset);
98 98
99 if (paintInfo.phase == PaintPhaseMask) { 99 if (paintInfo.phase == PaintPhaseMask) {
100 paintMask(paintInfo, adjustedPaintOffset); 100 paintMask(paintInfo, adjustedPaintOffset);
101 return; 101 return;
102 } 102 }
103 103
104 LayoutRect paintRect = LayoutRect(adjustedPaintOffset, size()); 104 LayoutRect paintRect = LayoutRect(adjustedPaintOffset, size());
105 if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSe lfOutline) && style()->outlineWidth()) 105 if (paintInfo.phase == PaintPhaseForeground && style()->outlineWidth())
106 paintOutline(paintInfo, paintRect); 106 paintOutline(paintInfo, paintRect);
107 107
108 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhase Selection && !canHaveChildren()) 108 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhase Selection && !canHaveChildren())
109 return; 109 return;
110 110
111 if (!paintInfo.shouldPaintWithinRoot(this)) 111 if (!paintInfo.shouldPaintWithinRoot(this))
112 return; 112 return;
113 113
114 bool drawSelectionTint = selectionState() != SelectionNone; 114 bool drawSelectionTint = selectionState() != SelectionNone;
115 if (paintInfo.phase == PaintPhaseSelection) { 115 if (paintInfo.phase == PaintPhaseSelection) {
(...skipping 27 matching lines...) Expand all
143 // surrounding content. 143 // surrounding content.
144 if (drawSelectionTint) { 144 if (drawSelectionTint) {
145 LayoutRect selectionPaintingRect = localSelectionRect(); 145 LayoutRect selectionPaintingRect = localSelectionRect();
146 selectionPaintingRect.moveBy(adjustedPaintOffset); 146 selectionPaintingRect.moveBy(adjustedPaintOffset);
147 paintInfo.context->fillRect(pixelSnappedIntRect(selectionPaintingRect), selectionBackgroundColor()); 147 paintInfo.context->fillRect(pixelSnappedIntRect(selectionPaintingRect), selectionBackgroundColor());
148 } 148 }
149 } 149 }
150 150
151 bool RenderReplaced::shouldPaint(PaintInfo& paintInfo, const LayoutPoint& paintO ffset) 151 bool RenderReplaced::shouldPaint(PaintInfo& paintInfo, const LayoutPoint& paintO ffset)
152 { 152 {
153 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhase Outline && paintInfo.phase != PaintPhaseSelfOutline
ojan 2015/01/27 04:44:40 This was listing every remaining phase except for
154 && paintInfo.phase != PaintPhaseSelection && paintInfo.phase != PaintPha seMask)
155 return false;
156
157 if (!paintInfo.shouldPaintWithinRoot(this)) 153 if (!paintInfo.shouldPaintWithinRoot(this))
158 return false; 154 return false;
159 155
160 LayoutPoint adjustedPaintOffset = paintOffset + location(); 156 LayoutPoint adjustedPaintOffset = paintOffset + location();
161 157
162 // Early exit if the element touches the edges. 158 // Early exit if the element touches the edges.
163 LayoutUnit top = adjustedPaintOffset.y() + visualOverflowRect().y(); 159 LayoutUnit top = adjustedPaintOffset.y() + visualOverflowRect().y();
164 LayoutUnit bottom = adjustedPaintOffset.y() + visualOverflowRect().maxY(); 160 LayoutUnit bottom = adjustedPaintOffset.y() + visualOverflowRect().maxY();
165 if (isSelected() && inlineBoxWrapper()) { 161 if (isSelected() && inlineBoxWrapper()) {
166 LayoutUnit selTop = paintOffset.y() + inlineBoxWrapper()->root().selecti onTop(); 162 LayoutUnit selTop = paintOffset.y() + inlineBoxWrapper()->root().selecti onTop();
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 if (s == SelectionEnd) 476 if (s == SelectionEnd)
481 return selectionEnd == end; 477 return selectionEnd == end;
482 if (s == SelectionBoth) 478 if (s == SelectionBoth)
483 return selectionStart == 0 && selectionEnd == end; 479 return selectionStart == 0 && selectionEnd == end;
484 480
485 ASSERT(0); 481 ASSERT(0);
486 return false; 482 return false;
487 } 483 }
488 484
489 } 485 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698