# List of test case sources (Only these get parsed for test cases)
SET(TC_SOURCES
+ utc-Dali-BidirectionalSupport.cpp
+ utc-Dali-ColorConversion.cpp
+ utc-Dali-DebugRendering.cpp
+ utc-Dali-ItemView-internal.cpp
+ utc-Dali-LogicalModel.cpp
+ utc-Dali-PropertyHelper.cpp
utc-Dali-Text-CharacterSetConversion.cpp
+ utc-Dali-Text-Controller.cpp
utc-Dali-Text-Cursor.cpp
- utc-Dali-Text-Segmentation.cpp
- utc-Dali-Text-MultiLanguage.cpp
- utc-Dali-LogicalModel.cpp
- utc-Dali-BidirectionalSupport.cpp
- utc-Dali-Text-Shaping.cpp
- utc-Dali-VisualModel.cpp
utc-Dali-Text-Layout.cpp
- utc-Dali-Text-Controller.cpp
- utc-Dali-VisualUrl.cpp
utc-Dali-Text-Markup.cpp
+ utc-Dali-Text-MultiLanguage.cpp
+ utc-Dali-Text-Segmentation.cpp
+ utc-Dali-Text-Shaping.cpp
utc-Dali-Text-Typesetter.cpp
utc-Dali-Text-ViewModel.cpp
- utc-Dali-DebugRendering.cpp
- utc-Dali-ItemView-internal.cpp
- utc-Dali-PropertyHelper.cpp
- utc-Dali-ColorConversion.cpp
+ utc-Dali-TextureManager.cpp
+ utc-Dali-VisualModel.cpp
+ utc-Dali-VisualUrl.cpp
)
# Append list of test harness files (Won't get parsed for test cases)
--- /dev/null
+/*
+ * Copyright (c) 2017 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 <iostream>
+
+#include <stdlib.h>
+
+#include <dali-toolkit-test-suite-utils.h>
+#include <dali-toolkit/internal/visuals/texture-manager.h>
+#include <dali-toolkit/internal/visuals/texture-upload-observer.h>
+
+using namespace Dali::Toolkit::Internal;
+
+class TestObserver : public Dali::Toolkit::TextureUploadObserver
+{
+public:
+ TestObserver()
+ : mLoaded(false),
+ mObserverCalled(false)
+ {
+ }
+
+ void UploadComplete( bool loadSuccess, TextureSet textureSet, bool useAtlasing, const Vector4& atlasRect )
+ {
+ mLoaded = loadSuccess;
+ mObserverCalled = true;
+ }
+
+ bool mLoaded;
+ bool mObserverCalled;
+};
+
+
+int UtcTextureManagerRequestLoad(void)
+{
+ ToolkitTestApplication application;
+
+ TextureManager textureManager; // Create new texture manager
+
+ TestObserver observer;
+ std::string filename("image.png");
+
+ TextureManager::TextureId textureId = textureManager.RequestLoad(
+ filename,
+ ImageDimensions(),
+ FittingMode::SCALE_TO_FILL,
+ SamplingMode::BOX_THEN_LINEAR,
+ TextureManager::NO_ATLAS,
+ &observer );
+
+ const VisualUrl& url = textureManager.GetVisualUrl( textureId );
+
+ DALI_TEST_EQUALS( url.GetUrl().compare( filename ), 0, TEST_LOCATION );
+
+ END_TEST;
+}
../dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor.cpp
../dali-toolkit/dali-toolkit-test-utils/toolkit-accessibility-adaptor.cpp
../dali-toolkit/dali-toolkit-test-utils/toolkit-application.cpp
- ../dali-toolkit/dali-toolkit-test-utils/toolkit-bitmap-loader.cpp
../dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard.cpp
../dali-toolkit/dali-toolkit-test-utils/toolkit-color-controller.cpp
../dali-toolkit/dali-toolkit-test-utils/toolkit-event-thread-callback.cpp
dali-toolkit-test-utils/toolkit-adaptor.cpp
dali-toolkit-test-utils/toolkit-accessibility-adaptor.cpp
dali-toolkit-test-utils/toolkit-application.cpp
- dali-toolkit-test-utils/toolkit-bitmap-loader.cpp
dali-toolkit-test-utils/toolkit-clipboard.cpp
dali-toolkit-test-utils/toolkit-clipboard-event-notifier.cpp
dali-toolkit-test-utils/toolkit-event-thread-callback.cpp
+++ /dev/null
-/*
- * 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.
- * 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.
- */
-
-// CLASS HEADER
-#include "toolkit-bitmap-loader.h"
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/object/base-object.h>
-#include <cstring>
-#include <semaphore.h>
-
-using namespace Dali;
-
-namespace Dali
-{
-namespace
-{
-Dali::BitmapLoader gBitmapLoader;
-}
-
-
-namespace Internal
-{
-
-class BitmapLoader : public BaseObject
-{
-public:
- static IntrusivePtr<BitmapLoader> New( const std::string& url,
- ImageDimensions size,
- FittingMode::Type fittingMode,
- SamplingMode::Type samplingMode,
- bool orientationCorrection)
- {
- IntrusivePtr<BitmapLoader> internal = new BitmapLoader( url, size, fittingMode, samplingMode, orientationCorrection );
- return internal;
- }
-
- BitmapLoader(const std::string& url,
- ImageDimensions size,
- FittingMode::Type fittingMode,
- SamplingMode::Type samplingMode,
- bool orientationCorrection)
- : mSize(size),
- mPixelData(),
- mUrl(url)
- {
- sem_init( &mySemaphore, 0, 0 );
- }
-
- ~BitmapLoader(){}
-
- void Load()
- {
- size_t bufferSize = mSize.GetWidth() * mSize.GetHeight() * 4;
- unsigned char* buffer = static_cast<unsigned char*>(malloc(bufferSize));
- memset(buffer, 0, bufferSize);
-
- mPixelData = Dali::PixelData::New( buffer, bufferSize, mSize.GetWidth(), mSize.GetHeight(), Pixel::RGBA8888, Dali::PixelData::FREE);
-
- sem_post( &mySemaphore );
- }
-
- Dali::PixelData GetPixelData() const
- {
- return mPixelData;
- }
-
- const std::string& GetUrl() const
- {
- return mUrl;
- }
-
- bool IsLoaded()
- {
- return mPixelData ? true : false;
- }
-
- void WaitForLoading()
- {
- if( mPixelData )
- {
- return;
- }
- sem_wait( &mySemaphore );
- }
-
- ImageDimensions mSize;
- Dali::PixelData mPixelData;
- const std::string mUrl;
- sem_t mySemaphore;
-};
-
-} // internal
-
-inline Internal::BitmapLoader& GetImplementation(Dali::BitmapLoader& handle)
-{
- DALI_ASSERT_ALWAYS( handle && "handle is empty" );
- BaseObject& object = handle.GetBaseObject();
- return static_cast<Internal::BitmapLoader&>(object);
-}
-
-inline const Internal::BitmapLoader& GetImplementation(const Dali::BitmapLoader& handle)
-{
- DALI_ASSERT_ALWAYS( handle && "handle is empty" );
- const BaseObject& object = handle.GetBaseObject();
- return static_cast<const Internal::BitmapLoader&>(object);
-}
-
-Dali::BitmapLoader Dali::BitmapLoader::New(std::string const&url, Dali::Uint16Pair size, Dali::FittingMode::Type fittingMode, Dali::SamplingMode::Type samplingMode, bool orientationCorrection)
-{
- IntrusivePtr<Internal::BitmapLoader> internal = Internal::BitmapLoader::New(url, size, fittingMode, samplingMode, orientationCorrection);
- gBitmapLoader = BitmapLoader(internal.Get());
- return gBitmapLoader;
-}
-
-BitmapLoader::BitmapLoader()
-{
-}
-
-Dali::BitmapLoader::BitmapLoader(Dali::BitmapLoader const& handle)
-:BaseHandle(handle)
-{
-}
-Dali::BitmapLoader::BitmapLoader(Internal::BitmapLoader* internal)
-:BaseHandle(internal)
-{
-}
-Dali::BitmapLoader::~BitmapLoader()
-{
-}
-BitmapLoader& BitmapLoader::operator=(const BitmapLoader& rhs)
-{
- BaseHandle::operator=(rhs);
- return *this;
-}
-void Dali::BitmapLoader::Load()
-{
- GetImplementation(*this).Load();
-}
-PixelData Dali::BitmapLoader::GetPixelData() const
-{
- return GetImplementation(*this).GetPixelData();
-}
-std::string Dali::BitmapLoader::GetUrl() const
-{
- return GetImplementation(*this).GetUrl();
-}
-bool Dali::BitmapLoader::IsLoaded()
-{
- return GetImplementation(*this).IsLoaded();
-}
-void Dali::BitmapLoader::WaitForLoading()
-{
- GetImplementation(*this).WaitForLoading();
-}
-
-BitmapLoader Dali::BitmapLoader::GetLatestCreated()
-{
- return gBitmapLoader;
-}
-
-void Dali::BitmapLoader::ResetLatestCreated()
-{
- gBitmapLoader.Reset();
-}
-
-} // Dali
+++ /dev/null
-#ifndef DALI_TOOLKIT_BITMAP_LOADER_H
-#define DALI_TOOLKIT_BITMAP_LOADER_H
-/*
- * 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.
- * 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.
- */
-
-#define DALI_BITMAP_LOADER_H
-
-#include <string>
-#include <dali/public-api/common/dali-common.h>
-#include <dali/public-api/images/image-operations.h>
-#include <dali/public-api/images/pixel.h>
-#include <dali/public-api/images/pixel-data.h>
-#include <dali/public-api/object/base-handle.h>
-
-namespace Dali
-{
-namespace Internal
-{
-class BitmapLoader;
-}
-
-class DALI_IMPORT_API BitmapLoader : public BaseHandle
-{
-public:
-
- static BitmapLoader New( const std::string& url,
- ImageDimensions size = ImageDimensions( 0, 0 ),
- FittingMode::Type fittingMode = FittingMode::DEFAULT,
- SamplingMode::Type samplingMode = SamplingMode::BOX_THEN_LINEAR,
- bool orientationCorrection = true);
- BitmapLoader();
- ~BitmapLoader();
- BitmapLoader(const BitmapLoader& handle);
- BitmapLoader& operator=(const BitmapLoader& rhs);
-
-public:
- void Load();
- bool IsLoaded();
- std::string GetUrl() const;
- PixelData GetPixelData() const;
-
- void WaitForLoading();
- static BitmapLoader GetLatestCreated(); // return the latest created BitmapLoader
- static void ResetLatestCreated();
-
-public: // Not intended for application developers
-
- explicit DALI_INTERNAL BitmapLoader(Internal::BitmapLoader*);
-};
-
-} // Dali
-
-#endif // DALI_TOOLKIT_BITMAP_LOADER_H
#include <dali-toolkit/devel-api/transition-effects/cube-transition-cross-effect.h>
#include <dali-toolkit/devel-api/transition-effects/cube-transition-fold-effect.h>
#include <dali-toolkit/devel-api/transition-effects/cube-transition-wave-effect.h>
-#include <dali/devel-api/adaptor-framework/bitmap-loader.h>
#include <dali/public-api/images/buffer-image.h>
-
+#include <dali/devel-api/adaptor-framework/image-loading.h>
+#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
using namespace Dali;
application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
- BitmapLoader loader = BitmapLoader::New( "Image.jpg" );
- loader.Load();
- PixelData pixelData = loader.GetPixelData();
+ Devel::PixelBuffer pixelBuffer = LoadImageFromFile(TEST_RESOURCE_DIR "/gallery-small-1.jpg");
+ PixelData pixelData = Devel::PixelBuffer::Convert( pixelBuffer );
Texture texture = Texture::New( TextureType::TEXTURE_2D, pixelData.GetPixelFormat(), pixelData.GetWidth(), pixelData.GetHeight() );
texture.Upload( pixelData );
application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
- BitmapLoader loader = BitmapLoader::New( "Image.jpg" );
- loader.Load();
- PixelData pixelData = loader.GetPixelData();
+ Devel::PixelBuffer pixelBuffer = LoadImageFromFile(TEST_RESOURCE_DIR "/gallery-small-1.jpg");
+ PixelData pixelData = Devel::PixelBuffer::Convert( pixelBuffer );
Texture texture = Texture::New( TextureType::TEXTURE_2D, pixelData.GetPixelFormat(), pixelData.GetWidth(), pixelData.GetHeight() );
texture.Upload( pixelData );
// resolution: 128*128, pixel format: RGB888
static const char* gImage_128_RGB = TEST_RESOURCE_DIR "/gallery-small-1.jpg";
-// this is image is not exist, for negative test
-static const char* gImageNonExist = "non-exist.jpg";
+// Empty image, for testing broken image loading
+static const char* gEmptyImage = TEST_RESOURCE_DIR "/empty.bmp";
const int RENDER_FRAME_INTERVAL = 16; ///< Duration of each frame in ms. (at approx 60FPS)
unsigned int size = 200;
ImageAtlas atlas = ImageAtlas::New( size, size );
- Vector4 textureRect;
- atlas.Upload( textureRect, gImageNonExist );
- DALI_TEST_EQUALS( textureRect, Vector4::ZERO, TEST_LOCATION );
-
// Set broken image
TestPlatformAbstraction& platform = application.GetPlatform();
platform.SetClosestImageSize(Vector2( 34, 34));
atlas.SetBrokenImage( gImage_34_RGBA );
- // the non-exit image will be replaced with the broken image
- platform.SetClosestImageSize(Vector2( 0, 0));
- atlas.Upload( textureRect, gImageNonExist );
+ Vector4 textureRect;
+
+ // the empty image will be replaced with the broken image
+ platform.SetClosestImageSize(Vector2( 20, 20));
+ atlas.Upload( textureRect, gEmptyImage );
+ DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
Rect<int> pixelArea = TextureCoordinateToPixelArea(textureRect, size);
- DALI_TEST_EQUALS( pixelArea.width, 34, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelArea.height, 34, TEST_LOCATION );
+ DALI_TEST_EQUALS( pixelArea.width, 20, TEST_LOCATION );
+ DALI_TEST_EQUALS( pixelArea.height, 20, TEST_LOCATION );
END_TEST;
}
+
+
int UtcDaliImageAtlasUploadP(void)
{
ToolkitTestApplication application;
// Need to override adaptor classes for toolkit test harness, so include
// test harness headers before dali headers.
#include <dali-toolkit-test-suite-utils.h>
-#include <toolkit-bitmap-loader.h>
#include <toolkit-event-thread-callback.h>
#include <dali-toolkit/dali-toolkit.h>
#include <test-native-image.h>
#include <sstream>
+#include <unistd.h>
using namespace Dali;
using namespace Toolkit;
int UtcDaliImageViewAsyncLoadingWithoutAltasing(void)
{
ToolkitTestApplication application;
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ const std::vector<GLuint>& textures = gl.GetBoundTextures();
+ size_t numTextures = textures.size();
// Async loading, no atlasing for big size image
ImageView imageView = ImageView::New( gImage_600_RGB );
// By default, Aysnc loading is used
Stage::GetCurrent().Add( imageView );
+ imageView.SetSize(100, 100);
+ imageView.SetParentOrigin( ParentOrigin::CENTER );
+
+ DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+
application.SendNotification();
application.Render(16);
- application.Render(16);
application.SendNotification();
- // BitmapLoader is not used
- BitmapLoader loader = BitmapLoader::GetLatestCreated();
- DALI_TEST_CHECK( !loader );
+ const std::vector<GLuint>& textures2 = gl.GetBoundTextures();
+ DALI_TEST_GREATER( textures2.size(), numTextures, TEST_LOCATION );
+
+
END_TEST;
}
// Sync loading is used
syncLoadingMap[ ImageVisual::Property::URL ] = gImage_600_RGB;
imageView.SetProperty( ImageView::Property::IMAGE, syncLoadingMap );
-
-
- // BitmapLoader is used, and the loading is started immediately even the actor is not on stage.
- BitmapLoader loader = BitmapLoader::GetLatestCreated();
- DALI_TEST_CHECK( loader );
}
// Sync loading, automatic atlasing for small size image
{
- BitmapLoader::ResetLatestCreated();
TraceCallStack& callStack = application.GetGlAbstraction().GetTextureTrace();
callStack.Reset();
callStack.Enable(true);
ImageView imageView = ImageView::New( );
+
// Sync loading is used
syncLoadingMap[ ImageVisual::Property::URL ] = gImage_34_RGBA;
syncLoadingMap[ ImageVisual::Property::DESIRED_HEIGHT ] = 34;
syncLoadingMap[ ImageVisual::Property::DESIRED_WIDTH ] = 34;
imageView.SetProperty( ImageView::Property::IMAGE, syncLoadingMap );
- // loading is started even if the actor is offStage
- BitmapLoader loader = BitmapLoader::GetLatestCreated();
- DALI_TEST_CHECK( loader );
-
- loader.WaitForLoading();
-
- DALI_TEST_CHECK( loader.IsLoaded() );
-
Stage::GetCurrent().Add( imageView );
application.SendNotification();
application.Render(16);
// Sync loading, automatic atlasing for small size image
{
- BitmapLoader::ResetLatestCreated();
TraceCallStack& callStack = application.GetGlAbstraction().GetTextureTrace();
callStack.Reset();
callStack.Enable(true);
syncLoadingMap[ "atlasing" ] = true;
imageView.SetProperty( ImageView::Property::IMAGE, syncLoadingMap );
- // loading is started even if the actor is offStage
- BitmapLoader loader = BitmapLoader::GetLatestCreated();
- DALI_TEST_CHECK( loader );
-
- loader.WaitForLoading();
-
- DALI_TEST_CHECK( loader.IsLoaded() );
-
Stage::GetCurrent().Add( imageView );
application.SendNotification();
application.Render(16);
#include <stdlib.h>
#include <dali-toolkit-test-suite-utils.h>
#include <toolkit-timer.h>
-#include <toolkit-bitmap-loader.h>
#include <toolkit-event-thread-callback.h>
#include <dali/public-api/rendering/renderer.h>
#include <dali/public-api/rendering/texture-set.h>
application.SendNotification();
application.Render();
- BitmapLoader loader = BitmapLoader::GetLatestCreated();
- DALI_TEST_CHECK( loader );
- loader.WaitForLoading();// waiting until the image to be loaded
- DALI_TEST_CHECK( loader.IsLoaded() );
-
DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
application.SendNotification();
application.Render();
- BitmapLoader loader = BitmapLoader::GetLatestCreated();
- DALI_TEST_CHECK( loader );
- loader.WaitForLoading();// waiting until the image to be loaded
- DALI_TEST_CHECK( loader.IsLoaded() );
-
DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
#include <stdlib.h>
#include <dali-toolkit-test-suite-utils.h>
#include <toolkit-timer.h>
-#include <toolkit-bitmap-loader.h>
#include <toolkit-event-thread-callback.h>
#include <dali/public-api/rendering/renderer.h>
#include <dali/public-api/rendering/texture-set.h>
$(devel_api_src_dir)/controls/tool-bar/tool-bar.cpp \
$(devel_api_src_dir)/focus-manager/keyinput-focus-manager.cpp \
$(devel_api_src_dir)/focus-manager/keyboard-focus-manager-devel.cpp \
+ $(devel_api_src_dir)/image-loader/async-image-loader-devel.cpp \
$(devel_api_src_dir)/image-loader/atlas-upload-observer.cpp \
$(devel_api_src_dir)/image-loader/image-atlas.cpp \
$(devel_api_src_dir)/scripting/script.cpp \
$(devel_api_src_dir)/focus-manager/keyboard-focus-manager-devel.h
devel_api_image_loader_header_files = \
+ $(devel_api_src_dir)/image-loader/async-image-loader-devel.h \
$(devel_api_src_dir)/image-loader/atlas-upload-observer.h \
$(devel_api_src_dir)/image-loader/image-atlas.h
--- /dev/null
+/*
+ * Copyright (c) 2017 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 <dali-toolkit/devel-api/image-loader/async-image-loader-devel.h>
+#include <dali-toolkit/internal/image-loader/async-image-loader-impl.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace DevelAsyncImageLoader
+{
+
+PixelBufferLoadedSignalType& PixelBufferLoadedSignal( AsyncImageLoader asyncImageLoader )
+{
+ return GetImplementation( asyncImageLoader ).PixelBufferLoadedSignal();
+}
+
+} // Devel
+} // Toolkit
+} // Dali
--- /dev/null
+#ifndef DALI_TOOLKIT_DEVEL_API_IMAGE_LOADER_ASYNC_IMAGE_LOADER_DEVEL_H
+#define DALI_TOOLKIT_DEVEL_API_IMAGE_LOADER_ASYNC_IMAGE_LOADER_DEVEL_H
+
+/*
+ * Copyright (c) 2017 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 <dali/public-api/signals/dali-signal.h>
+#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
+#include <dali-toolkit/public-api/image-loader/async-image-loader.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace DevelAsyncImageLoader
+{
+
+typedef Signal< void ( uint32_t, Devel::PixelBuffer ) > PixelBufferLoadedSignalType;
+
+/**
+ * Connect to this signal if you want to load a PixelBuffer instead of a PixelData.
+ * @note Connecting to this signal prevents the emission of the ImageLoadedSignal.
+ */
+DALI_IMPORT_API PixelBufferLoadedSignalType& PixelBufferLoadedSignal( AsyncImageLoader asyncImageLoader );
+
+}
+} // Toolkit
+} // Dali
+
+#endif
#include <dali-toolkit/public-api/controls/model3d-view/model3d-view.h>
#include <dali/public-api/images/resource-image.h>
#include <dali/devel-api/adaptor-framework/file-loader.h>
-#include <dali/devel-api/adaptor-framework/bitmap-loader.h>
+#include <dali/devel-api/adaptor-framework/image-loading.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/model3d-view/obj-loader.h>
Texture LoadTexture( const char* imageUrl )
{
Texture texture;
- Dali::BitmapLoader loader = Dali::BitmapLoader::New( imageUrl );
- loader.Load();
- PixelData pixelData = loader.GetPixelData();
- if( pixelData )
+ Devel::PixelBuffer pixelBuffer = LoadImageFromFile( imageUrl );
+ if( pixelBuffer )
{
- texture = Texture::New( TextureType::TEXTURE_2D, pixelData.GetPixelFormat(), pixelData.GetWidth(), pixelData.GetHeight() );
+ texture = Texture::New( TextureType::TEXTURE_2D, pixelBuffer.GetPixelFormat(), pixelBuffer.GetWidth(), pixelBuffer.GetHeight() );
+ PixelData pixelData = Devel::PixelBuffer::Convert( pixelBuffer );
texture.Upload( pixelData );
texture.GenerateMipmaps();
}
return mLoadedSignal;
}
+Toolkit::DevelAsyncImageLoader::PixelBufferLoadedSignalType& AsyncImageLoader::PixelBufferLoadedSignal()
+{
+ return mPixelBufferLoadedSignal;
+}
+
bool AsyncImageLoader::Cancel( uint32_t loadingTaskId )
{
return mLoadThread.CancelTask( loadingTaskId );
{
while( LoadingTask *next = mLoadThread.NextCompletedTask() )
{
- mLoadedSignal.Emit( next->id, next->pixelData );
+ if( mPixelBufferLoadedSignal.GetConnectionCount() > 0 )
+ {
+ mPixelBufferLoadedSignal.Emit( next->id, next->pixelBuffer );
+ }
+ else if( mLoadedSignal.GetConnectionCount() > 0 )
+ {
+ PixelData pixelData;
+ if( next->pixelBuffer )
+ {
+ pixelData = Devel::PixelBuffer::Convert( next->pixelBuffer );
+ }
+ mLoadedSignal.Emit( next->id, pixelData );
+ }
+
delete next;
}
}
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/image-loader/async-image-loader.h>
+#include <dali-toolkit/devel-api/image-loader/async-image-loader-devel.h>
#include <dali-toolkit/internal/image-loader/image-load-thread.h>
namespace Dali
Toolkit::AsyncImageLoader::ImageLoadedSignalType& ImageLoadedSignal();
/**
+ * @copydoc Toolkit::AsyncImageLoader::PixelBufferLoadedSignal
+ */
+ Toolkit::DevelAsyncImageLoader::PixelBufferLoadedSignalType& PixelBufferLoadedSignal();
+
+ /**
* @copydoc Toolkit::AsyncImageLoader::Cancel
*/
bool Cancel( uint32_t loadingTaskId );
private:
Toolkit::AsyncImageLoader::ImageLoadedSignalType mLoadedSignal;
+ Toolkit::DevelAsyncImageLoader::PixelBufferLoadedSignalType mPixelBufferLoadedSignal;
ImageLoadThread mLoadThread;
uint32_t mLoadTaskId;
#include <string.h>
#include <dali/public-api/signals/callback.h>
#include <dali/devel-api/adaptor-framework/image-loading.h>
-#include <dali/devel-api/adaptor-framework/bitmap-loader.h>
#include <dali/integration-api/debug.h>
namespace Dali
void ImageAtlas::UploadBrokenImage( const Rect<unsigned int>& area )
{
- BitmapLoader loader = BitmapLoader::New(mBrokenImageUrl, ImageDimensions( area.width, area.height ) );
- loader.Load();
- SizeType loadedWidth = loader.GetPixelData().GetWidth();
- SizeType loadedHeight = loader.GetPixelData().GetHeight();
+ Devel::PixelBuffer brokenBuffer = LoadImageFromFile( mBrokenImageUrl, ImageDimensions( area.width, area.height ) );
+ SizeType loadedWidth = brokenBuffer.GetWidth();
+ SizeType loadedHeight = brokenBuffer.GetHeight();
bool needBackgroundClear = false;
SizeType packX = area.x;
if( needBackgroundClear )
{
SizeType size = area.width * area.height * Pixel::GetBytesPerPixel( mPixelFormat );
- PixelBuffer* buffer = new PixelBuffer [size];
- PixelData background = PixelData::New( buffer, size, area.width, area.height, mPixelFormat, PixelData::DELETE_ARRAY );
+ Devel::PixelBuffer background = Devel::PixelBuffer::New( area.width, area.height, mPixelFormat );
+ unsigned char* buffer = background.GetBuffer();
for( SizeType idx = 0; idx < size; idx++ )
{
buffer[idx] = 0x00;
}
- mAtlas.Upload( background, 0u, 0u, area.x, area.y, area.width, area.height );
+ PixelData pixelData = Devel::PixelBuffer::Convert( background );
+ mAtlas.Upload( pixelData, 0u, 0u, area.x, area.y, area.width, area.height );
}
- mAtlas.Upload( loader.GetPixelData(), 0u, 0u, packX, packY, loadedWidth, loadedHeight );
+ PixelData brokenPixelData = Devel::PixelBuffer::Convert( brokenBuffer );
+ mAtlas.Upload( brokenPixelData, 0u, 0u, packX, packY, loadedWidth, loadedHeight );
}
} // namespace Internal
LoadingTask::LoadingTask( uint32_t id, const VisualUrl& url, ImageDimensions dimensions,
FittingMode::Type fittingMode, SamplingMode::Type samplingMode, bool orientationCorrection )
-: pixelData(),
+: pixelBuffer(),
url( url ),
id( id ),
dimensions( dimensions ),
{
if( url.IsLocal() )
{
- pixelData = Dali::LoadImageFromFile( url.GetUrl(), dimensions, fittingMode, samplingMode, orientationCorrection );
+ pixelBuffer = Dali::LoadImageFromFile( url.GetUrl(), dimensions, fittingMode, samplingMode, orientationCorrection );
}
else
{
- pixelData = Dali::DownloadImageSynchronously ( url.GetUrl(), dimensions, fittingMode, samplingMode, orientationCorrection );
+ pixelBuffer = Dali::DownloadImageSynchronously ( url.GetUrl(), dimensions, fittingMode, samplingMode, orientationCorrection );
}
}
#include <dali/public-api/common/dali-vector.h>
#include <dali/public-api/object/ref-object.h>
#include <dali/public-api/images/image-operations.h>
-#include <dali/public-api/images/pixel-data.h>
#include <dali/devel-api/threading/conditional-wait.h>
#include <dali/devel-api/threading/mutex.h>
#include <dali/devel-api/threading/thread.h>
#include <dali/devel-api/adaptor-framework/event-thread-callback.h>
+#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
#include <dali-toolkit/internal/visuals/visual-url.h>
namespace Dali
public:
- PixelData pixelData; ///< pixelData handle after successfull load
+ Devel::PixelBuffer pixelBuffer; ///< pixelBuffer handle after successful load
VisualUrl url; ///< url of the image to load
uint32_t id; ///< The unique id associated with this task.
ImageDimensions dimensions; ///< dimensions to load
#include <dali/public-api/images/resource-image.h>
#include <dali/public-api/images/native-image.h>
#include <dali/devel-api/images/texture-set-image.h>
-#include <dali/devel-api/adaptor-framework/bitmap-loader.h>
#include <dali/devel-api/adaptor-framework/image-loading.h>
#include <dali/devel-api/scripting/enum-helper.h>
#include <dali/devel-api/scripting/scripting.h>
{
if( mImageUrl.IsValid() )
{
- BitmapLoader loader = BitmapLoader::New( mImageUrl.GetUrl(), mDesiredSize, mFittingMode, mSamplingMode );
- loader.Load();
- mPixels = loader.GetPixelData();
+ Devel::PixelBuffer pixelBuffer = LoadImageFromFile( mImageUrl.GetUrl(), mDesiredSize, mFittingMode, mSamplingMode );
+
+ if( pixelBuffer )
+ {
+ mPixels = Devel::PixelBuffer::Convert(pixelBuffer); // takes ownership of buffer
+ }
mTextureLoading = false;
}
}
// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
#include <dali/public-api/common/stage.h>
-#include <dali/devel-api/adaptor-framework/bitmap-loader.h>
+#include <dali/devel-api/adaptor-framework/image-loading.h>
#include <dali/devel-api/adaptor-framework/file-loader.h>
#include <dali/devel-api/scripting/enum-helper.h>
#include <dali/devel-api/scripting/scripting.h>
Texture LoadTexture( const char* imageUrl, bool generateMipmaps )
{
Texture texture;
- Dali::BitmapLoader loader = Dali::BitmapLoader::New( imageUrl );
- loader.Load();
- PixelData pixelData = loader.GetPixelData();
- if( pixelData )
+
+ Devel::PixelBuffer pixelBuffer = LoadImageFromFile( imageUrl );
+ if( pixelBuffer )
{
- texture = Texture::New( TextureType::TEXTURE_2D, pixelData.GetPixelFormat(), pixelData.GetWidth(), pixelData.GetHeight() );
+ texture = Texture::New( TextureType::TEXTURE_2D, pixelBuffer.GetPixelFormat(), pixelBuffer.GetWidth(), pixelBuffer.GetHeight() );
+ PixelData pixelData = Devel::PixelBuffer::Convert( pixelBuffer );
texture.Upload( pixelData );
if( generateMipmaps )
// EXTERNAL HEADERS
#include <dali/devel-api/common/hash.h>
-#include <dali/devel-api/images/pixel-data-mask.h>
#include <dali/devel-api/images/texture-set-image.h>
+#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
#include <dali/integration-api/debug.h>
// INTERNAL HEADERS
#include <dali/integration-api/debug.h>
-#include <dali-toolkit/internal/image-loader/async-image-loader-impl.h>
+#include <dali-toolkit/devel-api/image-loader/async-image-loader-devel.h>
#include <dali-toolkit/internal/image-loader/image-atlas-impl.h>
+#include <dali-toolkit/internal/image-loader/async-image-loader-impl.h>
#include <dali-toolkit/public-api/image-loader/sync-image-loader.h>
mAsyncRemoteLoader( Toolkit::AsyncImageLoader::New() ),
mCurrentTextureId( 0 )
{
- mAsyncLocalLoader.ImageLoadedSignal().Connect( this, &TextureManager::AsyncLocalLoadComplete );
- mAsyncRemoteLoader.ImageLoadedSignal().Connect( this, &TextureManager::AsyncRemoteLoadComplete );
+ DevelAsyncImageLoader::PixelBufferLoadedSignal(mAsyncLocalLoader).Connect( this, &TextureManager::AsyncLocalLoadComplete );
+ DevelAsyncImageLoader::PixelBufferLoadedSignal(mAsyncRemoteLoader).Connect( this, &TextureManager::AsyncRemoteLoadComplete );
}
TextureManager::TextureId TextureManager::RequestLoad(
const UseAtlas useAtlas,
TextureUploadObserver* observer )
{
- return RequestInternalLoad( url, INVALID_TEXTURE_ID, desiredSize, fittingMode, samplingMode, useAtlas, GPU_UPLOAD, observer );
+ return RequestLoadInternal( url, INVALID_TEXTURE_ID, desiredSize, fittingMode, samplingMode, useAtlas, UPLOAD_TO_TEXTURE, observer );
}
TextureManager::TextureId TextureManager::RequestLoad(
const UseAtlas useAtlas,
TextureUploadObserver* observer )
{
- return RequestInternalLoad( url, maskTextureId, desiredSize, fittingMode, samplingMode, useAtlas, GPU_UPLOAD, observer );
+ return RequestLoadInternal( url, maskTextureId, desiredSize, fittingMode, samplingMode, useAtlas, UPLOAD_TO_TEXTURE, observer );
}
TextureManager::TextureId TextureManager::RequestMaskLoad( const VisualUrl& maskUrl )
{
// Use the normal load procedure to get the alpha mask.
- return RequestInternalLoad( maskUrl, INVALID_TEXTURE_ID, ImageDimensions(), FittingMode::SCALE_TO_FILL, SamplingMode::NO_FILTER, NO_ATLAS, CPU, NULL );
+ return RequestLoadInternal( maskUrl, INVALID_TEXTURE_ID, ImageDimensions(), FittingMode::SCALE_TO_FILL, SamplingMode::NO_FILTER, NO_ATLAS, KEEP_PIXEL_BUFFER, NULL );
}
-TextureManager::TextureId TextureManager::RequestInternalLoad(
+TextureManager::TextureId TextureManager::RequestLoadInternal(
const VisualUrl& url,
TextureId maskTextureId,
const ImageDimensions desiredSize,
}
}
+const VisualUrl& TextureManager::GetVisualUrl( TextureId textureId )
+{
+ int cacheIndex = GetCacheIndexFromId( textureId );
+ DALI_ASSERT_DEBUG( cacheIndex != INVALID_CACHE_INDEX && "TextureId out of range");
+
+ TextureInfo& cachedTextureInfo( mTextureInfoContainer[ cacheIndex ] );
+ return cachedTextureInfo.url;
+}
+
TextureManager::LoadState TextureManager::GetTextureState( TextureId textureId )
{
LoadState loadState = TextureManager::NOT_STARTED;
}
}
-void TextureManager::AsyncLocalLoadComplete( uint32_t id, PixelData pixelData )
+void TextureManager::AsyncLocalLoadComplete( uint32_t id, Devel::PixelBuffer pixelBuffer )
{
- AsyncLoadComplete( mAsyncLocalLoadingInfoContainer, id, pixelData );
+ AsyncLoadComplete( mAsyncLocalLoadingInfoContainer, id, pixelBuffer );
}
-void TextureManager::AsyncRemoteLoadComplete( uint32_t id, PixelData pixelData )
+void TextureManager::AsyncRemoteLoadComplete( uint32_t id, Devel::PixelBuffer pixelBuffer )
{
- AsyncLoadComplete( mAsyncRemoteLoadingInfoContainer, id, pixelData );
+ AsyncLoadComplete( mAsyncRemoteLoadingInfoContainer, id, pixelBuffer );
}
-void TextureManager::AsyncLoadComplete( AsyncLoadingInfoContainerType& loadingContainer, uint32_t id, PixelData pixelData )
+void TextureManager::AsyncLoadComplete( AsyncLoadingInfoContainerType& loadingContainer, uint32_t id, Devel::PixelBuffer pixelBuffer )
{
DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise, "TextureManager::AsyncLoadComplete( id:%d )\n", id );
if( textureInfo.loadState != CANCELLED )
{
// textureInfo can be invalidated after this call (as the mTextureInfoContainer may be modified)
- PostLoad( textureInfo, pixelData );
+ PostLoad( textureInfo, pixelBuffer );
}
else
{
}
}
-void TextureManager::PostLoad( TextureInfo& textureInfo, PixelData pixelData )
+void TextureManager::PostLoad( TextureInfo& textureInfo, Devel::PixelBuffer& pixelBuffer )
{
// Was the load successful?
- if( pixelData && ( pixelData.GetWidth() != 0 ) && ( pixelData.GetHeight() != 0 ) )
+ if( pixelBuffer && ( pixelBuffer.GetWidth() != 0 ) && ( pixelBuffer.GetHeight() != 0 ) )
{
// No atlas support for now
textureInfo.useAtlas = NO_ATLAS;
- if( textureInfo.storageType == GPU_UPLOAD )
+ if( textureInfo.storageType == UPLOAD_TO_TEXTURE )
{
// If there is a mask texture ID associated with this texture, then apply the mask
// if it's already loaded. If it hasn't, and the mask is still loading,
LoadState maskLoadState = GetTextureState( textureInfo.maskTextureId );
if( maskLoadState == LOADING )
{
- textureInfo.pixelData = pixelData; // Store the pixel data temporarily
+ textureInfo.pixelBuffer = pixelBuffer; // Store the pixel buffer temporarily
textureInfo.loadState = WAITING_FOR_MASK;
}
else if( maskLoadState == LOAD_FINISHED )
{
- ApplyMask( pixelData, textureInfo.maskTextureId );
- UploadTexture( pixelData, textureInfo );
+ ApplyMask( pixelBuffer, textureInfo.maskTextureId );
+ UploadTexture( pixelBuffer, textureInfo );
NotifyObservers( textureInfo, true );
}
}
else
{
- UploadTexture( pixelData, textureInfo );
+ UploadTexture( pixelBuffer, textureInfo );
NotifyObservers( textureInfo, true );
}
}
- else // currently, CPU textures are local to texture manager
+ else
{
- textureInfo.pixelData = pixelData; // Store the pixel data
+ textureInfo.pixelBuffer = pixelBuffer; // Store the pixel data
textureInfo.loadState = LOAD_FINISHED;
// Check if there was another texture waiting for this load to complete
mTextureInfoContainer[cacheIndex].loadState == WAITING_FOR_MASK )
{
TextureInfo& textureInfo( mTextureInfoContainer[cacheIndex] );
- PixelData pixelData = textureInfo.pixelData;
- textureInfo.pixelData.Reset();
+ Devel::PixelBuffer pixelBuffer = textureInfo.pixelBuffer;
+ textureInfo.pixelBuffer.Reset();
if( maskTextureInfo.loadState == LOAD_FINISHED )
{
- ApplyMask( pixelData, maskTextureInfo.textureId );
- UploadTexture( pixelData, textureInfo );
+ ApplyMask( pixelBuffer, maskTextureInfo.textureId );
+ UploadTexture( pixelBuffer, textureInfo );
NotifyObservers( textureInfo, true );
}
else
}
}
-void TextureManager::ApplyMask( PixelData pixelData, TextureId maskTextureId )
+void TextureManager::ApplyMask( Devel::PixelBuffer& pixelBuffer, TextureId maskTextureId )
{
int maskCacheIndex = GetCacheIndexFromId( maskTextureId );
- PixelData maskPixelData = mTextureInfoContainer[maskCacheIndex].pixelData;
- Dali::ApplyMask( pixelData, maskPixelData );
+ Devel::PixelBuffer maskPixelBuffer = mTextureInfoContainer[maskCacheIndex].pixelBuffer;
+ pixelBuffer.ApplyMask( maskPixelBuffer );
}
-void TextureManager::UploadTexture( PixelData pixelData, TextureInfo& textureInfo )
+void TextureManager::UploadTexture( Devel::PixelBuffer& pixelBuffer, TextureInfo& textureInfo )
{
if( textureInfo.useAtlas != USE_ATLAS )
{
DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise, " TextureManager::UploadTexture() New Texture for textureId:%d\n", textureInfo.textureId );
- Texture texture = Texture::New( Dali::TextureType::TEXTURE_2D, pixelData.GetPixelFormat(), pixelData.GetWidth(), pixelData.GetHeight() );
+ Texture texture = Texture::New( Dali::TextureType::TEXTURE_2D, pixelBuffer.GetPixelFormat(), pixelBuffer.GetWidth(), pixelBuffer.GetHeight() );
+ PixelData pixelData = Devel::PixelBuffer::Convert( pixelBuffer );
texture.Upload( pixelData );
textureInfo.textureSet = TextureSet::New();
textureInfo.textureSet.SetTexture( 0u, texture );
#include <dali/public-api/object/ref-object.h>
#include <dali/public-api/rendering/texture-set.h>
#include <dali/devel-api/common/owner-container.h>
+#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
#include <deque>
// INTERNAL INCLUDES
};
/**
- * Whether the texture should be stored in CPU memory, or uploaded to a GPU texture
+ * Whether the pixel data should be kept in TextureManager, or uploaded for rendering
*/
enum StorageType
{
- CPU,
- GPU_UPLOAD
+ KEEP_PIXEL_BUFFER,
+ UPLOAD_TO_TEXTURE
};
/**
/**
* @brief Requests an image load of the given URL, when the texture has
- * have loaded, it will perform a CPU blend with the image mask, and upload
- * the blend texture.
+ * have loaded, it will perform a blend with the image mask, and upload
+ * the blended texture.
*
* The parameters are used to specify how the image is loaded.
* The observer has the UploadComplete method called when the load is ready.
void Remove( const TextureManager::TextureId textureId );
/**
+ * Get the visualUrl associated with the texture id
+ */
+ const VisualUrl& GetVisualUrl( TextureId textureId );
+
+ /**
* @brief Get the current state of a texture
* @param[in] textureId The texture id to query
* @return The loading state if the texture is valid, or NOT_STARTED if the textureId
* This is called when an image load completes (or fails).
* @return A TextureId to use as a handle to reference this Texture
*/
- TextureId RequestInternalLoad(
+ TextureId RequestLoadInternal(
const VisualUrl& url,
TextureId maskTextureId,
const ImageDimensions desiredSize,
loadState( NOT_STARTED ),
fittingMode( fittingMode ),
samplingMode( samplingMode ),
- storageType( GPU_UPLOAD ),
+ storageType( UPLOAD_TO_TEXTURE ),
loadSynchronously( loadSynchronously ),
useAtlas( useAtlas )
{
ObserverListType observerList; ///< Container used to store all observer clients of this Texture
Toolkit::ImageAtlas atlas; ///< The atlas this Texture lays within (if any)
- PixelData pixelData; ///< The PixelData holding the image data (this is used if atlasing is deferred or CPU storage is required)
+ Devel::PixelBuffer pixelBuffer;///< The PixelBuffer holding the image data (May be empty after upload)
TextureSet textureSet; ///< The TextureSet holding the Texture
VisualUrl url; ///< The URL of the image
ImageDimensions desiredSize; ///< The size requested
/**
* @brief This signal handler is called when the async local loader finishes loading.
* @param[in] id This is the async image loaders Id
- * @param[in] pixelData The loaded image data
+ * @param[in] pixelBuffer The loaded image data
*/
- void AsyncLocalLoadComplete( uint32_t id, PixelData pixelData );
+ void AsyncLocalLoadComplete( uint32_t id, Devel::PixelBuffer pixelBuffer );
/**
* @brief This signal handler is called when the async local loader finishes loading.
* @param[in] id This is the async image loaders Id
- * @param[in] pixelData The loaded image data
+ * @param[in] pixelBuffer The loaded image data
*/
- void AsyncRemoteLoadComplete( uint32_t id, PixelData pixelData );
+ void AsyncRemoteLoadComplete( uint32_t id, Devel::PixelBuffer pixelBuffer );
/**
* Common method to handle loading completion
* @param[in] container The Async loading container
* @param[in] id This is the async image loaders Id
- * @param[in] pixelData The loaded image data
+ * @param[in] pixelBuffer The loaded image data
*/
- void AsyncLoadComplete( AsyncLoadingInfoContainerType& container, uint32_t id, PixelData pixelData );
+ void AsyncLoadComplete( AsyncLoadingInfoContainerType& container, uint32_t id, Devel::PixelBuffer pixelBuffer );
/**
* @brief Performs Post-Load steps including atlasing.
* @param[in] textureInfo The struct associated with this Texture
- * @param[in] pixelData The image pixelData
+ * @param[in] pixelBuffer The image pixelBuffer
* @return True if successful
*/
- void PostLoad( TextureManager::TextureInfo& textureInfo, PixelData pixelData );
+ void PostLoad( TextureManager::TextureInfo& textureInfo, Devel::PixelBuffer& pixelBuffer );
/**
* Check if there is a texture waiting to be masked. If there
void CheckForWaitingTexture( TextureInfo& maskTextureInfo );
/**
- * Apply the mask texture to the image texture.
- * @param[in] pixelData The image pixelData to apply the mask to
+ * Apply the mask to the pixelBuffer.
+ * @param[in] pixelBuffer The pixelBuffer to apply the mask to
* @param[in] maskTextureId The texture id of the mask.
*/
- void ApplyMask( PixelData pixelData, TextureId maskTextureId );
+ void ApplyMask( Devel::PixelBuffer& pixelBuffer, TextureId maskTextureId );
/**
- * Upload the texture specified in pixelData to the appropriate location
- * @param[in] pixelData The image data to upload
+ * Upload the texture specified in pixelBuffer to the appropriate location
+ * @param[in] pixelBuffer The image data to upload
* @param[in] textureInfo The texture info containing the location to
* store the data to.
*/
- void UploadTexture( PixelData pixelData, TextureInfo& textureInfo );
+ void UploadTexture( Devel::PixelBuffer& pixelBuffer, TextureInfo& textureInfo );
/**
* Mark the texture as complete, and inform observers
bool orientationCorrection )
{
// Load the image synchronously (block the thread here).
- return Dali::LoadImageFromFile( url, dimensions, fittingMode, samplingMode, orientationCorrection );
+ Devel::PixelBuffer pixelBuffer = Dali::LoadImageFromFile( url, dimensions, fittingMode, samplingMode, orientationCorrection );
+ if( pixelBuffer )
+ {
+ return Devel::PixelBuffer::Convert( pixelBuffer );
+ }
+ return Dali::PixelData(); // return empty handle
}