projects
/
platform
/
core
/
uifw
/
dali-adaptor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revert "Revert "Revert "[4.0] Fixed BMP loader."""
[platform/core/uifw/dali-adaptor.git]
/
automated-tests
/
src
/
dali-adaptor-internal
/
image-loaders.cpp
diff --git
a/automated-tests/src/dali-adaptor-internal/image-loaders.cpp
b/automated-tests/src/dali-adaptor-internal/image-loaders.cpp
index
c3f7abe
..
a5fd26e
100644
(file)
--- a/
automated-tests/src/dali-adaptor-internal/image-loaders.cpp
+++ b/
automated-tests/src/dali-adaptor-internal/image-loaders.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 201
8
Samsung Electronics Co., Ltd.
+ * Copyright (c) 201
6
Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-39,8
+39,8
@@
ImageDetails::ImageDetails( const char * const _name, unsigned int _width, unsig
height( _height ),
reportedWidth( _width ),
reportedHeight( _height ),
height( _height ),
reportedWidth( _width ),
reportedHeight( _height ),
- refBufferSize(
0u
),
- refBuffer( n
ullptr
)
+ refBufferSize(
_width * _height
),
+ refBuffer( n
ew Dali::PixelBuffer[ refBufferSize ]
)
{
LoadBuffer();
}
{
LoadBuffer();
}
@@
-51,33
+51,27
@@
ImageDetails::ImageDetails( const char * const _name, unsigned int _width, unsig
height( _height ),
reportedWidth( _reportedWidth ),
reportedHeight( _reportedHeight ),
height( _height ),
reportedWidth( _reportedWidth ),
reportedHeight( _reportedHeight ),
- refBufferSize(
0u
),
- refBuffer( n
ullptr
)
+ refBufferSize(
_width * _height
),
+ refBuffer( n
ew Dali::PixelBuffer[ refBufferSize ]
)
{
LoadBuffer();
}
ImageDetails::~ImageDetails()
{
{
LoadBuffer();
}
ImageDetails::~ImageDetails()
{
- if( refBuffer )
- {
- delete[] refBuffer;
- }
+ delete [] refBuffer;
}
void ImageDetails::LoadBuffer()
{
// Load the reference buffer from the buffer file
}
void ImageDetails::LoadBuffer()
{
// Load the reference buffer from the buffer file
+
std::string refBufferFilename( name + ".buffer" );
FILE *fp = fopen ( refBufferFilename.c_str(), "rb" );
AutoCloseFile autoCloseBufferFile( fp );
if ( fp )
{
std::string refBufferFilename( name + ".buffer" );
FILE *fp = fopen ( refBufferFilename.c_str(), "rb" );
AutoCloseFile autoCloseBufferFile( fp );
if ( fp )
{
- fseek( fp, 0, SEEK_END );
- refBufferSize = ftell( fp );
- fseek( fp, 0, SEEK_SET );
- refBuffer = reinterpret_cast<Dali::PixelBuffer*>( malloc( refBufferSize ) );
fread( refBuffer, sizeof( Dali::PixelBuffer ), refBufferSize, fp );
}
}
fread( refBuffer, sizeof( Dali::PixelBuffer ), refBufferSize, fp );
}
}