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

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

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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.h ('k') | cc/surfaces/surface_factory_unittest.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_factory.h" 5 #include "cc/surfaces/surface_factory.h"
6 6
7 #include "cc/output/compositor_frame.h" 7 #include "cc/output/compositor_frame.h"
8 #include "cc/output/copy_output_request.h" 8 #include "cc/output/copy_output_request.h"
9 #include "cc/surfaces/surface.h" 9 #include "cc/surfaces/surface.h"
10 #include "cc/surfaces/surface_manager.h" 10 #include "cc/surfaces/surface_manager.h"
(...skipping 12 matching lines...) Expand all
23 } 23 }
24 DestroyAll(); 24 DestroyAll();
25 } 25 }
26 26
27 void SurfaceFactory::DestroyAll() { 27 void SurfaceFactory::DestroyAll() {
28 for (auto it = surface_map_.begin(); it != surface_map_.end(); ++it) 28 for (auto it = surface_map_.begin(); it != surface_map_.end(); ++it)
29 manager_->Destroy(surface_map_.take(it)); 29 manager_->Destroy(surface_map_.take(it));
30 surface_map_.clear(); 30 surface_map_.clear();
31 } 31 }
32 32
33 void SurfaceFactory::Create(SurfaceId surface_id, const gfx::Size& size) { 33 void SurfaceFactory::Create(SurfaceId surface_id) {
34 scoped_ptr<Surface> surface(new Surface(surface_id, size, this)); 34 scoped_ptr<Surface> surface(new Surface(surface_id, this));
35 manager_->RegisterSurface(surface.get()); 35 manager_->RegisterSurface(surface.get());
36 DCHECK(!surface_map_.count(surface_id)); 36 DCHECK(!surface_map_.count(surface_id));
37 surface_map_.add(surface_id, surface.Pass()); 37 surface_map_.add(surface_id, surface.Pass());
38 } 38 }
39 39
40 void SurfaceFactory::Destroy(SurfaceId surface_id) { 40 void SurfaceFactory::Destroy(SurfaceId surface_id) {
41 OwningSurfaceMap::iterator it = surface_map_.find(surface_id); 41 OwningSurfaceMap::iterator it = surface_map_.find(surface_id);
42 DCHECK(it != surface_map_.end()); 42 DCHECK(it != surface_map_.end());
43 DCHECK(it->second->factory().get() == this); 43 DCHECK(it->second->factory().get() == this);
44 manager_->Destroy(surface_map_.take_and_erase(it)); 44 manager_->Destroy(surface_map_.take_and_erase(it));
(...skipping 29 matching lines...) Expand all
74 74
75 void SurfaceFactory::RefResources(const TransferableResourceArray& resources) { 75 void SurfaceFactory::RefResources(const TransferableResourceArray& resources) {
76 holder_.RefResources(resources); 76 holder_.RefResources(resources);
77 } 77 }
78 78
79 void SurfaceFactory::UnrefResources(const ReturnedResourceArray& resources) { 79 void SurfaceFactory::UnrefResources(const ReturnedResourceArray& resources) {
80 holder_.UnrefResources(resources); 80 holder_.UnrefResources(resources);
81 } 81 }
82 82
83 } // namespace cc 83 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/surface_factory.h ('k') | cc/surfaces/surface_factory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698