X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fpublic-api%2Frendering%2Ftexture.cpp;h=2f6205380a4c33ef538bb11cc9d693b23382c3bc;hb=0b501ba800a263b97d99adf224fc42d0c2aa8b37;hp=79720cf1108cd76804e948156803e95071c8e412;hpb=03bb1840a40c61ff70f4de174615d93240bca7d8;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/public-api/rendering/texture.cpp b/dali/public-api/rendering/texture.cpp index 79720cf..2f62053 100644 --- a/dali/public-api/rendering/texture.cpp +++ b/dali/public-api/rendering/texture.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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. @@ -16,65 +16,59 @@ */ // CLASS HEADER -#include // Dali::Texture +#include // Dali::Texture // INTERNAL INCLUDES -#include // Dali::Internal::Texture #include // Dali::Internal::PixelData - +#include // Dali::Internal::Texture namespace Dali { - -Texture Texture::New( TextureType::Type type, Pixel::Format format, unsigned int width, unsigned int height ) +Texture Texture::New(TextureType::Type type, Pixel::Format format, uint32_t width, uint32_t height) { - Internal::TexturePtr texture = Internal::Texture::New(type, format, width, height ); - return Texture( texture.Get() ); + Internal::TexturePtr texture = Internal::Texture::New(type, format, width, height); + return Texture(texture.Get()); } -Texture Texture::New( NativeImageInterface& nativeImageInterface ) +Texture Texture::New(NativeImageInterface& nativeImageInterface) { - Internal::TexturePtr texture = Internal::Texture::New( nativeImageInterface ); - return Texture( texture.Get() ); + Internal::TexturePtr texture = Internal::Texture::New(nativeImageInterface); + return Texture(texture.Get()); } -Texture::Texture() -{ -} +Texture::Texture() = default; -Texture::~Texture() -{ -} +Texture::~Texture() = default; -Texture::Texture( const Texture& handle ) -: BaseHandle( handle ) -{ -} +Texture::Texture(const Texture& handle) = default; -Texture Texture::DownCast( BaseHandle handle ) +Texture Texture::DownCast(BaseHandle handle) { - return Texture( dynamic_cast(handle.GetObjectPtr())); + return Texture(dynamic_cast(handle.GetObjectPtr())); } -Texture& Texture::operator=( const Texture& handle ) -{ - BaseHandle::operator=( handle ); - return *this; -} +Texture& Texture::operator=(const Texture& handle) = default; + +Texture::Texture(Texture&& rhs) noexcept = default; -bool Texture::Upload( PixelData pixelData ) +Texture& Texture::operator=(Texture&& rhs) noexcept = default; + +bool Texture::Upload(PixelData pixelData) { - Internal::PixelData& internalPixelData = GetImplementation( pixelData ); - return GetImplementation(*this).Upload( &internalPixelData ); + Internal::PixelData& internalPixelData = GetImplementation(pixelData); + return GetImplementation(*this).Upload(&internalPixelData); } -bool Texture::Upload( PixelData pixelData, - unsigned int layer, unsigned int mipmap, - unsigned int xOffset, unsigned int yOffset, - unsigned int width, unsigned int height ) +bool Texture::Upload(PixelData pixelData, + uint32_t layer, + uint32_t mipmap, + uint32_t xOffset, + uint32_t yOffset, + uint32_t width, + uint32_t height) { - Internal::PixelData& internalPixelData = GetImplementation( pixelData ); - return GetImplementation(*this).Upload( &internalPixelData, layer, mipmap, xOffset, yOffset, width, height ); + Internal::PixelData& internalPixelData = GetImplementation(pixelData); + return GetImplementation(*this).Upload(&internalPixelData, layer, mipmap, xOffset, yOffset, width, height); } void Texture::GenerateMipmaps() @@ -82,18 +76,23 @@ void Texture::GenerateMipmaps() return GetImplementation(*this).GenerateMipmaps(); } -unsigned int Texture::GetWidth() const +uint32_t Texture::GetWidth() const { return GetImplementation(*this).GetWidth(); } -unsigned int Texture::GetHeight() const +uint32_t Texture::GetHeight() const { return GetImplementation(*this).GetHeight(); } -Texture::Texture( Internal::Texture* pointer ) -: BaseHandle( pointer ) +Pixel::Format Texture::GetPixelFormat() const +{ + return GetImplementation(*this).GetPixelFormat(); +} + +Texture::Texture(Internal::Texture* pointer) +: BaseHandle(pointer) { }