Sometimes EGL image extensions are initialized after NativeImageSource is created.
Change-Id: I424c451a336ca4b9b7e85fae0785c8bf4f20a553
/*
- * Copyright (c) 2021 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.
return image;
}
-NativeImageSourceAndroid::NativeImageSourceAndroid( uint32_t width, uint32_t height, Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource )
+NativeImageSourceAndroid::NativeImageSourceAndroid(uint32_t width, uint32_t height, Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource)
: mWidth(width),
- mHeight(height ),
+ mHeight(height),
mOwnPixmap(true),
mPixmap(NULL),
mBlendingRequired(false),
mColorDepth(depth),
mEglImageKHR(NULL),
+ mEglGraphics(NULL),
mEglImageExtensions(NULL),
mResourceDestructionCallback()
{
DALI_ASSERT_ALWAYS(Adaptor::IsAvailable());
- GraphicsInterface* graphics = &(Adaptor::GetImplementation(Adaptor::Get()).GetGraphicsInterface());
- auto eglGraphics = static_cast<EglGraphics*>(graphics);
-
- mEglImageExtensions = eglGraphics->GetImageExtensions();
-
- DALI_ASSERT_DEBUG(mEglImageExtensions);
+ GraphicsInterface* graphics = &(Adaptor::GetImplementation(Adaptor::Get()).GetGraphicsInterface());
+ mEglGraphics = static_cast<EglGraphics*>(graphics);
// assign the pixmap
mPixmap = static_cast<AHardwareBuffer*>(GetPixmapFromAny(nativeImageSource));
bool NativeImageSourceAndroid::CreateResource()
{
+ mEglImageExtensions = mEglGraphics->GetImageExtensions();
+ DALI_ASSERT_DEBUG(mEglImageExtensions);
+
// if the image existed previously delete it.
if(mEglImageKHR != NULL)
{
#define DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H
/*
- * Copyright (c) 2021 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.
{
namespace Adaptor
{
+class EglGraphics;
class EglImageExtensions;
/**
void GetPixmapDetails();
private:
- uint32_t mWidth; ///< image width
- uint32_t mHeight; ///< image heights
- bool mOwnPixmap; ///< Whether we created pixmap or not
- AHardwareBuffer* mPixmap; ///<
- bool mBlendingRequired; ///< Whether blending is required
- Dali::NativeImageSource::ColorDepth mColorDepth; ///< color depth of image
- void* mEglImageKHR; ///< From EGL extension
- EglImageExtensions* mEglImageExtensions; ///< The EGL Image Extensions
- std::unique_ptr<EventThreadCallback> mResourceDestructionCallback; ///< The Resource Destruction Callback
+ uint32_t mWidth; ///< image width
+ uint32_t mHeight; ///< image heights
+ bool mOwnPixmap; ///< Whether we created pixmap or not
+ AHardwareBuffer* mPixmap; ///<
+ bool mBlendingRequired; ///< Whether blending is required
+ Dali::NativeImageSource::ColorDepth mColorDepth; ///< color depth of image
+ void* mEglImageKHR; ///< From EGL extension
+ EglGraphics* mEglGraphics; ///< EGL Graphics
+ EglImageExtensions* mEglImageExtensions; ///< The EGL Image Extensions
+ std::unique_ptr<EventThreadCallback> mResourceDestructionCallback; ///< The Resource Destruction Callback
};
} // namespace Adaptor
/*
- * Copyright (c) 2021 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.
mBlendingRequired(false),
mColorDepth(depth),
mEglImageKHR(NULL),
+ mEglGraphics(NULL),
mEglImageExtensions(NULL),
mResourceDestructionCallback()
{
DALI_ASSERT_ALWAYS(Adaptor::IsAvailable());
- GraphicsInterface* graphics = &(Adaptor::GetImplementation(Adaptor::Get()).GetGraphicsInterface());
- auto eglGraphics = static_cast<EglGraphics*>(graphics);
-
- mEglImageExtensions = eglGraphics->GetImageExtensions();
-
- DALI_ASSERT_DEBUG(mEglImageExtensions);
+ GraphicsInterface* graphics = &(Adaptor::GetImplementation(Adaptor::Get()).GetGraphicsInterface());
+ mEglGraphics = static_cast<EglGraphics*>(graphics);
// assign the pixmap
mPixmap = GetPixmapFromAny(nativeImageSource);
bool NativeImageSourceX::CreateResource()
{
+ mEglImageExtensions = mEglGraphics->GetImageExtensions();
+ DALI_ASSERT_DEBUG(mEglImageExtensions);
+
// if the image existed previously delete it.
if(mEglImageKHR != NULL)
{
#define DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H
/*
- * Copyright (c) 2021 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.
#include <memory>
// INTERNAL INCLUDES
-#include <dali/public-api/adaptor-framework/native-image-source.h>
#include <dali/internal/imaging/common/native-image-source-impl.h>
+#include <dali/public-api/adaptor-framework/native-image-source.h>
namespace Dali
{
{
namespace Adaptor
{
+class EglGraphics;
class EglImageExtensions;
/**
void GetPixmapDetails();
private:
- uint32_t mWidth; ///< image width
- uint32_t mHeight; ///< image heights
- bool mOwnPixmap; ///< Whether we created pixmap or not
- Ecore_X_Pixmap mPixmap; ///< From Xlib
- bool mBlendingRequired; ///< Whether blending is required
- Dali::NativeImageSource::ColorDepth mColorDepth; ///< color depth of image
- void* mEglImageKHR; ///< From EGL extension
- EglImageExtensions* mEglImageExtensions; ///< The EGL Image Extensions
- std::unique_ptr<EventThreadCallback> mResourceDestructionCallback; ///< The Resource Destruction Callback
+ uint32_t mWidth; ///< image width
+ uint32_t mHeight; ///< image heights
+ bool mOwnPixmap; ///< Whether we created pixmap or not
+ Ecore_X_Pixmap mPixmap; ///< From Xlib
+ bool mBlendingRequired; ///< Whether blending is required
+ Dali::NativeImageSource::ColorDepth mColorDepth; ///< color depth of image
+ void* mEglImageKHR; ///< From EGL extension
+ EglGraphics* mEglGraphics; ///< EGL Graphics
+ EglImageExtensions* mEglImageExtensions; ///< The EGL Image Extensions
+ std::unique_ptr<EventThreadCallback> mResourceDestructionCallback; ///< The Resource Destruction Callback
};
} // namespace Adaptor
/*
- * Copyright (c) 2021 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.
mBlendingRequired(false),
mColorDepth(depth),
mEglImageKHR(NULL),
+ mEglGraphics(NULL),
mEglImageExtensions(NULL),
mResourceDestructionCallback()
{
DALI_ASSERT_ALWAYS(Adaptor::IsAvailable());
- GraphicsInterface* graphics = &(Adaptor::GetImplementation(Adaptor::Get()).GetGraphicsInterface());
- auto eglGraphics = static_cast<EglGraphics*>(graphics);
-
- mEglImageExtensions = eglGraphics->GetImageExtensions();
-
- DALI_ASSERT_DEBUG(mEglImageExtensions);
+ GraphicsInterface* graphics = &(Adaptor::GetImplementation(Adaptor::Get()).GetGraphicsInterface());
+ mEglGraphics = static_cast<EglGraphics*>(graphics);
// assign the pixmap
mPixmap = GetPixmapFromAny(nativeImageSource);
bool NativeImageSourceWin::CreateResource()
{
+ mEglImageExtensions = mEglGraphics->GetImageExtensions();
+ DALI_ASSERT_DEBUG(mEglImageExtensions);
+
// if the image existed previously delete it.
if(mEglImageKHR != NULL)
{
#define DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H
/*
- * Copyright (c) 2021 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.
{
namespace Adaptor
{
+class EglGraphics;
class EglImageExtensions;
/**
void GetPixmapDetails();
private:
- unsigned int mWidth; ///< image width
- unsigned int mHeight; ///< image heights
- bool mOwnPixmap; ///< Whether we created pixmap or not
- unsigned int mPixmap; ///< From Windows
- bool mBlendingRequired; ///< Whether blending is required
- Dali::NativeImageSource::ColorDepth mColorDepth; ///< color depth of image
- void* mEglImageKHR; ///< From EGL extension
- EglImageExtensions* mEglImageExtensions; ///< The EGL Image Extensions
- std::unique_ptr<EventThreadCallback> mResourceDestructionCallback; ///< The Resource Destruction Callback
+ unsigned int mWidth; ///< image width
+ unsigned int mHeight; ///< image heights
+ bool mOwnPixmap; ///< Whether we created pixmap or not
+ unsigned int mPixmap; ///< From Windows
+ bool mBlendingRequired; ///< Whether blending is required
+ Dali::NativeImageSource::ColorDepth mColorDepth; ///< color depth of image
+ void* mEglImageKHR; ///< From EGL extension
+ EglGraphics* mEglGraphics; ///< EGL Graphics
+ EglImageExtensions* mEglImageExtensions; ///< The EGL Image Extensions
+ std::unique_ptr<EventThreadCallback> mResourceDestructionCallback; ///< The Resource Destruction Callback
};
} // namespace Adaptor