Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(533)

Side by Side Diff: ui/ozone/platform/dri/buffer_data.h

Issue 400283002: [Ozone-GBM] Migrate GBM buffers to use the ScanoutBuffer interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 // This class is used to tag a gbm buffer with custom information needed
17 // for presentation with the surface factory.
18 class BufferData {
19 public:
20 // When we create the BufferData we need to register the buffer. Once
21 // successfully registered, the |framebuffer_| field will hold the ID of the
22 // buffer. The controller will use this ID when scanning out the buffer. On
23 // creation we will also associate the BufferData with the buffer.
24 static BufferData* CreateData(DriWrapper* dri, gbm_bo* buffer);
25
26 // Callback used by GBM to destroy the BufferData associated with a buffer.
27 static void Destroy(gbm_bo* buffer, void* data);
28
29 // Returns the BufferData associated with |buffer|. NULL if no data is
30 // associated.
31 static BufferData* GetData(gbm_bo* buffer);
32
33 uint32_t framebuffer() const { return framebuffer_; }
34 uint32_t handle() const { return handle_; }
35
36 private:
37 BufferData(DriWrapper* dri, gbm_bo* buffer);
38 ~BufferData();
39
40 DriWrapper* dri_;
41
42 uint32_t handle_;
43
44 // ID provided by the controller when the buffer is registered. This ID is
45 // used when scanning out the buffer.
46 uint32_t framebuffer_;
47
48 DISALLOW_COPY_AND_ASSIGN(BufferData);
49 };
50
51 } // namespace ui
52
53 #endif // UI_OZONE_PLATFORM_DRI_BUFFER_DATA_H_
OLDNEW
« no previous file with comments | « no previous file | ui/ozone/platform/dri/buffer_data.cc » ('j') | ui/ozone/platform/dri/gbm_surface.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698