Wait gles initialize when we try to get MaxTextureSize 24/280324/1
authorEunki, Hong <eunkiki.hong@samsung.com>
Fri, 26 Aug 2022 12:40:58 +0000 (21:40 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Fri, 26 Aug 2022 12:40:58 +0000 (21:40 +0900)
All other API in configureation-manager wait until
GLES initialized.
Let GetMaxTextureSize() API also follow this role

Change-Id: Ieea15bdb5d807d344a9c1f6c153b2e29b69e7279
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali/internal/system/common/configuration-manager.cpp

index dcac08b..12c1c9a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -119,6 +119,13 @@ uint32_t ConfigurationManager::GetMaxTextureSize()
 
     if(!mMaxTextureSizeCached)
     {
+      if(!mGraphics->IsInitialized())
+      {
+        // Wait until Graphics Subsystem is initialised, but this will happen once.
+        // This method blocks until the render thread has initialised the graphics.
+        mThreadController->WaitForGraphicsInitialization();
+      }
+
       mMaxTextureSize       = mGraphics->GetMaxTextureSize();
       mMaxTextureSizeCached = true;