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

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

Issue 885443002: Roll Chrome into Mojo. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Rebase to ToT mojo Created 5 years, 10 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_damage_observer.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_aggregator.h" 5 #include "cc/surfaces/surface_aggregator.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 426
427 void SurfaceAggregator::RemoveUnreferencedChildren() { 427 void SurfaceAggregator::RemoveUnreferencedChildren() {
428 for (const auto& surface : previous_contained_surfaces_) { 428 for (const auto& surface : previous_contained_surfaces_) {
429 if (!contained_surfaces_.count(surface.first)) { 429 if (!contained_surfaces_.count(surface.first)) {
430 SurfaceToResourceChildIdMap::iterator it = 430 SurfaceToResourceChildIdMap::iterator it =
431 surface_id_to_resource_child_id_.find(surface.first); 431 surface_id_to_resource_child_id_.find(surface.first);
432 if (it != surface_id_to_resource_child_id_.end()) { 432 if (it != surface_id_to_resource_child_id_.end()) {
433 provider_->DestroyChild(it->second); 433 provider_->DestroyChild(it->second);
434 surface_id_to_resource_child_id_.erase(it); 434 surface_id_to_resource_child_id_.erase(it);
435 } 435 }
436
437 Surface* surface_ptr = manager_->GetSurfaceForId(surface.first);
438 if (surface_ptr)
439 surface_ptr->RunDrawCallbacks(SurfaceDrawStatus::DRAW_SKIPPED);
436 } 440 }
437 } 441 }
438 } 442 }
439 443
440 scoped_ptr<CompositorFrame> SurfaceAggregator::Aggregate(SurfaceId surface_id) { 444 scoped_ptr<CompositorFrame> SurfaceAggregator::Aggregate(SurfaceId surface_id) {
441 Surface* surface = manager_->GetSurfaceForId(surface_id); 445 Surface* surface = manager_->GetSurfaceForId(surface_id);
442 DCHECK(surface); 446 DCHECK(surface);
443 contained_surfaces_[surface_id] = surface->frame_index(); 447 contained_surfaces_[surface_id] = surface->frame_index();
444 const CompositorFrame* root_surface_frame = surface->GetEligibleFrame(); 448 const CompositorFrame* root_surface_frame = surface->GetEligibleFrame();
445 if (!root_surface_frame) 449 if (!root_surface_frame)
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 void SurfaceAggregator::ReleaseResources(SurfaceId surface_id) { 490 void SurfaceAggregator::ReleaseResources(SurfaceId surface_id) {
487 SurfaceToResourceChildIdMap::iterator it = 491 SurfaceToResourceChildIdMap::iterator it =
488 surface_id_to_resource_child_id_.find(surface_id); 492 surface_id_to_resource_child_id_.find(surface_id);
489 if (it != surface_id_to_resource_child_id_.end()) { 493 if (it != surface_id_to_resource_child_id_.end()) {
490 provider_->DestroyChild(it->second); 494 provider_->DestroyChild(it->second);
491 surface_id_to_resource_child_id_.erase(it); 495 surface_id_to_resource_child_id_.erase(it);
492 } 496 }
493 } 497 }
494 498
495 } // namespace cc 499 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/surface.cc ('k') | cc/surfaces/surface_damage_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698