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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 // Transform rect from the current target's space to the next. | 409 // Transform rect from the current target's space to the next. |
410 LayerImpl* current_target = current_state->render_target; | 410 LayerImpl* current_target = current_state->render_target; |
411 DCHECK(current_target->render_surface()); | 411 DCHECK(current_target->render_surface()); |
412 const gfx::Transform& current_draw_transform = | 412 const gfx::Transform& current_draw_transform = |
413 current_target->render_surface()->draw_transform(); | 413 current_target->render_surface()->draw_transform(); |
414 | 414 |
415 // If we have unclipped descendants, the draw transform is a translation. | 415 // If we have unclipped descendants, the draw transform is a translation. |
416 DCHECK_IMPLIES(current_target->num_unclipped_descendants(), | 416 DCHECK_IMPLIES(current_target->num_unclipped_descendants(), |
417 current_draw_transform.IsIdentityOrTranslation()); | 417 current_draw_transform.IsIdentityOrTranslation()); |
418 | 418 |
419 target_rect = gfx::ToEnclosingRect( | 419 target_rect = |
420 MathUtil::MapClippedRect(current_draw_transform, target_rect)); | 420 MathUtil::MapEnclosingClippedRect(current_draw_transform, target_rect); |
421 } | 421 } |
422 | 422 |
423 // It is an error to not reach |render_target|. If this happens, it means that | 423 // It is an error to not reach |render_target|. If this happens, it means that |
424 // either the clip parent is not an ancestor of the clip child or the surface | 424 // either the clip parent is not an ancestor of the clip child or the surface |
425 // state vector is empty, both of which should be impossible. | 425 // state vector is empty, both of which should be impossible. |
426 DCHECK(found_render_target); | 426 DCHECK(found_render_target); |
427 } | 427 } |
428 | 428 |
429 template <typename LayerType> | 429 template <typename LayerType> |
430 static inline bool LayerIsInExisting3DRenderingContext(LayerType* layer) { | 430 static inline bool LayerIsInExisting3DRenderingContext(LayerType* layer) { |
(...skipping 2399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2830 | 2830 |
2831 PropertyTrees* GetPropertyTrees(Layer* layer) { | 2831 PropertyTrees* GetPropertyTrees(Layer* layer) { |
2832 return layer->layer_tree_host()->property_trees(); | 2832 return layer->layer_tree_host()->property_trees(); |
2833 } | 2833 } |
2834 | 2834 |
2835 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { | 2835 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { |
2836 return layer->layer_tree_impl()->property_trees(); | 2836 return layer->layer_tree_impl()->property_trees(); |
2837 } | 2837 } |
2838 | 2838 |
2839 } // namespace cc | 2839 } // namespace cc |
OLD | NEW |