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

Side by Side Diff: cc/surfaces/surface_factory.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 | « no previous file | cc/surfaces/surface_manager.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"
11 #include "ui/gfx/geometry/size.h" 11 #include "ui/gfx/geometry/size.h"
12 12
13 namespace cc { 13 namespace cc {
14 SurfaceFactory::SurfaceFactory(SurfaceManager* manager, 14 SurfaceFactory::SurfaceFactory(SurfaceManager* manager,
15 SurfaceFactoryClient* client) 15 SurfaceFactoryClient* client)
16 : manager_(manager), client_(client), holder_(client) { 16 : manager_(manager), client_(client), holder_(client) {
17 } 17 }
18 18
19 SurfaceFactory::~SurfaceFactory() { 19 SurfaceFactory::~SurfaceFactory() {
20 DCHECK_EQ(0u, surface_map_.size());
21 } 20 }
22 21
23 void SurfaceFactory::Create(SurfaceId surface_id, const gfx::Size& size) { 22 void SurfaceFactory::Create(SurfaceId surface_id, const gfx::Size& size) {
24 scoped_ptr<Surface> surface(new Surface(surface_id, size, this)); 23 scoped_ptr<Surface> surface(new Surface(surface_id, size, this));
25 manager_->RegisterSurface(surface.get()); 24 manager_->RegisterSurface(surface.get());
26 DCHECK(!surface_map_.count(surface_id)); 25 DCHECK(!surface_map_.count(surface_id));
27 surface_map_.add(surface_id, surface.Pass()); 26 surface_map_.add(surface_id, surface.Pass());
28 } 27 }
29 28
30 void SurfaceFactory::Destroy(SurfaceId surface_id) { 29 void SurfaceFactory::Destroy(SurfaceId surface_id) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 63
65 void SurfaceFactory::RefResources(const TransferableResourceArray& resources) { 64 void SurfaceFactory::RefResources(const TransferableResourceArray& resources) {
66 holder_.RefResources(resources); 65 holder_.RefResources(resources);
67 } 66 }
68 67
69 void SurfaceFactory::UnrefResources(const ReturnedResourceArray& resources) { 68 void SurfaceFactory::UnrefResources(const ReturnedResourceArray& resources) {
70 holder_.UnrefResources(resources); 69 holder_.UnrefResources(resources);
71 } 70 }
72 71
73 } // namespace cc 72 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/surfaces/surface_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698