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

Side by Side Diff: cc/surfaces/surface_aggregator.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.cc ('k') | cc/surfaces/surface_aggregator_unittest.cc » ('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_aggregator.h" 5 #include "cc/surfaces/surface_aggregator.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <map> 9 #include <map>
10 10
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 std::vector<ResourceId> referenced_resources; 618 std::vector<ResourceId> referenced_resources;
619 size_t reserve_size = frame.resource_list.size(); 619 size_t reserve_size = frame.resource_list.size();
620 referenced_resources.reserve(reserve_size); 620 referenced_resources.reserve(reserve_size);
621 621
622 bool invalid_frame = false; 622 bool invalid_frame = false;
623 ResourceProvider::ResourceIdMap empty_map; 623 ResourceProvider::ResourceIdMap empty_map;
624 const ResourceProvider::ResourceIdMap& child_to_parent_map = 624 const ResourceProvider::ResourceIdMap& child_to_parent_map =
625 provider_ ? provider_->GetChildToParentMap(child_id) : empty_map; 625 provider_ ? provider_->GetChildToParentMap(child_id) : empty_map;
626 626
627 CHECK(debug_weak_this.get()); 627 CHECK(debug_weak_this.get());
628 if (!frame.render_pass_list.empty()) { 628 int remapped_pass_id =
629 int remapped_pass_id = 629 RemapPassId(frame.render_pass_list.back()->id, surface_id);
630 RemapPassId(frame.render_pass_list.back()->id, surface_id); 630 if (in_moved_pixel_surface)
631 if (in_moved_pixel_surface) 631 moved_pixel_passes_.insert(remapped_pass_id);
632 moved_pixel_passes_.insert(remapped_pass_id); 632 if (parent_pass_id)
633 if (parent_pass_id) 633 render_pass_dependencies_[parent_pass_id].insert(remapped_pass_id);
634 render_pass_dependencies_[parent_pass_id].insert(remapped_pass_id);
635 }
636 634
637 struct SurfaceInfo { 635 struct SurfaceInfo {
638 SurfaceInfo(const SurfaceId& id, 636 SurfaceInfo(const SurfaceId& id,
639 bool has_moved_pixels, 637 bool has_moved_pixels,
640 int parent_pass_id, 638 int parent_pass_id,
641 const gfx::Transform& target_to_surface_transform) 639 const gfx::Transform& target_to_surface_transform)
642 : id(id), 640 : id(id),
643 has_moved_pixels(has_moved_pixels), 641 has_moved_pixels(has_moved_pixels),
644 parent_pass_id(parent_pass_id), 642 parent_pass_id(parent_pass_id),
645 target_to_surface_transform(target_to_surface_transform) {} 643 target_to_surface_transform(target_to_surface_transform) {}
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 valid_surfaces_.insert(surface->surface_id()); 713 valid_surfaces_.insert(surface->surface_id());
716 714
717 ResourceIdSet resource_set(std::move(referenced_resources), 715 ResourceIdSet resource_set(std::move(referenced_resources),
718 base::KEEP_FIRST_OF_DUPES); 716 base::KEEP_FIRST_OF_DUPES);
719 if (provider_) 717 if (provider_)
720 provider_->DeclareUsedResourcesFromChild(child_id, resource_set); 718 provider_->DeclareUsedResourcesFromChild(child_id, resource_set);
721 CHECK(debug_weak_this.get()); 719 CHECK(debug_weak_this.get());
722 720
723 gfx::Rect damage_rect; 721 gfx::Rect damage_rect;
724 gfx::Rect full_damage; 722 gfx::Rect full_damage;
725 if (!frame.render_pass_list.empty()) { 723 RenderPass* last_pass = frame.render_pass_list.back().get();
726 RenderPass* last_pass = frame.render_pass_list.back().get(); 724 full_damage = last_pass->output_rect;
727 full_damage = last_pass->output_rect; 725 damage_rect =
728 damage_rect = 726 DamageRectForSurface(surface, *last_pass, last_pass->output_rect);
729 DamageRectForSurface(surface, *last_pass, last_pass->output_rect);
730 }
731 727
732 // Avoid infinite recursion by adding current surface to 728 // Avoid infinite recursion by adding current surface to
733 // referenced_surfaces_. 729 // referenced_surfaces_.
734 referenced_surfaces_.insert(surface->surface_id()); 730 referenced_surfaces_.insert(surface->surface_id());
735 for (const auto& surface_info : child_surfaces) { 731 for (const auto& surface_info : child_surfaces) {
736 gfx::Rect surface_damage = 732 gfx::Rect surface_damage =
737 PrewalkTree(surface_info.id, surface_info.has_moved_pixels, 733 PrewalkTree(surface_info.id, surface_info.has_moved_pixels,
738 surface_info.parent_pass_id, result); 734 surface_info.parent_pass_id, result);
739 if (surface_damage.IsEmpty()) 735 if (surface_damage.IsEmpty())
740 continue; 736 continue;
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
931 } 927 }
932 928
933 void SurfaceAggregator::SetOutputColorSpace( 929 void SurfaceAggregator::SetOutputColorSpace(
934 const gfx::ColorSpace& blending_color_space, 930 const gfx::ColorSpace& blending_color_space,
935 const gfx::ColorSpace& output_color_space) { 931 const gfx::ColorSpace& output_color_space) {
936 blending_color_space_ = blending_color_space; 932 blending_color_space_ = blending_color_space;
937 output_color_space_ = output_color_space; 933 output_color_space_ = output_color_space;
938 } 934 }
939 935
940 } // namespace cc 936 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/surface.cc ('k') | cc/surfaces/surface_aggregator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698