/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
// CLASS HEADER
#include <dali/internal/render/gl-resources/bitmap-texture.h>
+// EXTERNAL INCLUDES
+#include <cstring>
+
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-vector.h>
+#include <dali/public-api/images/buffer-image.h> // For PixelBuffer
#include <dali/integration-api/debug.h>
-#include <dali/internal/render/common/vertex.h>
#include <dali/internal/render/common/performance-monitor.h>
#include <dali/internal/render/gl-resources/context.h>
#include <dali/internal/render/gl-resources/texture-units.h>
bitmap->GetImageWidth(),
bitmap->GetImageHeight()),
mBitmap(bitmap),
- mClearPixels(false),
+ mPixelFormat(bitmap->GetPixelFormat()),
mDiscardPolicy(policy),
- mPixelFormat(bitmap->GetPixelFormat())
+ mClearPixels(false)
{
DALI_LOG_TRACE_METHOD(Debug::Filter::gImage);
DALI_LOG_SET_OBJECT_STRING(this, DALI_LOG_GET_OBJECT_STRING(bitmap));
width, height,
width, height),
mBitmap(NULL),
- mClearPixels(clearPixels),
+ mPixelFormat( pixelFormat ),
mDiscardPolicy(policy),
- mPixelFormat( pixelFormat )
+ mClearPixels(clearPixels)
{
DALI_LOG_TRACE_METHOD(Debug::Filter::gImage);
}
DALI_ASSERT_DEBUG( bitmap != 0 );
if( !bitmap )
{
- DALI_LOG_ERROR( "Passed a null bitmap to update this bitmap texture." );
+ DALI_LOG_ERROR( "Passed a null bitmap to update this bitmap texture.\n" );
return;
}
if( !bitmapPackedPixels )
{
///! This should never happen.
- DALI_LOG_ERROR("Passed an incompatible bitmap type to update this bitmap texture.");
+ DALI_LOG_ERROR("Passed an incompatible bitmap type to update this bitmap texture.\n");
return;
}
mBitmap = bitmap;
void BitmapTexture::Update( const unsigned char* pixels, std::size_t width, std::size_t height, Pixel::Format pixelFormat, std::size_t xOffset, std::size_t yOffset )
{
- GLenum pixelGLFormat = GL_RGBA;
+ GLenum pixelGLFormat = GL_RGBA;
GLenum pixelDataType = GL_UNSIGNED_BYTE;
Integration::ConvertToGlFormat( mPixelFormat, pixelDataType, pixelGLFormat );
}
#if DALI_GLES_VERSION >= 30
-// for gles 3.0, uploading sub-image with different format is a valid operation
- Integration::ConvertToGlFormat( srcBitmap->GetPixelFormat(), pixelDataType, pixelGLFormat );
+ // For GLES 3.0, uploading sub-image with different format is a valid operation.
+ Integration::ConvertToGlFormat( pixelFormat, pixelDataType, pixelGLFormat );
#else
- // allows RGB888 source bitmap to be added to RGBA8888 texture, need to convert the bitmap format manually
+ // Allows RGB888 source bitmap to be added to RGBA8888 texture, need to convert the bitmap format manually.
if(pixelFormat == Pixel::RGB888 && mPixelFormat == Pixel::RGBA8888 )
{
std::size_t size = width * height;