X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Frender%2Frenderers%2Frender-texture.cpp;h=f016af65ff2d75c0dd39219b164c53423202af36;hb=refs%2Fchanges%2F76%2F290076%2F7;hp=d0d655bbcb9e4f8dbd01f017a1ed1839e9ca70ca;hpb=6e5768771c9f9e0667ad8f61430135b7b61bbcab;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/render/renderers/render-texture.cpp b/dali/internal/render/renderers/render-texture.cpp index d0d655b..f016af6 100644 --- a/dali/internal/render/renderers/render-texture.cpp +++ b/dali/internal/render/renderers/render-texture.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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,10 +16,13 @@ // CLASS HEADER #include -#include // EXTERNAL INCLUDES -#include //floor, log2 +#include //floor, log2 + +// INTERNAL INCLUDES +#include +#include namespace Dali { @@ -27,855 +30,386 @@ namespace Internal { namespace Render { - namespace { +#if defined(DEBUG_ENABLED) +Debug::Filter* gTextureFilter = Debug::Filter::New(Debug::Concise, false, "LOG_TEXTURE"); +#endif -// These match the GL specification -const GLint GL_MINIFY_DEFAULT = GL_NEAREST_MIPMAP_LINEAR; -const GLint GL_MAGNIFY_DEFAULT = GL_LINEAR; -const GLint GL_WRAP_DEFAULT = GL_CLAMP_TO_EDGE; - -// These are the Dali defaults -const GLint DALI_MINIFY_DEFAULT = GL_LINEAR; -const GLint DALI_MAGNIFY_DEFAULT = GL_LINEAR; - -/** - * @brief Convert a FilterMode to its corresponding GL type. - * - * @param[in] filterMode The FilterMode type. - * @param[in] daliDefault The filter mode to use if filterMode is DEFAULT. - * @param[in] glDefault The filter mode to use if filterMode is NONE. - * @return the equivalent GL filter mode. - */ -GLint FilterModeToGL( FilterMode::Type filterMode, GLint daliDefault, GLint glDefault ) -{ - switch( filterMode ) - { - case FilterMode::NEAREST: - { - return GL_NEAREST; - } - case FilterMode::LINEAR: - { - return GL_LINEAR; - } - case FilterMode::NONE: - { - return glDefault; - } - case FilterMode::NEAREST_MIPMAP_NEAREST: - { - return GL_NEAREST_MIPMAP_NEAREST; - } - case FilterMode::LINEAR_MIPMAP_NEAREST: - { - return GL_LINEAR_MIPMAP_NEAREST; - } - case FilterMode::NEAREST_MIPMAP_LINEAR: - { - return GL_NEAREST_MIPMAP_LINEAR; - } - case FilterMode::LINEAR_MIPMAP_LINEAR: - { - return GL_LINEAR_MIPMAP_LINEAR; - } - case FilterMode::DEFAULT: - { - return daliDefault; - } - } - - return daliDefault; -} - -/** - * @brief Convert from a WrapMode to its corresponding GL enumeration - * @param[in] wrapMode The wrap mode - * @param[in] defaultWrapMode The mode to use if WrapMode is Default - * @return The equivalent GL wrap mode - */ -GLint WrapModeToGL( WrapMode::Type wrapMode, GLint defaultWrapMode ) -{ - switch( wrapMode ) - { - case WrapMode::CLAMP_TO_EDGE: - { - return GL_CLAMP_TO_EDGE; - } - case WrapMode::REPEAT: - { - return GL_REPEAT; - } - case WrapMode::MIRRORED_REPEAT: - { - return GL_MIRRORED_REPEAT; - } - case WrapMode::DEFAULT: - { - return defaultWrapMode; - } - } - - return defaultWrapMode; -} +// Memory pool used to allocate new textures. Memory used by this pool will be released when shutting down DALi +MemoryPoolObjectAllocator gTextureMemoryPool; /** - * @brief Retrive GL internal format and pixel data type from a Pixel::Format - * @param[in] pixelFormat The pixel format - * @param[out] pixelDataType The data type of the pixel data - * @param[out] internalFormat The internal format + * Converts DALi pixel format to Graphics::Format + * @param format + * @return */ -void PixelFormatToGl( Pixel::Format pixelformat, unsigned& pixelDataType, unsigned& internalFormat ) +constexpr Graphics::Format ConvertPixelFormat(Pixel::Format format) { - // Compressed textures have no pixelDataType, so init to an invalid value: - pixelDataType = -1; - - switch( pixelformat ) + switch(format) { + case Pixel::INVALID: + return Graphics::Format::UNDEFINED; case Pixel::A8: - { - pixelDataType = GL_UNSIGNED_BYTE; - internalFormat= GL_ALPHA; - break; - } + return Graphics::Format::R8_UNORM; case Pixel::L8: - { - pixelDataType = GL_UNSIGNED_BYTE; - internalFormat= GL_LUMINANCE; - break; - } - + return Graphics::Format::L8; case Pixel::LA88: - { - pixelDataType = GL_UNSIGNED_BYTE; - internalFormat= GL_LUMINANCE_ALPHA; - break; - } - + return Graphics::Format::L8A8; case Pixel::RGB565: - { - pixelDataType = GL_UNSIGNED_SHORT_5_6_5; - internalFormat= GL_RGB; - break; - } - + return Graphics::Format::R5G6B5_UNORM_PACK16; case Pixel::BGR565: - { - DALI_LOG_ERROR("Pixel format BGR565 is not supported by GLES.\n"); - pixelDataType = GL_UNSIGNED_SHORT_5_6_5; -#ifdef _ARCH_ARM_ - internalFormat= GL_BGRA_EXT; // alpha is reserved but not used -#else - internalFormat= GL_RGBA; // alpha is reserved but not used -#endif - break; - } - + return Graphics::Format::B5G6R5_UNORM_PACK16; case Pixel::RGBA4444: - { - pixelDataType = GL_UNSIGNED_SHORT_4_4_4_4; - internalFormat= GL_RGBA; - break; - } + return Graphics::Format::R4G4B4A4_UNORM_PACK16; case Pixel::BGRA4444: - { - DALI_LOG_ERROR("Pixel format BGRA4444 is not supported by GLES.\n"); - pixelDataType = GL_UNSIGNED_SHORT_4_4_4_4; -#ifdef _ARCH_ARM_ - internalFormat= GL_BGRA_EXT; // alpha is reserved but not used -#else - internalFormat= GL_RGBA; // alpha is reserved but not used -#endif - break; - } - + return Graphics::Format::B4G4R4A4_UNORM_PACK16; case Pixel::RGBA5551: - { - pixelDataType = GL_UNSIGNED_SHORT_5_5_5_1; - internalFormat= GL_RGBA; - break; - } - + return Graphics::Format::R5G5B5A1_UNORM_PACK16; case Pixel::BGRA5551: - { - DALI_LOG_ERROR("Pixel format BGRA5551 is not supported by GLES.\n"); - pixelDataType = GL_UNSIGNED_SHORT_5_5_5_1; -#ifdef _ARCH_ARM_ - internalFormat= GL_BGRA_EXT; // alpha is reserved but not used -#else - internalFormat= GL_RGBA; // alpha is reserved but not used -#endif - break; - } - + return Graphics::Format::B5G5R5A1_UNORM_PACK16; case Pixel::RGB888: - { - pixelDataType = GL_UNSIGNED_BYTE; - internalFormat= GL_RGB; - break; - } - + return Graphics::Format::R8G8B8_UNORM; case Pixel::RGB8888: - { - pixelDataType = GL_UNSIGNED_BYTE; - internalFormat= GL_RGBA; // alpha is reserved but not used - break; - } - + return Graphics::Format::R8G8B8A8_UNORM; case Pixel::BGR8888: - { - pixelDataType = GL_UNSIGNED_BYTE; -#ifdef GL_BGRA_EXT - internalFormat= GL_BGRA_EXT; // alpha is reserved but not used -#else - internalFormat= GL_RGBA; // alpha is reserved but not used -#endif - break; - } - + return Graphics::Format::B8G8R8A8_UNORM; case Pixel::RGBA8888: - { - pixelDataType = GL_UNSIGNED_BYTE; - internalFormat= GL_RGBA; - break; - } - + return Graphics::Format::R8G8B8A8_UNORM; case Pixel::BGRA8888: - { - pixelDataType = GL_UNSIGNED_BYTE; -#ifdef GL_BGRA_EXT - internalFormat= GL_BGRA_EXT; // alpha is reserved but not used -#else - internalFormat= GL_RGBA; // alpha is reserved but not used -#endif - break; - } + return Graphics::Format::B8G8R8A8_UNORM; - // GLES 2 extension compressed formats: - case Pixel::COMPRESSED_RGB8_ETC1: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using non-standard GLES 2.0 extension compressed pixel format COMPRESSED_RGB8_ETC1.\n" ); - internalFormat = 0x8D64; ///! < Hardcoded so we can test before we move to GLES 3.0 or greater. - break; - } - case Pixel::COMPRESSED_RGB_PVRTC_4BPPV1: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using non-standard GLES 2.0 extension compressed pixel format COMPRESSED_RGB_PVRTC_4BPPV1.\n" ); - internalFormat = 0x8C00; ///! < Hardcoded so we can test before we move to GLES 3.0 or greater. - break; - } + case Pixel::DEPTH_UNSIGNED_INT: + return Graphics::Format::D16_UNORM; + case Pixel::DEPTH_FLOAT: + return Graphics::Format::D32_SFLOAT; + case Pixel::DEPTH_STENCIL: + return Graphics::Format::D24_UNORM_S8_UINT; - // GLES 3.0 standard compressed formats: + // EAC case Pixel::COMPRESSED_R11_EAC: - { - DALI_LOG_INFO(Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.0 standard compressed pixel format COMPRESSED_R11_EAC.\n"); - internalFormat = GL_COMPRESSED_R11_EAC; - break; - } + return Graphics::Format::EAC_R11_UNORM_BLOCK; case Pixel::COMPRESSED_SIGNED_R11_EAC: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.0 standard compressed pixel format COMPRESSED_SIGNED_R11_EAC.\n" ); - internalFormat = GL_COMPRESSED_SIGNED_R11_EAC; - break; - } + return Graphics::Format::EAC_R11_SNORM_BLOCK; case Pixel::COMPRESSED_RG11_EAC: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.0 standard compressed pixel format COMPRESSED_RG11_EAC.\n" ); - internalFormat = GL_COMPRESSED_RG11_EAC; - break; - } + return Graphics::Format::EAC_R11G11_UNORM_BLOCK; case Pixel::COMPRESSED_SIGNED_RG11_EAC: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.0 standard compressed pixel format COMPRESSED_SIGNED_RG11_EAC.\n" ); - internalFormat = GL_COMPRESSED_SIGNED_RG11_EAC; - break; - } + return Graphics::Format::EAC_R11G11_SNORM_BLOCK; + + // ETC case Pixel::COMPRESSED_RGB8_ETC2: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.0 standard compressed pixel format COMPRESSED_RGB8_ETC2.\n" ); - internalFormat = GL_COMPRESSED_RGB8_ETC2; - break; - } + return Graphics::Format::ETC2_R8G8B8_UNORM_BLOCK; case Pixel::COMPRESSED_SRGB8_ETC2: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.0 standard compressed pixel format COMPRESSED_SRGB8_ETC2.\n" ); - internalFormat = GL_COMPRESSED_SRGB8_ETC2; - break; - } + return Graphics::Format::ETC2_R8G8B8_SRGB_BLOCK; + case Pixel::COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.0 standard compressed pixel format COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2.\n" ); - internalFormat = GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2; - break; - } + return Graphics::Format::ETC2_R8G8B8A1_UNORM_BLOCK; // no 'punchthrough' format + case Pixel::COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.0 standard compressed pixel format COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2.\n" ); - internalFormat = GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2; - break; - } + return Graphics::Format::ETC2_R8G8B8A1_SRGB_BLOCK; // no 'punchthrough' format + case Pixel::COMPRESSED_RGBA8_ETC2_EAC: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.0 standard compressed pixel format COMPRESSED_RGBA8_ETC2_EAC.\n" ); - internalFormat = GL_COMPRESSED_RGBA8_ETC2_EAC; - break; - } + return Graphics::Format::ETC2_R8G8B8A8_UNORM_BLOCK; + case Pixel::COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.0 standard compressed pixel format COMPRESSED_SRGB8_ALPHA8_ETC2_EAC.\n" ); - internalFormat = GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC; - break; - } + return Graphics::Format::ETC2_R8G8B8A8_SRGB_BLOCK; - // GLES 3.1 extension compressed formats: + case Pixel::COMPRESSED_RGB8_ETC1: + return Graphics::Format::ETC2_R8G8B8_UNORM_BLOCK; // doesn't seem to be supported at all + + case Pixel::COMPRESSED_RGB_PVRTC_4BPPV1: + return Graphics::Format::PVRTC1_4BPP_UNORM_BLOCK_IMG; // or SRGB? + + // ASTC case Pixel::COMPRESSED_RGBA_ASTC_4x4_KHR: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.1 standard compressed pixel format COMPRESSED_RGBA_ASTC_4x4_KHR.\n" ); - internalFormat = GL_COMPRESSED_RGBA_ASTC_4x4_KHR; - break; - } + return Graphics::Format::ASTC_4x4_UNORM_BLOCK; // or SRGB? case Pixel::COMPRESSED_RGBA_ASTC_5x4_KHR: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.1 standard compressed pixel format COMPRESSED_RGBA_ASTC_5x4_KHR.\n" ); - internalFormat = GL_COMPRESSED_RGBA_ASTC_5x4_KHR; - break; - } + return Graphics::Format::ASTC_5x4_UNORM_BLOCK; case Pixel::COMPRESSED_RGBA_ASTC_5x5_KHR: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.1 standard compressed pixel format COMPRESSED_RGBA_ASTC_5x5_KHR.\n" ); - internalFormat = GL_COMPRESSED_RGBA_ASTC_5x5_KHR; - break; - } + return Graphics::Format::ASTC_5x5_UNORM_BLOCK; case Pixel::COMPRESSED_RGBA_ASTC_6x5_KHR: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.1 standard compressed pixel format COMPRESSED_RGBA_ASTC_6x5_KHR.\n" ); - internalFormat = GL_COMPRESSED_RGBA_ASTC_6x5_KHR; - break; - } + return Graphics::Format::ASTC_6x5_UNORM_BLOCK; case Pixel::COMPRESSED_RGBA_ASTC_6x6_KHR: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.1 standard compressed pixel format COMPRESSED_RGBA_ASTC_6x6_KHR.\n" ); - internalFormat = GL_COMPRESSED_RGBA_ASTC_6x6_KHR; - break; - } + return Graphics::Format::ASTC_6x6_UNORM_BLOCK; case Pixel::COMPRESSED_RGBA_ASTC_8x5_KHR: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.1 standard compressed pixel format COMPRESSED_RGBA_ASTC_8x5_KHR.\n" ); - internalFormat = GL_COMPRESSED_RGBA_ASTC_8x5_KHR; - break; - } + return Graphics::Format::ASTC_8x5_UNORM_BLOCK; case Pixel::COMPRESSED_RGBA_ASTC_8x6_KHR: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.1 standard compressed pixel format COMPRESSED_RGBA_ASTC_8x6_KHR.\n" ); - internalFormat = GL_COMPRESSED_RGBA_ASTC_8x6_KHR; - break; - } + return Graphics::Format::ASTC_8x6_UNORM_BLOCK; case Pixel::COMPRESSED_RGBA_ASTC_8x8_KHR: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.1 standard compressed pixel format COMPRESSED_RGBA_ASTC_8x8_KHR.\n" ); - internalFormat = GL_COMPRESSED_RGBA_ASTC_8x8_KHR; - break; - } + return Graphics::Format::ASTC_8x8_UNORM_BLOCK; case Pixel::COMPRESSED_RGBA_ASTC_10x5_KHR: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.1 standard compressed pixel format COMPRESSED_RGBA_ASTC_10x5_KHR.\n" ); - internalFormat = GL_COMPRESSED_RGBA_ASTC_10x5_KHR; - break; - } + return Graphics::Format::ASTC_10x5_UNORM_BLOCK; case Pixel::COMPRESSED_RGBA_ASTC_10x6_KHR: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.1 standard compressed pixel format COMPRESSED_RGBA_ASTC_10x6_KHR.\n" ); - internalFormat = GL_COMPRESSED_RGBA_ASTC_10x6_KHR; - break; - } + return Graphics::Format::ASTC_10x6_UNORM_BLOCK; case Pixel::COMPRESSED_RGBA_ASTC_10x8_KHR: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.1 standard compressed pixel format COMPRESSED_RGBA_ASTC_10x8_KHR.\n" ); - internalFormat = GL_COMPRESSED_RGBA_ASTC_10x8_KHR; - break; - } + return Graphics::Format::ASTC_10x8_UNORM_BLOCK; case Pixel::COMPRESSED_RGBA_ASTC_10x10_KHR: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.1 standard compressed pixel format COMPRESSED_RGBA_ASTC_10x10_KHR.\n" ); - internalFormat = GL_COMPRESSED_RGBA_ASTC_10x10_KHR; - break; - } + return Graphics::Format::ASTC_10x10_UNORM_BLOCK; case Pixel::COMPRESSED_RGBA_ASTC_12x10_KHR: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.1 standard compressed pixel format COMPRESSED_RGBA_ASTC_12x10_KHR.\n" ); - internalFormat = GL_COMPRESSED_RGBA_ASTC_12x10_KHR; - break; - } + return Graphics::Format::ASTC_12x10_UNORM_BLOCK; case Pixel::COMPRESSED_RGBA_ASTC_12x12_KHR: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.1 standard compressed pixel format COMPRESSED_RGBA_ASTC_12x12_KHR.\n" ); - internalFormat = GL_COMPRESSED_RGBA_ASTC_12x12_KHR; - break; - } + return Graphics::Format::ASTC_12x12_UNORM_BLOCK; case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.1 standard compressed pixel format COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR.\n" ); - internalFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR; - break; - } + return Graphics::Format::ASTC_4x4_SRGB_BLOCK; // not type with alpha, but likely to use SRGB case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.1 standard compressed pixel format COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR.\n" ); - internalFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR; - break; - } + return Graphics::Format::ASTC_5x4_SRGB_BLOCK; case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.1 standard compressed pixel format COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR.\n" ); - internalFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR; - break; - } + return Graphics::Format::ASTC_5x5_SRGB_BLOCK; case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.1 standard compressed pixel format COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR.\n" ); - internalFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR; - break; - } + return Graphics::Format::ASTC_6x5_SRGB_BLOCK; case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.1 standard compressed pixel format COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR.\n" ); - internalFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR; - break; - } + return Graphics::Format::ASTC_6x6_SRGB_BLOCK; case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.1 standard compressed pixel format COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR.\n" ); - internalFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR; - break; - } + return Graphics::Format::ASTC_8x5_SRGB_BLOCK; case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.1 standard compressed pixel format COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR.\n" ); - internalFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR; - break; - } + return Graphics::Format::ASTC_8x6_UNORM_BLOCK; case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.1 standard compressed pixel format COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR.\n" ); - internalFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR; - break; - } + return Graphics::Format::ASTC_8x8_SRGB_BLOCK; case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.1 standard compressed pixel format COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR.\n" ); - internalFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR; - break; - } + return Graphics::Format::ASTC_10x5_SRGB_BLOCK; case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.1 standard compressed pixel format COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR.\n" ); - internalFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR; - break; - } + return Graphics::Format::ASTC_10x6_SRGB_BLOCK; case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.1 standard compressed pixel format COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR.\n" ); - internalFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR; - break; - } + return Graphics::Format::ASTC_10x8_SRGB_BLOCK; case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.1 standard compressed pixel format COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR.\n" ); - internalFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR; - break; - } + return Graphics::Format::ASTC_10x10_SRGB_BLOCK; case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.1 standard compressed pixel format COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR.\n" ); - internalFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR; - break; - } + return Graphics::Format::ASTC_12x10_SRGB_BLOCK; case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: - { - DALI_LOG_INFO( Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.1 standard compressed pixel format COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR.\n" ); - internalFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR; - break; - } - - case Pixel::INVALID: - { - DALI_LOG_ERROR( "Invalid pixel format for bitmap\n" ); - internalFormat = 0; - break; - } + return Graphics::Format::ASTC_12x12_SRGB_BLOCK; + + case Pixel::RGB16F: + return Graphics::Format::R16G16B16_SFLOAT; + case Pixel::RGB32F: + return Graphics::Format::R32G32B32_SFLOAT; + case Pixel::R11G11B10F: + return Graphics::Format::R11G11B10_UFLOAT_PACK32; + + case Pixel::CHROMINANCE_U: + return Graphics::Format::L8; + case Pixel::CHROMINANCE_V: + return Graphics::Format::L8; } + return Graphics::Format::UNDEFINED; } -/** - * @brief Whether specified pixel format is compressed. - * - * @param [in] pixelformat Pixel format - * @return true if format is compressed, false otherwise - */ -bool IsCompressedFormat(Pixel::Format pixelFormat) +constexpr Graphics::TextureType ConvertType(Texture::Type type) { - switch (pixelFormat) + switch(type) { - case Pixel::L8: - case Pixel::A8: - case Pixel::LA88: - case Pixel::RGB565: - case Pixel::RGBA4444: - case Pixel::RGBA5551: - case Pixel::BGR565: - case Pixel::BGRA4444: - case Pixel::BGRA5551: - case Pixel::RGB888: - case Pixel::RGB8888: - case Pixel::BGR8888: - case Pixel::RGBA8888: - case Pixel::BGRA8888: - case Pixel::INVALID: - { - return false; - } - - case Pixel::COMPRESSED_R11_EAC: - case Pixel::COMPRESSED_SIGNED_R11_EAC: - case Pixel::COMPRESSED_RG11_EAC: - case Pixel::COMPRESSED_SIGNED_RG11_EAC: - case Pixel::COMPRESSED_RGB8_ETC2: - case Pixel::COMPRESSED_SRGB8_ETC2: - case Pixel::COMPRESSED_RGB8_ETC1: - case Pixel::COMPRESSED_RGB_PVRTC_4BPPV1: - case Pixel::COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: - case Pixel::COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: - case Pixel::COMPRESSED_RGBA8_ETC2_EAC: - case Pixel::COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: - case Pixel::COMPRESSED_RGBA_ASTC_4x4_KHR: - case Pixel::COMPRESSED_RGBA_ASTC_5x4_KHR: - case Pixel::COMPRESSED_RGBA_ASTC_5x5_KHR: - case Pixel::COMPRESSED_RGBA_ASTC_6x5_KHR: - case Pixel::COMPRESSED_RGBA_ASTC_6x6_KHR: - case Pixel::COMPRESSED_RGBA_ASTC_8x5_KHR: - case Pixel::COMPRESSED_RGBA_ASTC_8x6_KHR: - case Pixel::COMPRESSED_RGBA_ASTC_8x8_KHR: - case Pixel::COMPRESSED_RGBA_ASTC_10x5_KHR: - case Pixel::COMPRESSED_RGBA_ASTC_10x6_KHR: - case Pixel::COMPRESSED_RGBA_ASTC_10x8_KHR: - case Pixel::COMPRESSED_RGBA_ASTC_10x10_KHR: - case Pixel::COMPRESSED_RGBA_ASTC_12x10_KHR: - case Pixel::COMPRESSED_RGBA_ASTC_12x12_KHR: - case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: - case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: - case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: - case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: - case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: - case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: - case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: - case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: - case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR: - case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: - case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: - case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: - case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: - case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: - { - return true; - } + case TextureType::TEXTURE_2D: + return Graphics::TextureType::TEXTURE_2D; + case TextureType::TEXTURE_CUBE: + return Graphics::TextureType::TEXTURE_CUBEMAP; } - - return false; + return Graphics::TextureType::TEXTURE_2D; } } //Unnamed namespace - -Texture::Texture( Type type, Pixel::Format format, unsigned int width, unsigned int height ) -:mId( 0 ), - mTarget( (type == TextureType::TEXTURE_2D)? GL_TEXTURE_2D : GL_TEXTURE_CUBE_MAP ), - mType( type ), - mSampler(), - mNativeImage(), - mInternalFormat(GL_RGB), - mPixelDataType(GL_UNSIGNED_BYTE), - mWidth( width ), - mHeight( height ), - mHasAlpha( HasAlpha( format ) ), - mIsCompressed( IsCompressedFormat( format ) ) +TextureKey Texture::NewKey(Type type, Pixel::Format format, ImageDimensions size) { - PixelFormatToGl( format, mPixelDataType, mInternalFormat ); + void* ptr = gTextureMemoryPool.AllocateRawThreadSafe(); + auto key = gTextureMemoryPool.GetKeyFromPtr(static_cast(ptr)); + new(ptr) Texture(type, format, size); + + return TextureKey(key); } -Texture::Texture( NativeImageInterfacePtr nativeImageInterface ) -:mId( 0 ), - mTarget( GL_TEXTURE_2D ), - mType( TextureType::TEXTURE_2D ), - mSampler(), - mNativeImage( nativeImageInterface ), - mInternalFormat(GL_RGB), - mPixelDataType(GL_UNSIGNED_BYTE), - mWidth( nativeImageInterface->GetWidth() ), - mHeight( nativeImageInterface->GetHeight() ), - mHasAlpha( nativeImageInterface->RequiresBlending() ), - mIsCompressed( false ) +TextureKey Texture::NewKey(NativeImageInterfacePtr nativeImageInterface) { + void* ptr = gTextureMemoryPool.AllocateRawThreadSafe(); + auto key = gTextureMemoryPool.GetKeyFromPtr(static_cast(ptr)); + new(ptr) Texture(nativeImageInterface); + + return TextureKey(key); } -Texture::~Texture() -{} +Texture::Texture(Type type, Pixel::Format format, ImageDimensions size) +: mGraphicsController(nullptr), + mGraphicsTexture(nullptr), + mNativeImage(), + mSampler(), + mPixelFormat(format), + mWidth(size.GetWidth()), + mHeight(size.GetHeight()), + mType(type), + mHasAlpha(HasAlpha(format)), + mUpdated(true) +{ +} -void Texture::Destroy( Context& context ) +Texture::Texture(NativeImageInterfacePtr nativeImageInterface) +: mGraphicsController(nullptr), + mGraphicsTexture(nullptr), + mNativeImage(nativeImageInterface), + mSampler(), + mPixelFormat(Pixel::RGBA8888), + mWidth(static_cast(nativeImageInterface->GetWidth())), // ignoring overflow, not happening in practice + mHeight(static_cast(nativeImageInterface->GetHeight())), // ignoring overflow, not happening in practice + mType(TextureType::TEXTURE_2D), + mHasAlpha(nativeImageInterface->RequiresBlending()), + mUpdated(true) { - if( mId ) - { - context.DeleteTextures( 1, &mId ); +} - if( mNativeImage ) - { - mNativeImage->GlExtensionDestroy(); - } - } +Texture::~Texture() = default; + +void Texture::operator delete(void* ptr) +{ + gTextureMemoryPool.FreeThreadSafe(static_cast(ptr)); } -void Texture::GlContextDestroyed() +Render::Texture* Texture::Get(TextureKey::KeyType key) { - mId = 0u; + return gTextureMemoryPool.GetPtrFromKey(key); } -void Texture::Initialize(Context& context) +void Texture::Initialize(Graphics::Controller& graphicsController) { - if( mNativeImage ) - { - if( mNativeImage->GlExtensionCreate() ) - { - NativeImageInterface::Extension* extension = mNativeImage->GetExtension(); - if( extension ) - { - mTarget = extension->GetEglImageTextureTarget(); - } - - context.GenTextures( 1, &mId ); - context.BindTexture( mTarget, mId ); - context.PixelStorei( GL_UNPACK_ALIGNMENT, 1 ); // We always use tightly packed data - - //Apply default sampling parameters - context.TexParameteri( mTarget, GL_TEXTURE_MIN_FILTER, DALI_MINIFY_DEFAULT ); - context.TexParameteri( mTarget, GL_TEXTURE_MAG_FILTER, DALI_MAGNIFY_DEFAULT ); - context.TexParameteri( mTarget, GL_TEXTURE_WRAP_S, GL_WRAP_DEFAULT ); - context.TexParameteri( mTarget, GL_TEXTURE_WRAP_T, GL_WRAP_DEFAULT ); - - // platform specific implementation decides on what GL extension to use - if( mNativeImage->TargetTexture() != 0u ) - { - context.DeleteTextures( 1, &mId ); - mNativeImage->GlExtensionDestroy(); - mId = 0u; - } - } - } - else + mGraphicsController = &graphicsController; + if(mNativeImage) { - //Create the texture and reserve memory for the first mipmap level. - context.GenTextures( 1, &mId ); - context.BindTexture( mTarget, mId ); - context.PixelStorei( GL_UNPACK_ALIGNMENT, 1 ); // We always use tightly packed data - - //Apply default sampling parameters - context.TexParameteri( mTarget, GL_TEXTURE_MIN_FILTER, DALI_MINIFY_DEFAULT ); - context.TexParameteri( mTarget, GL_TEXTURE_MAG_FILTER, DALI_MAGNIFY_DEFAULT ); - context.TexParameteri( mTarget, GL_TEXTURE_WRAP_S, GL_WRAP_DEFAULT ); - context.TexParameteri( mTarget, GL_TEXTURE_WRAP_T, GL_WRAP_DEFAULT ); - - if( mType == TextureType::TEXTURE_2D ) - { - if( !mIsCompressed ) - { - context.TexImage2D(GL_TEXTURE_2D, 0, mInternalFormat, mWidth, mHeight, 0, mInternalFormat, mPixelDataType, 0 ); - } - else - { - context.CompressedTexImage2D(GL_TEXTURE_2D, 0, mInternalFormat, mWidth, mHeight, 0, 0, 0 ); - } - } - else if( mType == TextureType::TEXTURE_CUBE ) - { - if( !mIsCompressed ) - { - for( unsigned int i(0); i<6; ++i ) - { - context.TexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, mInternalFormat, mWidth, mHeight, 0, mInternalFormat, mPixelDataType, 0 ); - } - } - else - { - for( unsigned int i(0); i<6; ++i ) - { - context.CompressedTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, mInternalFormat, mWidth, mHeight, 0, 0, 0 ); - } - } - context.TexParameteri( mTarget, GL_TEXTURE_WRAP_R, GL_WRAP_DEFAULT ); - } + Create(static_cast(Graphics::TextureUsageFlagBits::SAMPLE)); } } -void Texture::Upload( Context& context, PixelDataPtr pixelData, const Internal::Texture::UploadParams& params ) +void Texture::Destroy() { - DALI_ASSERT_ALWAYS( mNativeImage == NULL ); + mGraphicsTexture.reset(); +} - //Get pointer to the data of the PixelData object - unsigned char* buffer( pixelData->GetBuffer() ); +Graphics::Texture* Texture::GetGraphicsObject() const +{ + DALI_LOG_INFO(gTextureFilter, Debug::General, "SC::Texture(%p)::GetGraphicsObject() = %p\n", this, mGraphicsTexture.get()); - //This buffer is only used if manually converting from RGB to RGBA - unsigned char* tempBuffer(0); + return mGraphicsTexture.get(); +} - //Get pixel format and data type of the data contained in the PixelData object - GLenum pixelDataFormat, pixelDataElementType; - PixelFormatToGl( pixelData->GetPixelFormat(), pixelDataElementType, pixelDataFormat ); +void Texture::Create(Graphics::TextureUsageFlags usage) +{ + CreateWithData(usage, nullptr, 0u); +} -#if DALI_GLES_VERSION < 30 - if( pixelDataFormat == GL_RGB && mInternalFormat == GL_RGBA ) - { - //Convert manually from RGB to RGBA if GLES < 3 ( GLES 3 can do the conversion automatically when uploading ) - size_t dataSize = static_cast< size_t >( params.width ) * params.height; - tempBuffer = new unsigned char[dataSize*4u]; - for( size_t i(0u); iCreateTexture(createInfo, std::move(mGraphicsTexture)); +} - //Upload data to the texture +void Texture::Upload(PixelDataPtr pixelData, const Internal::Texture::UploadParams& params) +{ + DALI_ASSERT_ALWAYS(!mNativeImage); - context.BindTexture( mTarget, mId ); - GLenum target( mTarget ); - if( mType == TextureType::TEXTURE_CUBE ) + if(!mGraphicsTexture) { - target = GL_TEXTURE_CUBE_MAP_POSITIVE_X + params.layer; + Create(static_cast(Graphics::TextureUsageFlagBits::SAMPLE)); } - context.PixelStorei( GL_UNPACK_ALIGNMENT, 1 ); - - if( params.xOffset == 0 && params.yOffset == 0 && - params.width == ( mWidth / (1<GetBufferSize(), buffer ); - } - } - else - { - //Specifying part of the image for the mipmap - if( !mIsCompressed ) - { - context.TexSubImage2D( target, params.mipmap, - params.xOffset, params.yOffset, params.width, params.height, - pixelDataFormat, pixelDataElementType, buffer ); - } - else - { - context.CompressedTexSubImage2D( target, params.mipmap, - params.xOffset, params.yOffset, params.width, params.height, - pixelDataFormat, pixelData->GetBufferSize(), buffer ); - } - } + Graphics::TextureUpdateInfo info{}; + const uint32_t srcStride = pixelData->GetStride(); + uint32_t srcOffset = 0u; + uint32_t srcSize = pixelData->GetBufferSize(); - //Destroy temp buffer used for conversion RGB->RGBA - delete[] tempBuffer; -} + const bool requiredSubPixelData = (!Pixel::IsCompressed(pixelData->GetPixelFormat())) && + ((params.dataXOffset != 0) || + (params.dataYOffset != 0) || + (params.dataWidth != pixelData->GetWidth()) || + (params.dataHeight != pixelData->GetHeight())); -bool Texture::Bind( Context& context, unsigned int textureUnit, Render::Sampler* sampler ) -{ - if( mNativeImage && mId == 0 ) + if(requiredSubPixelData) { - Initialize( context ); + /** + * TextureUpdateInfo use byte scaled offset / size. + * + * To make we only use sub-data of inputed PixelData, make srcOffset as 'start of SubPixelData. + * + * |---- dataStrideByte -----| + * |-----| <-- dataXOffsetByte + * ........................... + * ......A-----------+........ + * ......| |........ + * ......| |........ + * ......+-----------+C....... + * ......B.................... + * + * A) Start of SubPixelData. offsetByte = dataStrideByte * dataYOffset + dataXOffsetByte. + * B) offsetByte = A).offsetByte + dataStrideByte * dataHeight. Note, It can be out of original PixelData boundary. + * C) End of SubPixelData. offsetByte = B).offsetByte - dataStrideByte + dataWidthByte. + * + * srcOffset = A).offsetByte; + * srcSize = ( C).offsetByte - A).offsetByte ); + */ + const uint32_t bytePerPixel = Pixel::GetBytesPerPixel(pixelData->GetPixelFormat()); + const uint32_t dataStrideByte = (srcStride ? srcStride : static_cast(params.dataWidth)) * bytePerPixel; + const uint32_t dataXOffsetByte = params.dataXOffset * bytePerPixel; + const uint32_t dataWidthByte = static_cast(params.dataWidth) * bytePerPixel; + + srcOffset = params.dataYOffset * dataStrideByte + dataXOffsetByte; + srcSize = static_cast(params.dataHeight) * dataStrideByte - (dataStrideByte - dataWidthByte); } - if( mId != 0 ) - { - context.ActiveTexture( static_cast(textureUnit) ); - context.BindTexture( mTarget, mId ); - ApplySampler( context, sampler ); + info.dstTexture = mGraphicsTexture.get(); + info.dstOffset2D = {params.xOffset, params.yOffset}; + info.layer = params.layer; + info.level = params.mipmap; + info.srcReference = 0; + info.srcExtent2D = {params.dataWidth, params.dataHeight}; + info.srcOffset = srcOffset; + info.srcSize = srcSize; + info.srcStride = srcStride; + info.srcFormat = ConvertPixelFormat(pixelData->GetPixelFormat()); - if( mNativeImage ) - { - mNativeImage->PrepareTexture(); - } + Graphics::TextureUpdateSourceInfo updateSourceInfo{}; + updateSourceInfo.sourceType = Graphics::TextureUpdateSourceInfo::Type::PIXEL_DATA; + updateSourceInfo.pixelDataSource.pixelData = Dali::PixelData(pixelData.Get()); - return true; - } + mGraphicsController->UpdateTextures({info}, {updateSourceInfo}); - return false; + SetUpdated(true); } -void Texture::ApplySampler( Context& context, Render::Sampler* sampler ) +bool Texture::HasAlphaChannel() const { - Render::Sampler oldSampler = mSampler; - mSampler = sampler ? *sampler : Sampler(); - - if( mSampler != oldSampler ) + bool alpha = mHasAlpha; + if(mNativeImage) { - GLint mode = FilterModeToGL( mSampler.mMinificationFilter, DALI_MINIFY_DEFAULT, GL_MINIFY_DEFAULT ); - if( mode != FilterModeToGL( oldSampler.mMinificationFilter, DALI_MINIFY_DEFAULT, GL_MINIFY_DEFAULT ) ) - { - context.TexParameteri( mTarget, GL_TEXTURE_MIN_FILTER, mode ); - } - - mode = FilterModeToGL( mSampler.mMagnificationFilter, DALI_MAGNIFY_DEFAULT, GL_MAGNIFY_DEFAULT ); - if( mode != FilterModeToGL( oldSampler.mMagnificationFilter, DALI_MAGNIFY_DEFAULT, GL_MAGNIFY_DEFAULT ) ) - { - context.TexParameteri( mTarget, GL_TEXTURE_MAG_FILTER, mode ); - } - - mode = WrapModeToGL( mSampler.mSWrapMode, GL_WRAP_DEFAULT ); - if( mode != WrapModeToGL( oldSampler.mSWrapMode, GL_WRAP_DEFAULT ) ) - { - context.TexParameteri( mTarget, GL_TEXTURE_WRAP_S, mode ); - } - - mode = WrapModeToGL( mSampler.mTWrapMode, GL_WRAP_DEFAULT ); - if( mode != WrapModeToGL( oldSampler.mTWrapMode, GL_WRAP_DEFAULT ) ) - { - context.TexParameteri( mTarget, GL_TEXTURE_WRAP_T, mode ); - } - - if( mType == TextureType::TEXTURE_CUBE ) - { - mode = WrapModeToGL( mSampler.mRWrapMode, GL_WRAP_DEFAULT ); - if( mode != WrapModeToGL( oldSampler.mRWrapMode, GL_WRAP_DEFAULT ) ) - { - context.TexParameteri( mTarget, GL_TEXTURE_WRAP_R, mode ); - } - } + alpha = mNativeImage->RequiresBlending(); } + return alpha; } -bool Texture::HasAlphaChannel() +void Texture::GenerateMipmaps() { - return mHasAlpha; + if(!mGraphicsTexture) + { + Create(static_cast(Graphics::TextureUsageFlagBits::SAMPLE)); + } + + mGraphicsController->GenerateTextureMipmaps(*mGraphicsTexture.get()); } -void Texture::GenerateMipmaps( Context& context ) +void Texture::OnRenderFinished() { - context.BindTexture( mTarget, mId ); - context.GenerateMipmap( mTarget ); + SetUpdated(false); } -} //Render +} // namespace Render -} //Internal +} // namespace Internal -} //Dali +} // namespace Dali