Fix framebuffer rendering for native image source on Ubuntu 37/214337/2
authorRichard Huang <r.huang@samsung.com>
Fri, 20 Sep 2019 10:15:51 +0000 (11:15 +0100)
committerRichard Huang <r.huang@samsung.com>
Fri, 20 Sep 2019 10:23:24 +0000 (11:23 +0100)
Change-Id: I1438b8af9b38efe6dc3c0e94979633b364ea3ba8

dali/internal/render/renderers/render-texture-frame-buffer.cpp
dali/internal/render/renderers/render-texture.cpp
dali/internal/render/renderers/render-texture.h

index 4e5cd51..fb718fb 100644 (file)
@@ -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
   {
index a2f11bc..2937453 100644 (file)
@@ -912,7 +912,7 @@ void Texture::ApplySampler( Context& context, Render::Sampler* sampler )
   }
 }
 
-bool Texture::HasAlphaChannel()
+bool Texture::HasAlphaChannel() const
 {
   return mHasAlpha;
 }
index 86f32f1..e23d28a 100755 (executable)
@@ -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
    */