Remove unused variable movedSectionLogicalTop from table layout code.
[chromium-blink-merge.git] / third_party / WebKit / Source / core / layout / ClipRectsCache.h
bloba3a6089d20e49ce69a7e9f271aab5fc37e52bb80
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.
5 #ifndef ClipRectsCache_h
6 #define ClipRectsCache_h
8 #include "core/layout/ClipRects.h"
10 #if ENABLE(ASSERT)
11 #include "core/layout/LayoutBox.h" // For OverlayScrollbarSizeRelevancy.
12 #endif
14 namespace blink {
16 class DeprecatedPaintLayer;
18 enum ClipRectsCacheSlot {
19 // Relative to the ancestor treated as the root (e.g. transformed layer). Used for hit testing.
20 RootRelativeClipRects,
21 RootRelativeClipRectsIgnoringViewportClip,
23 // Relative to the LayoutView's layer. Used for compositing overlap testing.
24 AbsoluteClipRects,
26 // Relative to painting ancestor. Used for painting.
27 PaintingClipRects,
28 PaintingClipRectsIgnoringOverflowClip,
30 NumberOfClipRectsCacheSlots,
31 UncachedClipRects,
34 class ClipRectsCache {
35 WTF_MAKE_FAST_ALLOCATED(ClipRectsCache);
36 public:
37 struct Entry {
38 Entry()
39 : root(nullptr)
40 #if ENABLE(ASSERT)
41 , scrollbarRelevancy(IgnoreOverlayScrollbarSize)
42 #endif
45 const DeprecatedPaintLayer* root;
46 RefPtr<ClipRects> clipRects;
47 #if ENABLE(ASSERT)
48 OverlayScrollbarSizeRelevancy scrollbarRelevancy;
49 #endif
51 Entry& get(ClipRectsCacheSlot slot)
53 ASSERT(slot < NumberOfClipRectsCacheSlots);
54 return m_entries[slot];
56 void clear(ClipRectsCacheSlot slot)
58 ASSERT(slot < NumberOfClipRectsCacheSlots);
59 m_entries[slot] = Entry();
61 private:
62 Entry m_entries[NumberOfClipRectsCacheSlots];
65 } // namespace blink
67 #endif // ClipRectsCache_h