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

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

Issue 2908783002: WIP Hittest Component.
Patch Set: change HitTestFlags to constants so we can mix and match and convert to struct naming convention 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_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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 117
118 void SurfaceManager::DestroySurface(std::unique_ptr<Surface> surface) { 118 void SurfaceManager::DestroySurface(std::unique_ptr<Surface> surface) {
119 DCHECK(thread_checker_.CalledOnValidThread()); 119 DCHECK(thread_checker_.CalledOnValidThread());
120 surface->set_destroyed(true); 120 surface->set_destroyed(true);
121 for (auto& observer : observer_list_) 121 for (auto& observer : observer_list_)
122 observer.OnSurfaceDestroyed(surface->surface_id()); 122 observer.OnSurfaceDestroyed(surface->surface_id());
123 surfaces_to_destroy_.push_back(std::move(surface)); 123 surfaces_to_destroy_.push_back(std::move(surface));
124 GarbageCollectSurfaces(); 124 GarbageCollectSurfaces();
125 } 125 }
126 126
127 void SurfaceManager::SurfaceWillDraw(const SurfaceId& surface_id) {
128 DCHECK(thread_checker_.CalledOnValidThread());
129 for (auto& observer : observer_list_)
130 observer.OnSurfaceWillDraw(surface_id);
131 }
132
127 void SurfaceManager::RequireSequence(const SurfaceId& surface_id, 133 void SurfaceManager::RequireSequence(const SurfaceId& surface_id,
128 const SurfaceSequence& sequence) { 134 const SurfaceSequence& sequence) {
129 auto* surface = GetSurfaceForId(surface_id); 135 auto* surface = GetSurfaceForId(surface_id);
130 if (!surface) { 136 if (!surface) {
131 DLOG(ERROR) << "Attempting to require callback on nonexistent surface"; 137 DLOG(ERROR) << "Attempting to require callback on nonexistent surface";
132 return; 138 return;
133 } 139 }
134 surface->AddDestructionDependency(sequence); 140 surface->AddDestructionDependency(sequence);
135 } 141 }
136 142
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 std::vector<SurfaceId> children(iter->second.begin(), iter->second.end()); 565 std::vector<SurfaceId> children(iter->second.begin(), iter->second.end());
560 std::sort(children.begin(), children.end()); 566 std::sort(children.begin(), children.end());
561 567
562 for (const SurfaceId& child_id : children) 568 for (const SurfaceId& child_id : children)
563 SurfaceReferencesToStringImpl(child_id, indent + " ", str); 569 SurfaceReferencesToStringImpl(child_id, indent + " ", str);
564 } 570 }
565 } 571 }
566 #endif // DCHECK_IS_ON() 572 #endif // DCHECK_IS_ON()
567 573
568 } // namespace cc 574 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698