mirror of
https://github.com/boostorg/gil.git
synced 2026-02-18 14:12:10 +00:00
reverted back fix to reuse memory.
[SVN r84048]
This commit is contained in:
committed by
Stefan Seefeld
parent
5b6ef45728
commit
83d2797277
@@ -145,33 +145,9 @@ public:
|
||||
swap(_alloc, img._alloc);
|
||||
}
|
||||
|
||||
void recreate(const point_t& dims, std::size_t alignment=0, const Alloc alloc_in = Alloc())
|
||||
{
|
||||
if( dims == _view.dimensions() && _align_in_bytes == alignment )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
std::size_t old_size = total_allocated_size_in_bytes( _view.dimensions() );
|
||||
std::size_t new_size = total_allocated_size_in_bytes( dims );
|
||||
|
||||
if( old_size >= new_size )
|
||||
{
|
||||
destruct_pixels( _view );
|
||||
|
||||
_view = view_t( dims
|
||||
, typename view_t::locator( typename view_t::x_iterator( _memory )
|
||||
, get_row_size_in_memunits( dims.x )
|
||||
)
|
||||
);
|
||||
|
||||
default_construct_pixels( _view );
|
||||
}
|
||||
else
|
||||
{
|
||||
image tmp(dims, alignment, alloc_in);
|
||||
swap(tmp);
|
||||
}
|
||||
void recreate(const point_t& dims, std::size_t alignment=0, const Alloc alloc_in = Alloc()) {
|
||||
image tmp(dims, alignment, alloc_in);
|
||||
swap(tmp);
|
||||
}
|
||||
|
||||
void recreate(x_coord_t width, y_coord_t height, std::size_t alignment=0, const Alloc alloc_in = Alloc()) {
|
||||
|
||||
Reference in New Issue
Block a user