| 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/layers/delegated_renderer_layer_impl.h" | 5 #include "cc/layers/delegated_renderer_layer_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 if (child_id_) | 93 if (child_id_) |
| 94 return; | 94 return; |
| 95 | 95 |
| 96 ResourceProvider* resource_provider = layer_tree_impl()->resource_provider(); | 96 ResourceProvider* resource_provider = layer_tree_impl()->resource_provider(); |
| 97 child_id_ = resource_provider->CreateChild(return_callback); | 97 child_id_ = resource_provider->CreateChild(return_callback); |
| 98 own_child_id_ = true; | 98 own_child_id_ = true; |
| 99 } | 99 } |
| 100 | 100 |
| 101 void DelegatedRendererLayerImpl::SetFrameData( | 101 void DelegatedRendererLayerImpl::SetFrameData( |
| 102 const DelegatedFrameData* frame_data, | 102 const DelegatedFrameData* frame_data, |
| 103 gfx::RectF damage_in_frame) { | 103 const gfx::RectF& damage_in_frame) { |
| 104 DCHECK(child_id_) << "CreateChildIdIfNeeded must be called first."; | 104 DCHECK(child_id_) << "CreateChildIdIfNeeded must be called first."; |
| 105 DCHECK(frame_data); | 105 DCHECK(frame_data); |
| 106 DCHECK(!frame_data->render_pass_list.empty()); | 106 DCHECK(!frame_data->render_pass_list.empty()); |
| 107 // A frame with an empty root render pass is invalid. | 107 // A frame with an empty root render pass is invalid. |
| 108 DCHECK(!frame_data->render_pass_list.back()->output_rect.IsEmpty()); | 108 DCHECK(!frame_data->render_pass_list.back()->output_rect.IsEmpty()); |
| 109 | 109 |
| 110 ResourceProvider* resource_provider = layer_tree_impl()->resource_provider(); | 110 ResourceProvider* resource_provider = layer_tree_impl()->resource_provider(); |
| 111 const ResourceProvider::ResourceIdMap& resource_map = | 111 const ResourceProvider::ResourceIdMap& resource_map = |
| 112 resource_provider->GetChildToParentMap(child_id_); | 112 resource_provider->GetChildToParentMap(child_id_); |
| 113 | 113 |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 if (own_child_id_) { | 482 if (own_child_id_) { |
| 483 ResourceProvider* provider = layer_tree_impl()->resource_provider(); | 483 ResourceProvider* provider = layer_tree_impl()->resource_provider(); |
| 484 provider->DestroyChild(child_id_); | 484 provider->DestroyChild(child_id_); |
| 485 } | 485 } |
| 486 | 486 |
| 487 resources_.clear(); | 487 resources_.clear(); |
| 488 child_id_ = 0; | 488 child_id_ = 0; |
| 489 } | 489 } |
| 490 | 490 |
| 491 } // namespace cc | 491 } // namespace cc |
| OLD | NEW |