mEventThreadSemaphore.Acquire();
}
- Dali::RenderSurfaceInterface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
- if( currentSurface )
- {
- currentSurface->StartRender();
- }
-
mRunning = TRUE;
LOG_EVENT( "Startup Complete, starting Update/Render Thread" );
RunUpdateRenderThread( CONTINUOUS, AnimationProgression::NONE, UpdateMode::NORMAL );
+ Dali::RenderSurfaceInterface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
+ if( currentSurface )
+ {
+ currentSurface->StartRender();
+ }
+
DALI_LOG_RELEASE_INFO( "CombinedUpdateRenderController::Start\n" );
}
SET( adaptor_window_system_macos_src_files
${adaptor_window_system_dir}/macos/display-connection-factory-mac.cpp
${adaptor_window_system_dir}/macos/display-connection-impl-mac.cpp
+ ${adaptor_window_system_dir}/macos/window-render-surface-cocoa.cpp
${adaptor_window_system_dir}/macos/window-system-mac.mm
${adaptor_window_system_dir}/macos/window-base-mac.mm
${adaptor_window_system_dir}/macos/window-factory-mac.cpp
#include <dali/integration-api/adaptor-framework/native-render-surface.h>
#include <dali/internal/window-system/common/display-utils.h>
#include <dali/internal/window-system/common/pixmap-render-surface.h>
-#include <dali/internal/window-system/common/window-render-surface.h>
+#include "window-render-surface-cocoa.h"
namespace Dali::Internal::Adaptor
{
bool isTransparent
)
{
- return Utils::MakeUnique< WindowRenderSurface >( positionSize, surface, isTransparent );
+ return Utils::MakeUnique< WindowRenderSurfaceCocoa >( positionSize, surface, isTransparent );
}
std::unique_ptr< PixmapRenderSurface >
--- /dev/null
+/*
+ * Copyright (c) 2020 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.
+ *
+ */
+
+#include "window-render-surface-cocoa.h"
+
+namespace Dali::Internal::Adaptor
+{
+WindowRenderSurfaceCocoa::WindowRenderSurfaceCocoa(Dali::PositionSize positionSize, Any surface, bool isTransparent)
+ : WindowRenderSurface(positionSize, surface, isTransparent)
+ , mReady(false)
+{
+}
+
+void WindowRenderSurfaceCocoa::StartRender()
+{
+ std::unique_lock<std::mutex> lock(mCondMutex);
+ WindowRenderSurface::StartRender();
+ while (!mReady)
+ {
+ mRenderWait.wait(lock);
+ }
+}
+
+void WindowRenderSurfaceCocoa::CreateSurface()
+{
+ std::lock_guard<std::mutex> lock(mCondMutex);
+ WindowRenderSurface::CreateSurface();
+ mReady = true;
+ mRenderWait.notify_all();
+}
+} // Dali::Internal::Adaptor
--- /dev/null
+#pragma once
+
+/*
+ * Copyright (c) 2020 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.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <mutex>
+#include <condition_variable>
+
+// INTERNAL INCLUDES
+#include <dali/internal/window-system/common/window-render-surface.h>
+
+namespace Dali::Internal::Adaptor
+{
+/**
+ * We must create the EGL Window before we enter the run loop.
+ * This specialization ensures this condition is respected.
+ */
+class WindowRenderSurfaceCocoa : public WindowRenderSurface
+{
+public:
+
+ /**
+ * @copydoc Dali::WindowRenderSurface()
+ */
+ WindowRenderSurfaceCocoa(Dali::PositionSize positionSize, Any surface, bool isTransparent = true);
+
+ /**
+ * @copydoc Dali::RenderSurfaceInterface::StartRender()
+ */
+ void StartRender() override;
+
+ /**
+ * @copydoc Dali::RenderSurfaceInterface::CreateSurface()
+ */
+ void CreateSurface() override;
+
+private:
+ std::mutex mCondMutex;
+ std::condition_variable mRenderWait;
+ bool mReady;
+};
+} // Dali::Internal::Adaptor