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

Unified Diff: ui/ozone/platform/dri/buffer_data.h

Issue 325133003: Refactor BufferData class into a separate file to be later used by individual gbm_bo's in EGLImage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/ozone/platform/dri/buffer_data.cc » ('j') | ui/ozone/platform/dri/buffer_data.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/dri/buffer_data.h
diff --git a/ui/ozone/platform/dri/buffer_data.h b/ui/ozone/platform/dri/buffer_data.h
new file mode 100644
index 0000000000000000000000000000000000000000..2d2533309b0ca32c2da3ea5e6dfa3604f5904327
--- /dev/null
+++ b/ui/ozone/platform/dri/buffer_data.h
@@ -0,0 +1,51 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_OZONE_PLATFORM_DRI_BUFFER_DATA_H_
+#define UI_OZONE_PLATFORM_DRI_BUFFER_DATA_H_
+
+#include "base/memory/scoped_ptr.h"
+
+struct gbm_bo;
+
+namespace ui {
+
+class DriWrapper;
+
+class BufferData {
rjkroege 2014/06/11 14:43:04 What is this class for? Can you explain?
+ public:
+ // When we create the BufferData we need to register the buffer. Once
+ // successfully registered, the |framebuffer_| field will hold the ID of the
+ // buffer. The controller will use this ID when scanning out the buffer. On
+ // creation we will also associate the BufferData with the buffer.
+ static BufferData* CreateData(DriWrapper* dri, gbm_bo* buffer);
+
+ // Callback used by GBM to destory the BufferData associated with a buffer.
rjkroege 2014/06/11 14:43:04 nit destory
+ static void Destroy(gbm_bo* buffer, void* data);
+
+ // Returns the BufferData associated with |buffer|. NULL if no data is
+ // associated.
+ static BufferData* GetData(gbm_bo* buffer);
+
+ uint32_t framebuffer() const { return framebuffer_; }
+ uint32_t handle() const { return handle_; }
+
+ private:
+ BufferData(DriWrapper* dri, gbm_bo* buffer);
+ ~BufferData();
+
+ DriWrapper* dri_;
+
+ uint32_t handle_;
+
+ // ID provided by the controller when the buffer is registered. This ID is
+ // used when scanning out the buffer.
+ uint32_t framebuffer_;
+
+ DISALLOW_COPY_AND_ASSIGN(BufferData);
+};
+
+} // namespace ui
+
+#endif // UI_OZONE_PLATFORM_DRI_BUFFER_DATA_H_
« no previous file with comments | « no previous file | ui/ozone/platform/dri/buffer_data.cc » ('j') | ui/ozone/platform/dri/buffer_data.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698