| 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 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 | 491 |
| 492 // Print the current line for |surface_id|. | 492 // Print the current line for |surface_id|. |
| 493 Surface* surface = GetSurfaceForId(surface_id); | 493 Surface* surface = GetSurfaceForId(surface_id); |
| 494 if (surface) { | 494 if (surface) { |
| 495 *str << surface->surface_id().ToString(); | 495 *str << surface->surface_id().ToString(); |
| 496 *str << (surface->destroyed() ? " destroyed" : " live"); | 496 *str << (surface->destroyed() ? " destroyed" : " live"); |
| 497 | 497 |
| 498 if (surface->HasPendingFrame()) { | 498 if (surface->HasPendingFrame()) { |
| 499 // This provides the surface size from the root render pass. | 499 // This provides the surface size from the root render pass. |
| 500 const CompositorFrame& frame = surface->GetPendingFrame(); | 500 const CompositorFrame& frame = surface->GetPendingFrame(); |
| 501 if (!frame.render_pass_list.empty()) { | 501 *str << " pending " |
| 502 *str << " pending " | 502 << frame.render_pass_list.back()->output_rect.size().ToString(); |
| 503 << frame.render_pass_list.back()->output_rect.size().ToString(); | |
| 504 } | |
| 505 } | 503 } |
| 506 | 504 |
| 507 if (surface->HasActiveFrame()) { | 505 if (surface->HasActiveFrame()) { |
| 508 // This provides the surface size from the root render pass. | 506 // This provides the surface size from the root render pass. |
| 509 const CompositorFrame& frame = surface->GetActiveFrame(); | 507 const CompositorFrame& frame = surface->GetActiveFrame(); |
| 510 if (!frame.render_pass_list.empty()) { | 508 *str << " active " |
| 511 *str << " active " | 509 << frame.render_pass_list.back()->output_rect.size().ToString(); |
| 512 << frame.render_pass_list.back()->output_rect.size().ToString(); | |
| 513 } | |
| 514 } | 510 } |
| 515 } else { | 511 } else { |
| 516 *str << surface_id; | 512 *str << surface_id; |
| 517 } | 513 } |
| 518 *str << "\n"; | 514 *str << "\n"; |
| 519 | 515 |
| 520 // If the current surface has references to children, sort children and print | 516 // If the current surface has references to children, sort children and print |
| 521 // references for each child. | 517 // references for each child. |
| 522 auto iter = parent_to_child_refs_.find(surface_id); | 518 auto iter = parent_to_child_refs_.find(surface_id); |
| 523 if (iter != parent_to_child_refs_.end()) { | 519 if (iter != parent_to_child_refs_.end()) { |
| 524 std::vector<SurfaceId> children(iter->second.begin(), iter->second.end()); | 520 std::vector<SurfaceId> children(iter->second.begin(), iter->second.end()); |
| 525 std::sort(children.begin(), children.end()); | 521 std::sort(children.begin(), children.end()); |
| 526 | 522 |
| 527 for (const SurfaceId& child_id : children) | 523 for (const SurfaceId& child_id : children) |
| 528 SurfaceReferencesToStringImpl(child_id, indent + " ", str); | 524 SurfaceReferencesToStringImpl(child_id, indent + " ", str); |
| 529 } | 525 } |
| 530 } | 526 } |
| 531 #endif // DCHECK_IS_ON() | 527 #endif // DCHECK_IS_ON() |
| 532 | 528 |
| 533 } // namespace cc | 529 } // namespace cc |
| OLD | NEW |