OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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_DRM_GPU_GBM_MAP_PIXMAP_INTEL_H_ |
| 6 #define UI_OZONE_PLATFORM_DRM_GPU_GBM_MAP_PIXMAP_INTEL_H_ |
| 7 |
| 8 extern "C" { |
| 9 #include <libdrm/intel_bufmgr.h> |
| 10 } |
| 11 |
| 12 #include "base/macros.h" |
| 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "ui/gfx/geometry/size.h" |
| 15 #include "ui/ozone/platform/drm/gpu/gbm_buffer_base.h" |
| 16 #include "ui/ozone/public/native_pixmap.h" |
| 17 #include "ui/ozone/public/surface_factory_ozone.h" |
| 18 |
| 19 namespace ui { |
| 20 |
| 21 class GbmDevice; |
| 22 |
| 23 class GbmMapPixmapIntel : public NativePixmap { |
| 24 public: |
| 25 static scoped_refptr<GbmMapPixmapIntel> CreatePixmap( |
| 26 const scoped_refptr<GbmDevice>& gbm, |
| 27 SurfaceFactoryOzone::BufferFormat format, |
| 28 const gfx::Size& size, |
| 29 gfx::GpuMemoryBufferHandle* handle); |
| 30 |
| 31 // NativePixmap: |
| 32 void* GetEGLClientBuffer() override; |
| 33 int GetDmaBufFd() override; |
| 34 int GetDmaBufPitch() override; |
| 35 |
| 36 private: |
| 37 GbmMapPixmapIntel(); |
| 38 ~GbmMapPixmapIntel() override; |
| 39 |
| 40 bool Initialize(const scoped_refptr<GbmDevice>& gbm, |
| 41 SurfaceFactoryOzone::BufferFormat format, |
| 42 const gfx::Size& size, |
| 43 gfx::GpuMemoryBufferHandle* handle); |
| 44 |
| 45 drm_intel_bo* buffer_; |
| 46 base::ScopedFD prime_fd_; |
| 47 uint32 stride_; |
| 48 |
| 49 DISALLOW_COPY_AND_ASSIGN(GbmMapPixmapIntel); |
| 50 }; |
| 51 |
| 52 } // namespace ui |
| 53 |
| 54 #endif // UI_OZONE_PLATFORM_DRM_GPU_GBM_MAP_PIXMAP_INTEL_H_ |
OLD | NEW |