#define DALI_INTERNAL_ADAPTOR_PIXEL_BUFFER_H
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
// INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
+#include <dali/integration-api/debug.h>
#include <dali/public-api/images/image-operations.h> // For ImageDimensions
#include <dali/public-api/images/pixel-data.h>
#include <dali/public-api/object/base-object.h>
* The new object takes ownership of the buffer data, and the
* mBuffer pointer is reset to NULL.
* @param[in] pixelBuffer The buffer to convert
+ * @param[in] releaseAfterUpload Whether converted PixelData released after upload or not.
* @return the pixelData
*/
- static Dali::PixelData Convert(PixelBuffer& pixelBuffer);
+ static Dali::PixelData Convert(PixelBuffer& pixelBuffer, bool releaseAfterUpload);
/**
* @brief Constructor.
public:
/**
+ * Get the total allocated size of current pixel buffers
+ */
+ static uint32_t GetTotalAllocatedSize()
+ {
+#if defined(DEBUG_ENABLED)
+ return gPixelBufferAllocationTotal;
+#else
+ return 0;
+#endif
+ }
+
+ /**
* Get the width of the buffer in pixels.
* @return The width of the buffer in pixels
*/
uint32_t mStride; ///< Buffer stride in bytes, 0 means the buffer is tightly packed
Pixel::Format mPixelFormat; ///< Pixel format
bool mPreMultiplied; ///< PreMultiplied
+
+#if defined(DEBUG_ENABLED)
+ static uint32_t gPixelBufferAllocationTotal;
+#endif
};
} // namespace Adaptor