| 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 WTF_MAKE_NONCOPYABLE(CompositingReasonFinder); |
| 20 public: | 20 public: |
| 21 explicit CompositingReasonFinder(RenderView&); | 21 explicit CompositingReasonFinder(RenderView&); |
| 22 | 22 |
| 23 CompositingReasons styleDeterminedReasons(RenderObject*) const; | 23 CompositingReasons styleDeterminedReasons(RenderObject*) const; |
| 24 CompositingReasons directReasons(const RenderLayer*, bool* needToRecomputeCo
mpositingRequirements) const; | 24 CompositingReasons directReasons(const RenderLayer*, bool* needToRecomputeCo
mpositingRequirements) const; |
| 25 | 25 |
| 26 CompositingReasons suppressWillChangeAndAnimationForGpuRasterization(const R
enderLayer*, CompositingReasons styleReasons) const; |
| 27 |
| 26 void updateTriggers(); | 28 void updateTriggers(); |
| 27 bool hasTriggers() const { return m_compositingTriggers; } | 29 bool hasTriggers() const { return m_compositingTriggers; } |
| 28 | 30 |
| 29 bool has3DTransformTrigger() const; | 31 bool has3DTransformTrigger() const; |
| 30 bool hasAnimationTrigger() const; | 32 bool hasAnimationTrigger() const; |
| 31 bool hasOverflowScrollTrigger() const; | 33 bool hasOverflowScrollTrigger() const; |
| 32 bool hasLegacyOverflowScrollTrigger() const; | 34 bool hasLegacyOverflowScrollTrigger() const; |
| 33 | 35 |
| 34 bool requiresCompositingForScrollableFrame() const; | 36 bool requiresCompositingForScrollableFrame() const; |
| 35 bool requiresCompositingForPosition(RenderObject*, const RenderLayer*, Rende
rLayer::ViewportConstrainedNotCompositedReason*, bool* needToRecomputeCompositin
gRequirements) const; | 37 bool requiresCompositingForPosition(RenderObject*, const RenderLayer*, Rende
rLayer::ViewportConstrainedNotCompositedReason*, bool* needToRecomputeCompositin
gRequirements) const; |
| 36 | 38 |
| 37 static bool isViewportConstrainedFixedOrStickyLayer(const RenderLayer*); | 39 static bool isViewportConstrainedFixedOrStickyLayer(const RenderLayer*); |
| 38 | 40 |
| 39 private: | 41 private: |
| 40 bool isMainFrame() const; | 42 bool isMainFrame() const; |
| 41 | 43 |
| 42 CompositingReasons nonStyleDeterminedDirectReasons(const RenderLayer*, bool*
needToRecomputeCompositingRequirements) const; | 44 CompositingReasons nonStyleDeterminedDirectReasons(const RenderLayer*, bool*
needToRecomputeCompositingRequirements) const; |
| 43 | 45 |
| 44 bool requiresCompositingForAnimation(RenderObject*) const; | 46 bool requiresCompositingForAnimation(RenderObject*) const; |
| 45 bool requiresCompositingForTransform(RenderObject*) const; | 47 bool requiresCompositingForTransform(RenderObject*) const; |
| 46 bool requiresCompositingForBackfaceVisibilityHidden(RenderObject*) const; | 48 bool requiresCompositingForBackfaceVisibilityHidden(RenderObject*) const; |
| 47 bool requiresCompositingForFilters(RenderObject*) const; | 49 bool requiresCompositingForFilters(RenderObject*) const; |
| 48 bool requiresCompositingForOverflowScrollingParent(const RenderLayer*) const
; | 50 bool requiresCompositingForOverflowScrollingParent(const RenderLayer*) const
; |
| 49 bool requiresCompositingForOutOfFlowClipping(const RenderLayer*) const; | 51 bool requiresCompositingForOutOfFlowClipping(const RenderLayer*) const; |
| 50 bool requiresCompositingForOverflowScrolling(const RenderLayer*) const; | 52 bool requiresCompositingForOverflowScrolling(const RenderLayer*) const; |
| 51 bool requiresCompositingForPositionSticky(RenderObject*, const RenderLayer*)
const; | 53 bool requiresCompositingForPositionSticky(RenderObject*, const RenderLayer*)
const; |
| 52 bool requiresCompositingForPositionFixed(RenderObject*, const RenderLayer*,
RenderLayer::ViewportConstrainedNotCompositedReason*, bool* needToRecomputeCompo
sitingRequirements) const; | 54 bool requiresCompositingForPositionFixed(RenderObject*, const RenderLayer*,
RenderLayer::ViewportConstrainedNotCompositedReason*, bool* needToRecomputeCompo
sitingRequirements) const; |
| 53 bool requiresCompositingForWillChange(const RenderObject*) const; | 55 bool requiresCompositingForWillChangeCompositingHint(const RenderObject*) co
nst; |
| 56 bool requiresCompositingForWillChangeGpuRasterizationHint(const RenderObject
*) const; |
| 54 | 57 |
| 55 RenderView& m_renderView; | 58 RenderView& m_renderView; |
| 56 CompositingTriggerFlags m_compositingTriggers; | 59 CompositingTriggerFlags m_compositingTriggers; |
| 57 }; | 60 }; |
| 58 | 61 |
| 59 } // namespace WebCore | 62 } // namespace WebCore |
| 60 | 63 |
| 61 #endif // CompositingReasonFinder_h | 64 #endif // CompositingReasonFinder_h |
| OLD | NEW |