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

Side by Side Diff: third_party/WebKit/Source/core/paint/BlockPainter.cpp

Issue 2181953004: Changed ComputedStyle's EVisibility to be an enum class and fixed naming (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_move_computedstyle_around
Patch Set: Rebase Created 4 years, 4 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/BlockPainter.h" 5 #include "core/paint/BlockPainter.h"
6 6
7 #include "core/editing/DragCaretController.h" 7 #include "core/editing/DragCaretController.h"
8 #include "core/editing/FrameSelection.h" 8 #include "core/editing/FrameSelection.h"
9 #include "core/layout/LayoutFlexibleBox.h" 9 #include "core/layout/LayoutFlexibleBox.h"
10 #include "core/layout/LayoutInline.h" 10 #include "core/layout/LayoutInline.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 // Our scrollbar widgets paint exactly when we tell them to, so that they wo rk properly with 63 // Our scrollbar widgets paint exactly when we tell them to, so that they wo rk properly with
64 // z-index. We paint after we painted the background/border, so that the scr ollbars will 64 // z-index. We paint after we painted the background/border, so that the scr ollbars will
65 // sit above the background/border. 65 // sit above the background/border.
66 localPaintInfo.phase = originalPhase; 66 localPaintInfo.phase = originalPhase;
67 paintOverflowControlsIfNeeded(localPaintInfo, adjustedPaintOffset); 67 paintOverflowControlsIfNeeded(localPaintInfo, adjustedPaintOffset);
68 } 68 }
69 69
70 void BlockPainter::paintOverflowControlsIfNeeded(const PaintInfo& paintInfo, con st LayoutPoint& paintOffset) 70 void BlockPainter::paintOverflowControlsIfNeeded(const PaintInfo& paintInfo, con st LayoutPoint& paintOffset)
71 { 71 {
72 if (m_layoutBlock.hasOverflowClip() 72 if (m_layoutBlock.hasOverflowClip()
73 && m_layoutBlock.style()->visibility() == VISIBLE 73 && m_layoutBlock.style()->visibility() == EVisibility::Visible
74 && shouldPaintSelfBlockBackground(paintInfo.phase) 74 && shouldPaintSelfBlockBackground(paintInfo.phase)
75 && !paintInfo.paintRootBackgroundOnly()) { 75 && !paintInfo.paintRootBackgroundOnly()) {
76 Optional<ClipRecorder> clipRecorder; 76 Optional<ClipRecorder> clipRecorder;
77 if (!m_layoutBlock.layer()->isSelfPaintingLayer()) { 77 if (!m_layoutBlock.layer()->isSelfPaintingLayer()) {
78 LayoutRect clipRect = m_layoutBlock.borderBoxRect(); 78 LayoutRect clipRect = m_layoutBlock.borderBoxRect();
79 clipRect.moveBy(paintOffset); 79 clipRect.moveBy(paintOffset);
80 clipRecorder.emplace(paintInfo.context, m_layoutBlock, DisplayItem:: ClipScrollbarsToBoxBounds, pixelSnappedIntRect(clipRect)); 80 clipRecorder.emplace(paintInfo.context, m_layoutBlock, DisplayItem:: ClipScrollbarsToBoxBounds, pixelSnappedIntRect(clipRect));
81 } 81 }
82 ScrollableAreaPainter(*m_layoutBlock.layer()->getScrollableArea()).paint OverflowControls(paintInfo.context, roundedIntPoint(paintOffset), paintInfo.cull Rect(), false /* paintingOverlayControls */); 82 ScrollableAreaPainter(*m_layoutBlock.layer()->getScrollableArea()).paint OverflowControls(paintInfo.context, roundedIntPoint(paintOffset), paintInfo.cull Rect(), false /* paintingOverlayControls */);
83 } 83 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 childPoint = LineLayoutAPIShim::layoutObjectFrom(inlineBox.getLineLayout Item())->containingBlock()->flipForWritingModeForChild(toLayoutBox(LineLayoutAPI Shim::layoutObjectFrom(inlineBox.getLineLayoutItem())), childPoint); 122 childPoint = LineLayoutAPIShim::layoutObjectFrom(inlineBox.getLineLayout Item())->containingBlock()->flipForWritingModeForChild(toLayoutBox(LineLayoutAPI Shim::layoutObjectFrom(inlineBox.getLineLayoutItem())), childPoint);
123 123
124 ObjectPainter(*LineLayoutAPIShim::constLayoutObjectFrom(inlineBox.getLineLay outItem())).paintAllPhasesAtomically(paintInfo, childPoint); 124 ObjectPainter(*LineLayoutAPIShim::constLayoutObjectFrom(inlineBox.getLineLay outItem())).paintAllPhasesAtomically(paintInfo, childPoint);
125 } 125 }
126 126
127 void BlockPainter::paintObject(const PaintInfo& paintInfo, const LayoutPoint& pa intOffset) 127 void BlockPainter::paintObject(const PaintInfo& paintInfo, const LayoutPoint& pa intOffset)
128 { 128 {
129 const PaintPhase paintPhase = paintInfo.phase; 129 const PaintPhase paintPhase = paintInfo.phase;
130 130
131 if (shouldPaintSelfBlockBackground(paintPhase)) { 131 if (shouldPaintSelfBlockBackground(paintPhase)) {
132 if (m_layoutBlock.style()->visibility() == VISIBLE && m_layoutBlock.hasB oxDecorationBackground()) 132 if (m_layoutBlock.style()->visibility() == EVisibility::Visible && m_lay outBlock.hasBoxDecorationBackground())
133 m_layoutBlock.paintBoxDecorationBackground(paintInfo, paintOffset); 133 m_layoutBlock.paintBoxDecorationBackground(paintInfo, paintOffset);
134 // We're done. We don't bother painting any children. 134 // We're done. We don't bother painting any children.
135 if (paintPhase == PaintPhaseSelfBlockBackgroundOnly) 135 if (paintPhase == PaintPhaseSelfBlockBackgroundOnly)
136 return; 136 return;
137 } 137 }
138 138
139 if (paintInfo.paintRootBackgroundOnly()) 139 if (paintInfo.paintRootBackgroundOnly())
140 return; 140 return;
141 141
142 if (paintPhase == PaintPhaseMask && m_layoutBlock.style()->visibility() == V ISIBLE) { 142 if (paintPhase == PaintPhaseMask && m_layoutBlock.style()->visibility() == E Visibility::Visible) {
143 m_layoutBlock.paintMask(paintInfo, paintOffset); 143 m_layoutBlock.paintMask(paintInfo, paintOffset);
144 return; 144 return;
145 } 145 }
146 146
147 if (paintPhase == PaintPhaseClippingMask && m_layoutBlock.style()->visibilit y() == VISIBLE) { 147 if (paintPhase == PaintPhaseClippingMask && m_layoutBlock.style()->visibilit y() == EVisibility::Visible) {
148 BoxPainter(m_layoutBlock).paintClippingMask(paintInfo, paintOffset); 148 BoxPainter(m_layoutBlock).paintClippingMask(paintInfo, paintOffset);
149 return; 149 return;
150 } 150 }
151 151
152 if (paintPhase == PaintPhaseForeground && paintInfo.isPrinting()) 152 if (paintPhase == PaintPhaseForeground && paintInfo.isPrinting())
153 ObjectPainter(m_layoutBlock).addPDFURLRectIfNeeded(paintInfo, paintOffse t); 153 ObjectPainter(m_layoutBlock).addPDFURLRectIfNeeded(paintInfo, paintOffse t);
154 154
155 if (paintPhase != PaintPhaseSelfOutlineOnly) { 155 if (paintPhase != PaintPhaseSelfOutlineOnly) {
156 Optional<ScopedPaintChunkProperties> m_scopedScrollProperty; 156 Optional<ScopedPaintChunkProperties> m_scopedScrollProperty;
157 Optional<ScrollRecorder> scrollRecorder; 157 Optional<ScrollRecorder> scrollRecorder;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 } 244 }
245 245
246 void BlockPainter::paintContents(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) 246 void BlockPainter::paintContents(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
247 { 247 {
248 DCHECK(!m_layoutBlock.childrenInline()); 248 DCHECK(!m_layoutBlock.childrenInline());
249 PaintInfo paintInfoForDescendants = paintInfo.forDescendants(); 249 PaintInfo paintInfoForDescendants = paintInfo.forDescendants();
250 m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset); 250 m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset);
251 } 251 }
252 252
253 } // namespace blink 253 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698