mirror of
https://github.com/TomHarte/CLK.git
synced 2024-12-02 02:49:28 +00:00
Corrected for potential lost lines.
This commit is contained in:
parent
a75259ce9f
commit
ccdbec3ffc
@ -40,8 +40,8 @@ const GLsizei IntermediateBufferWidth = 2048;
|
|||||||
const GLsizei IntermediateBufferHeight = 512;
|
const GLsizei IntermediateBufferHeight = 512;
|
||||||
|
|
||||||
// Some internal buffer sizes
|
// Some internal buffer sizes
|
||||||
const GLsizeiptr OutputVertexBufferDataSize = 44928; // a multiple of 6 * OutputVertexSize
|
const GLsizeiptr OutputVertexBufferDataSize = 6 * 8 * 312 * 10; // a multiple of 6 * OutputVertexSize
|
||||||
const GLsizeiptr SourceVertexBufferDataSize = 29952; // a multiple of 2 * SourceVertexSize
|
const GLsizeiptr SourceVertexBufferDataSize = 2 * 16 * 312 * 10; // a multiple of 2 * SourceVertexSize
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,16 +49,25 @@ void CRTInputBufferBuilder::allocate_write_area(size_t required_length)
|
|||||||
|
|
||||||
void CRTInputBufferBuilder::release_write_pointer()
|
void CRTInputBufferBuilder::release_write_pointer()
|
||||||
{
|
{
|
||||||
if(_should_reset)
|
// if(_should_reset)
|
||||||
{
|
// {
|
||||||
_next_write_x_position = _next_write_y_position = 0;
|
// _next_write_x_position = _next_write_y_position = 0;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CRTInputBufferBuilder::reduce_previous_allocation_to(size_t actual_length)
|
bool CRTInputBufferBuilder::reduce_previous_allocation_to(size_t actual_length)
|
||||||
{
|
{
|
||||||
if(_next_write_y_position == InputBufferBuilderHeight) return false;
|
if(_next_write_y_position == InputBufferBuilderHeight) return false;
|
||||||
|
|
||||||
|
// correct if the writing cursor was reset while a client was writing
|
||||||
|
if(_next_write_x_position == 0 && _next_write_y_position == 0 && _write_target_pointer != 1)
|
||||||
|
{
|
||||||
|
memmove(&_image[1], &_image[_write_target_pointer], actual_length);
|
||||||
|
_write_target_pointer = 1;
|
||||||
|
_last_allocation_amount = actual_length;
|
||||||
|
_next_write_x_position = (uint16_t)(actual_length + 2);
|
||||||
|
}
|
||||||
|
|
||||||
// book end the allocation with duplicates of the first and last pixel, to protect
|
// book end the allocation with duplicates of the first and last pixel, to protect
|
||||||
// against rounding errors when this run is drawn
|
// against rounding errors when this run is drawn
|
||||||
memcpy( &_image[(_write_target_pointer - 1) * _bytes_per_pixel],
|
memcpy( &_image[(_write_target_pointer - 1) * _bytes_per_pixel],
|
||||||
@ -82,9 +91,8 @@ uint8_t *CRTInputBufferBuilder::get_image_pointer()
|
|||||||
|
|
||||||
uint16_t CRTInputBufferBuilder::get_and_finalise_current_line()
|
uint16_t CRTInputBufferBuilder::get_and_finalise_current_line()
|
||||||
{
|
{
|
||||||
// TODO: we may have a vended allocate_write_area in play that'll be lost by this step; fix.
|
|
||||||
uint16_t result = _write_y_position + (_next_write_x_position ? 1 : 0);
|
uint16_t result = _write_y_position + (_next_write_x_position ? 1 : 0);
|
||||||
_should_reset = (_next_write_y_position == InputBufferBuilderHeight);
|
_next_write_x_position = _next_write_y_position = 0;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user