From: Richard Huang Date: Tue, 16 Jul 2019 14:15:58 +0000 (+0100) Subject: FBO/Texture access synchronization for multiple contexts X-Git-Tag: dali_1.4.29~2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=2d4f8648d5d40b896b33dfca734cf6eaacf6b986 FBO/Texture access synchronization for multiple contexts Change-Id: I959546eb2b987f257329dae514aa23c0f92f5dd3 --- diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.cpp index d457916..6e41c42 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.cpp @@ -58,6 +58,7 @@ void TestApplication::CreateCore() mPlatformAbstraction, mGlAbstraction, mGlSyncAbstraction, + mGlContextHelperAbstraction, mDataRetentionPolicy, Integration::RenderToFrameBuffer::FALSE, Integration::DepthBufferAvailable::TRUE, @@ -156,6 +157,11 @@ TestGlSyncAbstraction& TestApplication::GetGlSyncAbstraction() return mGlSyncAbstraction; } +TestGlContextHelperAbstraction& TestApplication::GetGlContextHelperAbstraction() +{ + return mGlContextHelperAbstraction; +} + void TestApplication::ProcessEvent(const Integration::Event& event) { mCore->QueueEvent(event); diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.h index 32447d6..cc694df 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.h @@ -22,6 +22,7 @@ #include #include "test-gl-sync-abstraction.h" #include "test-gl-abstraction.h" +#include "test-gl-context-helper-abstraction.h" #include "test-render-controller.h" #include "test-render-surface.h" #include @@ -66,6 +67,7 @@ public: TestRenderController& GetRenderController(); TestGlAbstraction& GetGlAbstraction(); TestGlSyncAbstraction& GetGlSyncAbstraction(); + TestGlContextHelperAbstraction& GetGlContextHelperAbstraction(); void ProcessEvent(const Integration::Event& event); void SendNotification(); bool Render( uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL, const char* location=NULL ); @@ -93,6 +95,7 @@ protected: TestRenderController mRenderController; TestGlAbstraction mGlAbstraction; TestGlSyncAbstraction mGlSyncAbstraction; + TestGlContextHelperAbstraction mGlContextHelperAbstraction; TestRenderSurface* mRenderSurface; Integration::UpdateStatus mStatus; diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-context-helper-abstraction.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-context-helper-abstraction.h new file mode 100644 index 0000000..0442f0d --- /dev/null +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-context-helper-abstraction.h @@ -0,0 +1,71 @@ +#ifndef TEST_GL_CONTEXT_HELPER_ABSTRACTION_H +#define TEST_GL_CONTEXT_HELPER_ABSTRACTION_H + +/* + * Copyright (c) 2019 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +/** + * Class to emulate the GL context helper + */ +class DALI_CORE_API TestGlContextHelperAbstraction: public Integration::GlContextHelperAbstraction +{ +public: + /** + * Constructor + */ + TestGlContextHelperAbstraction() {}; + + /** + * Destructor + */ + ~TestGlContextHelperAbstraction() {}; + + /** + * @brief Switch to the surfaceless GL context + */ + virtual void MakeSurfacelessContextCurrent() {}; + + /** + * @brief Switch to the GL context of the specific render surface + * @param[in] surface The render surface + */ + virtual void MakeContextCurrent( Integration::RenderSurface* surface ) {}; + + /** + * @brief Clear the GL context + */ + virtual void MakeContextNull() {}; + + /** + * @brief Wait until all GL rendering calls for the current GL context are executed + */ + virtual void WaitClient() {}; +private: + + TestGlContextHelperAbstraction( const TestGlContextHelperAbstraction& ); ///< Undefined + TestGlContextHelperAbstraction& operator=( const TestGlContextHelperAbstraction& ); ///< Undefined +}; + +} // Dali + +#endif // TEST_GL_CONTEXT_HELPER_ABSTRACTION_H