| 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/layout/Layer.h" | 8 #include "core/layout/Layer.h" |
| 9 #include "core/layout/LayoutBox.h" |
| 9 #include "core/layout/PaintInfo.h" | 10 #include "core/layout/PaintInfo.h" |
| 10 #include "core/rendering/RenderBox.h" | |
| 11 #include "platform/RuntimeEnabledFeatures.h" | 11 #include "platform/RuntimeEnabledFeatures.h" |
| 12 #include "platform/graphics/GraphicsLayer.h" | 12 #include "platform/graphics/GraphicsLayer.h" |
| 13 #include "platform/graphics/paint/ClipDisplayItem.h" | 13 #include "platform/graphics/paint/ClipDisplayItem.h" |
| 14 #include "platform/graphics/paint/DisplayItemList.h" | 14 #include "platform/graphics/paint/DisplayItemList.h" |
| 15 | 15 |
| 16 namespace blink { | 16 namespace blink { |
| 17 | 17 |
| 18 BoxClipper::BoxClipper(RenderBox& box, const PaintInfo& paintInfo, const LayoutP
oint& accumulatedOffset, ContentsClipBehavior contentsClipBehavior) | 18 BoxClipper::BoxClipper(LayoutBox& box, const PaintInfo& paintInfo, const LayoutP
oint& accumulatedOffset, ContentsClipBehavior contentsClipBehavior) |
| 19 : m_pushedClip(false) | 19 : m_pushedClip(false) |
| 20 , m_accumulatedOffset(accumulatedOffset) | 20 , m_accumulatedOffset(accumulatedOffset) |
| 21 , m_paintInfo(paintInfo) | 21 , m_paintInfo(paintInfo) |
| 22 , m_box(box) | 22 , m_box(box) |
| 23 , m_clipType(DisplayItem::ClipBoxPaintPhaseFirst) | 23 , m_clipType(DisplayItem::ClipBoxPaintPhaseFirst) |
| 24 { | 24 { |
| 25 if (m_paintInfo.phase == PaintPhaseBlockBackground || m_paintInfo.phase == P
aintPhaseSelfOutline || m_paintInfo.phase == PaintPhaseMask) | 25 if (m_paintInfo.phase == PaintPhaseBlockBackground || m_paintInfo.phase == P
aintPhaseSelfOutline || m_paintInfo.phase == PaintPhaseMask) |
| 26 return; | 26 return; |
| 27 | 27 |
| 28 bool isControlClip = m_box.hasControlClip(); | 28 bool isControlClip = m_box.hasControlClip(); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 OwnPtr<EndClipDisplayItem> endClipDisplayItem = EndClipDisplayItem::crea
te(m_box.displayItemClient(), endType); | 80 OwnPtr<EndClipDisplayItem> endClipDisplayItem = EndClipDisplayItem::crea
te(m_box.displayItemClient(), endType); |
| 81 ASSERT(m_paintInfo.context->displayItemList()); | 81 ASSERT(m_paintInfo.context->displayItemList()); |
| 82 m_paintInfo.context->displayItemList()->add(endClipDisplayItem.release()
); | 82 m_paintInfo.context->displayItemList()->add(endClipDisplayItem.release()
); |
| 83 } else { | 83 } else { |
| 84 EndClipDisplayItem endClipDisplayItem(m_box.displayItemClient(), endType
); | 84 EndClipDisplayItem endClipDisplayItem(m_box.displayItemClient(), endType
); |
| 85 endClipDisplayItem.replay(m_paintInfo.context); | 85 endClipDisplayItem.replay(m_paintInfo.context); |
| 86 } | 86 } |
| 87 } | 87 } |
| 88 | 88 |
| 89 } // namespace blink | 89 } // namespace blink |
| OLD | NEW |