| 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/LayerClipRecorder.h" | 6 #include "core/paint/LayerClipRecorder.h" |
| 7 | 7 |
| 8 #include "core/layout/ClipRect.h" | 8 #include "core/layout/ClipRect.h" |
| 9 #include "core/layout/Layer.h" | 9 #include "core/layout/Layer.h" |
| 10 #include "core/rendering/RenderView.h" | 10 #include "core/rendering/RenderView.h" |
| 11 #include "platform/RuntimeEnabledFeatures.h" | 11 #include "platform/RuntimeEnabledFeatures.h" |
| 12 #include "platform/geometry/IntRect.h" | 12 #include "platform/geometry/IntRect.h" |
| 13 #include "platform/graphics/GraphicsContext.h" | 13 #include "platform/graphics/GraphicsContext.h" |
| 14 #include "platform/graphics/GraphicsLayer.h" | 14 #include "platform/graphics/GraphicsLayer.h" |
| 15 #include "platform/graphics/paint/ClipRecorder.h" | 15 #include "platform/graphics/paint/ClipRecorder.h" |
| 16 #include "platform/graphics/paint/DisplayItemList.h" | 16 #include "platform/graphics/paint/DisplayItemList.h" |
| 17 | 17 |
| 18 namespace blink { | 18 namespace blink { |
| 19 | 19 |
| 20 LayerClipRecorder::LayerClipRecorder(const LayoutLayerModelObject* renderer, Gra
phicsContext* graphicsContext, DisplayItem::Type clipType, const ClipRect& clipR
ect, | 20 LayerClipRecorder::LayerClipRecorder(const LayoutBoxModelObject* renderer, Graph
icsContext* graphicsContext, DisplayItem::Type clipType, const ClipRect& clipRec
t, |
| 21 const LayerPaintingInfo* localPaintingInfo, const LayoutPoint& fragmentOffse
t, PaintLayerFlags paintFlags, BorderRadiusClippingRule rule) | 21 const LayerPaintingInfo* localPaintingInfo, const LayoutPoint& fragmentOffse
t, PaintLayerFlags paintFlags, BorderRadiusClippingRule rule) |
| 22 : m_graphicsContext(graphicsContext) | 22 : m_graphicsContext(graphicsContext) |
| 23 , m_renderer(renderer) | 23 , m_renderer(renderer) |
| 24 , m_clipType(clipType) | 24 , m_clipType(clipType) |
| 25 { | 25 { |
| 26 ASSERT(renderer); | 26 ASSERT(renderer); |
| 27 | 27 |
| 28 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect()); | 28 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect()); |
| 29 OwnPtr<ClipDisplayItem> clipDisplayItem = ClipDisplayItem::create(renderer->
displayItemClient(), clipType, snappedClipRect); | 29 OwnPtr<ClipDisplayItem> clipDisplayItem = ClipDisplayItem::create(renderer->
displayItemClient(), clipType, snappedClipRect); |
| 30 if (localPaintingInfo && clipRect.hasRadius()) | 30 if (localPaintingInfo && clipRect.hasRadius()) |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 DisplayItem::Type endType = DisplayItem::clipTypeToEndClipType(m_clipTyp
e); | 82 DisplayItem::Type endType = DisplayItem::clipTypeToEndClipType(m_clipTyp
e); |
| 83 OwnPtr<EndClipDisplayItem> endClip = EndClipDisplayItem::create(m_render
er->displayItemClient(), endType); | 83 OwnPtr<EndClipDisplayItem> endClip = EndClipDisplayItem::create(m_render
er->displayItemClient(), endType); |
| 84 ASSERT(m_graphicsContext->displayItemList()); | 84 ASSERT(m_graphicsContext->displayItemList()); |
| 85 m_graphicsContext->displayItemList()->add(endClip.release()); | 85 m_graphicsContext->displayItemList()->add(endClip.release()); |
| 86 } else { | 86 } else { |
| 87 m_graphicsContext->restore(); | 87 m_graphicsContext->restore(); |
| 88 } | 88 } |
| 89 } | 89 } |
| 90 | 90 |
| 91 } // namespace blink | 91 } // namespace blink |
| OLD | NEW |