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

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

Issue 2938833002: Add SurfaceWillDraw notification (Closed)
Patch Set: correct MojoFrameSinkManager::OnSurfaceWillDraw impl Created 3 years, 6 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
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 744 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 for (const auto& surface_id : frame.metadata.referenced_surfaces) { 755 for (const auto& surface_id : frame.metadata.referenced_surfaces) {
756 if (!contained_surfaces_.count(surface_id)) { 756 if (!contained_surfaces_.count(surface_id)) {
757 result->undrawn_surfaces.insert(surface_id); 757 result->undrawn_surfaces.insert(surface_id);
758 PrewalkTree(surface_id, false, 0, result); 758 PrewalkTree(surface_id, false, 0, result);
759 } 759 }
760 } 760 }
761 761
762 CHECK(debug_weak_this.get()); 762 CHECK(debug_weak_this.get());
763 // TODO(staraz): It shouldn't need to call the callback when the damage is 763 // TODO(staraz): It shouldn't need to call the callback when the damage is
764 // from |surface| and not from |child_surfaces|. 764 // from |surface| and not from |child_surfaces|.
765 if (!damage_rect.IsEmpty()) 765 if (!damage_rect.IsEmpty()) {
766 surface->RunWillDrawCallback(damage_rect); 766 surface->RunWillDrawCallback(damage_rect);
767 manager_->SurfaceWillDraw(surface->surface_id());
danakj 2017/06/14 18:53:12 Would it be better to collect a set of surface ids
gklassen 2017/06/14 19:29:11 In the consumer we are currently contemplating it
768 }
767 769
768 CHECK(debug_weak_this.get()); 770 CHECK(debug_weak_this.get());
769 for (const auto& render_pass : frame.render_pass_list) { 771 for (const auto& render_pass : frame.render_pass_list) {
770 if (!render_pass->copy_requests.empty()) { 772 if (!render_pass->copy_requests.empty()) {
771 RenderPassId remapped_pass_id = RemapPassId(render_pass->id, surface_id); 773 RenderPassId remapped_pass_id = RemapPassId(render_pass->id, surface_id);
772 copy_request_passes_.insert(remapped_pass_id); 774 copy_request_passes_.insert(remapped_pass_id);
773 } 775 }
774 } 776 }
775 777
776 referenced_surfaces_.erase(referenced_surfaces_.find(surface->surface_id())); 778 referenced_surfaces_.erase(referenced_surfaces_.find(surface->surface_id()));
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
934 } 936 }
935 937
936 void SurfaceAggregator::SetOutputColorSpace( 938 void SurfaceAggregator::SetOutputColorSpace(
937 const gfx::ColorSpace& blending_color_space, 939 const gfx::ColorSpace& blending_color_space,
938 const gfx::ColorSpace& output_color_space) { 940 const gfx::ColorSpace& output_color_space) {
939 blending_color_space_ = blending_color_space; 941 blending_color_space_ = blending_color_space;
940 output_color_space_ = output_color_space; 942 output_color_space_ = output_color_space;
941 } 943 }
942 944
943 } // namespace cc 945 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698