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

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

Issue 2422973002: Revert of Convert a few more CFI blacklist entries into DISABLE_CFI_PERF attributes. (Closed)
Patch Set: Created 4 years, 2 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"
11 #include "core/layout/api/LineLayoutAPIShim.h" 11 #include "core/layout/api/LineLayoutAPIShim.h"
12 #include "core/layout/api/LineLayoutBox.h" 12 #include "core/layout/api/LineLayoutBox.h"
13 #include "core/page/Page.h" 13 #include "core/page/Page.h"
14 #include "core/paint/BlockFlowPainter.h" 14 #include "core/paint/BlockFlowPainter.h"
15 #include "core/paint/BoxClipper.h" 15 #include "core/paint/BoxClipper.h"
16 #include "core/paint/BoxPainter.h" 16 #include "core/paint/BoxPainter.h"
17 #include "core/paint/LayoutObjectDrawingRecorder.h" 17 #include "core/paint/LayoutObjectDrawingRecorder.h"
18 #include "core/paint/ObjectPaintProperties.h" 18 #include "core/paint/ObjectPaintProperties.h"
19 #include "core/paint/ObjectPainter.h" 19 #include "core/paint/ObjectPainter.h"
20 #include "core/paint/PaintInfo.h" 20 #include "core/paint/PaintInfo.h"
21 #include "core/paint/PaintLayer.h" 21 #include "core/paint/PaintLayer.h"
22 #include "core/paint/ScrollRecorder.h" 22 #include "core/paint/ScrollRecorder.h"
23 #include "core/paint/ScrollableAreaPainter.h" 23 #include "core/paint/ScrollableAreaPainter.h"
24 #include "platform/graphics/GraphicsLayer.h" 24 #include "platform/graphics/GraphicsLayer.h"
25 #include "platform/graphics/paint/ClipRecorder.h" 25 #include "platform/graphics/paint/ClipRecorder.h"
26 #include "wtf/Optional.h" 26 #include "wtf/Optional.h"
27 27
28 namespace blink { 28 namespace blink {
29 29
30 DISABLE_CFI_PERF
31 void BlockPainter::paint(const PaintInfo& paintInfo, 30 void BlockPainter::paint(const PaintInfo& paintInfo,
32 const LayoutPoint& paintOffset) { 31 const LayoutPoint& paintOffset) {
33 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutBlock.location(); 32 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutBlock.location();
34 if (!intersectsPaintRect(paintInfo, adjustedPaintOffset)) 33 if (!intersectsPaintRect(paintInfo, adjustedPaintOffset))
35 return; 34 return;
36 35
37 PaintInfo localPaintInfo(paintInfo); 36 PaintInfo localPaintInfo(paintInfo);
38 PaintPhase originalPhase = localPaintInfo.phase; 37 PaintPhase originalPhase = localPaintInfo.phase;
39 38
40 // There are some cases where not all clipped visual overflow is accounted 39 // There are some cases where not all clipped visual overflow is accounted
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 toLayoutBox(LineLayoutAPIShim::layoutObjectFrom( 155 toLayoutBox(LineLayoutAPIShim::layoutObjectFrom(
157 inlineBox.getLineLayoutItem())), 156 inlineBox.getLineLayoutItem())),
158 childPoint); 157 childPoint);
159 } 158 }
160 159
161 ObjectPainter( 160 ObjectPainter(
162 *LineLayoutAPIShim::constLayoutObjectFrom(inlineBox.getLineLayoutItem())) 161 *LineLayoutAPIShim::constLayoutObjectFrom(inlineBox.getLineLayoutItem()))
163 .paintAllPhasesAtomically(paintInfo, childPoint); 162 .paintAllPhasesAtomically(paintInfo, childPoint);
164 } 163 }
165 164
166 DISABLE_CFI_PERF
167 void BlockPainter::paintObject(const PaintInfo& paintInfo, 165 void BlockPainter::paintObject(const PaintInfo& paintInfo,
168 const LayoutPoint& paintOffset) { 166 const LayoutPoint& paintOffset) {
169 const PaintPhase paintPhase = paintInfo.phase; 167 const PaintPhase paintPhase = paintInfo.phase;
170 168
171 if (shouldPaintSelfBlockBackground(paintPhase)) { 169 if (shouldPaintSelfBlockBackground(paintPhase)) {
172 if (m_layoutBlock.style()->visibility() == EVisibility::Visible && 170 if (m_layoutBlock.style()->visibility() == EVisibility::Visible &&
173 m_layoutBlock.hasBoxDecorationBackground()) 171 m_layoutBlock.hasBoxDecorationBackground())
174 m_layoutBlock.paintBoxDecorationBackground(paintInfo, paintOffset); 172 m_layoutBlock.paintBoxDecorationBackground(paintInfo, paintOffset);
175 // We're done. We don't bother painting any children. 173 // We're done. We don't bother painting any children.
176 if (paintPhase == PaintPhaseSelfBlockBackgroundOnly) 174 if (paintPhase == PaintPhaseSelfBlockBackgroundOnly)
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 LocalFrame* frame = m_layoutBlock.frame(); 254 LocalFrame* frame = m_layoutBlock.frame();
257 255
258 if (m_layoutBlock.hasCursorCaret()) 256 if (m_layoutBlock.hasCursorCaret())
259 frame->selection().paintCaret(paintInfo.context, paintOffset); 257 frame->selection().paintCaret(paintInfo.context, paintOffset);
260 258
261 if (m_layoutBlock.hasDragCaret()) 259 if (m_layoutBlock.hasDragCaret())
262 frame->page()->dragCaretController().paintDragCaret( 260 frame->page()->dragCaretController().paintDragCaret(
263 frame, paintInfo.context, paintOffset); 261 frame, paintInfo.context, paintOffset);
264 } 262 }
265 263
266 DISABLE_CFI_PERF
267 bool BlockPainter::intersectsPaintRect( 264 bool BlockPainter::intersectsPaintRect(
268 const PaintInfo& paintInfo, 265 const PaintInfo& paintInfo,
269 const LayoutPoint& adjustedPaintOffset) const { 266 const LayoutPoint& adjustedPaintOffset) const {
270 LayoutRect overflowRect; 267 LayoutRect overflowRect;
271 if (paintInfo.isPrinting() && m_layoutBlock.isAnonymousBlock() && 268 if (paintInfo.isPrinting() && m_layoutBlock.isAnonymousBlock() &&
272 m_layoutBlock.childrenInline()) { 269 m_layoutBlock.childrenInline()) {
273 // For case <a href="..."><div>...</div></a>, when m_layoutBlock is the 270 // For case <a href="..."><div>...</div></a>, when m_layoutBlock is the
274 // anonymous container of <a>, the anonymous container's visual overflow is 271 // anonymous container of <a>, the anonymous container's visual overflow is
275 // empty, but we need to continue painting to output <a>'s PDF URL rect 272 // empty, but we need to continue painting to output <a>'s PDF URL rect
276 // which covers the continuations, as if we included <a>'s PDF URL rect into 273 // which covers the continuations, as if we included <a>'s PDF URL rect into
(...skipping 24 matching lines...) Expand all
301 } 298 }
302 299
303 void BlockPainter::paintContents(const PaintInfo& paintInfo, 300 void BlockPainter::paintContents(const PaintInfo& paintInfo,
304 const LayoutPoint& paintOffset) { 301 const LayoutPoint& paintOffset) {
305 DCHECK(!m_layoutBlock.childrenInline()); 302 DCHECK(!m_layoutBlock.childrenInline());
306 PaintInfo paintInfoForDescendants = paintInfo.forDescendants(); 303 PaintInfo paintInfoForDescendants = paintInfo.forDescendants();
307 m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset); 304 m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset);
308 } 305 }
309 306
310 } // namespace blink 307 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/page/PageAnimator.cpp ('k') | third_party/WebKit/Source/core/paint/BoxClipper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698