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

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

Issue 1381133002: ozone: Implement support for CreateGpuMemoryBufferFromHandle for OzoneNativePixmap backed GMBs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gmb-factory-create-from-handle
Patch Set: rebase Created 5 years, 2 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
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 0c426d7551c5205dfc4eb02495dfd176b3556dfd..737a9cc0a2eaa19288b5dd4c15504e02764808d9 100644
--- a/ui/ozone/platform/drm/gpu/gbm_buffer.h
+++ b/ui/ozone/platform/drm/gpu/gbm_buffer.h
@@ -5,6 +5,7 @@
#ifndef UI_OZONE_PLATFORM_DRM_GPU_GBM_BUFFER_H_
#define UI_OZONE_PLATFORM_DRM_GPU_GBM_BUFFER_H_
+#include "base/files/scoped_file.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "ui/gfx/buffer_types.h"
@@ -41,9 +42,9 @@ class GbmBuffer : public GbmBufferBase {
class GbmPixmap : public NativePixmap {
public:
- GbmPixmap(const scoped_refptr<GbmBuffer>& buffer,
- GbmSurfaceFactory* surface_manager);
- bool Initialize();
+ explicit GbmPixmap(GbmSurfaceFactory* surface_manager);
+ void Initialize(base::ScopedFD dma_buf, int dma_buf_pitch);
+ bool InitializeFromBuffer(const scoped_refptr<GbmBuffer>& buffer);
void SetScalingCallback(const ScalingCallback& scaling_callback) override;
scoped_refptr<NativePixmap> GetScaledPixmap(gfx::Size new_size) override;
@@ -67,7 +68,8 @@ class GbmPixmap : public NativePixmap {
gfx::Size* required_size);
scoped_refptr<GbmBuffer> buffer_;
- int dma_buf_ = -1;
+ base::ScopedFD dma_buf_;
+ int dma_buf_pitch_ = -1;
GbmSurfaceFactory* surface_manager_;
« no previous file with comments | « content/common/gpu/gpu_memory_buffer_factory_ozone_native_pixmap_unittest.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