• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 CompositingInputsUpdater_h
6 #define CompositingInputsUpdater_h
7 
8 #include "core/rendering/RenderGeometryMap.h"
9 
10 namespace blink {
11 
12 class RenderLayer;
13 
14 class CompositingInputsUpdater {
15 public:
16     explicit CompositingInputsUpdater(RenderLayer* rootRenderLayer);
17     ~CompositingInputsUpdater();
18 
19     void update();
20 
21 #if ENABLE(ASSERT)
22     static void assertNeedsCompositingInputsUpdateBitsCleared(RenderLayer*);
23 #endif
24 
25 private:
26     enum UpdateType {
27         DoNotForceUpdate,
28         ForceUpdate,
29     };
30 
31     struct AncestorInfo {
AncestorInfoAncestorInfo32         AncestorInfo()
33             : ancestorStackingContext(0)
34             , enclosingCompositedLayer(0)
35             , lastScrollingAncestor(0)
36             , hasAncestorWithClipOrOverflowClip(false)
37             , hasAncestorWithClipPath(false)
38         {
39         }
40 
41         RenderLayer* ancestorStackingContext;
42         RenderLayer* enclosingCompositedLayer;
43         // Notice that lastScrollingAncestor isn't the same thing as
44         // ancestorScrollingLayer. The former is just the nearest scrolling
45         // along the RenderLayer::parent() chain. The latter is the layer that
46         // actually controls the scrolling of this layer, which we find on the
47         // containing block chain.
48         RenderLayer* lastScrollingAncestor;
49         bool hasAncestorWithClipOrOverflowClip;
50         bool hasAncestorWithClipPath;
51     };
52 
53     void updateRecursive(RenderLayer*, UpdateType, AncestorInfo);
54 
55     RenderGeometryMap m_geometryMap;
56     RenderLayer* m_rootRenderLayer;
57 };
58 
59 } // namespace blink
60 
61 #endif // CompositingInputsUpdater_h
62