OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 // composited Layers. It determines which Layers | 61 // composited Layers. It determines which Layers |
62 // become compositing, and creates and maintains a hierarchy of | 62 // become compositing, and creates and maintains a hierarchy of |
63 // GraphicsLayers based on the Layer painting order. | 63 // GraphicsLayers based on the Layer painting order. |
64 // | 64 // |
65 // There is one DeprecatedPaintLayerCompositor per LayoutView. | 65 // There is one DeprecatedPaintLayerCompositor per LayoutView. |
66 | 66 |
67 class CORE_EXPORT DeprecatedPaintLayerCompositor final : public GraphicsLayerCli
ent { | 67 class CORE_EXPORT DeprecatedPaintLayerCompositor final : public GraphicsLayerCli
ent { |
68 WTF_MAKE_FAST_ALLOCATED(DeprecatedPaintLayerCompositor); | 68 WTF_MAKE_FAST_ALLOCATED(DeprecatedPaintLayerCompositor); |
69 public: | 69 public: |
70 explicit DeprecatedPaintLayerCompositor(LayoutView&); | 70 explicit DeprecatedPaintLayerCompositor(LayoutView&); |
71 virtual ~DeprecatedPaintLayerCompositor(); | 71 ~DeprecatedPaintLayerCompositor() override; |
72 | 72 |
73 void updateIfNeededRecursive(); | 73 void updateIfNeededRecursive(); |
74 | 74 |
75 // Return true if this LayoutView is in "compositing mode" (i.e. has one or
more | 75 // Return true if this LayoutView is in "compositing mode" (i.e. has one or
more |
76 // composited Layers) | 76 // composited Layers) |
77 bool inCompositingMode() const; | 77 bool inCompositingMode() const; |
78 // FIXME: Replace all callers with inCompositingMode and remove this functio
n. | 78 // FIXME: Replace all callers with inCompositingMode and remove this functio
n. |
79 bool staleInCompositingMode() const; | 79 bool staleInCompositingMode() const; |
80 // This will make a compositing layer at the root automatically, and hook up
to | 80 // This will make a compositing layer at the root automatically, and hook up
to |
81 // the native view/window system. | 81 // the native view/window system. |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 | 149 |
150 String layerTreeAsText(LayerTreeFlags); | 150 String layerTreeAsText(LayerTreeFlags); |
151 | 151 |
152 GraphicsLayer* layerForHorizontalScrollbar() const { return m_layerForHorizo
ntalScrollbar.get(); } | 152 GraphicsLayer* layerForHorizontalScrollbar() const { return m_layerForHorizo
ntalScrollbar.get(); } |
153 GraphicsLayer* layerForVerticalScrollbar() const { return m_layerForVertical
Scrollbar.get(); } | 153 GraphicsLayer* layerForVerticalScrollbar() const { return m_layerForVertical
Scrollbar.get(); } |
154 GraphicsLayer* layerForScrollCorner() const { return m_layerForScrollCorner.
get(); } | 154 GraphicsLayer* layerForScrollCorner() const { return m_layerForScrollCorner.
get(); } |
155 | 155 |
156 void resetTrackedPaintInvalidationRects(); | 156 void resetTrackedPaintInvalidationRects(); |
157 void setTracksPaintInvalidations(bool); | 157 void setTracksPaintInvalidations(bool); |
158 | 158 |
159 virtual String debugName(const GraphicsLayer*) override; | 159 String debugName(const GraphicsLayer*) override; |
160 DocumentLifecycle& lifecycle() const; | 160 DocumentLifecycle& lifecycle() const; |
161 | 161 |
162 bool needsUpdateDescendantDependentFlags() const { return m_needsUpdateDesce
ndantDependentFlags; } | 162 bool needsUpdateDescendantDependentFlags() const { return m_needsUpdateDesce
ndantDependentFlags; } |
163 void setNeedsUpdateDescendantDependentFlags() { m_needsUpdateDescendantDepen
dentFlags = true; } | 163 void setNeedsUpdateDescendantDependentFlags() { m_needsUpdateDescendantDepen
dentFlags = true; } |
164 | 164 |
165 void updatePotentialCompositingReasonsFromStyle(DeprecatedPaintLayer*); | 165 void updatePotentialCompositingReasonsFromStyle(DeprecatedPaintLayer*); |
166 | 166 |
167 // Whether the layer could ever be composited. | 167 // Whether the layer could ever be composited. |
168 bool canBeComposited(const DeprecatedPaintLayer*) const; | 168 bool canBeComposited(const DeprecatedPaintLayer*) const; |
169 | 169 |
170 // FIXME: Move allocateOrClearCompositedDeprecatedPaintLayerMapping to Compo
sitingLayerAssigner once we've fixed | 170 // FIXME: Move allocateOrClearCompositedDeprecatedPaintLayerMapping to Compo
sitingLayerAssigner once we've fixed |
171 // the compositing chicken/egg issues. | 171 // the compositing chicken/egg issues. |
172 bool allocateOrClearCompositedDeprecatedPaintLayerMapping(DeprecatedPaintLay
er*, CompositingStateTransitionType compositedLayerUpdate); | 172 bool allocateOrClearCompositedDeprecatedPaintLayerMapping(DeprecatedPaintLay
er*, CompositingStateTransitionType compositedLayerUpdate); |
173 | 173 |
174 void updateDirectCompositingReasons(DeprecatedPaintLayer*); | 174 void updateDirectCompositingReasons(DeprecatedPaintLayer*); |
175 | 175 |
176 bool inOverlayFullscreenVideo() const { return m_inOverlayFullscreenVideo; } | 176 bool inOverlayFullscreenVideo() const { return m_inOverlayFullscreenVideo; } |
177 | 177 |
178 private: | 178 private: |
179 #if ENABLE(ASSERT) | 179 #if ENABLE(ASSERT) |
180 void assertNoUnresolvedDirtyBits(); | 180 void assertNoUnresolvedDirtyBits(); |
181 #endif | 181 #endif |
182 | 182 |
183 // GraphicsLayerClient implementation | 183 // GraphicsLayerClient implementation |
184 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsL
ayerPaintingPhase, const IntRect&) override; | 184 void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPain
tingPhase, const IntRect&) override; |
185 | 185 |
186 virtual bool isTrackingPaintInvalidations() const override; | 186 bool isTrackingPaintInvalidations() const override; |
187 | 187 |
188 void updateWithoutAcceleratedCompositing(CompositingUpdateType); | 188 void updateWithoutAcceleratedCompositing(CompositingUpdateType); |
189 void updateIfNeeded(); | 189 void updateIfNeeded(); |
190 | 190 |
191 void ensureRootLayer(); | 191 void ensureRootLayer(); |
192 void destroyRootLayer(); | 192 void destroyRootLayer(); |
193 | 193 |
194 void attachRootLayer(RootLayerAttachment); | 194 void attachRootLayer(RootLayerAttachment); |
195 void detachRootLayer(); | 195 void detachRootLayer(); |
196 | 196 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 | 247 |
248 // Layers for overflow controls | 248 // Layers for overflow controls |
249 OwnPtr<GraphicsLayer> m_layerForHorizontalScrollbar; | 249 OwnPtr<GraphicsLayer> m_layerForHorizontalScrollbar; |
250 OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar; | 250 OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar; |
251 OwnPtr<GraphicsLayer> m_layerForScrollCorner; | 251 OwnPtr<GraphicsLayer> m_layerForScrollCorner; |
252 }; | 252 }; |
253 | 253 |
254 } // namespace blink | 254 } // namespace blink |
255 | 255 |
256 #endif // DeprecatedPaintLayerCompositor_h | 256 #endif // DeprecatedPaintLayerCompositor_h |
OLD | NEW |