OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef UI_OZONE_PLATFORM_DRI_BUFFER_DATA_H_ | |
6 #define UI_OZONE_PLATFORM_DRI_BUFFER_DATA_H_ | |
7 | |
8 #include "base/memory/scoped_ptr.h" | |
9 | |
10 struct gbm_bo; | |
11 | |
12 namespace ui { | |
13 | |
14 class DriWrapper; | |
15 | |
16 class BufferData { | |
rjkroege
2014/06/11 14:43:04
What is this class for? Can you explain?
| |
17 public: | |
18 // When we create the BufferData we need to register the buffer. Once | |
19 // successfully registered, the |framebuffer_| field will hold the ID of the | |
20 // buffer. The controller will use this ID when scanning out the buffer. On | |
21 // creation we will also associate the BufferData with the buffer. | |
22 static BufferData* CreateData(DriWrapper* dri, gbm_bo* buffer); | |
23 | |
24 // Callback used by GBM to destory the BufferData associated with a buffer. | |
rjkroege
2014/06/11 14:43:04
nit destory
| |
25 static void Destroy(gbm_bo* buffer, void* data); | |
26 | |
27 // Returns the BufferData associated with |buffer|. NULL if no data is | |
28 // associated. | |
29 static BufferData* GetData(gbm_bo* buffer); | |
30 | |
31 uint32_t framebuffer() const { return framebuffer_; } | |
32 uint32_t handle() const { return handle_; } | |
33 | |
34 private: | |
35 BufferData(DriWrapper* dri, gbm_bo* buffer); | |
36 ~BufferData(); | |
37 | |
38 DriWrapper* dri_; | |
39 | |
40 uint32_t handle_; | |
41 | |
42 // ID provided by the controller when the buffer is registered. This ID is | |
43 // used when scanning out the buffer. | |
44 uint32_t framebuffer_; | |
45 | |
46 DISALLOW_COPY_AND_ASSIGN(BufferData); | |
47 }; | |
48 | |
49 } // namespace ui | |
50 | |
51 #endif // UI_OZONE_PLATFORM_DRI_BUFFER_DATA_H_ | |
OLD | NEW |