return impl.ApplyNativeFragmentShader(shader);
}
+bool IsUploaded(Dali::Texture texture)
+{
+ auto& impl = GetImplementation(texture);
+ return impl.IsUploaded();
+}
+
} // namespace DevelTexture
} // namespace Dali
*/
bool DALI_CORE_API ApplyNativeFragmentShader(Dali::Texture texture, std::string& shader);
+bool DALI_CORE_API IsUploaded(Dali::Texture texture);
+
} // namespace DevelTexture
} // namespace Dali
return modified;
}
+bool Texture::IsUploaded()
+{
+ if(EventThreadServices::IsCoreRunning() && mRenderObject)
+ {
+ return mRenderObject->IsUploaded();
+ }
+ return false;
+}
+
} // namespace Internal
} // namespace Dali
*/
bool ApplyNativeFragmentShader(std::string& shader);
+ /**
+ * @brief Check whether texture is uploaded or not.
+ */
+ bool IsUploaded();
+
private: // implementation
/**
* Constructor
mMaxMipMapLevel( 0 ),
mType( type ),
mHasAlpha( HasAlpha( format ) ),
- mIsCompressed( IsCompressedFormat( format ) )
+ mIsCompressed( IsCompressedFormat( format ) ),
+ mIsUploaded( false )
{
PixelFormatToGl( format,
mGlFormat,
mMaxMipMapLevel( 0 ),
mType( TextureType::TEXTURE_2D ),
mHasAlpha( nativeImageInterface->RequiresBlending() ),
- mIsCompressed( false )
+ mIsCompressed( false ),
+ mIsUploaded( false )
{
}
glFormat, static_cast<GLsizei>( pixelData->GetBufferSize() ), buffer );
}
}
+ mIsUploaded = true;
}
bool Texture::Bind( Context& context, uint32_t textureUnit, Render::Sampler* sampler )
return mNativeImage;
}
+ bool IsUploaded() const
+ {
+ return mIsUploaded;
+ }
+
private:
/**
Type mType:3; ///< Type of the texture
bool mHasAlpha : 1; ///< Whether the format has an alpha channel
bool mIsCompressed : 1; ///< Whether the format is compressed
+ bool mIsUploaded : 1;
};