From: Richard Huang Date: Fri, 20 Sep 2019 10:15:51 +0000 (+0100) Subject: Fix framebuffer rendering for native image source on Ubuntu X-Git-Tag: dali_1.4.39~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=52d0f712a5e7484eefd8f33fa6290d9cfedba888;p=platform%2Fcore%2Fuifw%2Fdali-core.git Fix framebuffer rendering for native image source on Ubuntu Change-Id: I1438b8af9b38efe6dc3c0e94979633b364ea3ba8 --- diff --git a/dali/internal/render/renderers/render-texture-frame-buffer.cpp b/dali/internal/render/renderers/render-texture-frame-buffer.cpp index 4e5cd51..fb718fb 100644 --- a/dali/internal/render/renderers/render-texture-frame-buffer.cpp +++ b/dali/internal/render/renderers/render-texture-frame-buffer.cpp @@ -89,15 +89,7 @@ void TextureFrameBuffer::AttachColorTexture( Context& context, Render::Texture* // Create a color attachment. if( texture->GetType() == TextureType::TEXTURE_2D ) { - if( !texture->IsNativeImage() ) - { - context.FramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mTextureId, mipmapLevel ); - } - else - { - // If it's a native image we need to use GL_TEXTURE_EXTERNAL_OES as the texture target parameter - context.FramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_EXTERNAL_OES, mTextureId, mipmapLevel ); - } + context.FramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, texture->GetTarget(), mTextureId, mipmapLevel ); } else { diff --git a/dali/internal/render/renderers/render-texture.cpp b/dali/internal/render/renderers/render-texture.cpp index a2f11bc..2937453 100644 --- a/dali/internal/render/renderers/render-texture.cpp +++ b/dali/internal/render/renderers/render-texture.cpp @@ -912,7 +912,7 @@ void Texture::ApplySampler( Context& context, Render::Sampler* sampler ) } } -bool Texture::HasAlphaChannel() +bool Texture::HasAlphaChannel() const { return mHasAlpha; } diff --git a/dali/internal/render/renderers/render-texture.h b/dali/internal/render/renderers/render-texture.h index 86f32f1..e23d28a 100755 --- a/dali/internal/render/renderers/render-texture.h +++ b/dali/internal/render/renderers/render-texture.h @@ -108,18 +108,27 @@ public: * Retrieve wheter the texture has an alpha channel * @return True if the texture has alpha channel, false otherwise */ - bool HasAlphaChannel(); + bool HasAlphaChannel() const; /** * Get the id of the texture * @return Id of the texture */ - GLuint GetId() + GLuint GetId() const { return mId; } /** + * Get the target to which the texture is bound + * @return target to which the texture is bound + */ + GLuint GetTarget() const + { + return mTarget; + } + + /** * Get the type of the texture * @return Type of the texture */