From f71aae75017308545d0f835de6a5e39603d17002 Mon Sep 17 00:00:00 2001 From: Zolnai Tamás Date: Mon, 4 Aug 2014 12:04:10 +0200 Subject: It seems better if the caller allocates the memory for the RGBA buffer. For example it allows to use std::vector<> and call the method Change-Id: Id4b8e33838d358dd242d0176e42558505fa8d4a3 --- include/vcl/opengl/OpenGLHelper.hxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include/vcl/opengl') diff --git a/include/vcl/opengl/OpenGLHelper.hxx b/include/vcl/opengl/OpenGLHelper.hxx index 52093c2b1a14..aa9448c2b3b7 100644 --- a/include/vcl/opengl/OpenGLHelper.hxx +++ b/include/vcl/opengl/OpenGLHelper.hxx @@ -21,7 +21,11 @@ class VCLOPENGL_DLLPUBLIC OpenGLHelper public: static GLint LoadShaders(const OUString& rVertexShaderName, const OUString& rFragmentShaderName); - static sal_uInt8* ConvertBitmapExToRGBABuffer(const BitmapEx& rBitmapEx); + /** + * Note: The caller is responsible for allocate the memory for the RGBA buffer, before call + * this method. RGBA buffer size is assumed to be 4*width*height + **/ + static void ConvertBitmapExToRGBABuffer(const BitmapEx& rBitmapEx, sal_uInt8* o_pRGBABuffer); static BitmapEx ConvertBGRABufferToBitmapEx(const sal_uInt8* const pBuffer, long nWidth, long nHeight); static void renderToFile(long nWidth, long nHeight, const OUString& rFileName); -- cgit