OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CompositingReasonFinder_h | 5 #ifndef CompositingReasonFinder_h |
6 #define CompositingReasonFinder_h | 6 #define CompositingReasonFinder_h |
7 | 7 |
8 #include "core/rendering/RenderLayer.h" | 8 #include "core/rendering/RenderLayer.h" |
9 #include "core/rendering/compositing/CompositingTriggers.h" | 9 #include "core/rendering/compositing/CompositingTriggers.h" |
10 #include "platform/graphics/CompositingReasons.h" | 10 #include "platform/graphics/CompositingReasons.h" |
11 | 11 |
12 namespace WebCore { | 12 namespace WebCore { |
13 | 13 |
14 class RenderLayer; | 14 class RenderLayer; |
15 class RenderObject; | 15 class RenderObject; |
16 class RenderView; | 16 class RenderView; |
17 | 17 |
18 class CompositingReasonFinder { | 18 class CompositingReasonFinder { |
| 19 WTF_MAKE_NONCOPYABLE(CompositingReasonFinder); |
19 public: | 20 public: |
20 explicit CompositingReasonFinder(RenderView&); | 21 explicit CompositingReasonFinder(RenderView&); |
21 | 22 |
| 23 CompositingReasons styleDeterminedReasons(RenderObject*) const; |
22 CompositingReasons directReasons(const RenderLayer*, bool* needToRecomputeCo
mpositingRequirements) const; | 24 CompositingReasons directReasons(const RenderLayer*, bool* needToRecomputeCo
mpositingRequirements) const; |
23 | 25 |
24 void updateTriggers(); | 26 void updateTriggers(); |
25 bool hasTriggers() const { return m_compositingTriggers; } | 27 bool hasTriggers() const { return m_compositingTriggers; } |
26 | 28 |
27 bool has3DTransformTrigger() const; | 29 bool has3DTransformTrigger() const; |
28 bool hasAnimationTrigger() const; | 30 bool hasAnimationTrigger() const; |
29 | 31 |
30 bool requiresCompositingForScrollableFrame() const; | 32 bool requiresCompositingForScrollableFrame() const; |
31 bool requiresCompositingForPosition(RenderObject*, const RenderLayer*, Rende
rLayer::ViewportConstrainedNotCompositedReason*, bool* needToRecomputeCompositin
gRequirements) const; | 33 bool requiresCompositingForPosition(RenderObject*, const RenderLayer*, Rende
rLayer::ViewportConstrainedNotCompositedReason*, bool* needToRecomputeCompositin
gRequirements) const; |
32 | 34 |
33 static bool isViewportConstrainedFixedOrStickyLayer(const RenderLayer*); | 35 static bool isViewportConstrainedFixedOrStickyLayer(const RenderLayer*); |
34 | 36 |
35 private: | 37 private: |
36 bool isMainFrame() const; | 38 bool isMainFrame() const; |
37 | 39 |
38 CompositingReasons styleDeterminedDirectReasons(RenderObject*) const; | |
39 CompositingReasons nonStyleDeterminedDirectReasons(const RenderLayer*, bool*
needToRecomputeCompositingRequirements) const; | 40 CompositingReasons nonStyleDeterminedDirectReasons(const RenderLayer*, bool*
needToRecomputeCompositingRequirements) const; |
40 | 41 |
41 bool requiresCompositingForAnimation(RenderObject*) const; | 42 bool requiresCompositingForAnimation(RenderObject*) const; |
42 bool requiresCompositingForTransform(RenderObject*) const; | 43 bool requiresCompositingForTransform(RenderObject*) const; |
43 bool requiresCompositingForBackfaceVisibilityHidden(RenderObject*) const; | 44 bool requiresCompositingForBackfaceVisibilityHidden(RenderObject*) const; |
44 bool requiresCompositingForFilters(RenderObject*) const; | 45 bool requiresCompositingForFilters(RenderObject*) const; |
45 bool requiresCompositingForOverflowScrollingParent(const RenderLayer*) const
; | 46 bool requiresCompositingForOverflowScrollingParent(const RenderLayer*) const
; |
46 bool requiresCompositingForOutOfFlowClipping(const RenderLayer*) const; | 47 bool requiresCompositingForOutOfFlowClipping(const RenderLayer*) const; |
47 bool requiresCompositingForOverflowScrolling(const RenderLayer*) const; | 48 bool requiresCompositingForOverflowScrolling(const RenderLayer*) const; |
48 bool requiresCompositingForWillChange(const RenderObject*) const; | 49 bool requiresCompositingForWillChange(const RenderObject*) const; |
49 | 50 |
50 RenderView& m_renderView; | 51 RenderView& m_renderView; |
51 CompositingTriggerFlags m_compositingTriggers; | 52 CompositingTriggerFlags m_compositingTriggers; |
52 }; | 53 }; |
53 | 54 |
54 } // namespace WebCore | 55 } // namespace WebCore |
55 | 56 |
56 #endif // CompositingReasonFinder_h | 57 #endif // CompositingReasonFinder_h |
OLD | NEW |