* The Connect() and Disconnect() methods are unnecessarily
implementing a counter that tracks how many handlers are
observing the frame buffer image. In case that the frame
buffer image is not observed by any handler, the internal
FBO is destroyed. A handler may observe again the frame
buffer image but the FBO has already been destroyed.
This caused an issue with the GaussianBlurView effect which
was using a render task to blur an image and a frabe buffer
image to write the blurred image.
Change-Id: I89a7de6f97ee52fb219f8b7641d4d2bbb42764d5
Signed-off-by: Victor Cebollada <v.cebollada@samsung.com>
unsigned int height,
Pixel::Format pixelFormat,
RenderBuffer::Format bufferformat )
unsigned int height,
Pixel::Format pixelFormat,
RenderBuffer::Format bufferformat )
+: Image( width, height ),
mNativeImage(0),
mPixelFormat( pixelFormat ),
mBufferFormat( bufferformat ),
mNativeImage(0),
mPixelFormat( pixelFormat ),
mBufferFormat( bufferformat ),
+ mIsNativeFbo( false ),
+ mIsConnected( false )
- mWidth = width;
- mHeight = height;
}
FrameBufferImage::FrameBufferImage( NativeImageInterface& nativeImage )
}
FrameBufferImage::FrameBufferImage( NativeImageInterface& nativeImage )
+: Image( nativeImage.GetWidth(), nativeImage.GetHeight() ),
mNativeImage( &nativeImage ),
mPixelFormat( Pixel::FIRST_VALID_PIXEL_FORMAT ),
mBufferFormat( RenderBuffer::COLOR ),
mNativeImage( &nativeImage ),
mPixelFormat( Pixel::FIRST_VALID_PIXEL_FORMAT ),
mBufferFormat( RenderBuffer::COLOR ),
+ mIsNativeFbo( true ),
+ mIsConnected( false )
- mWidth = nativeImage.GetWidth();
- mHeight = nativeImage.GetHeight();
}
void FrameBufferImage::Connect()
{
}
void FrameBufferImage::Connect()
{
- ++mConnectionCount;
-
- if (mConnectionCount == 1)
{
// ticket was thrown away when related actors went offstage
if (!mTicket)
{
// ticket was thrown away when related actors went offstage
if (!mTicket)
mTicket->AddObserver(*this);
}
}
mTicket->AddObserver(*this);
}
}
}
}
void FrameBufferImage::Disconnect()
{
}
}
void FrameBufferImage::Disconnect()
{
- if(!mTicket)
- {
- return;
- }
-
- DALI_ASSERT_DEBUG(mConnectionCount > 0);
- --mConnectionCount;
- if (mConnectionCount == 0)
- {
- // release image memory when it's not visible anymore (decrease ref. count of texture)
- mTicket->RemoveObserver(*this);
- mTicket.Reset();
- }
}
bool FrameBufferImage::IsNativeFbo() const
}
bool FrameBufferImage::IsNativeFbo() const
NativeImageInterfacePtr mNativeImage;
Pixel::Format mPixelFormat;
RenderBuffer::Format mBufferFormat;
NativeImageInterfacePtr mNativeImage;
Pixel::Format mPixelFormat;
RenderBuffer::Format mBufferFormat;
+ bool mIsNativeFbo : 1;
+ bool mIsConnected : 1;
}; // class FrameBufferImage
} // namespace Internal
}; // class FrameBufferImage
} // namespace Internal
+Image::Image( unsigned int width, unsigned int height )
+: mWidth( width ),
+ mHeight( height ),
+ mConnectionCount( 0 )
+{
+}
+
Image::~Image()
{
if( mTicket )
Image::~Image()
{
if( mTicket )
+ * Constructor, with width and height
+ *
+ * @param[in] width The width.
+ * @param[in] height The height.
+ */
+ Image( unsigned int width, unsigned int height );
+
+ /**
* Second stage initialization
*/
void Initialize();
* Second stage initialization
*/
void Initialize();
CameraActor* cam = GetCameraActor();
Vector4 pos(position);
CameraActor* cam = GetCameraActor();
Vector4 pos(position);
Vector4 viewportPosition;
Vector4 viewportPosition;
bool RenderTask::HasRendered()
{
bool notify = false;
bool RenderTask::HasRendered()
{
bool notify = false;
- if( mNotifyTrigger == true )
{
++mRenderedOnceCounter;
mState = RENDERED_ONCE_AND_NOTIFIED;
{
++mRenderedOnceCounter;
mState = RENDERED_ONCE_AND_NOTIFIED;