OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2014 Google Inc. All rights reserved. | 3 * Copyright (C) 2014 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 hasMostRecentMapping(false), | 61 hasMostRecentMapping(false), |
62 haveAssignedBackingsToEntireSquashingLayerSubtree(false), | 62 haveAssignedBackingsToEntireSquashingLayerSubtree(false), |
63 nextSquashedLayerIndex(0), | 63 nextSquashedLayerIndex(0), |
64 totalAreaOfSquashedRects(0) {} | 64 totalAreaOfSquashedRects(0) {} |
65 | 65 |
66 void updateSquashingStateForNewMapping( | 66 void updateSquashingStateForNewMapping( |
67 CompositedLayerMapping*, | 67 CompositedLayerMapping*, |
68 bool hasNewCompositedPaintLayerMapping, | 68 bool hasNewCompositedPaintLayerMapping, |
69 Vector<PaintLayer*>& layersNeedingPaintInvalidation); | 69 Vector<PaintLayer*>& layersNeedingPaintInvalidation); |
70 | 70 |
71 // The most recent composited backing that the layer should squash onto if n
eeded. | 71 // The most recent composited backing that the layer should squash onto if |
| 72 // needed. |
72 CompositedLayerMapping* mostRecentMapping; | 73 CompositedLayerMapping* mostRecentMapping; |
73 bool hasMostRecentMapping; | 74 bool hasMostRecentMapping; |
74 | 75 |
75 // Whether all Layers in the stacking subtree rooted at the most recent mapp
ing's | 76 // Whether all Layers in the stacking subtree rooted at the most recent |
76 // owning layer have had CompositedLayerMappings assigned. Layers cannot squ
ash into a | 77 // mapping's owning layer have had CompositedLayerMappings assigned. Layers |
77 // CompositedLayerMapping owned by a stacking ancestor, since this changes p
aint order. | 78 // cannot squash into a CompositedLayerMapping owned by a stacking ancestor, |
| 79 // since this changes paint order. |
78 bool haveAssignedBackingsToEntireSquashingLayerSubtree; | 80 bool haveAssignedBackingsToEntireSquashingLayerSubtree; |
79 | 81 |
80 // Counter that tracks what index the next Layer would be if it gets squashe
d to the current squashing layer. | 82 // Counter that tracks what index the next Layer would be if it gets |
| 83 // squashed to the current squashing layer. |
81 size_t nextSquashedLayerIndex; | 84 size_t nextSquashedLayerIndex; |
82 | 85 |
83 // The absolute bounding rect of all the squashed layers. | 86 // The absolute bounding rect of all the squashed layers. |
84 IntRect boundingRect; | 87 IntRect boundingRect; |
85 | 88 |
86 // This is simply the sum of the areas of the squashed rects. This can be ve
ry skewed if the rects overlap, | 89 // This is simply the sum of the areas of the squashed rects. This can be |
87 // but should be close enough to drive a heuristic. | 90 // very skewed if the rects overlap, but should be close enough to drive a |
| 91 // heuristic. |
88 uint64_t totalAreaOfSquashedRects; | 92 uint64_t totalAreaOfSquashedRects; |
89 }; | 93 }; |
90 | 94 |
91 void assignLayersToBackingsInternal( | 95 void assignLayersToBackingsInternal( |
92 PaintLayer*, | 96 PaintLayer*, |
93 SquashingState&, | 97 SquashingState&, |
94 Vector<PaintLayer*>& layersNeedingPaintInvalidation); | 98 Vector<PaintLayer*>& layersNeedingPaintInvalidation); |
95 SquashingDisallowedReasons getReasonsPreventingSquashing( | 99 SquashingDisallowedReasons getReasonsPreventingSquashing( |
96 const PaintLayer*, | 100 const PaintLayer*, |
97 const SquashingState&); | 101 const SquashingState&); |
98 bool squashingWouldExceedSparsityTolerance(const PaintLayer* candidate, | 102 bool squashingWouldExceedSparsityTolerance(const PaintLayer* candidate, |
99 const SquashingState&); | 103 const SquashingState&); |
100 void updateSquashingAssignment( | 104 void updateSquashingAssignment( |
101 PaintLayer*, | 105 PaintLayer*, |
102 SquashingState&, | 106 SquashingState&, |
103 CompositingStateTransitionType, | 107 CompositingStateTransitionType, |
104 Vector<PaintLayer*>& layersNeedingPaintInvalidation); | 108 Vector<PaintLayer*>& layersNeedingPaintInvalidation); |
105 bool needsOwnBacking(const PaintLayer*) const; | 109 bool needsOwnBacking(const PaintLayer*) const; |
106 | 110 |
107 PaintLayerCompositor* m_compositor; | 111 PaintLayerCompositor* m_compositor; |
108 bool m_layersChanged; | 112 bool m_layersChanged; |
109 }; | 113 }; |
110 | 114 |
111 } // namespace blink | 115 } // namespace blink |
112 | 116 |
113 #endif // CompositingLayerAssigner_h | 117 #endif // CompositingLayerAssigner_h |
OLD | NEW |