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

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

Issue 534843002: Convert view manager to surfaces with uploading shim in client lib (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove overzealous shutdown check in cc/surfaces, add NON_EXPORTED_BASE for windows build, saturate… Created 6 years, 3 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_factory.cc ('k') | mojo/examples/compositor_app/compositor_app.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_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 9
10 namespace cc { 10 namespace cc {
11 11
12 SurfaceManager::SurfaceManager() { 12 SurfaceManager::SurfaceManager() {
13 } 13 }
14 14
15 SurfaceManager::~SurfaceManager() { 15 SurfaceManager::~SurfaceManager() {
16 DCHECK_EQ(0u, surface_map_.size());
17 } 16 }
18 17
19 void SurfaceManager::RegisterSurface(Surface* surface) { 18 void SurfaceManager::RegisterSurface(Surface* surface) {
20 DCHECK(surface); 19 DCHECK(surface);
21 DCHECK(!surface_map_.count(surface->surface_id())); 20 DCHECK(!surface_map_.count(surface->surface_id()));
22 surface_map_[surface->surface_id()] = surface; 21 surface_map_[surface->surface_id()] = surface;
23 } 22 }
24 23
25 void SurfaceManager::DeregisterSurface(SurfaceId surface_id) { 24 void SurfaceManager::DeregisterSurface(SurfaceId surface_id) {
26 SurfaceMap::iterator it = surface_map_.find(surface_id); 25 SurfaceMap::iterator it = surface_map_.find(surface_id);
27 DCHECK(it != surface_map_.end()); 26 DCHECK(it != surface_map_.end());
28 surface_map_.erase(it); 27 surface_map_.erase(it);
29 } 28 }
30 29
31 Surface* SurfaceManager::GetSurfaceForId(SurfaceId surface_id) { 30 Surface* SurfaceManager::GetSurfaceForId(SurfaceId surface_id) {
32 SurfaceMap::iterator it = surface_map_.find(surface_id); 31 SurfaceMap::iterator it = surface_map_.find(surface_id);
33 if (it == surface_map_.end()) 32 if (it == surface_map_.end())
34 return NULL; 33 return NULL;
35 return it->second; 34 return it->second;
36 } 35 }
37 36
38 void SurfaceManager::SurfaceModified(SurfaceId surface_id) { 37 void SurfaceManager::SurfaceModified(SurfaceId surface_id) {
39 FOR_EACH_OBSERVER( 38 FOR_EACH_OBSERVER(
40 SurfaceDamageObserver, observer_list_, OnSurfaceDamaged(surface_id)); 39 SurfaceDamageObserver, observer_list_, OnSurfaceDamaged(surface_id));
41 } 40 }
42 41
43 } // namespace cc 42 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/surface_factory.cc ('k') | mojo/examples/compositor_app/compositor_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698