Chromium Code Reviews| Index: Source/core/rendering/PaintInvalidationState.h |
| diff --git a/Source/core/rendering/PaintInvalidationState.h b/Source/core/rendering/PaintInvalidationState.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8dd5a1e61642b95e57a1ef80fcd2686d73eb8d10 |
| --- /dev/null |
| +++ b/Source/core/rendering/PaintInvalidationState.h |
| @@ -0,0 +1,61 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef PaintInvalidationState_h |
| +#define PaintInvalidationState_h |
| + |
| +#include "platform/geometry/LayoutRect.h" |
| +#include "wtf/Noncopyable.h" |
| + |
| +namespace WebCore { |
| + |
| +class RenderBox; |
| +class RenderInline; |
| +class RenderLayerModelObject; |
| +class RenderObject; |
| +class RenderSVGModelObject; |
| + |
| +class PaintInvalidationState { |
| + WTF_MAKE_NONCOPYABLE(PaintInvalidationState); |
| +public: |
| + PaintInvalidationState(const PaintInvalidationState& next, RenderInline& renderer, const RenderLayerModelObject& paintInvalidationContainer); |
| + PaintInvalidationState(const PaintInvalidationState& next, RenderBox& renderer, const RenderLayerModelObject& paintInvalidationContainer); |
| + PaintInvalidationState(const PaintInvalidationState& next, RenderSVGModelObject& renderer, const RenderLayerModelObject& paintInvalidationContainer); |
| + |
| + explicit PaintInvalidationState(RenderObject&); |
| + |
| + const LayoutRect& clipRect() const { return m_clipRect; } |
| + const LayoutSize& paintOffset() const { return m_paintOffset; } |
| + |
| + bool cachedOffsetsEnabled() const { return m_cachedOffsetsEnabled; } |
| + bool isClipped() const { return m_clipped; } |
| + |
| + const RenderLayerModelObject& paintInvalidationContainer() const { return m_paintInvalidationContainer; } |
| + RenderObject& renderer() const { return m_renderer; } |
| + |
| + bool canMapToContainer(const RenderLayerModelObject* container) const |
| + { |
| + return m_cachedOffsetsEnabled && container == &m_paintInvalidationContainer; |
| + } |
| +private: |
| + void applyClipIfNeeded(const RenderObject&); |
| + |
| + friend class ForceHorriblySlowRectMapping; |
| + |
| + bool m_clipped; |
| + mutable bool m_cachedOffsetsEnabled; |
|
Julien - ping for review
2014/07/07 22:09:59
Does this field have to be mutable?
|
| + |
| + LayoutRect m_clipRect; |
| + |
| + // x/y offset from paint invalidation container. Includes relative positioning and scroll offsets. |
| + LayoutSize m_paintOffset; |
| + |
| + const RenderLayerModelObject& m_paintInvalidationContainer; |
| + |
| + RenderObject& m_renderer; |
| +}; |
| + |
| +} // namespace WebCore |
| + |
| +#endif // PaintInvalidationState_h |