Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(389)

Side by Side Diff: cc/surfaces/surface_manager.cc

Issue 2855723002: Don't submit frames with no render passes in cc tests (Closed)
Patch Set: c Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/surfaces/surface_manager.h ('k') | cc/test/compositor_frame_helpers.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « cc/surfaces/surface_manager.h ('k') | cc/test/compositor_frame_helpers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698