Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/delegated_renderer_layer_impl.h" | 5 #include "cc/delegated_renderer_layer_impl.h" |
| 6 | 6 |
| 7 #include "cc/append_quads_data.h" | 7 #include "cc/append_quads_data.h" |
| 8 #include "cc/delegated_frame_data.h" | 8 #include "cc/delegated_frame_data.h" |
| 9 #include "cc/layer_tree_impl.h" | 9 #include "cc/layer_tree_impl.h" |
| 10 #include "cc/math_util.h" | 10 #include "cc/math_util.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 // Display size is already set so we can compute what the damage rect | 45 // Display size is already set so we can compute what the damage rect |
| 46 // will be in layer space. | 46 // will be in layer space. |
| 47 RenderPass* new_root_pass = frame_data->render_pass_list.empty() ? | 47 RenderPass* new_root_pass = frame_data->render_pass_list.empty() ? |
| 48 NULL : frame_data->render_pass_list.back(); | 48 NULL : frame_data->render_pass_list.back(); |
| 49 bool new_frame_is_empty = !new_root_pass; | 49 bool new_frame_is_empty = !new_root_pass; |
| 50 | 50 |
| 51 RenderPass* old_root_pass = render_passes_in_draw_order_.empty() ? | 51 RenderPass* old_root_pass = render_passes_in_draw_order_.empty() ? |
| 52 NULL : render_passes_in_draw_order_.back(); | 52 NULL : render_passes_in_draw_order_.back(); |
| 53 bool old_frame_is_empty = !old_root_pass; | 53 bool old_frame_is_empty = !old_root_pass; |
| 54 | 54 |
| 55 gfx::RectF damage_in_layer; | 55 gfx::RectF damage_in_layer; |
|
piman
2013/02/27 20:51:03
nit: you can now move this and the setUpdateRect i
danakj
2013/02/27 20:53:45
Thanks! I've already uploaded another version with
| |
| 56 if (new_frame_is_empty) { | 56 if (!new_frame_is_empty) { |
| 57 if (!old_frame_is_empty) | |
| 58 damage_in_layer = gfx::Rect(bounds()); | |
| 59 } else { | |
| 60 DCHECK(!new_root_pass->output_rect.IsEmpty()); | 57 DCHECK(!new_root_pass->output_rect.IsEmpty()); |
| 61 damage_in_layer = MathUtil::mapClippedRect( | 58 damage_in_layer = MathUtil::mapClippedRect( |
| 62 DelegatedFrameToLayerSpaceTransform(new_root_pass->output_rect.size()), | 59 DelegatedFrameToLayerSpaceTransform(new_root_pass->output_rect.size()), |
| 63 damage_in_frame); | 60 damage_in_frame); |
| 64 } | 61 } |
| 65 setUpdateRect(gfx::UnionRects(updateRect(), damage_in_layer)); | 62 setUpdateRect(gfx::UnionRects(updateRect(), damage_in_layer)); |
| 66 | 63 |
| 67 // TODO(danakj): Convert the resource ids the render passes and return data | 64 // TODO(danakj): Convert the resource ids the render passes and return data |
| 68 // for a frame ack. | 65 // for a frame ack. |
| 69 SetRenderPasses(frame_data->render_pass_list); | 66 SetRenderPasses(frame_data->render_pass_list); |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 287 void DelegatedRendererLayerImpl::ClearChildId() { | 284 void DelegatedRendererLayerImpl::ClearChildId() { |
| 288 if (!child_id_) | 285 if (!child_id_) |
| 289 return; | 286 return; |
| 290 | 287 |
| 291 ResourceProvider* resource_provider = layerTreeImpl()->resource_provider(); | 288 ResourceProvider* resource_provider = layerTreeImpl()->resource_provider(); |
| 292 resource_provider->destroyChild(child_id_); | 289 resource_provider->destroyChild(child_id_); |
| 293 child_id_ = 0; | 290 child_id_ = 0; |
| 294 } | 291 } |
| 295 | 292 |
| 296 } // namespace cc | 293 } // namespace cc |
| OLD | NEW |