示例#1
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);
                }
            }
        }
示例#2
0
 public void SetUserData(nint data, DestroyUserDataCallback destroyFB) =>
 BufferObject.gbm_bo_set_user_data(this.handle, data, destroyFB);
示例#3
0
 public uint PanelStride(int panel) => BufferObject.gbm_bo_get_stride_for_plane(this.handle, panel);
示例#4
0
 public uint PanelOffset(int panel) => BufferObject.gbm_bo_get_offset(this.handle, panel);
示例#5
0
 public uint PanelHandle(int panel) => BufferObject.gbm_bo_get_handle_for_plane(this.handle, panel).u32;