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/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/layout/compositing/CompositingTriggers.h" | 9 #include "core/layout/compositing/CompositingTriggers.h" |
10 #include "platform/graphics/CompositingReasons.h" | 10 #include "platform/graphics/CompositingReasons.h" |
11 #include "wtf/Allocator.h" | 11 #include "wtf/Allocator.h" |
12 #include "wtf/Noncopyable.h" | 12 #include "wtf/Noncopyable.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 class PaintLayer; | 16 class PaintLayer; |
17 class LayoutObject; | 17 class LayoutObject; |
18 class ComputedStyle; | 18 class ComputedStyle; |
19 class LayoutView; | 19 class LayoutView; |
20 | 20 |
21 class CORE_EXPORT CompositingReasonFinder { | 21 class CORE_EXPORT CompositingReasonFinder { |
22 DISALLOW_NEW(); | 22 DISALLOW_NEW(); |
23 WTF_MAKE_NONCOPYABLE(CompositingReasonFinder); | 23 WTF_MAKE_NONCOPYABLE(CompositingReasonFinder); |
24 | 24 |
25 public: | 25 public: |
26 explicit CompositingReasonFinder(LayoutView&); | 26 explicit CompositingReasonFinder(LayoutView&); |
27 | 27 |
28 CompositingReasons potentialCompositingReasonsFromStyle(LayoutObject*) const; | 28 CompositingReasons potentialCompositingReasonsFromStyle(LayoutObject&) const; |
29 CompositingReasons directReasons(const PaintLayer*) const; | 29 CompositingReasons directReasons(const PaintLayer*) const; |
30 | 30 |
31 void updateTriggers(); | 31 void updateTriggers(); |
32 | 32 |
33 bool hasOverflowScrollTrigger() const; | 33 bool hasOverflowScrollTrigger() const; |
34 bool requiresCompositingForScrollableFrame() const; | 34 bool requiresCompositingForScrollableFrame() const; |
35 static bool requiresCompositingForAnimation(const ComputedStyle&); | 35 static bool requiresCompositingForAnimation(const ComputedStyle&); |
36 static bool requiresCompositingForOpacityAnimation(const ComputedStyle&); | 36 static bool requiresCompositingForOpacityAnimation(const ComputedStyle&); |
37 static bool requiresCompositingForFilterAnimation(const ComputedStyle&); | 37 static bool requiresCompositingForFilterAnimation(const ComputedStyle&); |
38 static bool requiresCompositingForBackdropFilterAnimation( | 38 static bool requiresCompositingForBackdropFilterAnimation( |
39 const ComputedStyle&); | 39 const ComputedStyle&); |
40 static bool requiresCompositingForEffectAnimation(const ComputedStyle&); | 40 static bool requiresCompositingForEffectAnimation(const ComputedStyle&); |
41 static bool requiresCompositingForTransformAnimation(const ComputedStyle&); | 41 static bool requiresCompositingForTransformAnimation(const ComputedStyle&); |
42 static bool requiresCompositingForTransform(const LayoutObject&); | 42 static bool requiresCompositingForTransform(const LayoutObject&); |
43 | 43 |
44 private: | 44 private: |
45 bool isMainFrame() const; | 45 bool isMainFrame() const; |
46 | 46 |
47 CompositingReasons nonStyleDeterminedDirectReasons(const PaintLayer*) const; | 47 CompositingReasons nonStyleDeterminedDirectReasons(const PaintLayer*) const; |
48 bool requiresCompositingForScrollDependentPosition(const PaintLayer*) const; | 48 bool requiresCompositingForScrollDependentPosition(const PaintLayer*) const; |
49 | 49 |
50 LayoutView& m_layoutView; | 50 LayoutView& m_layoutView; |
51 CompositingTriggerFlags m_compositingTriggers; | 51 CompositingTriggerFlags m_compositingTriggers; |
52 }; | 52 }; |
53 | 53 |
54 } // namespace blink | 54 } // namespace blink |
55 | 55 |
56 #endif // CompositingReasonFinder_h | 56 #endif // CompositingReasonFinder_h |
OLD | NEW |