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

Unified Diff: ui/ozone/platform/drm/gpu/gbm_buffer.h

Issue 2705213005: Add NativePixmapDmabufStub to finalize glCreateImageCHROMIUM on Linux. (Closed)
Patch Set: Go back to previous solution (Patch Set 13) make the helper a parent instead of member Created 3 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 | « ui/gfx/linux/native_pixmap_dmabuf.cc ('k') | ui/ozone/platform/drm/gpu/gbm_buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/drm/gpu/gbm_buffer.h
diff --git a/ui/ozone/platform/drm/gpu/gbm_buffer.h b/ui/ozone/platform/drm/gpu/gbm_buffer.h
index 2823243793ea49ed20ab8ef115bfa22d76bc25fb..7ac7695be8354ad0410c7a57d54eafc35f963532 100644
--- a/ui/ozone/platform/drm/gpu/gbm_buffer.h
+++ b/ui/ozone/platform/drm/gpu/gbm_buffer.h
@@ -11,7 +11,7 @@
#include "base/macros.h"
#include "ui/gfx/buffer_types.h"
#include "ui/gfx/geometry/size.h"
-#include "ui/gfx/native_pixmap.h"
+#include "ui/gfx/linux/native_pixmap_dmabuf.h"
#include "ui/ozone/platform/drm/gpu/gbm_buffer_base.h"
struct gbm_bo;
@@ -21,7 +21,7 @@ namespace ui {
class GbmDevice;
class GbmSurfaceFactory;
-class GbmBuffer : public GbmBufferBase {
+class GbmBuffer : public GbmBufferBase, public gfx::NativePixmapDmabufHelper {
reveman 2017/06/08 13:40:32 why do we need to inherit this here? can't we just
public:
static scoped_refptr<GbmBuffer> CreateBuffer(
const scoped_refptr<GbmDevice>& gbm,
@@ -40,17 +40,16 @@ class GbmBuffer : public GbmBufferBase {
const gfx::Size& size,
std::vector<base::ScopedFD>&& fds,
const std::vector<gfx::NativePixmapPlane>& planes);
+
uint32_t GetFormat() const { return format_; }
uint32_t GetFlags() const { return flags_; }
- bool AreFdsValid() const;
- size_t GetFdCount() const;
- int GetFd(size_t plane) const;
- int GetStride(size_t plane) const;
- int GetOffset(size_t plane) const;
- size_t GetSize(size_t plane) const;
- uint64_t GetFormatModifier(size_t plane) const;
+
+ // GbmBufferBase
gfx::Size GetSize() const override;
+ // NativePixmapDmabufHelper
+ size_t GetSize(size_t plane) const override;
+
private:
GbmBuffer(const scoped_refptr<GbmDevice>& gbm,
gbm_bo* bo,
@@ -74,15 +73,12 @@ class GbmBuffer : public GbmBufferBase {
uint32_t format_;
uint32_t flags_;
- std::vector<base::ScopedFD> fds_;
gfx::Size size_;
- std::vector<gfx::NativePixmapPlane> planes_;
-
DISALLOW_COPY_AND_ASSIGN(GbmBuffer);
};
-class GbmPixmap : public gfx::NativePixmap {
+class GbmPixmap : public gfx::NativePixmapDmaBuf {
public:
GbmPixmap(GbmSurfaceFactory* surface_manager,
const scoped_refptr<GbmBuffer>& buffer);
@@ -90,16 +86,7 @@ class GbmPixmap : public gfx::NativePixmap {
void SetProcessingCallback(
const ProcessingCallback& processing_callback) override;
- // NativePixmap:
- void* GetEGLClientBuffer() const override;
- bool AreDmaBufFdsValid() const override;
- size_t GetDmaBufFdCount() const override;
- int GetDmaBufFd(size_t plane) const override;
- int GetDmaBufPitch(size_t plane) const override;
- int GetDmaBufOffset(size_t plane) const override;
- uint64_t GetDmaBufModifier(size_t plane) const override;
- gfx::BufferFormat GetBufferFormat() const override;
- gfx::Size GetBufferSize() const override;
+ // NativePixmapDmabuf
bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
int plane_z_order,
gfx::OverlayTransform plane_transform,
« no previous file with comments | « ui/gfx/linux/native_pixmap_dmabuf.cc ('k') | ui/ozone/platform/drm/gpu/gbm_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698