From: dongsug.song Date: Thu, 4 Jan 2018 06:13:45 +0000 (+0900) Subject: Revert "Revert "Revert "[4.0] Fixed BMP loader.""" X-Git-Tag: accepted/tizen/4.0/unified/20180111.045407~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e4208f979fdc7cda69c5644b1ab8548e0746dc4e;hp=efbfe41145cb178ee71f073f74f1e98e2485fffc;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git Revert "Revert "Revert "[4.0] Fixed BMP loader.""" - MyContents crash error is solved BUT C#FS transparent image shows still X-box. This reverts commit 99ddbcce26eaa735d969327211be9415f0391be0. Change-Id: I481e92856cf0dac1962f9dbf6a96af26ebfc71f8 --- diff --git a/automated-tests/images/flag-24bpp.bmp b/automated-tests/images/flag-24bpp.bmp deleted file mode 100644 index bbc1518..0000000 Binary files a/automated-tests/images/flag-24bpp.bmp and /dev/null differ diff --git a/automated-tests/images/flag-24bpp.buffer b/automated-tests/images/flag-24bpp.buffer deleted file mode 100644 index 9af4726..0000000 Binary files a/automated-tests/images/flag-24bpp.buffer and /dev/null differ diff --git a/automated-tests/src/dali-adaptor-internal/CMakeLists.txt b/automated-tests/src/dali-adaptor-internal/CMakeLists.txt index 2f6845e..c953ca4 100644 --- a/automated-tests/src/dali-adaptor-internal/CMakeLists.txt +++ b/automated-tests/src/dali-adaptor-internal/CMakeLists.txt @@ -11,7 +11,6 @@ SET(TC_SOURCES utc-Dali-FontClient.cpp utc-Dali-GifLoader.cpp utc-Dali-IcoLoader.cpp - utc-Dali-BmpLoader.cpp utc-Dali-ImageOperations.cpp utc-Dali-Internal-PixelBuffer.cpp utc-Dali-Lifecycle-Controller.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 --- 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) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 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. @@ -39,8 +39,8 @@ ImageDetails::ImageDetails( const char * const _name, unsigned int _width, unsig height( _height ), reportedWidth( _width ), reportedHeight( _height ), - refBufferSize( 0u ), - refBuffer( nullptr ) + refBufferSize( _width * _height ), + refBuffer( new Dali::PixelBuffer[ refBufferSize ] ) { LoadBuffer(); } @@ -51,33 +51,27 @@ ImageDetails::ImageDetails( const char * const _name, unsigned int _width, unsig height( _height ), reportedWidth( _reportedWidth ), reportedHeight( _reportedHeight ), - refBufferSize( 0u ), - refBuffer( nullptr ) + refBufferSize( _width * _height ), + refBuffer( new Dali::PixelBuffer[ refBufferSize ] ) { LoadBuffer(); } ImageDetails::~ImageDetails() { - if( refBuffer ) - { - delete[] refBuffer; - } + delete [] refBuffer; } 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 ) { - fseek( fp, 0, SEEK_END ); - refBufferSize = ftell( fp ); - fseek( fp, 0, SEEK_SET ); - refBuffer = reinterpret_cast( malloc( refBufferSize ) ); fread( refBuffer, sizeof( Dali::PixelBuffer ), refBufferSize, fp ); } } diff --git a/automated-tests/src/dali-adaptor-internal/image-loaders.h b/automated-tests/src/dali-adaptor-internal/image-loaders.h index fa7fa0d..9a3ce7a 100644 --- a/automated-tests/src/dali-adaptor-internal/image-loaders.h +++ b/automated-tests/src/dali-adaptor-internal/image-loaders.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 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. @@ -66,7 +66,7 @@ struct ImageDetails unsigned int reportedWidth; unsigned int reportedHeight; unsigned int refBufferSize; - Dali::PixelBuffer* refBuffer; + Dali::PixelBuffer* const refBuffer; private: diff --git a/automated-tests/src/dali-adaptor-internal/utc-Dali-BmpLoader.cpp b/automated-tests/src/dali-adaptor-internal/utc-Dali-BmpLoader.cpp deleted file mode 100644 index dd8838e..0000000 --- a/automated-tests/src/dali-adaptor-internal/utc-Dali-BmpLoader.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2018 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include -#include -#include - -#include "platform-abstractions/tizen/image-loaders/loader-bmp.h" -#include "image-loaders.h" - -using namespace Dali; - -namespace -{ - -static const LoadFunctions BmpLoaders( TizenPlatform::LoadBmpHeader, TizenPlatform::LoadBitmapFromBmp ); - -} // Unnamed namespace. - -int UtcDaliBmp24bpp(void) -{ - ImageDetails image( TEST_IMAGE_DIR "/flag-24bpp.bmp", 32u, 32u ); - - TestImageLoading( image, BmpLoaders ); - - END_TEST; -} - diff --git a/platform-abstractions/tizen/image-loaders/loader-bmp.cpp b/platform-abstractions/tizen/image-loaders/loader-bmp.cpp index fdd0837..37f3c26 100644 --- a/platform-abstractions/tizen/image-loaders/loader-bmp.cpp +++ b/platform-abstractions/tizen/image-loaders/loader-bmp.cpp @@ -1242,12 +1242,6 @@ bool LoadBitmapFromBmp( const ImageLoader::Input& input, Integration::Bitmap& bi { pixels = bitmap.GetPackedPixelsProfile()->ReserveBuffer(pixelFormat, infoHeader.width, infoHeader.height); } - else - { - pixelBufferW = infoHeader.width; - pixelBufferH = infoHeader.height; - newPixelFormat = pixelFormat; - } break; }