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

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

Issue 2514033002: Introducing SurfaceReferenceFactory (Closed)
Patch Set: rebase Created 4 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
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 13 matching lines...) Expand all
24 const FrameSinkSourceMapping& other) = default; 24 const FrameSinkSourceMapping& other) = default;
25 25
26 SurfaceManager::FrameSinkSourceMapping::~FrameSinkSourceMapping() { 26 SurfaceManager::FrameSinkSourceMapping::~FrameSinkSourceMapping() {
27 DCHECK(is_empty()) << "client: " << client 27 DCHECK(is_empty()) << "client: " << client
28 << ", children: " << children.size(); 28 << ", children: " << children.size();
29 } 29 }
30 30
31 SurfaceManager::SurfaceManager(LifetimeType lifetime_type) 31 SurfaceManager::SurfaceManager(LifetimeType lifetime_type)
32 : lifetime_type_(lifetime_type), 32 : lifetime_type_(lifetime_type),
33 root_surface_id_(FrameSinkId(0u, 0u), 33 root_surface_id_(FrameSinkId(0u, 0u),
34 LocalFrameId(1u, base::UnguessableToken::Create())) { 34 LocalFrameId(1u, base::UnguessableToken::Create())),
35 reference_factory_(new DirectSurfaceReferenceFactory(this)) {
35 thread_checker_.DetachFromThread(); 36 thread_checker_.DetachFromThread();
36 } 37 }
37 38
38 SurfaceManager::~SurfaceManager() { 39 SurfaceManager::~SurfaceManager() {
39 DCHECK(thread_checker_.CalledOnValidThread()); 40 DCHECK(thread_checker_.CalledOnValidThread());
40 for (SurfaceDestroyList::iterator it = surfaces_to_destroy_.begin(); 41 for (SurfaceDestroyList::iterator it = surfaces_to_destroy_.begin();
41 it != surfaces_to_destroy_.end(); 42 it != surfaces_to_destroy_.end();
42 ++it) { 43 ++it) {
43 DeregisterSurface((*it)->surface_id()); 44 DeregisterSurface((*it)->surface_id());
44 } 45 }
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 494
494 void SurfaceManager::SurfaceCreated(const SurfaceId& surface_id, 495 void SurfaceManager::SurfaceCreated(const SurfaceId& surface_id,
495 const gfx::Size& frame_size, 496 const gfx::Size& frame_size,
496 float device_scale_factor) { 497 float device_scale_factor) {
497 CHECK(thread_checker_.CalledOnValidThread()); 498 CHECK(thread_checker_.CalledOnValidThread());
498 for (auto& observer : observer_list_) 499 for (auto& observer : observer_list_)
499 observer.OnSurfaceCreated(surface_id, frame_size, device_scale_factor); 500 observer.OnSurfaceCreated(surface_id, frame_size, device_scale_factor);
500 } 501 }
501 502
502 } // namespace cc 503 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698