| 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/trees/layer_tree_host_common.h" | 5 #include "cc/trees/layer_tree_host_common.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 break; | 295 break; |
| 296 } | 296 } |
| 297 | 297 |
| 298 // Transform rect from the current target's space to the next. | 298 // Transform rect from the current target's space to the next. |
| 299 LayerType* current_target = current_state->render_target; | 299 LayerType* current_target = current_state->render_target; |
| 300 DCHECK(current_target->render_surface()); | 300 DCHECK(current_target->render_surface()); |
| 301 const gfx::Transform& current_draw_transform = | 301 const gfx::Transform& current_draw_transform = |
| 302 current_target->render_surface()->draw_transform(); | 302 current_target->render_surface()->draw_transform(); |
| 303 | 303 |
| 304 // If we have unclipped descendants, the draw transform is a translation. | 304 // If we have unclipped descendants, the draw transform is a translation. |
| 305 DCHECK_IMPLIES(current_target->num_unclipped_descendants(), | 305 DCHECK(!current_target->num_unclipped_descendants() || |
| 306 current_draw_transform.IsIdentityOrTranslation()); | 306 current_draw_transform.IsIdentityOrTranslation()); |
| 307 | 307 |
| 308 target_rect = gfx::ToEnclosingRect( | 308 target_rect = gfx::ToEnclosingRect( |
| 309 MathUtil::MapClippedRect(current_draw_transform, target_rect)); | 309 MathUtil::MapClippedRect(current_draw_transform, target_rect)); |
| 310 } | 310 } |
| 311 | 311 |
| 312 // It is an error to not reach |render_target|. If this happens, it means that | 312 // It is an error to not reach |render_target|. If this happens, it means that |
| 313 // either the clip parent is not an ancestor of the clip child or the surface | 313 // either the clip parent is not an ancestor of the clip child or the surface |
| 314 // state vector is empty, both of which should be impossible. | 314 // state vector is empty, both of which should be impossible. |
| 315 DCHECK(found_render_target); | 315 DCHECK(found_render_target); |
| 316 } | 316 } |
| (...skipping 2319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2636 | 2636 |
| 2637 PropertyTrees* GetPropertyTrees(Layer* layer) { | 2637 PropertyTrees* GetPropertyTrees(Layer* layer) { |
| 2638 return layer->layer_tree_host()->property_trees(); | 2638 return layer->layer_tree_host()->property_trees(); |
| 2639 } | 2639 } |
| 2640 | 2640 |
| 2641 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { | 2641 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { |
| 2642 return layer->layer_tree_impl()->property_trees(); | 2642 return layer->layer_tree_impl()->property_trees(); |
| 2643 } | 2643 } |
| 2644 | 2644 |
| 2645 } // namespace cc | 2645 } // namespace cc |
| OLD | NEW |