| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "cc/base/math_util.h" | 9 #include "cc/base/math_util.h" |
| 10 #include "cc/layers/heads_up_display_layer_impl.h" | 10 #include "cc/layers/heads_up_display_layer_impl.h" |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 // | 276 // |
| 277 // This method is called when we want to consider how a layer contributes to | 277 // This method is called when we want to consider how a layer contributes to |
| 278 // its target RenderSurface, even if that layer owns the target RenderSurface | 278 // its target RenderSurface, even if that layer owns the target RenderSurface |
| 279 // itself. To consider how a layer's target surface contributes to the | 279 // itself. To consider how a layer's target surface contributes to the |
| 280 // ancestor surface, ExtendDamageForRenderSurface() must be called instead. | 280 // ancestor surface, ExtendDamageForRenderSurface() must be called instead. |
| 281 | 281 |
| 282 bool layer_is_new = false; | 282 bool layer_is_new = false; |
| 283 RectMapData& data = RectDataForLayer(layer->id(), &layer_is_new); | 283 RectMapData& data = RectDataForLayer(layer->id(), &layer_is_new); |
| 284 gfx::Rect old_rect_in_target_space = data.rect_; | 284 gfx::Rect old_rect_in_target_space = data.rect_; |
| 285 | 285 |
| 286 gfx::Rect rect_in_target_space = MathUtil::MapEnclosingClippedRect( | 286 gfx::Rect rect_in_target_space = layer->GetEnclosingRectInTargetSpace(); |
| 287 layer->draw_transform(), gfx::Rect(layer->content_bounds())); | |
| 288 data.Update(rect_in_target_space, mailboxId_); | 287 data.Update(rect_in_target_space, mailboxId_); |
| 289 | 288 |
| 290 gfx::RectF damage_rect = | 289 gfx::RectF damage_rect = |
| 291 gfx::UnionRects(layer->update_rect(), layer->damage_rect()); | 290 gfx::UnionRects(layer->update_rect(), layer->damage_rect()); |
| 292 | 291 |
| 293 if (layer_is_new || layer->LayerPropertyChanged()) { | 292 if (layer_is_new || layer->LayerPropertyChanged()) { |
| 294 // If a layer is new or has changed, then its entire layer rect affects the | 293 // If a layer is new or has changed, then its entire layer rect affects the |
| 295 // target surface. | 294 // target surface. |
| 296 target_damage_rect->Union(rect_in_target_space); | 295 target_damage_rect->Union(rect_in_target_space); |
| 297 | 296 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 // one in them. This means we need to redraw any pixels in the surface being | 395 // one in them. This means we need to redraw any pixels in the surface being |
| 397 // used for the blur in this layer this frame. | 396 // used for the blur in this layer this frame. |
| 398 if (layer->background_filters().HasFilterThatMovesPixels()) { | 397 if (layer->background_filters().HasFilterThatMovesPixels()) { |
| 399 ExpandDamageRectInsideRectWithFilters(target_damage_rect, | 398 ExpandDamageRectInsideRectWithFilters(target_damage_rect, |
| 400 surface_rect_in_target_space, | 399 surface_rect_in_target_space, |
| 401 layer->background_filters()); | 400 layer->background_filters()); |
| 402 } | 401 } |
| 403 } | 402 } |
| 404 | 403 |
| 405 } // namespace cc | 404 } // namespace cc |
| OLD | NEW |