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/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 | 385 |
386 // Nothing is visible if the layer bounds are empty. | 386 // Nothing is visible if the layer bounds are empty. |
387 if (!layer->DrawsContent() || layer->content_bounds().IsEmpty() || | 387 if (!layer->DrawsContent() || layer->content_bounds().IsEmpty() || |
388 layer->drawable_content_rect().IsEmpty()) | 388 layer->drawable_content_rect().IsEmpty()) |
389 return gfx::Rect(); | 389 return gfx::Rect(); |
390 | 390 |
391 // Compute visible bounds in target surface space. | 391 // Compute visible bounds in target surface space. |
392 gfx::Rect visible_rect_in_target_surface_space = | 392 gfx::Rect visible_rect_in_target_surface_space = |
393 layer->drawable_content_rect(); | 393 layer->drawable_content_rect(); |
394 | 394 |
395 if (!layer->render_target()->render_surface()->clip_rect().IsEmpty()) { | 395 if (layer->render_target()->render_surface()->is_clipped()) { |
396 // The |layer| L has a target T which owns a surface Ts. The surface Ts | 396 // The |layer| L has a target T which owns a surface Ts. The surface Ts |
397 // has a target TsT. | 397 // has a target TsT. |
398 // | 398 // |
399 // In this case the target surface Ts does clip the layer L that contributes | 399 // In this case the target surface Ts does clip the layer L that contributes |
400 // to it. So, we have to convert the clip rect of Ts from the target space | 400 // to it. So, we have to convert the clip rect of Ts from the target space |
401 // of Ts (that is the space of TsT), to the current render target's space | 401 // of Ts (that is the space of TsT), to the current render target's space |
402 // (that is the space of T). This conversion is done outside this function | 402 // (that is the space of T). This conversion is done outside this function |
403 // so that it can be cached instead of computing it redundantly for every | 403 // so that it can be cached instead of computing it redundantly for every |
404 // layer. | 404 // layer. |
405 visible_rect_in_target_surface_space.Intersect( | 405 visible_rect_in_target_surface_space.Intersect( |
(...skipping 2043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2449 inputs->current_render_surface_layer_list_id); | 2449 inputs->current_render_surface_layer_list_id); |
2450 | 2450 |
2451 // The dummy layer list should not have been used. | 2451 // The dummy layer list should not have been used. |
2452 DCHECK_EQ(0u, dummy_layer_list.size()); | 2452 DCHECK_EQ(0u, dummy_layer_list.size()); |
2453 // A root layer render_surface should always exist after | 2453 // A root layer render_surface should always exist after |
2454 // CalculateDrawProperties. | 2454 // CalculateDrawProperties. |
2455 DCHECK(inputs->root_layer->render_surface()); | 2455 DCHECK(inputs->root_layer->render_surface()); |
2456 } | 2456 } |
2457 | 2457 |
2458 } // namespace cc | 2458 } // namespace cc |
OLD | NEW |