2 * Copyright (c) 2019 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include <dali/internal/render/renderers/render-surface-frame-buffer.h>
21 #include <dali/internal/render/renderers/render-texture.h>
30 SurfaceFrameBuffer::SurfaceFrameBuffer( Integration::RenderSurface* surface )
37 SurfaceFrameBuffer::~SurfaceFrameBuffer()
40 void SurfaceFrameBuffer::Destroy( Context& context )
44 void SurfaceFrameBuffer::GlContextDestroyed()
48 mContext->GlContextDestroyed();
52 void SurfaceFrameBuffer::Initialize(Context& context)
55 mContext->GlContextCreated();
56 mSurface->InitializeGraphics();
59 void SurfaceFrameBuffer::Bind( Context& context )
61 mSurface->PreRender( false );
62 context.BindFramebuffer( GL_FRAMEBUFFER, 0u );
65 uint32_t SurfaceFrameBuffer::GetWidth() const
67 return mSurface->GetPositionSize().width;
70 uint32_t SurfaceFrameBuffer::GetHeight() const
72 return mSurface->GetPositionSize().height;
75 void SurfaceFrameBuffer::PostRender()
77 mSurface->PostRender( false, false, false );
80 Context* SurfaceFrameBuffer::GetContext()
85 Integration::DepthBufferAvailable SurfaceFrameBuffer::GetDepthBufferRequired()
87 return mSurface->GetDepthBufferRequired();
90 Integration::StencilBufferAvailable SurfaceFrameBuffer::GetStencilBufferRequired()
92 return mSurface->GetStencilBufferRequired();
95 Vector4 SurfaceFrameBuffer::GetBackgroundColor()
97 return mSurface->GetBackgroundColor();