| 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/damage_tracker.h" | 5 #include "cc/trees/damage_tracker.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 render_surface->damage_tracker()->current_damage_rect(); | 383 render_surface->damage_tracker()->current_damage_rect(); |
| 384 | 384 |
| 385 // If there was damage, transform it to target space, and possibly | 385 // If there was damage, transform it to target space, and possibly |
| 386 // contribute its reflection if needed. | 386 // contribute its reflection if needed. |
| 387 if (!damage_rect_in_local_space.IsEmpty()) { | 387 if (!damage_rect_in_local_space.IsEmpty()) { |
| 388 const gfx::Transform& draw_transform = render_surface->draw_transform(); | 388 const gfx::Transform& draw_transform = render_surface->draw_transform(); |
| 389 gfx::Rect damage_rect_in_target_space = MathUtil::MapEnclosingClippedRect( | 389 gfx::Rect damage_rect_in_target_space = MathUtil::MapEnclosingClippedRect( |
| 390 draw_transform, damage_rect_in_local_space); | 390 draw_transform, damage_rect_in_local_space); |
| 391 target_damage_rect->Union(damage_rect_in_target_space); | 391 target_damage_rect->Union(damage_rect_in_target_space); |
| 392 | 392 |
| 393 if (layer->replica_layer()) { | 393 if (render_surface->HasReplica()) { |
| 394 const gfx::Transform& replica_draw_transform = | 394 const gfx::Transform& replica_draw_transform = |
| 395 render_surface->replica_draw_transform(); | 395 render_surface->replica_draw_transform(); |
| 396 target_damage_rect->Union(MathUtil::MapEnclosingClippedRect( | 396 target_damage_rect->Union(MathUtil::MapEnclosingClippedRect( |
| 397 replica_draw_transform, damage_rect_in_local_space)); | 397 replica_draw_transform, damage_rect_in_local_space)); |
| 398 } | 398 } |
| 399 } | 399 } |
| 400 } | 400 } |
| 401 | 401 |
| 402 // If there was damage on the replica's mask, then the target surface receives | 402 // If there was damage on the replica's mask, then the target surface receives |
| 403 // that damage as well. | 403 // that damage as well. |
| 404 if (layer->replica_layer() && layer->replica_layer()->mask_layer()) { | 404 if (render_surface->HasReplicaMask()) { |
| 405 LayerImpl* replica_mask_layer = layer->replica_layer()->mask_layer(); | 405 LayerImpl* replica_mask_layer = render_surface->ReplicaMaskLayer(); |
| 406 | 406 |
| 407 bool replica_is_new = false; | 407 bool replica_is_new = false; |
| 408 LayerRectMapData& data = | 408 LayerRectMapData& data = |
| 409 RectDataForLayer(replica_mask_layer->id(), &replica_is_new); | 409 RectDataForLayer(replica_mask_layer->id(), &replica_is_new); |
| 410 | 410 |
| 411 const gfx::Transform& replica_draw_transform = | 411 const gfx::Transform& replica_draw_transform = |
| 412 render_surface->replica_draw_transform(); | 412 render_surface->replica_draw_transform(); |
| 413 gfx::Rect replica_mask_layer_rect = MathUtil::MapEnclosingClippedRect( | 413 gfx::Rect replica_mask_layer_rect = MathUtil::MapEnclosingClippedRect( |
| 414 replica_draw_transform, gfx::Rect(replica_mask_layer->bounds())); | 414 replica_draw_transform, gfx::Rect(replica_mask_layer->bounds())); |
| 415 data.Update(replica_mask_layer_rect, mailboxId_); | 415 data.Update(replica_mask_layer_rect, mailboxId_); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 429 // one in them. This means we need to redraw any pixels in the surface being | 429 // one in them. This means we need to redraw any pixels in the surface being |
| 430 // used for the blur in this layer this frame. | 430 // used for the blur in this layer this frame. |
| 431 if (layer->background_filters().HasFilterThatMovesPixels()) { | 431 if (layer->background_filters().HasFilterThatMovesPixels()) { |
| 432 ExpandDamageRectInsideRectWithFilters(target_damage_rect, | 432 ExpandDamageRectInsideRectWithFilters(target_damage_rect, |
| 433 surface_rect_in_target_space, | 433 surface_rect_in_target_space, |
| 434 layer->background_filters()); | 434 layer->background_filters()); |
| 435 } | 435 } |
| 436 } | 436 } |
| 437 | 437 |
| 438 } // namespace cc | 438 } // namespace cc |
| OLD | NEW |