X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Fgl-view%2Fgl-view.cpp;h=77e75e8fe5a6b72041b7620f42bff3d509e92ab8;hp=b5f6a8c4c785a515e102d819d36a58a45122488c;hb=0255ba0039cf628d8dbc82d8898000da98833532;hpb=ac3060d459ffbb26d332d21be5b1cf066273c723 diff --git a/dali-toolkit/public-api/controls/gl-view/gl-view.cpp b/dali-toolkit/public-api/controls/gl-view/gl-view.cpp index b5f6a8c..77e75e8 100644 --- a/dali-toolkit/public-api/controls/gl-view/gl-view.cpp +++ b/dali-toolkit/public-api/controls/gl-view/gl-view.cpp @@ -19,15 +19,13 @@ #include // INTERNAL INCLUDES +#include #include -namespace Dali +namespace Dali::Toolkit { -namespace Toolkit -{ -GlView::GlView() -{ -} + +GlView::GlView() = default; GlView::GlView(const GlView& GlView) = default; @@ -37,23 +35,44 @@ GlView& GlView::operator=(const GlView& GlView) = default; GlView& GlView::operator=(GlView&& rhs) = default; -GlView::~GlView() +GlView::~GlView() = default; + +GlView GlView::New(ColorFormat colorFormat) { + // This function is backward compatible and always returns + // backend based on NativeImage. + return Internal::GlView::New( colorFormat ); } -GlView GlView::New(ColorFormat colorFormat) +GlView GlView::New(BackendMode backendMode, ColorFormat colorFormat) { - return Internal::GlView::New(colorFormat); + switch(backendMode) + { + case BackendMode::DIRECT_RENDERING: + case BackendMode::DIRECT_RENDERING_THREADED: + { + return Internal::DrawableView::New(backendMode); + } + case BackendMode::EGL_IMAGE_OFFSCREEN_RENDERING: + { + return Internal::GlView::New(colorFormat); + } + default: + { + DALI_ASSERT_ALWAYS("Invalid BackendMode"); + } + } + return {}; } GlView GlView::DownCast(BaseHandle handle) { - return Control::DownCast(handle); + return Control::DownCast(handle); } -void GlView::RegisterGlCallback(CallbackBase* initCallback, CallbackBase* renderFrameCallback, CallbackBase* terminateCallback) +void GlView::RegisterGlCallbacks(CallbackBase* initCallback, CallbackBase* renderFrameCallback, CallbackBase* terminateCallback) { - Dali::Toolkit::GetImpl(*this).RegisterGlCallback(initCallback, renderFrameCallback, terminateCallback); + Dali::Toolkit::GetImpl(*this).RegisterGlCallbacks(initCallback, renderFrameCallback, terminateCallback); } void GlView::SetResizeCallback(CallbackBase* resizeCallback) @@ -76,12 +95,17 @@ Dali::Toolkit::GlView::RenderingMode GlView::GetRenderingMode() const return Dali::Toolkit::GetImpl(*this).GetRenderingMode(); } +Dali::Toolkit::GlView::BackendMode GlView::GetBackendMode() const +{ + return Dali::Toolkit::GetImpl(*this).GetBackendMode(); +} + void GlView::RenderOnce() { Dali::Toolkit::GetImpl(*this).RenderOnce(); } -GlView::GlView(Internal::GlView& implementation) +GlView::GlView(Internal::GlViewImpl& implementation) : Control(implementation) { } @@ -89,9 +113,7 @@ GlView::GlView(Internal::GlView& implementation) GlView::GlView(Dali::Internal::CustomActor* internal) : Control(internal) { - VerifyCustomActorPointer(internal); + VerifyCustomActorPointer(internal); } -} // namespace Toolkit - } // namespace Dali