| 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 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 namespace blink { | 34 namespace blink { |
| 35 | 35 |
| 36 class RenderLayer; | 36 class RenderLayer; |
| 37 | 37 |
| 38 class CompositingLayerAssigner { | 38 class CompositingLayerAssigner { |
| 39 public: | 39 public: |
| 40 explicit CompositingLayerAssigner(RenderLayerCompositor*); | 40 explicit CompositingLayerAssigner(RenderLayerCompositor*); |
| 41 ~CompositingLayerAssigner(); | 41 ~CompositingLayerAssigner(); |
| 42 | 42 |
| 43 void assign(RenderLayer* updateRoot, Vector<RenderLayer*>& layersNeedingRepa
int); | 43 void assign(RenderLayer* updateRoot, Vector<RenderLayer*>& layersNeedingPain
tInvalidation); |
| 44 | 44 |
| 45 bool layersChanged() const { return m_layersChanged; } | 45 bool layersChanged() const { return m_layersChanged; } |
| 46 | 46 |
| 47 // FIXME: This function should be private. We should remove the one caller | 47 // FIXME: This function should be private. We should remove the one caller |
| 48 // once we've fixed the compositing chicken/egg issues. | 48 // once we've fixed the compositing chicken/egg issues. |
| 49 CompositingStateTransitionType computeCompositedLayerUpdate(RenderLayer*); | 49 CompositingStateTransitionType computeCompositedLayerUpdate(RenderLayer*); |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 struct SquashingState { | 52 struct SquashingState { |
| 53 SquashingState() | 53 SquashingState() |
| (...skipping 18 matching lines...) Expand all Loading... |
| 72 size_t nextSquashedLayerIndex; | 72 size_t nextSquashedLayerIndex; |
| 73 | 73 |
| 74 // The absolute bounding rect of all the squashed layers. | 74 // The absolute bounding rect of all the squashed layers. |
| 75 IntRect boundingRect; | 75 IntRect boundingRect; |
| 76 | 76 |
| 77 // This is simply the sum of the areas of the squashed rects. This can b
e very skewed if the rects overlap, | 77 // This is simply the sum of the areas of the squashed rects. This can b
e very skewed if the rects overlap, |
| 78 // but should be close enough to drive a heuristic. | 78 // but should be close enough to drive a heuristic. |
| 79 uint64_t totalAreaOfSquashedRects; | 79 uint64_t totalAreaOfSquashedRects; |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 void assignLayersToBackingsInternal(RenderLayer*, SquashingState&, Vector<Re
nderLayer*>& layersNeedingRepaint); | 82 void assignLayersToBackingsInternal(RenderLayer*, SquashingState&, Vector<Re
nderLayer*>& layersNeedingPaintInvalidation); |
| 83 void assignLayersToBackingsForReflectionLayer(RenderLayer* reflectionLayer,
Vector<RenderLayer*>& layersNeedingRepaint); | 83 void assignLayersToBackingsForReflectionLayer(RenderLayer* reflectionLayer,
Vector<RenderLayer*>& layersNeedingPaintInvalidation); |
| 84 CompositingReasons getReasonsPreventingSquashing(const RenderLayer*, const S
quashingState&); | 84 CompositingReasons getReasonsPreventingSquashing(const RenderLayer*, const S
quashingState&); |
| 85 bool squashingWouldExceedSparsityTolerance(const RenderLayer* candidate, con
st SquashingState&); | 85 bool squashingWouldExceedSparsityTolerance(const RenderLayer* candidate, con
st SquashingState&); |
| 86 void updateSquashingAssignment(RenderLayer*, SquashingState&, CompositingSta
teTransitionType, Vector<RenderLayer*>& layersNeedingRepaint); | 86 void updateSquashingAssignment(RenderLayer*, SquashingState&, CompositingSta
teTransitionType, Vector<RenderLayer*>& layersNeedingPaintInvalidation); |
| 87 bool needsOwnBacking(const RenderLayer*) const; | 87 bool needsOwnBacking(const RenderLayer*) const; |
| 88 | 88 |
| 89 RenderLayerCompositor* m_compositor; | 89 RenderLayerCompositor* m_compositor; |
| 90 bool m_layerSquashingEnabled; | 90 bool m_layerSquashingEnabled; |
| 91 bool m_layersChanged; | 91 bool m_layersChanged; |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 } // namespace blink | 94 } // namespace blink |
| 95 | 95 |
| 96 #endif // CompositingLayerAssigner_h | 96 #endif // CompositingLayerAssigner_h |
| OLD | NEW |