OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/surfaces/surface_manager.h" | 5 #include "cc/surfaces/surface_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <queue> | 10 #include <queue> |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 children[i] = children.back(); | 575 children[i] = children.back(); |
576 children.resize(children.size() - 1); | 576 children.resize(children.size() - 1); |
577 break; | 577 break; |
578 } | 578 } |
579 } | 579 } |
580 DCHECK(found_child); | 580 DCHECK(found_child); |
581 | 581 |
582 // The SurfaceFactoryClient and hierarchy can be registered/unregistered | 582 // The SurfaceFactoryClient and hierarchy can be registered/unregistered |
583 // in either order, so empty frame_sink_source_map entries need to be | 583 // in either order, so empty frame_sink_source_map entries need to be |
584 // checked when removing either clients or relationships. | 584 // checked when removing either clients or relationships. |
585 if (!iter->second.has_children() && !clients_.count(parent_frame_sink_id)) { | 585 if (!iter->second.has_children() && !clients_.count(parent_frame_sink_id) && |
| 586 !iter->second.source) { |
586 frame_sink_source_map_.erase(iter); | 587 frame_sink_source_map_.erase(iter); |
587 return; | 588 return; |
588 } | 589 } |
589 | 590 |
590 // If the parent does not have a begin frame source, then disconnecting it | 591 // If the parent does not have a begin frame source, then disconnecting it |
591 // will not change any of its children. | 592 // will not change any of its children. |
592 BeginFrameSource* parent_source = iter->second.source; | 593 BeginFrameSource* parent_source = iter->second.source; |
593 if (!parent_source) | 594 if (!parent_source) |
594 return; | 595 return; |
595 | 596 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 std::vector<SurfaceId> children(iter->second.begin(), iter->second.end()); | 689 std::vector<SurfaceId> children(iter->second.begin(), iter->second.end()); |
689 std::sort(children.begin(), children.end()); | 690 std::sort(children.begin(), children.end()); |
690 | 691 |
691 for (const SurfaceId& child_id : children) | 692 for (const SurfaceId& child_id : children) |
692 SurfaceReferencesToStringImpl(child_id, indent + " ", str); | 693 SurfaceReferencesToStringImpl(child_id, indent + " ", str); |
693 } | 694 } |
694 } | 695 } |
695 #endif // DCHECK_IS_ON() | 696 #endif // DCHECK_IS_ON() |
696 | 697 |
697 } // namespace cc | 698 } // namespace cc |
OLD | NEW |