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 SERVICES_UI_SURFACES_SURFACES_STATE_H_ | |
6 #define SERVICES_UI_SURFACES_SURFACES_STATE_H_ | |
7 | |
8 #include <stdint.h> | |
9 | |
10 #include "base/macros.h" | |
11 #include "base/memory/ref_counted.h" | |
12 #include "cc/surfaces/surface_manager.h" | |
13 | |
14 namespace cc { | |
15 class SurfaceHittest; | |
16 class SurfaceManager; | |
17 } // namespace cc | |
18 | |
19 namespace ui { | |
20 | |
21 // The SurfacesState object is an object global to the Window Manager app that | |
22 // holds the SurfaceManager and allocates new Surfaces namespaces. | |
23 // This object lives on the main thread of the Window Manager. | |
24 // TODO(rjkroege, fsamuel): This object will need to change to support multiple | |
25 // displays. | |
26 class SurfacesState : public base::RefCounted<SurfacesState> { | |
27 public: | |
28 SurfacesState(); | |
29 | |
30 uint32_t next_client_id() { return next_client_id_++; } | |
31 | |
32 cc::SurfaceManager* manager() { return &manager_; } | |
33 | |
34 private: | |
35 friend class base::RefCounted<SurfacesState>; | |
36 ~SurfacesState(); | |
37 | |
38 // A Surface ID is an unsigned 64-bit int where the high 32-bits are generated | |
39 // by the Surfaces service, and the low 32-bits are generated by the process | |
40 // that requested the Surface. | |
41 uint32_t next_client_id_; | |
42 cc::SurfaceManager manager_; | |
43 | |
44 DISALLOW_COPY_AND_ASSIGN(SurfacesState); | |
45 }; | |
46 | |
47 } // namespace ui | |
48 | |
49 #endif // SERVICES_UI_SURFACES_SURFACES_STATE_H_ | |
OLD | NEW |