projects
/
platform
/
core
/
uifw
/
dali-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove RenderSurface from Core
[platform/core/uifw/dali-core.git]
/
dali
/
internal
/
event
/
rendering
/
frame-buffer-impl.cpp
diff --git
a/dali/internal/event/rendering/frame-buffer-impl.cpp
b/dali/internal/event/rendering/frame-buffer-impl.cpp
index
20d09d3
..
e26b0ee
100644
(file)
--- a/
dali/internal/event/rendering/frame-buffer-impl.cpp
+++ b/
dali/internal/event/rendering/frame-buffer-impl.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 20
17
Samsung Electronics Co., Ltd.
+ * Copyright (c) 20
20
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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-20,7
+20,6
@@
// INTERNAL INCLUDES
#include <dali/internal/update/manager/update-manager.h>
// INTERNAL INCLUDES
#include <dali/internal/update/manager/update-manager.h>
-#include <dali/internal/event/common/stage-impl.h>
#include <dali/internal/render/renderers/render-frame-buffer.h>
namespace Dali
#include <dali/internal/render/renderers/render-frame-buffer.h>
namespace Dali
@@
-28,52
+27,66
@@
namespace Dali
namespace Internal
{
namespace Internal
{
-FrameBufferPtr FrameBuffer::New( u
nsigned int width, unsigned int height, unsigned int
attachments )
+FrameBufferPtr FrameBuffer::New( u
int32_t width, uint32_t height, Mask
attachments )
{
FrameBufferPtr frameBuffer( new FrameBuffer( width, height, attachments ) );
frameBuffer->Initialize();
return frameBuffer;
}
{
FrameBufferPtr frameBuffer( new FrameBuffer( width, height, attachments ) );
frameBuffer->Initialize();
return frameBuffer;
}
-
Render::FrameBuffer* FrameBuffer::GetRenderObject() const
{
return mRenderObject;
}
Render::FrameBuffer* FrameBuffer::GetRenderObject() const
{
return mRenderObject;
}
-FrameBuffer::FrameBuffer( u
nsigned int width, unsigned int height, unsigned int
attachments )
-: mEventThreadServices(
*Stage::GetCurren
t() ),
+FrameBuffer::FrameBuffer( u
int32_t width, uint32_t height, Mask
attachments )
+: mEventThreadServices(
EventThreadServices::Ge
t() ),
mRenderObject( NULL ),
mRenderObject( NULL ),
- mColor
( NULL )
,
+ mColor
{ nullptr }
,
mWidth( width ),
mHeight( height ),
mWidth( width ),
mHeight( height ),
- mAttachments( attachments )
+ mAttachments( attachments ),
+ mColorAttachmentCount( 0 )
{
}
void FrameBuffer::Initialize()
{
{
}
void FrameBuffer::Initialize()
{
- mRenderObject = new Render::FrameBuffer( mWidth, mHeight, mAttachments );
- AddFrameBuffer( mEventThreadServices.GetUpdateManager(), *mRenderObject );
+ mRenderObject = new Render::FrameBuffer( mWidth, mHeight, mAttachments );
+
+ OwnerPointer< Render::FrameBuffer > transferOwnership( mRenderObject );
+ AddFrameBuffer( mEventThreadServices.GetUpdateManager(), transferOwnership );
}
}
-void FrameBuffer::AttachColorTexture( TexturePtr texture, u
nsigned int mipmapLevel, unsigned in
t layer )
+void FrameBuffer::AttachColorTexture( TexturePtr texture, u
int32_t mipmapLevel, uint32_
t layer )
{
{
- if( ( texture->GetWidth() / ( 1u << mipmapLevel )
== mWidth ) &&
- ( texture->GetHeight() / ( 1u << mipmapLevel )
=
= mHeight ) )
+ if( ( texture->GetWidth() / ( 1u << mipmapLevel )
!= mWidth ) ||
+ ( texture->GetHeight() / ( 1u << mipmapLevel )
!
= mHeight ) )
{
{
- mColor = texture;
- AttachColorTextureToFrameBuffer( mEventThreadServices.GetUpdateManager(), *mRenderObject, texture->GetRenderObject(), mipmapLevel, layer );
+ DALI_LOG_ERROR( "Failed to attach color texture to FrameBuffer: Size mismatch \n" );
+ }
+ else if ( mColorAttachmentCount >= Dali::DevelFrameBuffer::MAX_COLOR_ATTACHMENTS )
+ {
+ DALI_LOG_ERROR( "Failed to attach color texture to FrameBuffer: Exceeded maximum supported color attachments.\n" );
}
else
{
}
else
{
- DALI_LOG_ERROR( "Failed to attach color texture to FrameBuffer: Size mismatch \n" );
+ mColor[mColorAttachmentCount] = texture;
+ ++mColorAttachmentCount;
+
+ AttachColorTextureToFrameBuffer( mEventThreadServices.GetUpdateManager(), *mRenderObject, texture->GetRenderObject(), mipmapLevel, layer );
}
}
}
}
-Texture* FrameBuffer::GetColorTexture()
+Texture* FrameBuffer::GetColorTexture(uint8_t index) const
+{
+ return ( index >= mColorAttachmentCount ) ? nullptr : mColor[index].Get();
+}
+
+void FrameBuffer::SetSize( uint32_t width, uint32_t height )
{
{
- return mColor.Get();
+ mWidth = width;
+ mHeight = height;
}
FrameBuffer::~FrameBuffer()
}
FrameBuffer::~FrameBuffer()