// INTERNAL INCLUDES
#include <dali/internal/render/gl-resources/context.h>
+#include <dali/internal/render/gl-resources/texture-units.h>
#include <dali/integration-api/debug.h>
namespace Dali
namespace Internal
{
-NativeFrameBufferTexture::NativeFrameBufferTexture( NativeImagePtr nativeImage, Context& context)
+NativeFrameBufferTexture::NativeFrameBufferTexture( NativeImageInterfacePtr nativeImage, Context& context)
: FrameBufferTexture(nativeImage->GetWidth(),
nativeImage->GetHeight(),
- nativeImage->GetPixelFormat(),
context),
mNativeImage(nativeImage)
{
bool NativeFrameBufferTexture::IsFullyOpaque() const
{
- // TODO - Should test actual texture...
return !HasAlphaChannel();
}
bool NativeFrameBufferTexture::HasAlphaChannel() const
{
- return Pixel::HasAlpha(mNativeImage->GetPixelFormat());
+ return mNativeImage->RequiresBlending();
}
bool NativeFrameBufferTexture::Init()
if( mNativeImage->GlExtensionCreate() )
{
mContext.GenTextures(1, &mId);
- mContext.ActiveTexture(GL_TEXTURE7); // bind in unused unit so rebind works the first time
+ mContext.ActiveTexture( TEXTURE_UNIT_UPLOAD ); // bind in unused unit so rebind works the first time
mContext.Bind2dTexture(mId);
mContext.PixelStorei(GL_UNPACK_ALIGNMENT, 1); // We always use tightly packed data
mNativeImage.Reset();
}
-
} //namespace Internal
} //namespace Dali