Beispiel #1
0
        private BitmapBuffer Find(Ckdu_compositor_buf tgt)
        {
            int    tgt_row_gap = 0;
            IntPtr tgt_handle  = tgt.get_buf(ref tgt_row_gap, true);

            foreach (var buf in bufferList)
            {
                if (buf.buffer_handle == tgt_handle)
                {
                    return(buf);
                }
            }
            return(null);
        }
Beispiel #2
0
        /// <summary>
        /// Overrides the base callback function to correctly dispose of
        /// buffers which were allocated using the `allocate_buffer' function.
        /// </summary>
        public override void delete_buffer(Ckdu_compositor_buf buf)
        {
            BitmapBuffer equiv = null;

            if (bufferList.Count > 0)
            {
                var buffer = Find(buf);
                if (buffer == null)
                {
                    return;
                }
                equiv = buffer;
            }
            bufferList.Remove(equiv);
            equiv.Dispose();
        }