OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | |
dsinclair
2014/07/02 18:48:24
There is a new short license you can use on new fi
| |
3 * | |
4 * Redistribution and use in source and binary forms, with or without | |
5 * modification, are permitted provided that the following conditions are | |
6 * met: | |
7 * | |
8 * * Redistributions of source code must retain the above copyright | |
9 * notice, this list of conditions and the following disclaimer. | |
10 * * Redistributions in binary form must reproduce the above | |
11 * copyright notice, this list of conditions and the following disclaimer | |
12 * in the documentation and/or other materials provided with the | |
13 * distribution. | |
14 * * Neither the name of Google Inc. nor the names of its | |
15 * contributors may be used to endorse or promote products derived from | |
16 * this software without specific prior written permission. | |
17 * | |
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 */ | |
30 | |
31 #ifndef InvalidationTreeWalkState_h | |
32 #define InvalidationTreeWalkState_h | |
33 | |
34 #include "platform/geometry/LayoutRect.h" | |
35 #include "wtf/Noncopyable.h" | |
36 | |
37 namespace WebCore { | |
38 | |
39 class RenderBox; | |
40 class RenderInline; | |
41 class RenderLayerModelObject; | |
42 class RenderObject; | |
43 class RenderSVGModelObject; | |
44 | |
45 class InvalidationTreeWalkState { | |
46 WTF_MAKE_NONCOPYABLE(InvalidationTreeWalkState); | |
47 public: | |
48 InvalidationTreeWalkState(const InvalidationTreeWalkState& next, RenderInlin e& renderer, const RenderLayerModelObject& paintInvalidationContainer); | |
49 InvalidationTreeWalkState(const InvalidationTreeWalkState& next, RenderBox& renderer, const RenderLayerModelObject& paintInvalidationContainer); | |
50 InvalidationTreeWalkState(const InvalidationTreeWalkState& next, RenderSVGMo delObject& renderer, const RenderLayerModelObject& paintInvalidationContainer); | |
51 | |
52 InvalidationTreeWalkState(RenderObject&); | |
dsinclair
2014/07/02 18:48:24
Should this have an explicit?
| |
53 | |
54 const LayoutRect& clipRect() const { return m_clipRect; } | |
55 const LayoutSize& paintOffset() const { return m_paintOffset; } | |
56 | |
57 bool cachedOffsetsEnabled() const { return m_cachedOffsetsEnabled; } | |
58 bool isClipped() const { return m_clipped; } | |
59 | |
60 const RenderLayerModelObject& paintInvalidationContainer() const { return m_ paintInvalidationContainer; } | |
61 RenderObject& renderer() const { return m_renderer; } | |
62 | |
63 bool canMapToContainer(const RenderLayerModelObject* container) const | |
64 { | |
65 return m_cachedOffsetsEnabled && container == &m_paintInvalidationContai ner; | |
66 } | |
67 private: | |
68 void applyClipIfNeeded(const RenderObject&); | |
69 | |
70 friend class ForceHorriblySlowRectMapping; | |
71 | |
72 bool m_clipped; | |
73 mutable bool m_cachedOffsetsEnabled; | |
74 | |
75 LayoutRect m_clipRect; | |
76 | |
77 // x/y offset from paint invalidation container. Includes relative positioni ng and scroll offsets. | |
78 LayoutSize m_paintOffset; | |
79 | |
80 const RenderLayerModelObject& m_paintInvalidationContainer; | |
81 | |
82 RenderObject& m_renderer; | |
83 }; | |
84 | |
85 } // namespace WebCore | |
86 | |
87 #endif // InvalidationTreeWalkState_h | |
OLD | NEW |