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=91939c0ecfbdcec0c01ebca171668377fca123f5;hp=958d0312bdc09d5771b853224ff0fbd462d24ab9;hb=refs%2Fchanges%2F13%2F273213%2F11;hpb=a0f89cffaeee6f6f92a3c3aba029547a7870493a 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 958d031..91939c0 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,18 +35,38 @@ 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: + { + return Internal::DrawableView::New(); + } + 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::RegisterGlCallbacks(CallbackBase* initCallback, CallbackBase* renderFrameCallback, CallbackBase* terminateCallback) @@ -76,12 +94,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 +112,7 @@ GlView::GlView(Internal::GlView& implementation) GlView::GlView(Dali::Internal::CustomActor* internal) : Control(internal) { - VerifyCustomActorPointer(internal); + VerifyCustomActorPointer(internal); } -} // namespace Toolkit - } // namespace Dali