From: David Steele Date: Mon, 24 Jan 2022 12:05:04 +0000 (+0000) Subject: Initialized SG::Scene::mGraphicsController in constructor X-Git-Tag: dali_2.1.7~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9f1204aac923ca7df1fa771959de62160074a236;hp=3556f826b4ecd9de711de7d9489574885639b5d7;p=platform%2Fcore%2Fuifw%2Fdali-core.git Initialized SG::Scene::mGraphicsController in constructor Change-Id: I813f9643c1e4e92a6e2f01a342a2c6981b479f7a --- diff --git a/dali/internal/update/common/scene-graph-scene.cpp b/dali/internal/update/common/scene-graph-scene.cpp index 9360c32..2aa0287 100644 --- a/dali/internal/update/common/scene-graph-scene.cpp +++ b/dali/internal/update/common/scene-graph-scene.cpp @@ -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. @@ -49,7 +49,7 @@ void Scene::Initialize(Graphics::Controller& graphicsController, Integration::De mGraphicsController = &graphicsController; // Create the render target for the surface. It should already have been sent via message. - mRenderTarget = mGraphicsController->CreateRenderTarget(mRenderTargetCreateInfo, std::move(mRenderTarget)); + mRenderTarget = graphicsController.CreateRenderTarget(mRenderTargetCreateInfo, std::move(mRenderTarget)); // Create the render pass for the surface std::vector attachmentDescriptions; @@ -199,7 +199,10 @@ void Scene::SetSurfaceRenderTargetCreateInfo(const Graphics::RenderTargetCreateI { // Only recreate if the surface has changed. mRenderTargetCreateInfo = renderTargetCreateInfo; - mRenderTarget = mGraphicsController->CreateRenderTarget(renderTargetCreateInfo, std::move(mRenderTarget)); + if(mGraphicsController) // shouldn't be null, as we can't have already set mRenderTarget unless graphics controller exists. + { + mRenderTarget = mGraphicsController->CreateRenderTarget(renderTargetCreateInfo, std::move(mRenderTarget)); + } } else { diff --git a/dali/internal/update/common/scene-graph-scene.h b/dali/internal/update/common/scene-graph-scene.h index d8c8643..3183795 100644 --- a/dali/internal/update/common/scene-graph-scene.h +++ b/dali/internal/update/common/scene-graph-scene.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_SCENE_GRAPH_SCENE_H /* - * 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. @@ -268,7 +268,7 @@ private: RenderInstructionContainer mInstructions; ///< Render instructions for the scene - Graphics::Controller* mGraphicsController; ///< Graphics controller + Graphics::Controller* mGraphicsController{nullptr}; ///< Graphics controller Dali::Integration::Scene::FrameCallbackContainer mFrameRenderedCallbacks; ///< Frame rendered callbacks Dali::Integration::Scene::FrameCallbackContainer mFramePresentedCallbacks; ///< Frame presented callbacks