| 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 <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "cc/surfaces/surface.h" | 13 #include "cc/surfaces/surface.h" |
| 14 #include "cc/surfaces/surface_factory_client.h" | 14 #include "cc/surfaces/surface_factory_client.h" |
| 15 #include "cc/surfaces/surface_id_allocator.h" | 15 #include "cc/surfaces/surface_id_allocator.h" |
| 16 | 16 |
| 17 namespace cc { | 17 namespace cc { |
| 18 | 18 |
| 19 const SurfaceId SurfaceManager::kRootSurfaceId( | 19 const SurfaceId SurfaceManager::kRootSurfaceId(FrameSinkId(0u, 0u), |
| 20 FrameSinkId(0u, 0u), | 20 LocalFrameId(0u, 0u)); |
| 21 LocalFrameId(0u, base::UnguessableToken::Create())); | |
| 22 | 21 |
| 23 SurfaceManager::FrameSinkSourceMapping::FrameSinkSourceMapping() | 22 SurfaceManager::FrameSinkSourceMapping::FrameSinkSourceMapping() |
| 24 : client(nullptr), source(nullptr) {} | 23 : client(nullptr), source(nullptr) {} |
| 25 | 24 |
| 26 SurfaceManager::FrameSinkSourceMapping::FrameSinkSourceMapping( | 25 SurfaceManager::FrameSinkSourceMapping::FrameSinkSourceMapping( |
| 27 const FrameSinkSourceMapping& other) = default; | 26 const FrameSinkSourceMapping& other) = default; |
| 28 | 27 |
| 29 SurfaceManager::FrameSinkSourceMapping::~FrameSinkSourceMapping() { | 28 SurfaceManager::FrameSinkSourceMapping::~FrameSinkSourceMapping() { |
| 30 DCHECK(is_empty()) << "client: " << client | 29 DCHECK(is_empty()) << "client: " << client |
| 31 << ", children: " << children.size(); | 30 << ", children: " << children.size(); |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 | 439 |
| 441 void SurfaceManager::SurfaceCreated(const SurfaceId& surface_id, | 440 void SurfaceManager::SurfaceCreated(const SurfaceId& surface_id, |
| 442 const gfx::Size& frame_size, | 441 const gfx::Size& frame_size, |
| 443 float device_scale_factor) { | 442 float device_scale_factor) { |
| 444 CHECK(thread_checker_.CalledOnValidThread()); | 443 CHECK(thread_checker_.CalledOnValidThread()); |
| 445 for (auto& observer : observer_list_) | 444 for (auto& observer : observer_list_) |
| 446 observer.OnSurfaceCreated(surface_id, frame_size, device_scale_factor); | 445 observer.OnSurfaceCreated(surface_id, frame_size, device_scale_factor); |
| 447 } | 446 } |
| 448 | 447 |
| 449 } // namespace cc | 448 } // namespace cc |
| OLD | NEW |