X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Frender%2Fgl-resources%2Fcompressed-bitmap-texture.cpp;h=3ec72dbcd6831c9ab0e0292a59a99dd1d77d7db9;hb=2b10280985738c74efa2aa0fb956a837c69acee6;hp=06ea66a404fdcc37dec375f18a1af37edf4efb3d;hpb=8f2c5571c924479b6a07a2c2187dedd9c685baf0;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/render/gl-resources/compressed-bitmap-texture.cpp b/dali/internal/render/gl-resources/compressed-bitmap-texture.cpp index 06ea66a..3ec72db 100644 --- a/dali/internal/render/gl-resources/compressed-bitmap-texture.cpp +++ b/dali/internal/render/gl-resources/compressed-bitmap-texture.cpp @@ -1,33 +1,28 @@ -// -// Copyright (c) 2014 Samsung Electronics Co., Ltd. -// -// Licensed under the Flora License, Version 1.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// +/* + * Copyright (c) 2014 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ // CLASS HEADER #include -// EXTERNAL INCLUDES -#include -#include - // INTERNAL INCLUDES -#include -#include #include -#include #include #include +#include namespace Dali { @@ -35,14 +30,14 @@ namespace Dali namespace Internal { -CompressedBitmapTexture::CompressedBitmapTexture(Internal::BitmapCompressed* const bitmap, Context& context) +CompressedBitmapTexture::CompressedBitmapTexture(Internal::BitmapCompressed* const bitmap, Context& context, ResourcePolicy::Discardable /*discardPolicy*/) : Texture(context, bitmap->GetImageWidth(), bitmap->GetImageHeight(), bitmap->GetImageWidth(), - bitmap->GetImageHeight(), - bitmap->GetPixelFormat()), - mBitmap(bitmap) + bitmap->GetImageHeight()), + mBitmap(bitmap), + mPixelFormat( bitmap->GetPixelFormat() ) { DALI_LOG_TRACE_METHOD(Debug::Filter::gImage); DALI_LOG_SET_OBJECT_STRING(this, DALI_LOG_GET_OBJECT_STRING(bitmap)); @@ -84,7 +79,7 @@ void CompressedBitmapTexture::AssignBitmap( bool generateTexture, const unsigned } DALI_ASSERT_DEBUG( mId != 0 ); - mContext.ActiveTexture(GL_TEXTURE7); // bind in unused unit so rebind works the first time + mContext.ActiveTexture( TEXTURE_UNIT_UPLOAD ); mContext.Bind2dTexture(mId); GLenum pixelFormat = GL_RGBA; @@ -93,12 +88,9 @@ void CompressedBitmapTexture::AssignBitmap( bool generateTexture, const unsigned mContext.PixelStorei(GL_UNPACK_ALIGNMENT, 1); // We always use tightly packed data mContext.CompressedTexImage2D(GL_TEXTURE_2D, 0, pixelFormat, mWidth, mHeight, 0, bufferSize, pixels); - mContext.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - mContext.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); mContext.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); mContext.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - INCREASE_BY( PerformanceMonitor::TEXTURE_DATA_UPLOADED, bufferSize ); } void CompressedBitmapTexture::Update( Integration::Bitmap* bitmap ) @@ -109,7 +101,7 @@ void CompressedBitmapTexture::Update( Integration::Bitmap* bitmap ) if( !bitmap ) { - DALI_LOG_ERROR( "Passed a null bitmap to update this compressed bitmap texture." ); + DALI_LOG_ERROR( "Passed a null bitmap to update this compressed bitmap texture.\n" ); return; } @@ -140,7 +132,6 @@ void CompressedBitmapTexture::Update( Integration::Bitmap* bitmap ) if ( mId ) // If the texture is already bound { AssignBitmap( false, pixels, mBitmap->GetBufferSize() ); - mBitmap->DiscardBuffer(); } } }