Chromium Code Reviews| Index: Source/core/rendering/RenderLayer.h |
| diff --git a/Source/core/rendering/RenderLayer.h b/Source/core/rendering/RenderLayer.h |
| index b0e5ffbd6c6cbd34717db55785cace48550097dc..17489c623e83a2beed749f88439f215b3d452f8d 100644 |
| --- a/Source/core/rendering/RenderLayer.h |
| +++ b/Source/core/rendering/RenderLayer.h |
| @@ -423,6 +423,8 @@ public: |
| bool isInTopLayer() const; |
| bool isInTopLayerSubtree() const; |
| + // Note: this is internally stored using a minimal number of bits. Ensure |
| + // that you have enough when you add to this enum! |
| enum ViewportConstrainedNotCompositedReason { |
| NoNotCompositedReason, |
| NotCompositedForBoundsOutOfView, |
| @@ -431,7 +433,14 @@ public: |
| NotCompositedForUnscrollableAncestors, |
| }; |
| - void setViewportConstrainedNotCompositedReason(ViewportConstrainedNotCompositedReason reason) { m_compositingProperties.viewportConstrainedNotCompositedReason = reason; } |
| + void setViewportConstrainedNotCompositedReason(ViewportConstrainedNotCompositedReason reason) |
| + { |
| + m_compositingProperties.viewportConstrainedNotCompositedReason = reason; |
| + // This can fail if we forget to change the width of the viewportConstrainedNotCompositedReason |
| + // when we update the enum. |
| + ASSERT(viewportConstrainedNotCompositedReason() == reason); |
|
enne (OOO)
2014/02/28 20:28:46
Compile assert?
|
| + } |
| + |
| ViewportConstrainedNotCompositedReason viewportConstrainedNotCompositedReason() const { return static_cast<ViewportConstrainedNotCompositedReason>(m_compositingProperties.viewportConstrainedNotCompositedReason); } |
| bool isOutOfFlowRenderFlowThread() const { return renderer()->isOutOfFlowRenderFlowThread(); } |
| @@ -731,7 +740,7 @@ protected: |
| bool lostGroupedMapping : 1; |
| // The reason, if any exists, that a fixed-position layer is chosen not to be composited. |
| - unsigned viewportConstrainedNotCompositedReason : 2; |
| + unsigned viewportConstrainedNotCompositedReason : 3; |
| // Once computed, indicates all that a layer needs to become composited using the CompositingReasons enum bitfield. |
| CompositingReasons compositingReasons; |