OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 #include "cc/layer_tree_host_common.h" | 5 #include "cc/layer_tree_host_common.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "cc/heads_up_display_layer_impl.h" | 10 #include "cc/heads_up_display_layer_impl.h" |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 // via a render surface or explicitly if the parent preserves 3D), so the | 225 // via a render surface or explicitly if the parent preserves 3D), so the |
226 // entire subtree can be skipped if this layer is fully transparent. | 226 // entire subtree can be skipped if this layer is fully transparent. |
227 return !layer->opacity(); | 227 return !layer->opacity(); |
228 } | 228 } |
229 | 229 |
230 static inline bool subtreeShouldBeSkipped(Layer* layer) | 230 static inline bool subtreeShouldBeSkipped(Layer* layer) |
231 { | 231 { |
232 // If the opacity is being animated then the opacity on the main thread is u
nreliable | 232 // If the opacity is being animated then the opacity on the main thread is u
nreliable |
233 // (since the impl thread may be using a different opacity), so it should no
t be trusted. | 233 // (since the impl thread may be using a different opacity), so it should no
t be trusted. |
234 // In particular, it should not cause the subtree to be skipped. | 234 // In particular, it should not cause the subtree to be skipped. |
235 return !layer->opacity() && !layer->OpacityIsAnimating(); | 235 // Similarly, for layers that might animate opacity using an impl-only |
| 236 // animation, their subtree should also not be skipped. |
| 237 return !layer->opacity() && !layer->OpacityIsAnimating() && |
| 238 !layer->OpacityCanAnimateOnImplThread(); |
236 } | 239 } |
237 | 240 |
238 // Called on each layer that could be drawn after all information from | 241 // Called on each layer that could be drawn after all information from |
239 // calcDrawProperties has been updated on that layer. May have some false | 242 // calcDrawProperties has been updated on that layer. May have some false |
240 // positives (e.g. layers get this called on them but don't actually get drawn). | 243 // positives (e.g. layers get this called on them but don't actually get drawn). |
241 static inline void updateTilePrioritiesForLayer(LayerImpl* layer) | 244 static inline void updateTilePrioritiesForLayer(LayerImpl* layer) |
242 { | 245 { |
243 layer->UpdateTilePriorities(); | 246 layer->UpdateTilePriorities(); |
244 | 247 |
245 // Mask layers don't get this call, so explicitly update them so they can | 248 // Mask layers don't get this call, so explicitly update them so they can |
(...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1214 | 1217 |
1215 // At this point, we think the point does hit the touch event handler region o
n the layer, but we need to walk up | 1218 // At this point, we think the point does hit the touch event handler region o
n the layer, but we need to walk up |
1216 // the parents to ensure that the layer was not clipped in such a way that the | 1219 // the parents to ensure that the layer was not clipped in such a way that the |
1217 // hit point actually should not hit the layer. | 1220 // hit point actually should not hit the layer. |
1218 if (pointIsClippedBySurfaceOrClipRect(screenSpacePoint, layerImpl)) | 1221 if (pointIsClippedBySurfaceOrClipRect(screenSpacePoint, layerImpl)) |
1219 return false; | 1222 return false; |
1220 | 1223 |
1221 return true; | 1224 return true; |
1222 } | 1225 } |
1223 } // namespace cc | 1226 } // namespace cc |
OLD | NEW |