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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 break; | 408 break; |
409 } | 409 } |
410 | 410 |
411 // Transform rect from the current target's space to the next. | 411 // Transform rect from the current target's space to the next. |
412 LayerImpl* current_target = current_state->render_target; | 412 LayerImpl* current_target = current_state->render_target; |
413 DCHECK(current_target->render_surface()); | 413 DCHECK(current_target->render_surface()); |
414 const gfx::Transform& current_draw_transform = | 414 const gfx::Transform& current_draw_transform = |
415 current_target->render_surface()->draw_transform(); | 415 current_target->render_surface()->draw_transform(); |
416 | 416 |
417 // If we have unclipped descendants, the draw transform is a translation. | 417 // If we have unclipped descendants, the draw transform is a translation. |
418 DCHECK_IMPLIES(current_target->num_unclipped_descendants(), | 418 DCHECK(!current_target->num_unclipped_descendants() || |
419 current_draw_transform.IsIdentityOrTranslation()); | 419 current_draw_transform.IsIdentityOrTranslation()); |
420 | 420 |
421 target_rect = | 421 target_rect = |
422 MathUtil::MapEnclosingClippedRect(current_draw_transform, target_rect); | 422 MathUtil::MapEnclosingClippedRect(current_draw_transform, target_rect); |
423 } | 423 } |
424 | 424 |
425 // It is an error to not reach |render_target|. If this happens, it means that | 425 // It is an error to not reach |render_target|. If this happens, it means that |
426 // either the clip parent is not an ancestor of the clip child or the surface | 426 // either the clip parent is not an ancestor of the clip child or the surface |
427 // state vector is empty, both of which should be impossible. | 427 // state vector is empty, both of which should be impossible. |
428 DCHECK(found_render_target); | 428 DCHECK(found_render_target); |
429 } | 429 } |
(...skipping 2347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2777 | 2777 |
2778 PropertyTrees* GetPropertyTrees(Layer* layer) { | 2778 PropertyTrees* GetPropertyTrees(Layer* layer) { |
2779 return layer->layer_tree_host()->property_trees(); | 2779 return layer->layer_tree_host()->property_trees(); |
2780 } | 2780 } |
2781 | 2781 |
2782 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { | 2782 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { |
2783 return layer->layer_tree_impl()->property_trees(); | 2783 return layer->layer_tree_impl()->property_trees(); |
2784 } | 2784 } |
2785 | 2785 |
2786 } // namespace cc | 2786 } // namespace cc |
OLD | NEW |