Upload will return true if the upload operation can be performed, false otherwise
Change-Id: I94d852d65bddaa5c4b59b9b26bd84fd753c8a036
return *this;
}
-void Texture::Upload( PixelData pixelData )
+bool Texture::Upload( PixelData pixelData )
{
Internal::PixelData& internalPixelData = GetImplementation( pixelData );
return GetImplementation(*this).Upload( &internalPixelData );
}
-void Texture::Upload( PixelData pixelData,
+bool Texture::Upload( PixelData pixelData,
unsigned int layer, unsigned int mipmap,
unsigned int xOffset, unsigned int yOffset,
unsigned int width, unsigned int height )
/**
* @brief Upload data to the texture from a PixelData object
* @param[in] pixelData The pixelData object
+ * @return True if the PixelData object has compatible pixel format and fits within the texture, false otherwise
*/
- void Upload( PixelData pixelData );
+ bool Upload( PixelData pixelData );
/**
* @brief Upload data to the texture from a PixelData object
* @param[in] yOffset Specifies a vertical offset of the rectangular area in the texture that will be updated
* @param[in] width Specifies the width of the rectangular area in the texture that will be updated
* @param[in] height Specifies the height of the rectangular area in the texture that will be updated
+ * @return True if the PixelData object has compatible pixel format and fits in the rectangle specified, false otherwise
* @note Upload does not upsample or downsample pixel data to fit the specified rectangular area in the texture.
*/
- void Upload( PixelData pixelData,
+ bool Upload( PixelData pixelData,
unsigned int layer, unsigned int mipmap,
unsigned int xOffset, unsigned int yOffset,
unsigned int width, unsigned int height );
}
}
-void NewTexture::Upload( PixelDataPtr pixelData )
+bool NewTexture::Upload( PixelDataPtr pixelData )
{
- Upload( pixelData, 0u, 0u, 0u, 0u, mWidth, mHeight );
+ return Upload( pixelData, 0u, 0u, 0u, 0u, mWidth, mHeight );
}
-void NewTexture::Upload( PixelDataPtr pixelData,
+bool NewTexture::Upload( PixelDataPtr pixelData,
unsigned int layer, unsigned int mipmap,
unsigned int xOffset, unsigned int yOffset,
unsigned int width, unsigned int height )
{
+ bool result(false);
if( mNativeImage )
{
DALI_LOG_ERROR( "OpenGLES does not support uploading data to native texture");
//Parameters are correct. Send message to upload data to the texture
UploadParams params = { layer, mipmap, xOffset, yOffset, width, height };
UploadTextureMessage(mEventThreadServices.GetUpdateManager(), *mRenderObject, pixelData, params );
+ result = true;
}
}
else
}
}
}
+
+ return result;
}
void NewTexture::GenerateMipmaps()
/**
* @copydoc Dali::Texture::Upload()
*/
- void Upload( PixelDataPtr pixelData );
+ bool Upload( PixelDataPtr pixelData );
/**
* @copydoc Dali::Texture::Upload()
*/
- void Upload( PixelDataPtr pixelData,
+ bool Upload( PixelDataPtr pixelData,
unsigned int layer, unsigned int mipmap,
unsigned int xOffset, unsigned int yOffset,
unsigned int width, unsigned int height );