}
}
+void TestGraphicsController::GenerateTextureMipmaps(const Graphics::Texture& texture)
+{
+ mCallStack.PushCall("GenerateTextureMipmaps", "");
+
+ auto gfxTexture = Uncast<TestGraphicsTexture>(&texture);
+ mGl.BindTexture(gfxTexture->GetTarget(), 0);
+ mGl.GenerateMipmap(gfxTexture->GetTarget());
+}
+
bool TestGraphicsController::EnableDepthStencilBuffer(bool enableDepth, bool enableStencil)
{
TraceCallStack::NamedParams namedParams;
const std::vector<Graphics::TextureUpdateSourceInfo>& sourceList) override;
/**
+ * Auto generates mipmaps for the texture
+ * @param[in] texture The texture
+ */
+ void GenerateTextureMipmaps(const Graphics::Texture& texture) override;
+
+ /**
* TBD: do we need those functions in the new implementation?
*/
bool EnableDepthStencilBuffer(bool enableDepth, bool enableStencil) override;
int UtcDaliTextureGenerateMipmaps(void)
{
-#ifdef OLD_GRAPHICS_TEST
TestApplication application;
unsigned int width(64);
unsigned int height(64);
out << GL_TEXTURE_CUBE_MAP;
DALI_TEST_CHECK(callStack.FindMethodAndParams("GenerateMipmap", out.str().c_str()));
}
-#else
- DALI_TEST_CHECK(1);
-#endif
END_TEST;
}
const std::vector<TextureUpdateSourceInfo>& sourceList) = 0;
/**
+ * Auto generates mipmaps for the texture
+ * @param[in] texture The texture
+ */
+ virtual void GenerateTextureMipmaps(const Texture& texture) = 0;
+
+ /**
* @brief Enables depth/stencil buffer
*
* @param[in] enableDepth True to enable depth
* @param[out] outData Pointer to output memory
* @return True on success
*/
- virtual bool GetProgramParameter(Graphics::Program& program, uint32_t parameterId, void* outData ) = 0;
+ virtual bool GetProgramParameter(Graphics::Program& program, uint32_t parameterId, void* outData) = 0;
protected:
/**
mPixelFormat(format),
mWidth(size.GetWidth()),
mHeight(size.GetHeight()),
- mMaxMipMapLevel(0),
mType(type),
mHasAlpha(HasAlpha(format))
{
mPixelFormat(Pixel::RGBA8888),
mWidth(static_cast<uint16_t>(nativeImageInterface->GetWidth())), // ignoring overflow, not happening in practice
mHeight(static_cast<uint16_t>(nativeImageInterface->GetHeight())), // ignoring overflow, not happening in practice
- mMaxMipMapLevel(0),
mType(TextureType::TEXTURE_2D),
mHasAlpha(nativeImageInterface->RequiresBlending())
{
void Texture::GenerateMipmaps()
{
- mMaxMipMapLevel = 0;
- DALI_LOG_ERROR("FIXME: GRAPHICS");
- //@todo Implement with Graphics API
+ if(!mGraphicsTexture)
+ {
+ Create(static_cast<Graphics::TextureUsageFlags>(Graphics::TextureUsageFlagBits::SAMPLE));
+ }
+
+ mGraphicsController->GenerateTextureMipmaps(*mGraphicsTexture.get());
}
} // namespace Render
NativeImageInterfacePtr mNativeImage; ///< Pointer to native image
Render::Sampler mSampler; ///< The current sampler state
- Pixel::Format mPixelFormat; ///< Pixel format of the texture
- uint16_t mWidth; ///< Width of the texture
- uint16_t mHeight; ///< Height of the texture
- uint16_t mMaxMipMapLevel; ///< Maximum mipmap level
- Type mType : 3; ///< Type of the texture
- bool mHasAlpha : 1; ///< Whether the format has an alpha channel
+ Pixel::Format mPixelFormat; ///< Pixel format of the texture
+ uint16_t mWidth; ///< Width of the texture
+ uint16_t mHeight; ///< Height of the texture
+ Type mType : 3; ///< Type of the texture
+ bool mHasAlpha : 1; ///< Whether the format has an alpha channel
};
} // namespace Render