| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef COMPONENTS_MUS_SURFACES_SURFACES_STATE_H_ | 5 #ifndef COMPONENTS_MUS_SURFACES_SURFACES_STATE_H_ |
| 6 #define COMPONENTS_MUS_SURFACES_SURFACES_STATE_H_ | 6 #define COMPONENTS_MUS_SURFACES_SURFACES_STATE_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "cc/surfaces/surface_hittest.h" |
| 10 #include "cc/surfaces/surface_manager.h" | 11 #include "cc/surfaces/surface_manager.h" |
| 11 #include "components/mus/surfaces/surfaces_scheduler.h" | 12 #include "components/mus/surfaces/surfaces_scheduler.h" |
| 12 | 13 |
| 13 namespace cc { | 14 namespace cc { |
| 15 class SurfaceHittest; |
| 14 class SurfaceManager; | 16 class SurfaceManager; |
| 15 } // namespace cc | 17 } // namespace cc |
| 16 | 18 |
| 17 namespace mus { | 19 namespace mus { |
| 18 | 20 |
| 19 // The SurfacesState object is an object global to the View Manager app that | 21 // The SurfacesState object is an object global to the View Manager app that |
| 20 // holds the SurfaceManager, SurfacesScheduler and allocates new Surfaces | 22 // holds the SurfaceManager, SurfacesScheduler and allocates new Surfaces |
| 21 // namespaces. This object lives on the main thread of the View Manager. | 23 // namespaces. This object lives on the main thread of the View Manager. |
| 22 // TODO(rjkroege, fsamuel): This object will need to change to support multiple | 24 // TODO(rjkroege, fsamuel): This object will need to change to support multiple |
| 23 // displays. | 25 // displays. |
| 24 class SurfacesState : public base::RefCounted<SurfacesState> { | 26 class SurfacesState : public base::RefCounted<SurfacesState> { |
| 25 public: | 27 public: |
| 26 SurfacesState(); | 28 SurfacesState(); |
| 27 | 29 |
| 28 uint32_t next_id_namespace() { return next_id_namespace_++; } | 30 uint32_t next_id_namespace() { return next_id_namespace_++; } |
| 29 | 31 |
| 30 cc::SurfaceManager* manager() { return &manager_; } | 32 cc::SurfaceManager* manager() { return &manager_; } |
| 31 | 33 |
| 34 cc::SurfaceHittest* hit_tester() { return &hit_tester_; } |
| 35 |
| 32 SurfacesScheduler* scheduler() { return &scheduler_; } | 36 SurfacesScheduler* scheduler() { return &scheduler_; } |
| 33 | 37 |
| 34 private: | 38 private: |
| 35 friend class base::RefCounted<SurfacesState>; | 39 friend class base::RefCounted<SurfacesState>; |
| 36 ~SurfacesState(); | 40 ~SurfacesState(); |
| 37 | 41 |
| 38 // A Surface ID is an unsigned 64-bit int where the high 32-bits are generated | 42 // 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 | 43 // by the Surfaces service, and the low 32-bits are generated by the process |
| 40 // that requested the Surface. | 44 // that requested the Surface. |
| 41 uint32_t next_id_namespace_; | 45 uint32_t next_id_namespace_; |
| 42 cc::SurfaceManager manager_; | 46 cc::SurfaceManager manager_; |
| 47 cc::SurfaceHittest hit_tester_; |
| 43 SurfacesScheduler scheduler_; | 48 SurfacesScheduler scheduler_; |
| 44 | 49 |
| 45 DISALLOW_COPY_AND_ASSIGN(SurfacesState); | 50 DISALLOW_COPY_AND_ASSIGN(SurfacesState); |
| 46 }; | 51 }; |
| 47 | 52 |
| 48 } // namespace mus | 53 } // namespace mus |
| 49 | 54 |
| 50 #endif // COMPONENTS_MUS_SURFACES_SURFACES_STATE_H_ | 55 #endif // COMPONENTS_MUS_SURFACES_SURFACES_STATE_H_ |
| OLD | NEW |