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

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

Issue 666163006: Allow layers to signal that additional sequences are needed before surface destruction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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_manager.h" 5 #include "cc/surfaces/surface_manager.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "cc/surfaces/surface.h" 8 #include "cc/surfaces/surface.h"
9 #include "cc/surfaces/surface_id_allocator.h" 9 #include "cc/surfaces/surface_id_allocator.h"
10 10
(...skipping 27 matching lines...) Expand all
38 surface_map_.erase(it); 38 surface_map_.erase(it);
39 } 39 }
40 40
41 void SurfaceManager::DestroyOnSequence( 41 void SurfaceManager::DestroyOnSequence(
42 scoped_ptr<Surface> surface, 42 scoped_ptr<Surface> surface,
43 const std::set<SurfaceSequence>& dependency_set) { 43 const std::set<SurfaceSequence>& dependency_set) {
44 surfaces_to_destroy_.push_back(make_pair(surface.release(), dependency_set)); 44 surfaces_to_destroy_.push_back(make_pair(surface.release(), dependency_set));
45 SearchForSatisfaction(); 45 SearchForSatisfaction();
46 } 46 }
47 47
48 void SurfaceManager::DidSatisfySequences(SurfaceId id, 48 void SurfaceManager::DidSatisfySequences(uint32_t id_namespace,
49 std::vector<uint32_t>* sequence) { 49 std::vector<uint32_t>* sequence) {
50 for (std::vector<uint32_t>::iterator it = sequence->begin(); 50 for (std::vector<uint32_t>::iterator it = sequence->begin();
51 it != sequence->end(); 51 it != sequence->end();
52 ++it) { 52 ++it) {
53 satisfied_sequences_.insert( 53 satisfied_sequences_.insert(SurfaceSequence(id_namespace, *it));
54 SurfaceSequence(SurfaceIdAllocator::NamespaceForId(id), *it));
55 } 54 }
56 sequence->clear(); 55 sequence->clear();
57 SearchForSatisfaction(); 56 SearchForSatisfaction();
58 } 57 }
59 58
60 void SurfaceManager::SearchForSatisfaction() { 59 void SurfaceManager::SearchForSatisfaction() {
61 for (SurfaceDestroyList::iterator dest_it = surfaces_to_destroy_.begin(); 60 for (SurfaceDestroyList::iterator dest_it = surfaces_to_destroy_.begin();
62 dest_it != surfaces_to_destroy_.end();) { 61 dest_it != surfaces_to_destroy_.end();) {
63 std::set<SurfaceSequence>& dependency_set = dest_it->second; 62 std::set<SurfaceSequence>& dependency_set = dest_it->second;
64 63
(...skipping 26 matching lines...) Expand all
91 return it->second; 90 return it->second;
92 } 91 }
93 92
94 void SurfaceManager::SurfaceModified(SurfaceId surface_id) { 93 void SurfaceManager::SurfaceModified(SurfaceId surface_id) {
95 DCHECK(thread_checker_.CalledOnValidThread()); 94 DCHECK(thread_checker_.CalledOnValidThread());
96 FOR_EACH_OBSERVER( 95 FOR_EACH_OBSERVER(
97 SurfaceDamageObserver, observer_list_, OnSurfaceDamaged(surface_id)); 96 SurfaceDamageObserver, observer_list_, OnSurfaceDamaged(surface_id));
98 } 97 }
99 98
100 } // namespace cc 99 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698