OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |