| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef PaintInvalidationState_h | |
| 6 #define PaintInvalidationState_h | |
| 7 | |
| 8 #include "platform/geometry/LayoutRect.h" | |
| 9 #include "wtf/Noncopyable.h" | |
| 10 | |
| 11 namespace WebCore { | |
| 12 | |
| 13 class RenderBox; | |
| 14 class RenderInline; | |
| 15 class RenderLayerModelObject; | |
| 16 class RenderObject; | |
| 17 class RenderSVGModelObject; | |
| 18 | |
| 19 class PaintInvalidationState { | |
| 20 WTF_MAKE_NONCOPYABLE(PaintInvalidationState); | |
| 21 public: | |
| 22 PaintInvalidationState(const PaintInvalidationState& next, RenderInline& ren
derer, const RenderLayerModelObject& paintInvalidationContainer); | |
| 23 PaintInvalidationState(const PaintInvalidationState& next, RenderBox& render
er, const RenderLayerModelObject& paintInvalidationContainer); | |
| 24 PaintInvalidationState(const PaintInvalidationState& next, RenderSVGModelObj
ect& renderer, const RenderLayerModelObject& paintInvalidationContainer); | |
| 25 | |
| 26 explicit PaintInvalidationState(RenderObject&); | |
| 27 | |
| 28 const LayoutRect& clipRect() const { return m_clipRect; } | |
| 29 const LayoutSize& paintOffset() const { return m_paintOffset; } | |
| 30 | |
| 31 bool cachedOffsetsEnabled() const { return m_cachedOffsetsEnabled; } | |
| 32 bool isClipped() const { return m_clipped; } | |
| 33 | |
| 34 const RenderLayerModelObject& paintInvalidationContainer() const { return m_
paintInvalidationContainer; } | |
| 35 RenderObject& renderer() const { return m_renderer; } | |
| 36 | |
| 37 bool canMapToContainer(const RenderLayerModelObject* container) const | |
| 38 { | |
| 39 return m_cachedOffsetsEnabled && container == &m_paintInvalidationContai
ner; | |
| 40 } | |
| 41 private: | |
| 42 void applyClipIfNeeded(const RenderObject&); | |
| 43 | |
| 44 friend class ForceHorriblySlowRectMapping; | |
| 45 | |
| 46 bool m_clipped; | |
| 47 mutable bool m_cachedOffsetsEnabled; | |
| 48 | |
| 49 LayoutRect m_clipRect; | |
| 50 | |
| 51 // x/y offset from paint invalidation container. Includes relative positioni
ng and scroll offsets. | |
| 52 LayoutSize m_paintOffset; | |
| 53 | |
| 54 const RenderLayerModelObject& m_paintInvalidationContainer; | |
| 55 | |
| 56 RenderObject& m_renderer; | |
| 57 }; | |
| 58 | |
| 59 } // namespace WebCore | |
| 60 | |
| 61 #endif // PaintInvalidationState_h | |
| OLD | NEW |