From 1d622147ba46869f5fcd60448e675fa9fc277def Mon Sep 17 00:00:00 2001 From: Chu Hoang Date: Wed, 23 Sep 2015 16:04:30 +0100 Subject: [PATCH] Changed NinePatchImage to always load images without any filtering. This is so that the stretch borders metadata is not filtered and become incorrect. Change-Id: I3cd4be5c8511e39938a159de5431ab2ef88c015d --- dali/internal/event/images/nine-patch-image-impl.cpp | 8 ++++---- dali/internal/event/images/nine-patch-image-impl.h | 4 ---- dali/internal/event/images/resource-image-impl.cpp | 2 +- dali/public-api/images/nine-patch-image.cpp | 4 +--- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/dali/internal/event/images/nine-patch-image-impl.cpp b/dali/internal/event/images/nine-patch-image-impl.cpp index 778916e..f0f3832 100644 --- a/dali/internal/event/images/nine-patch-image-impl.cpp +++ b/dali/internal/event/images/nine-patch-image-impl.cpp @@ -137,14 +137,14 @@ namespace TypeRegistration mType( typeid( Dali::NinePatchImage ), typeid( Dali::Image ), NULL ); } // unnamed namespace -NinePatchImagePtr NinePatchImage::New( const std::string& filename, const ImageAttributes& attributes, ReleasePolicy releasePol ) +NinePatchImagePtr NinePatchImage::New( const std::string& filename, ReleasePolicy releasePol ) { - Internal::NinePatchImagePtr internal( new NinePatchImage( filename, attributes, releasePol ) ); + Internal::NinePatchImagePtr internal( new NinePatchImage( filename, releasePol ) ); internal->Initialize(); return internal; } -NinePatchImage::NinePatchImage( const std::string& filename, const ImageAttributes& attributes, ReleasePolicy releasePol ) +NinePatchImage::NinePatchImage( const std::string& filename, ReleasePolicy releasePol ) : ResourceImage( IMAGE_LOAD_POLICY_DEFAULT, releasePol ), mParsedBorder(false) { @@ -152,7 +152,7 @@ NinePatchImage::NinePatchImage( const std::string& filename, const ImageAttribut mResourceClient = &tls.GetResourceClient(); Integration::PlatformAbstraction& platformAbstraction = tls.GetPlatformAbstraction(); - Integration::BitmapResourceType resourceType( ImageDimensions::FromFloatVec2( attributes.GetSize() ), attributes.GetScalingMode(), attributes.GetFilterMode(), attributes.GetOrientationCorrection() ); + Integration::BitmapResourceType resourceType; // Note, bitmap is only destroyed when the image is destroyed. Integration::ResourcePointer resource = platformAbstraction.LoadResourceSynchronously( resourceType, filename ); diff --git a/dali/internal/event/images/nine-patch-image-impl.h b/dali/internal/event/images/nine-patch-image-impl.h index 5e09301..4669060 100644 --- a/dali/internal/event/images/nine-patch-image-impl.h +++ b/dali/internal/event/images/nine-patch-image-impl.h @@ -57,11 +57,9 @@ public: * Also a pixel buffer for image data is allocated. * Dali has ownership of the buffer. * @param [in] filename File to load synchronously into buffer - * @param [in] attributes Image attributes of the file * @param [in] releasePol optionally relase memory when image is not visible on screen (default: keep image data until Image object is alive). */ static NinePatchImagePtr New( const std::string& filename, - const ImageAttributes& attributes, ReleasePolicy releasePol = IMAGE_RELEASE_POLICY_DEFAULT ); /** @@ -69,11 +67,9 @@ public: * For better performance and portability use power of two dimensions. * The maximum size of the image is limited by GL_MAX_TEXTURE_SIZE. * @param [in] filename File to load synchronously into buffer - * @param [in] attributes Image attributes of the file * @param [in] releasePol optionally relase memory when image is not visible on screen (default: keep image data until Image object is alive). */ NinePatchImage( const std::string& filename, - const ImageAttributes& attributes, ReleasePolicy releasePol = IMAGE_RELEASE_POLICY_DEFAULT ); /** diff --git a/dali/internal/event/images/resource-image-impl.cpp b/dali/internal/event/images/resource-image-impl.cpp index 15431e2..de87657 100644 --- a/dali/internal/event/images/resource-image-impl.cpp +++ b/dali/internal/event/images/resource-image-impl.cpp @@ -76,7 +76,7 @@ ResourceImagePtr ResourceImage::New( const std::string& url, const ImageAttribut ResourceImagePtr image; if( NinePatchImage::IsNinePatchUrl( url ) ) { - image = NinePatchImage::New( url, attributes, releasePol ); + image = NinePatchImage::New( url, releasePol ); } else { diff --git a/dali/public-api/images/nine-patch-image.cpp b/dali/public-api/images/nine-patch-image.cpp index e1083b8..7722282 100644 --- a/dali/public-api/images/nine-patch-image.cpp +++ b/dali/public-api/images/nine-patch-image.cpp @@ -53,9 +53,7 @@ NinePatchImage& NinePatchImage::operator=(const NinePatchImage& rhs) NinePatchImage NinePatchImage::New( const std::string& filename ) { - Internal::ImageAttributes defaultAttrs; - - Internal::NinePatchImagePtr internal = Internal::NinePatchImage::New( filename, defaultAttrs, Image::NEVER ); + Internal::NinePatchImagePtr internal = Internal::NinePatchImage::New( filename, Image::NEVER ); return NinePatchImage(internal.Get()); } -- 2.7.4