Example #1
0
 public BufferObject(Device dev, uint _width, uint _height, SurfaceFormat format, SurfaceFlags flags)
 {
     handle = gbm_bo_create(dev.Handle, _width, _height, format, flags);
     if (handle == null)
     {
         throw new NotSupportedException("[GBM] BO creation failed.");
     }
 }
Example #2
0
 protected virtual void Dispose(bool disposing)
 {
     if (handle != null)
     {
         gbm_bo_destroy(handle);
     }
     handle = null;
 }
Example #3
0
        public gbm_bo *Lock()
        {
            gbm_bo *bo = gbm_surface_lock_front_buffer(handle);

            if (bo == null)
            {
                throw new Exception("[GBM]: Failed to lock front buffer.");
            }
            return(bo);
        }
Example #4
0
        private void Lock(Action <BufferObject, uint> action)
        {
            unsafe
            {
                var lastBo = this.boHandle;
                this.boHandle = gbm_surface_lock_front_buffer(this.surfaceHandle);

                if (this.boHandle == null)
                {
                    throw new Exception("[GBM]: Failed to lock front buffer.");
                }

                var bo = new BufferObject(this.boHandle);
                action?.Invoke(bo, bo.GetFb(this.Device));
                if (lastBo is not null)
                {
                    this.Release(lastBo);
                }
            }
        }
Example #5
0
 internal static extern ulong gbm_bo_get_modifier(gbm_bo *bo);
Example #6
0
 static extern void gbm_surface_release_buffer(gbm_surface *surface, gbm_bo *bo);
Example #7
0
 internal static extern int gbm_bo_get_plane_count(gbm_bo *bo);
Example #8
0
 internal static extern nint gbm_bo_map(gbm_bo *bo, uint x, uint y, uint width, uint height, TransferFlags flags, ref uint stride, out nint data);
Example #9
0
 internal static extern void gbm_bo_set_user_data(gbm_bo *bo, nint data, DestroyUserDataCallback callback);
Example #10
0
 internal static extern gbm_device *gbm_bo_get_device(gbm_bo *bo);
Example #11
0
 internal static extern int gbm_bo_write(gbm_bo *bo, nint buf, nint count);
Example #12
0
 internal static extern void gbm_bo_destroy(gbm_bo *bo);
Example #13
0
 public void Release(gbm_bo *bo)
 {
     gbm_surface_release_buffer(handle, bo);
 }
Example #14
0
 static extern void gbm_surface_release_buffer(IntPtr surface, gbm_bo *buffer);
Example #15
0
 internal static extern int gbm_bo_write(gbm_bo *bo, IntPtr buf, IntPtr count);
Example #16
0
 internal static extern uint gbm_bo_get_stride_for_plane(gbm_bo *bo, int plane);
Example #17
0
 internal static extern uint gbm_bo_get_offset(gbm_bo *bo, int plane);
Example #18
0
 internal static extern gbm_bo_handle gbm_bo_get_handle_for_plane(gbm_bo *bo, int plane);
Example #19
0
 internal static extern nint gbm_bo_get_user_data(gbm_bo *bo);
Example #20
0
 internal static extern gbm_bo_handle gbm_bo_get_handle(gbm_bo *bo);
Example #21
0
 internal static extern void gbm_bo_unmap(gbm_bo *bo, nint data);
Example #22
0
 internal static extern uint gbm_bo_get_height(gbm_bo *bo);
Example #23
0
 public BufferObject(gbm_bo *handle)
 {
     this.handle = handle;
 }
Example #24
0
 internal static extern uint gbm_bo_get_width(gbm_bo *bo);
Example #25
0
 private void Release(gbm_bo *bo)
 {
     gbm_surface_release_buffer(surfaceHandle, bo);
 }
Example #26
0
 internal static extern uint gbm_bo_get_stride(gbm_bo *bo);
Example #27
0
 internal static extern SurfaceFormat gbm_bo_get_format(gbm_bo *bo);
Example #28
0
 public BufferObject(gbm_bo *_handle)
 {
     handle = _handle;
 }