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_EXO_DISPLAY_H_ | 5 #ifndef COMPONENTS_EXO_DISPLAY_H_ |
6 #define COMPONENTS_EXO_DISPLAY_H_ | 6 #define COMPONENTS_EXO_DISPLAY_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/shared_memory_handle.h" | 10 #include "base/memory/shared_memory_handle.h" |
11 | 11 |
| 12 #if defined(USE_OZONE) |
| 13 #include "base/files/scoped_file.h" |
| 14 #include "ui/gfx/buffer_types.h" |
| 15 #include "ui/gfx/geometry/size.h" |
| 16 #endif |
| 17 |
12 namespace exo { | 18 namespace exo { |
13 class SharedMemory; | 19 class SharedMemory; |
14 class ShellSurface; | 20 class ShellSurface; |
15 class SubSurface; | 21 class SubSurface; |
16 class Surface; | 22 class Surface; |
17 | 23 |
| 24 #if defined(USE_OZONE) |
| 25 class Buffer; |
| 26 #endif |
| 27 |
18 // The core display class. This class provides functions for creating surfaces | 28 // The core display class. This class provides functions for creating surfaces |
19 // and is in charge of combining the contents of multiple surfaces into one | 29 // and is in charge of combining the contents of multiple surfaces into one |
20 // displayable output. | 30 // displayable output. |
21 class Display { | 31 class Display { |
22 public: | 32 public: |
23 Display(); | 33 Display(); |
24 ~Display(); | 34 ~Display(); |
25 | 35 |
26 // Creates a new surface. | 36 // Creates a new surface. |
27 scoped_ptr<Surface> CreateSurface(); | 37 scoped_ptr<Surface> CreateSurface(); |
28 | 38 |
29 // Creates a shared memory segment from |handle| of |size| with the | 39 // Creates a shared memory segment from |handle| of |size| with the |
30 // given |id|. This function takes ownership of |handle|. | 40 // given |id|. This function takes ownership of |handle|. |
31 scoped_ptr<SharedMemory> CreateSharedMemory( | 41 scoped_ptr<SharedMemory> CreateSharedMemory( |
32 const base::SharedMemoryHandle& handle, | 42 const base::SharedMemoryHandle& handle, |
33 size_t size); | 43 size_t size); |
34 | 44 |
| 45 #if defined(USE_OZONE) |
| 46 // Creates a buffer for the prime fd. |
| 47 scoped_ptr<Buffer> CreatePrimeBuffer(base::ScopedFD fd, |
| 48 const gfx::Size& size, |
| 49 gfx::BufferFormat format, |
| 50 int stride); |
| 51 #endif |
| 52 |
35 // Creates a shell surface for an existing surface. | 53 // Creates a shell surface for an existing surface. |
36 scoped_ptr<ShellSurface> CreateShellSurface(Surface* surface); | 54 scoped_ptr<ShellSurface> CreateShellSurface(Surface* surface); |
37 | 55 |
38 // Creates a sub-surface for an existing surface. The sub-surface will be | 56 // Creates a sub-surface for an existing surface. The sub-surface will be |
39 // a child of |parent|. | 57 // a child of |parent|. |
40 scoped_ptr<SubSurface> CreateSubSurface(Surface* surface, Surface* parent); | 58 scoped_ptr<SubSurface> CreateSubSurface(Surface* surface, Surface* parent); |
41 | 59 |
42 private: | 60 private: |
43 DISALLOW_COPY_AND_ASSIGN(Display); | 61 DISALLOW_COPY_AND_ASSIGN(Display); |
44 }; | 62 }; |
45 | 63 |
46 } // namespace exo | 64 } // namespace exo |
47 | 65 |
48 #endif // COMPONENTS_EXO_DISPLAY_H_ | 66 #endif // COMPONENTS_EXO_DISPLAY_H_ |
OLD | NEW |