OLD | NEW |
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 "config.h" | 5 #include "config.h" |
6 #include "core/paint/BoxClipper.h" | 6 #include "core/paint/BoxClipper.h" |
7 | 7 |
8 #include "core/paint/ClipRecorder.h" | 8 #include "core/paint/ClipRecorder.h" |
9 #include "core/paint/ViewDisplayList.h" | 9 #include "core/paint/ViewDisplayList.h" |
10 #include "core/rendering/PaintInfo.h" | 10 #include "core/rendering/PaintInfo.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 m_paintInfo.phase = PaintPhaseChildOutlines; | 56 m_paintInfo.phase = PaintPhaseChildOutlines; |
57 } else if (m_paintInfo.phase == PaintPhaseChildBlockBackground) { | 57 } else if (m_paintInfo.phase == PaintPhaseChildBlockBackground) { |
58 m_paintInfo.phase = PaintPhaseBlockBackground; | 58 m_paintInfo.phase = PaintPhaseBlockBackground; |
59 // FIXME: refactor to not call paintObject from within a clipping helper
. | 59 // FIXME: refactor to not call paintObject from within a clipping helper
. |
60 m_box.paintObject(m_paintInfo, m_accumulatedOffset); | 60 m_box.paintObject(m_paintInfo, m_accumulatedOffset); |
61 m_paintInfo.phase = PaintPhaseChildBlockBackgrounds; | 61 m_paintInfo.phase = PaintPhaseChildBlockBackgrounds; |
62 } | 62 } |
63 | 63 |
64 DisplayItem::Type clipType = DisplayItem::ClipBoxForeground; | 64 DisplayItem::Type clipType = DisplayItem::ClipBoxForeground; |
65 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { | 65 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { |
66 switch (m_paintInfo.phase) { | 66 clipType = DisplayItem::paintPhaseToClipType(m_paintInfo.phase); |
67 case PaintPhaseChildBlockBackgrounds: | |
68 clipType = DisplayItem::ClipBoxChildBlockBackgrounds; | |
69 break; | |
70 case PaintPhaseFloat: | |
71 clipType = DisplayItem::ClipBoxFloat; | |
72 break; | |
73 case PaintPhaseForeground: | |
74 clipType = DisplayItem::ClipBoxChildBlockBackgrounds; | |
75 break; | |
76 case PaintPhaseChildOutlines: | |
77 clipType = DisplayItem::ClipBoxChildOutlines; | |
78 break; | |
79 case PaintPhaseSelection: | |
80 clipType = DisplayItem::ClipBoxSelection; | |
81 break; | |
82 case PaintPhaseCollapsedTableBorders: | |
83 clipType = DisplayItem::ClipBoxCollapsedTableBorders; | |
84 break; | |
85 case PaintPhaseTextClip: | |
86 clipType = DisplayItem::ClipBoxTextClip; | |
87 break; | |
88 case PaintPhaseClippingMask: | |
89 clipType = DisplayItem::ClipBoxClippingMask; | |
90 break; | |
91 case PaintPhaseChildBlockBackground: | |
92 case PaintPhaseOutline: | |
93 case PaintPhaseBlockBackground: | |
94 case PaintPhaseSelfOutline: | |
95 case PaintPhaseMask: | |
96 ASSERT_NOT_REACHED(); | |
97 } | |
98 } | 67 } |
99 | 68 |
100 OwnPtr<ClipDisplayItem> clipDisplayItem = adoptPtr(new ClipDisplayItem(&m_bo
x, clipType, pixelSnappedIntRect(clipRect))); | 69 OwnPtr<ClipDisplayItem> clipDisplayItem = adoptPtr(new ClipDisplayItem(&m_bo
x, clipType, pixelSnappedIntRect(clipRect))); |
101 if (hasBorderRadius) | 70 if (hasBorderRadius) |
102 clipDisplayItem->roundedRectClips().append(clipRoundedRect); | 71 clipDisplayItem->roundedRectClips().append(clipRoundedRect); |
103 | 72 |
104 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) | 73 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) |
105 m_box.view()->viewDisplayList().add(clipDisplayItem.release()); | 74 m_box.view()->viewDisplayList().add(clipDisplayItem.release()); |
106 else | 75 else |
107 clipDisplayItem->replay(paintInfo.context); | 76 clipDisplayItem->replay(paintInfo.context); |
(...skipping 20 matching lines...) Expand all Loading... |
128 if (m_originalPhase == PaintPhaseOutline) { | 97 if (m_originalPhase == PaintPhaseOutline) { |
129 m_paintInfo.phase = PaintPhaseSelfOutline; | 98 m_paintInfo.phase = PaintPhaseSelfOutline; |
130 m_box.paintObject(m_paintInfo, m_accumulatedOffset); | 99 m_box.paintObject(m_paintInfo, m_accumulatedOffset); |
131 m_paintInfo.phase = m_originalPhase; | 100 m_paintInfo.phase = m_originalPhase; |
132 } else if (m_originalPhase == PaintPhaseChildBlockBackground) { | 101 } else if (m_originalPhase == PaintPhaseChildBlockBackground) { |
133 m_paintInfo.phase = m_originalPhase; | 102 m_paintInfo.phase = m_originalPhase; |
134 } | 103 } |
135 } | 104 } |
136 | 105 |
137 } // namespace blink | 106 } // namespace blink |
OLD | NEW |