Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_VIEW_MANAGER_SURFACES_SURFACES_STATE_H_ | |
| 6 #define COMPONENTS_VIEW_MANAGER_SURFACES_SURFACES_STATE_H_ | |
| 7 | |
| 8 #include "base/memory/ref_counted.h" | |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "cc/surfaces/surface_manager.h" | |
| 11 #include "components/view_manager/surfaces/surfaces_scheduler.h" | |
| 12 | |
| 13 namespace cc { | |
| 14 class SurfaceManager; | |
| 15 } // namespace cc | |
| 16 | |
| 17 namespace surfaces { | |
| 18 | |
| 19 // The SurfacesState object is an object global to the View Manager app that | |
| 20 // holds the SurfaceManager, SurfacesScheduler and allocates new Surfaces | |
| 21 // namespaces. | |
|
rjkroege
2015/08/06 22:39:11
can you say what thread it lives on
Fady Samuel
2015/08/07 01:15:21
Done.
| |
| 22 class SurfacesState : public base::RefCounted<SurfacesState> { | |
|
rjkroege
2015/08/06 22:39:11
if it's only on one thread and you pass it around,
Fady Samuel
2015/08/07 01:15:21
It might be possible to get away with not doing th
| |
| 23 public: | |
| 24 SurfacesState(); | |
| 25 | |
| 26 uint32_t next_id_namespace() { return next_id_namespace_++; } | |
| 27 | |
| 28 cc::SurfaceManager* manager() { return &manager_; } | |
| 29 | |
| 30 SurfacesScheduler* scheduler() { return &scheduler_; } | |
| 31 | |
| 32 private: | |
| 33 friend class base::RefCounted<SurfacesState>; | |
| 34 ~SurfacesState(); | |
| 35 | |
| 36 // A Surface ID is an unsigned 64-bit int where the high 32-bits are generated | |
| 37 // by the Surfaces service, and the low 32-bits are generated by the process | |
| 38 // that requested the Surface. | |
| 39 uint32_t next_id_namespace_; | |
| 40 cc::SurfaceManager manager_; | |
| 41 SurfacesScheduler scheduler_; | |
| 42 }; | |
| 43 | |
| 44 } // namespace surfaces | |
| 45 | |
| 46 #endif // COMPONENTS_VIEW_MANAGER_SURFACES_SURFACES_STATE_H_ | |
| OLD | NEW |