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

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

Issue 2419663009: 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/BoxClipper.h" 5 #include "core/paint/BoxClipper.h"
6 6
7 #include "core/layout/LayoutBox.h" 7 #include "core/layout/LayoutBox.h"
8 #include "core/layout/svg/LayoutSVGRoot.h" 8 #include "core/layout/svg/LayoutSVGRoot.h"
9 #include "core/paint/ObjectPaintProperties.h" 9 #include "core/paint/ObjectPaintProperties.h"
10 #include "core/paint/PaintInfo.h" 10 #include "core/paint/PaintInfo.h"
11 #include "core/paint/PaintLayer.h" 11 #include "core/paint/PaintLayer.h"
12 #include "platform/RuntimeEnabledFeatures.h" 12 #include "platform/RuntimeEnabledFeatures.h"
13 #include "platform/graphics/GraphicsLayer.h" 13 #include "platform/graphics/GraphicsLayer.h"
14 #include "platform/graphics/paint/ClipDisplayItem.h" 14 #include "platform/graphics/paint/ClipDisplayItem.h"
15 #include "platform/graphics/paint/PaintController.h" 15 #include "platform/graphics/paint/PaintController.h"
16 16
17 namespace blink { 17 namespace blink {
18 18
19 static bool boxNeedsClip(const LayoutBox& box) { 19 static bool boxNeedsClip(const LayoutBox& box) {
20 if (box.hasControlClip()) 20 if (box.hasControlClip())
21 return true; 21 return true;
22 if (box.isSVGRoot() && toLayoutSVGRoot(box).shouldApplyViewportClip()) 22 if (box.isSVGRoot() && toLayoutSVGRoot(box).shouldApplyViewportClip())
23 return true; 23 return true;
24 if (box.hasLayer() && box.layer()->isSelfPaintingLayer()) 24 if (box.hasLayer() && box.layer()->isSelfPaintingLayer())
25 return false; 25 return false;
26 return box.hasOverflowClip() || box.styleRef().containsPaint(); 26 return box.hasOverflowClip() || box.styleRef().containsPaint();
27 } 27 }
28 28
29 DISABLE_CFI_PERF
29 BoxClipper::BoxClipper(const LayoutBox& box, 30 BoxClipper::BoxClipper(const LayoutBox& box,
30 const PaintInfo& paintInfo, 31 const PaintInfo& paintInfo,
31 const LayoutPoint& accumulatedOffset, 32 const LayoutPoint& accumulatedOffset,
32 ContentsClipBehavior contentsClipBehavior) 33 ContentsClipBehavior contentsClipBehavior)
33 : m_box(box), 34 : m_box(box),
34 m_paintInfo(paintInfo), 35 m_paintInfo(paintInfo),
35 m_clipType(DisplayItem::kUninitializedType) { 36 m_clipType(DisplayItem::kUninitializedType) {
36 DCHECK(m_paintInfo.phase != PaintPhaseSelfBlockBackgroundOnly && 37 DCHECK(m_paintInfo.phase != PaintPhaseSelfBlockBackgroundOnly &&
37 m_paintInfo.phase != PaintPhaseSelfOutlineOnly); 38 m_paintInfo.phase != PaintPhaseSelfOutlineOnly);
38 39
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 BoxClipper::~BoxClipper() { 98 BoxClipper::~BoxClipper() {
98 if (m_clipType == DisplayItem::kUninitializedType) 99 if (m_clipType == DisplayItem::kUninitializedType)
99 return; 100 return;
100 101
101 DCHECK(boxNeedsClip(m_box)); 102 DCHECK(boxNeedsClip(m_box));
102 m_paintInfo.context.getPaintController().endItem<EndClipDisplayItem>( 103 m_paintInfo.context.getPaintController().endItem<EndClipDisplayItem>(
103 m_box, DisplayItem::clipTypeToEndClipType(m_clipType)); 104 m_box, DisplayItem::clipTypeToEndClipType(m_clipType));
104 } 105 }
105 106
106 } // namespace blink 107 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/BlockPainter.cpp ('k') | third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698