Chromium Code Reviews| 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/LayoutBox.h" | 8 #include "core/layout/LayoutBox.h" |
| 9 #include "core/paint/DeprecatedPaintLayer.h" | 9 #include "core/paint/DeprecatedPaintLayer.h" |
| 10 #include "core/paint/PaintInfo.h" | 10 #include "core/paint/PaintInfo.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 LayoutRect conservativeClipRect = clipRect; | 45 LayoutRect conservativeClipRect = clipRect; |
| 46 if (hasBorderRadius) | 46 if (hasBorderRadius) |
| 47 conservativeClipRect.intersect(LayoutRect(clipRoundedRect.radiusCent erRect())); | 47 conservativeClipRect.intersect(LayoutRect(clipRoundedRect.radiusCent erRect())); |
| 48 conservativeClipRect.moveBy(-m_accumulatedOffset); | 48 conservativeClipRect.moveBy(-m_accumulatedOffset); |
| 49 if (m_box.hasLayer()) | 49 if (m_box.hasLayer()) |
| 50 conservativeClipRect.move(m_box.scrolledContentOffset()); | 50 conservativeClipRect.move(m_box.scrolledContentOffset()); |
| 51 if (conservativeClipRect.contains(contentsVisualOverflow)) | 51 if (conservativeClipRect.contains(contentsVisualOverflow)) |
| 52 return; | 52 return; |
| 53 } | 53 } |
| 54 | 54 |
| 55 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) | 55 OwnPtr<Vector<FloatRoundedRect>> roundedRects; |
| 56 if (hasBorderRadius) { | |
| 57 roundedRects = adoptPtr(new Vector<FloatRoundedRect>()); | |
|
chrishtr
2015/06/19 22:10:17
How about putting the vector on the stack, and req
| |
| 58 roundedRects->append(clipRoundedRect); | |
| 59 } | |
| 60 | |
| 61 OwnPtr<ClipDisplayItem> clipDisplayItem = ClipDisplayItem::create(m_box, m_c lipType, pixelSnappedIntRect(clipRect), roundedRects.release()); | |
| 62 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { | |
| 56 m_clipType = m_paintInfo.displayItemTypeForClipping(); | 63 m_clipType = m_paintInfo.displayItemTypeForClipping(); |
| 57 | |
| 58 OwnPtr<ClipDisplayItem> clipDisplayItem = ClipDisplayItem::create(m_box, m_c lipType, pixelSnappedIntRect(clipRect)); | |
| 59 if (hasBorderRadius) | |
| 60 clipDisplayItem->roundedRectClips().append(clipRoundedRect); | |
| 61 | |
| 62 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { | |
| 63 ASSERT(m_paintInfo.context->displayItemList()); | 64 ASSERT(m_paintInfo.context->displayItemList()); |
| 64 if (!m_paintInfo.context->displayItemList()->displayItemConstructionIsDi sabled()) | 65 if (!m_paintInfo.context->displayItemList()->displayItemConstructionIsDi sabled()) |
| 65 m_paintInfo.context->displayItemList()->add(clipDisplayItem.release( )); | 66 m_paintInfo.context->displayItemList()->add(clipDisplayItem.release( )); |
| 66 } else { | 67 } else { |
| 67 clipDisplayItem->replay(*paintInfo.context); | 68 clipDisplayItem->replay(*paintInfo.context); |
| 68 } | 69 } |
| 69 | 70 |
| 70 m_pushedClip = true; | 71 m_pushedClip = true; |
| 71 } | 72 } |
| 72 | 73 |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 84 OwnPtr<EndClipDisplayItem> endClipDisplayItem = EndClipDisplayItem::crea te(m_box, endType); | 85 OwnPtr<EndClipDisplayItem> endClipDisplayItem = EndClipDisplayItem::crea te(m_box, endType); |
| 85 ASSERT(m_paintInfo.context->displayItemList()); | 86 ASSERT(m_paintInfo.context->displayItemList()); |
| 86 m_paintInfo.context->displayItemList()->add(endClipDisplayItem.release() ); | 87 m_paintInfo.context->displayItemList()->add(endClipDisplayItem.release() ); |
| 87 } else { | 88 } else { |
| 88 EndClipDisplayItem endClipDisplayItem(m_box, endType); | 89 EndClipDisplayItem endClipDisplayItem(m_box, endType); |
| 89 endClipDisplayItem.replay(*m_paintInfo.context); | 90 endClipDisplayItem.replay(*m_paintInfo.context); |
| 90 } | 91 } |
| 91 } | 92 } |
| 92 | 93 |
| 93 } // namespace blink | 94 } // namespace blink |
| OLD | NEW |